- Moved PACKETVER to mmo.h, and added support for the expanded character info window on the char-server when PACKETVER is above 7.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9539 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-12-20 17:21:56 +00:00
parent edbb476bf9
commit e29a1031d5
4 changed files with 35 additions and 6 deletions

View File

@ -1685,10 +1685,16 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
for(i = found_num; i < 9; i++) for(i = found_num; i < 9; i++)
sd->found_char[i] = -1; sd->found_char[i] = -1;
#if PACKETVER > 7
WFIFOHEAD(fd, offset + found_num * 108);
memset(WFIFOP(fd,0), 0, offset + found_num * 108);
WFIFOW(fd,2) = offset + found_num * 108;
#else
WFIFOHEAD(fd, offset + found_num * 106); WFIFOHEAD(fd, offset + found_num * 106);
memset(WFIFOP(fd,0), 0, offset + found_num * 106); memset(WFIFOP(fd,0), 0, offset + found_num * 106);
WFIFOW(fd,0) = 0x6b;
WFIFOW(fd,2) = offset + found_num * 106; WFIFOW(fd,2) = offset + found_num * 106;
#endif
WFIFOW(fd,0) = 0x6b;
for(i = 0; i < found_num; i++) { for(i = 0; i < found_num; i++) {
p = &char_dat[sd->found_char[i]].status; p = &char_dat[sd->found_char[i]].status;
@ -1733,7 +1739,12 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
WFIFOB(fd,j+101) = (p->int_ > 255) ? 255 : p->int_; WFIFOB(fd,j+101) = (p->int_ > 255) ? 255 : p->int_;
WFIFOB(fd,j+102) = (p->dex > 255) ? 255 : p->dex; WFIFOB(fd,j+102) = (p->dex > 255) ? 255 : p->dex;
WFIFOB(fd,j+103) = (p->luk > 255) ? 255 : p->luk; WFIFOB(fd,j+103) = (p->luk > 255) ? 255 : p->luk;
#if PACKETVER > 7
WFIFOW(fd,j+104) = p->char_num;
WFIFOB(fd,j+106) = 1; //TODO: Handle this rename bit: 0 to enable renaming
#else
WFIFOB(fd,j+104) = p->char_num; WFIFOB(fd,j+104) = p->char_num;
#endif
} }
WFIFOSET(fd,WFIFOW(fd,2)); WFIFOSET(fd,WFIFOW(fd,2));

View File

@ -1680,7 +1680,11 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
int i, j, found_num = 0; int i, j, found_num = 0;
struct mmo_charstatus *p = NULL; struct mmo_charstatus *p = NULL;
const int offset = 24; const int offset = 24;
#ifdef PACKETVER > 7
WFIFOHEAD(fd, offset +9*108);
#else
WFIFOHEAD(fd, offset +9*106); WFIFOHEAD(fd, offset +9*106);
#endif
set_char_online(-1, 99,sd->account_id); set_char_online(-1, 99,sd->account_id);
@ -1705,9 +1709,15 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
for(i = found_num; i < 9; i++) for(i = found_num; i < 9; i++)
sd->found_char[i] = -1; sd->found_char[i] = -1;
memset(WFIFOP(fd, 0), 0, offset + found_num * 106);
WFIFOW(fd, 0) = 0x6b; WFIFOW(fd, 0) = 0x6b;
#ifdef PACKETVER > 7
memset(WFIFOP(fd, 0), 0, offset + found_num * 108);
WFIFOW(fd, 2) = offset + found_num * 108;
#endif
memset(WFIFOP(fd, 0), 0, offset + found_num * 106);
WFIFOW(fd, 2) = offset + found_num * 106; WFIFOW(fd, 2) = offset + found_num * 106;
#endif
if (save_log) if (save_log)
ShowInfo("Loading Char Data ("CL_BOLD"%d"CL_RESET")\n",sd->account_id); ShowInfo("Loading Char Data ("CL_BOLD"%d"CL_RESET")\n",sd->account_id);
@ -1717,7 +1727,11 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
p = &char_dat; p = &char_dat;
#ifdef PACKETVER > 7
j = offset + (i * 108);
#else
j = offset + (i * 106); // increase speed of code j = offset + (i * 106); // increase speed of code
#endif
WFIFOL(fd,j) = p->char_id; WFIFOL(fd,j) = p->char_id;
WFIFOL(fd,j+4) = p->base_exp>LONG_MAX?LONG_MAX:p->base_exp; WFIFOL(fd,j+4) = p->base_exp>LONG_MAX?LONG_MAX:p->base_exp;
@ -1758,9 +1772,13 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
WFIFOB(fd,j+101) = (p->int_ > UCHAR_MAX) ? UCHAR_MAX : p->int_; WFIFOB(fd,j+101) = (p->int_ > UCHAR_MAX) ? UCHAR_MAX : p->int_;
WFIFOB(fd,j+102) = (p->dex > UCHAR_MAX) ? UCHAR_MAX : p->dex; WFIFOB(fd,j+102) = (p->dex > UCHAR_MAX) ? UCHAR_MAX : p->dex;
WFIFOB(fd,j+103) = (p->luk > UCHAR_MAX) ? UCHAR_MAX : p->luk; WFIFOB(fd,j+103) = (p->luk > UCHAR_MAX) ? UCHAR_MAX : p->luk;
#if PACKETVER > 7
WFIFOW(fd,j+104) = p->char_num;
WFIFOB(fd,j+106) = 1; //TODO: Handle this rename bit: 0 to enable renaming
#else
WFIFOB(fd,j+104) = p->char_num; WFIFOB(fd,j+104) = p->char_num;
#endif
} }
WFIFOSET(fd,WFIFOW(fd,2)); WFIFOSET(fd,WFIFOW(fd,2));
// printf("mmo_char_send006b end..\n"); // printf("mmo_char_send006b end..\n");
return 0; return 0;

View File

@ -8,6 +8,9 @@
#include "cbasetypes.h" #include "cbasetypes.h"
#include "utils.h" // _WIN32 #include "utils.h" // _WIN32
// server protocol version
#define PACKETVER 7
#define FIFOSIZE_SERVERLINK 256*1024 #define FIFOSIZE_SERVERLINK 256*1024
// set to 0 to not check IP of player between each server. // set to 0 to not check IP of player between each server.

View File

@ -6,9 +6,6 @@
#include "map.h" #include "map.h"
// protocol version
#define PACKETVER 7
// packet DB // packet DB
#define MAX_PACKET_DB 0x300 #define MAX_PACKET_DB 0x300
#define MAX_PACKET_VER 25 #define MAX_PACKET_VER 25