summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-21 18:40:29 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-21 18:40:29 +0000
commit6f3bd3a74c8a9e983f3a5748ecaaa729ebeb1c3e (patch)
treea19adfa1a31ad5a5b6777cfcff2d12b7f9990723 /src/map
parentda8099a53f9edd008d3b9b9a206367728b6a94b4 (diff)
downloadhercules-6f3bd3a74c8a9e983f3a5748ecaaa729ebeb1c3e.tar.gz
hercules-6f3bd3a74c8a9e983f3a5748ecaaa729ebeb1c3e.tar.bz2
hercules-6f3bd3a74c8a9e983f3a5748ecaaa729ebeb1c3e.tar.xz
hercules-6f3bd3a74c8a9e983f3a5748ecaaa729ebeb1c3e.zip
- Removed the TURBO socket mechanism - it was in fact just using a variable to cache a few arithmetic operations (premature optimization)
- Since the fifohead mess is gone, fixed leftover bad code structuring git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10599 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/chrif.c75
-rw-r--r--src/map/clif.c224
-rw-r--r--src/map/intif.c55
-rw-r--r--src/map/irc.c1
-rw-r--r--src/map/log.c6
-rw-r--r--src/map/mail.c12
-rw-r--r--src/map/map.c4
-rw-r--r--src/map/pc.c1
8 files changed, 80 insertions, 298 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 3d0eabfd5..ba11565b7 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -207,7 +207,7 @@ int chrif_save(struct map_session_data *sd, int flag)
int chrif_connect(int fd)
{
ShowStatus("Logging in to char server...\n", char_fd);
- WFIFOHEAD(fd, 60);
+ WFIFOHEAD(fd,60);
WFIFOW(fd,0) = 0x2af8;
memcpy(WFIFOP(fd,2), userid, NAME_LENGTH);
memcpy(WFIFOP(fd,26), passwd, NAME_LENGTH);
@@ -240,7 +240,6 @@ int chrif_recvmap(int fd)
int i, j;
uint32 ip;
uint16 port;
- RFIFOHEAD(fd);
ip = ntohl(RFIFOL(fd,4));
port = ntohs(RFIFOW(fd,8));
for(i = 10, j = 0; i < RFIFOW(fd,2); i += 4, j++) {
@@ -259,7 +258,6 @@ int chrif_removemap(int fd)
int i, j;
uint32 ip;
uint16 port;
- RFIFOHEAD(fd);
ip = RFIFOL(fd, 4);
port = RFIFOW(fd, 8);
@@ -278,7 +276,6 @@ int chrif_removemap(int fd)
int chrif_save_ack(int fd)
{
struct map_session_data *sd;
- RFIFOHEAD(fd);
sd = map_id2sd(RFIFOL(fd,2));
if (sd && sd->status.char_id == RFIFOL(fd,6))
@@ -306,7 +303,7 @@ int chrif_changemapserver(struct map_session_data *sd, short map, int x, int y,
else //Not connected? Can't retrieve IP
s_ip = 0;
- WFIFOHEAD(char_fd, 35);
+ WFIFOHEAD(char_fd,35);
WFIFOW(char_fd, 0) = 0x2b05;
WFIFOL(char_fd, 2) = sd->bl.id;
WFIFOL(char_fd, 6) = sd->login_id1;
@@ -329,7 +326,6 @@ int chrif_changemapserverack(int fd)
{
struct map_session_data *sd;
char mapname[MAP_NAME_LENGTH_EXT];
- RFIFOHEAD(fd);
sd = map_id2sd(RFIFOL(fd,2));
if (sd == NULL || sd->status.char_id != RFIFOL(fd,14))
@@ -355,7 +351,6 @@ int chrif_changemapserverack(int fd)
*------------------------------------------*/
int chrif_connectack(int fd)
{
- RFIFOHEAD(fd);
if (RFIFOB(fd,2)) {
ShowFatalError("Connection to char-server failed %d.\n", RFIFOB(fd,2));
exit(1);
@@ -381,7 +376,6 @@ int chrif_connectack(int fd)
*------------------------------------------*/
int chrif_sendmapack(int fd)
{
- RFIFOHEAD(fd);
if (RFIFOB(fd,2)) {
ShowFatalError("chrif : send map list to char server failed %d\n", RFIFOB(fd,2));
exit(1);
@@ -408,10 +402,10 @@ int chrif_scdata_request(int account_id, int char_id)
#ifdef ENABLE_SC_SAVING
chrif_check(-1);
- WFIFOHEAD(char_fd, 10);
- WFIFOW(char_fd, 0) = 0x2afc;
- WFIFOL(char_fd, 2) = account_id;
- WFIFOL(char_fd, 6) = char_id;
+ WFIFOHEAD(char_fd,10);
+ WFIFOW(char_fd,0) = 0x2afc;
+ WFIFOL(char_fd,2) = account_id;
+ WFIFOL(char_fd,6) = char_id;
WFIFOSET(char_fd,10);
#endif
return 0;
@@ -455,7 +449,6 @@ void chrif_authok(int fd)
{
struct auth_node *auth_data;
TBL_PC* sd;
- RFIFOHEAD(fd);
//Check if we don't already have player data in our server
//(prevents data that is to be saved from being overwritten by
//this received status data if this auth is later successful) [Skotlex]
@@ -535,7 +528,7 @@ int chrif_charselectreq(struct map_session_data* sd, uint32 s_ip)
return -1;
chrif_check(-1);
- WFIFOHEAD(char_fd, 18);
+ WFIFOHEAD(char_fd,18);
WFIFOW(char_fd, 0) = 0x2b02;
WFIFOL(char_fd, 2) = sd->bl.id;
WFIFOL(char_fd, 6) = sd->login_id1;
@@ -555,7 +548,7 @@ int chrif_searchcharid(int char_id)
return -1;
chrif_check(-1);
- WFIFOHEAD(char_fd, 6);
+ WFIFOHEAD(char_fd,6);
WFIFOW(char_fd,0) = 0x2b08;
WFIFOL(char_fd,2) = char_id;
WFIFOSET(char_fd,6);
@@ -593,7 +586,7 @@ int chrif_changeemail(int id, const char *actual_email, const char *new_email)
chrif_check(-1);
- WFIFOHEAD(char_fd, 86);
+ WFIFOHEAD(char_fd,86);
WFIFOW(char_fd,0) = 0x2b0c;
WFIFOL(char_fd,2) = id;
memcpy(WFIFOP(char_fd,6), actual_email, 40);
@@ -643,7 +636,7 @@ int chrif_changesex(int id, int sex)
{
chrif_check(-1);
- WFIFOHEAD(char_fd, 9);
+ WFIFOHEAD(char_fd,9);
WFIFOW(char_fd,0) = 0x2b11;
WFIFOW(char_fd,2) = 9;
WFIFOL(char_fd,4) = id;
@@ -673,7 +666,6 @@ int chrif_char_ask_name_answer(int fd)
struct map_session_data *sd;
char output[256];
char player_name[NAME_LENGTH];
- RFIFOHEAD(fd);
acc = RFIFOL(fd,2); // account_id of who has asked (-1 if nobody)
memcpy(player_name, RFIFOP(fd,6), NAME_LENGTH-1);
@@ -774,7 +766,6 @@ int chrif_changedgm(int fd)
{
int acc, level;
struct map_session_data *sd = NULL;
- RFIFOHEAD(fd);
acc = RFIFOL(fd,2);
level = RFIFOL(fd,6);
@@ -800,7 +791,6 @@ int chrif_changedsex(int fd)
{
int acc, sex, i;
struct map_session_data *sd;
- RFIFOHEAD(fd);
acc = RFIFOL(fd,2);
sex = RFIFOL(fd,6);
@@ -896,7 +886,6 @@ int chrif_accountdeletion(int fd)
{
int acc;
struct map_session_data *sd;
- RFIFOHEAD(fd);
acc = RFIFOL(fd,2);
if (battle_config.etc_log)
@@ -923,7 +912,6 @@ int chrif_accountban(int fd)
{
int acc;
struct map_session_data *sd;
- RFIFOHEAD(fd);
acc = RFIFOL(fd,2);
if (battle_config.etc_log)
@@ -991,7 +979,6 @@ int chrif_accountban(int fd)
int chrif_disconnectplayer(int fd)
{
struct map_session_data *sd;
- RFIFOHEAD(fd);
sd = map_id2sd(RFIFOL(fd, 2));
@@ -1040,9 +1027,9 @@ int chrif_reloadGMdb(void)
{
chrif_check(-1);
- WFIFOHEAD(char_fd, 2);
+ WFIFOHEAD(char_fd,2);
WFIFOW(char_fd,0) = 0x2af7;
- WFIFOSET(char_fd, 2);
+ WFIFOSET(char_fd,2);
return 0;
}
@@ -1080,12 +1067,12 @@ int chrif_updatefamelist(struct map_session_data *sd)
}
WFIFOHEAD(char_fd, 12);
- WFIFOW(char_fd, 0) = 0x2b10;
- WFIFOL(char_fd, 2) = sd->status.char_id;
- WFIFOL(char_fd, 6) = sd->status.fame;
- WFIFOB(char_fd, 10) = type;
- WFIFOB(char_fd, 11) = pc_famerank(sd->status.char_id, sd->class_&MAPID_UPPERMASK);
- WFIFOSET(char_fd, 12);
+ WFIFOW(char_fd,0) = 0x2b10;
+ WFIFOL(char_fd,2) = sd->status.char_id;
+ WFIFOL(char_fd,6) = sd->status.fame;
+ WFIFOB(char_fd,10) = type;
+ WFIFOB(char_fd,11) = pc_famerank(sd->status.char_id, sd->class_&MAPID_UPPERMASK);
+ WFIFOSET(char_fd,12);
return 0;
}
@@ -1094,9 +1081,9 @@ int chrif_buildfamelist(void)
{
chrif_check(-1);
- WFIFOHEAD(char_fd, 2);
- WFIFOW(char_fd, 0) = 0x2b1a;
- WFIFOSET(char_fd, 2);
+ WFIFOHEAD(char_fd,2);
+ WFIFOW(char_fd,0) = 0x2b1a;
+ WFIFOSET(char_fd,2);
return 0;
}
@@ -1105,7 +1092,6 @@ int chrif_recvfamelist(int fd)
{
int num, size;
int total = 0, len = 8;
- RFIFOHEAD(fd);
memset (smith_fame_list, 0, sizeof(smith_fame_list));
memset (chemist_fame_list, 0, sizeof(chemist_fame_list));
@@ -1141,7 +1127,6 @@ int chrif_updatefamelist_ack(int fd)
{
struct fame_list *list;
char index;
- RFIFOHEAD(fd);
switch (RFIFOB(fd, 2))
{
case 1:
@@ -1213,7 +1198,6 @@ int chrif_load_scdata(int fd)
struct map_session_data *sd;
struct status_change_data *data;
int aid, cid, i, count;
- RFIFOHEAD(fd);
aid = RFIFOL(fd,4); //Player Account ID
cid = RFIFOL(fd,8); //Player Char ID
@@ -1290,7 +1274,7 @@ int chrif_char_offline(struct map_session_data *sd)
{
chrif_check(-1);
- WFIFOHEAD(char_fd, 10);
+ WFIFOHEAD(char_fd,10);
WFIFOW(char_fd,0) = 0x2b17;
WFIFOL(char_fd,2) = sd->status.char_id;
WFIFOL(char_fd,6) = sd->status.account_id;
@@ -1320,7 +1304,7 @@ int chrif_char_reset_offline(void)
{
chrif_check(-1);
- WFIFOHEAD(char_fd, 2);
+ WFIFOHEAD(char_fd,2);
WFIFOW(char_fd,0) = 0x2b18;
WFIFOSET(char_fd,2);
@@ -1335,7 +1319,7 @@ int chrif_char_online(struct map_session_data *sd)
{
chrif_check(-1);
- WFIFOHEAD(char_fd, 10);
+ WFIFOHEAD(char_fd,10);
WFIFOW(char_fd,0) = 0x2b19;
WFIFOL(char_fd,2) = sd->status.char_id;
WFIFOL(char_fd,6) = sd->status.account_id;
@@ -1363,16 +1347,16 @@ int chrif_disconnect(int fd)
void chrif_update_ip(int fd)
{
uint32 new_ip;
- WFIFOHEAD(fd, 6);
+ WFIFOHEAD(fd,6);
new_ip = host2ip(char_ip_str);
if (new_ip && new_ip != char_ip)
char_ip = new_ip; //Update char_ip
new_ip = clif_refresh_ip();
if (!new_ip) return; //No change
- WFIFOW(fd, 0) = 0x2736;
- WFIFOL(fd, 2) = htonl(new_ip);
- WFIFOSET(fd, 6);
+ WFIFOW(fd,0) = 0x2736;
+ WFIFOL(fd,2) = htonl(new_ip);
+ WFIFOSET(fd,6);
}
/*==========================================
@@ -1395,7 +1379,6 @@ int chrif_parse(int fd)
}
while (RFIFOREST(fd) >= 2) { //Infinite loop on broken pipe fix. [Skotlex]
- RFIFOHEAD(fd);
cmd = RFIFOW(fd,0);
if (cmd < 0x2af8 || cmd >= 0x2af8 + (sizeof(packet_len_table) / sizeof(packet_len_table[0])) ||
packet_len_table[cmd-0x2af8] == 0) {
@@ -1469,7 +1452,7 @@ int send_usercount_tochar(int tid, unsigned int tick, int id, int data)
return 0;
last_count = count;
- WFIFOHEAD(char_fd, 4);
+ WFIFOHEAD(char_fd,4);
WFIFOW(char_fd,0) = 0x2afe;
WFIFOW(char_fd,2) = count;
WFIFOSET(char_fd,4);
diff --git a/src/map/clif.c b/src/map/clif.c
index 9c3345895..fd5f69bd0 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -711,9 +711,9 @@ int clif_clearchar_delay(unsigned int tick, struct block_list *bl, int type)
int clif_clearchar_id(int id, int type, int fd)
{
WFIFOHEAD(fd, packet_len(0x80));
- WFIFOW(fd,0) = 0x80;
- WFIFOL(fd,2) = id;
- WFIFOB(fd,6) = (char)type; // Why use int for a char in the first place?
+ WFIFOW(fd,0) = 0x80;
+ WFIFOL(fd,2) = id;
+ WFIFOB(fd,6) = (char)type; // Why use int for a char in the first place?
WFIFOSET(fd, packet_len(0x80));
return 0;
@@ -1876,13 +1876,13 @@ int clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes)
int fd = sd->fd;
int slen = strlen(mes) + 8;
struct block_list *bl = NULL;
- WFIFOHEAD(fd, slen);
if (!sd->state.using_fake_npc && (npcid == fake_nd->bl.id || ((bl = map_id2bl(npcid)) && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
clif_sendfakenpc(sd, npcid);
+ WFIFOHEAD(fd, slen);
WFIFOW(fd,0)=0xb7;
WFIFOW(fd,2)=slen;
WFIFOL(fd,4)=npcid;
@@ -2041,8 +2041,6 @@ static void clif_addcards(unsigned char* buf, struct item* item)
int clif_additem(struct map_session_data *sd, int n, int amount, int fail)
{
int fd;
- unsigned char *buf;
-
nullpo_retr(0, sd);
fd = sd->fd;
@@ -2050,40 +2048,39 @@ int clif_additem(struct map_session_data *sd, int n, int amount, int fail)
return 0;
WFIFOHEAD(fd,packet_len(0xa0));
- buf = WFIFOP(fd,0);
if(fail) {
- WBUFW(buf,0)=0xa0;
- WBUFW(buf,2)=n+2;
- WBUFW(buf,4)=amount;
- WBUFW(buf,6)=0;
- WBUFB(buf,8)=0;
- WBUFB(buf,9)=0;
- WBUFB(buf,10)=0;
- WBUFW(buf,11)=0;
- WBUFW(buf,13)=0;
- WBUFW(buf,15)=0;
- WBUFW(buf,17)=0;
- WBUFW(buf,19)=0;
- WBUFB(buf,21)=0;
- WBUFB(buf,22)=fail;
+ WFIFOW(fd,0)=0xa0;
+ WFIFOW(fd,2)=n+2;
+ WFIFOW(fd,4)=amount;
+ WFIFOW(fd,6)=0;
+ WFIFOB(fd,8)=0;
+ WFIFOB(fd,9)=0;
+ WFIFOB(fd,10)=0;
+ WFIFOW(fd,11)=0;
+ WFIFOW(fd,13)=0;
+ WFIFOW(fd,15)=0;
+ WFIFOW(fd,17)=0;
+ WFIFOW(fd,19)=0;
+ WFIFOB(fd,21)=0;
+ WFIFOB(fd,22)=fail;
} else {
if (n<0 || n>=MAX_INVENTORY || sd->status.inventory[n].nameid <=0 || sd->inventory_data[n] == NULL)
return 1;
- WBUFW(buf,0)=0xa0;
- WBUFW(buf,2)=n+2;
- WBUFW(buf,4)=amount;
+ WFIFOW(fd,0)=0xa0;
+ WFIFOW(fd,2)=n+2;
+ WFIFOW(fd,4)=amount;
if (sd->inventory_data[n]->view_id > 0)
- WBUFW(buf,6)=sd->inventory_data[n]->view_id;
+ WFIFOW(fd,6)=sd->inventory_data[n]->view_id;
else
- WBUFW(buf,6)=sd->status.inventory[n].nameid;
- WBUFB(buf,8)=sd->status.inventory[n].identify;
- WBUFB(buf,9)=sd->status.inventory[n].attribute;
- WBUFB(buf,10)=sd->status.inventory[n].refine;
- clif_addcards(WBUFP(buf,11), &sd->status.inventory[n]);
- WBUFW(buf,19)=pc_equippoint(sd,n);
- WBUFB(buf,21)=itemtype(sd->inventory_data[n]->type);
- WBUFB(buf,22)=fail;
+ WFIFOW(fd,6)=sd->status.inventory[n].nameid;
+ WFIFOB(fd,8)=sd->status.inventory[n].identify;
+ WFIFOB(fd,9)=sd->status.inventory[n].attribute;
+ WFIFOB(fd,10)=sd->status.inventory[n].refine;
+ clif_addcards(WFIFOP(fd,11), &sd->status.inventory[n]);
+ WFIFOW(fd,19)=pc_equippoint(sd,n);
+ WFIFOB(fd,21)=itemtype(sd->inventory_data[n]->type);
+ WFIFOB(fd,22)=fail;
}
WFIFOSET(fd,packet_len(0xa0));
@@ -2104,7 +2101,6 @@ int clif_delitem(struct map_session_data *sd,int n,int amount)
WFIFOW(fd,0)=0xaf;
WFIFOW(fd,2)=n+2;
WFIFOW(fd,4)=amount;
-
WFIFOSET(fd,packet_len(0xaf));
return 0;
@@ -2894,7 +2890,6 @@ int clif_arrowequip(struct map_session_data *sd,int val)
WFIFOHEAD(fd, packet_len(0x013c));
WFIFOW(fd,0)=0x013c;
WFIFOW(fd,2)=val+2;//矢のアイテムID
-
WFIFOSET(fd,packet_len(0x013c));
return 0;
@@ -2917,7 +2912,6 @@ int clif_arrow_fail(struct map_session_data *sd,int type)
WFIFOHEAD(fd, packet_len(0x013b));
WFIFOW(fd,0)=0x013b;
WFIFOW(fd,2)=type;
-
WFIFOSET(fd,packet_len(0x013b));
return 0;
@@ -7850,7 +7844,6 @@ static int clif_guess_PacketVer(int fd, int get_previous, int *error)
static int err = 1;
static int packet_ver = -1;
int cmd, packet_len, value; //Value is used to temporarily store account/char_id/sex
- RFIFOHEAD(fd);
if (get_previous)
{//For quick reruns, since the normal code flow is to fetch this once to identify the packet version, then again in the wanttoconnect function. [Skotlex]
@@ -7916,7 +7909,6 @@ void clif_parse_WantToConnection(int fd, TBL_PC* sd)
int cmd, account_id, char_id, login_id1, sex;
unsigned int client_tick; //The client tick is a tick, therefore it needs be unsigned. [Skotlex]
int packet_ver; // 5: old, 6: 7july04, 7: 13july04, 8: 26july04, 9: 9aug04/16aug04/17aug04, 10: 6sept04, 11: 21sept04, 12: 18oct04, 13: 25oct04 (by [Yor])
- RFIFOHEAD(fd);
if (sd) {
if (battle_config.error_log)
@@ -8204,9 +8196,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_TickSend(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
- sd->client_tick=RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+ sd->client_tick = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
WFIFOHEAD(fd, packet_len(0x7f));
WFIFOW(fd,0)=0x7f;
@@ -8224,7 +8214,6 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
{
int x, y;
int cmd;
- RFIFOHEAD(fd);
if (pc_isdead(sd)) {
clif_clearchar_area(&sd->bl, 1);
@@ -8373,7 +8362,6 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd)
int account_id;
struct block_list* bl;
struct status_change *sc;
- RFIFOHEAD(fd);
account_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
@@ -8412,8 +8400,6 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
char* message;
unsigned int packetlen, messagelen, namelen;
- RFIFOHEAD(fd);
-
packetlen = RFIFOW(fd,2);
if (packetlen > RFIFOREST(fd)) { // there has to be enough data to read
ShowWarning("clif_parse_GlobalMessage: Received malformed packet from player '%s' (length is incorrect)!", sd->status.name);
@@ -8557,7 +8543,6 @@ void clif_parse_MapMove(int fd, struct map_session_data *sd)
char output[MAP_NAME_LENGTH_EXT+15]; // Max length of a short: ' -6XXXX' -> 7 digits
char message[MAP_NAME_LENGTH_EXT+15+5]; // "/mm "+output
char *map_name;
- RFIFOHEAD(fd);
if (battle_config.atc_gmonly && !pc_isGM(sd))
return;
@@ -8604,7 +8589,6 @@ void clif_changed_dir(struct block_list *bl, int type)
void clif_parse_ChangeDir(int fd, struct map_session_data *sd)
{
unsigned char headdir, dir;
- RFIFOHEAD(fd);
headdir = RFIFOB(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
dir = RFIFOB(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
@@ -8620,7 +8604,6 @@ void clif_parse_ChangeDir(int fd, struct map_session_data *sd)
void clif_parse_Emotion(int fd, struct map_session_data *sd)
{
unsigned char buf[64];
- RFIFOHEAD(fd);
if (battle_config.basic_skill_check == 0 || pc_checkskill(sd, NV_BASIC) >= 2) {
if (RFIFOB(fd,2) == 34) {// prevent use of the mute emote [Valaris]
@@ -8745,7 +8728,6 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
*------------------------------------------*/
void clif_parse_ActionRequest(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
clif_parse_ActionRequest_sub(sd,
RFIFOB(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]),
RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]),
@@ -8758,8 +8740,6 @@ void clif_parse_ActionRequest(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_Restart(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
switch(RFIFOB(fd,2)) {
case 0x00:
if (!pc_isdead(sd))
@@ -8799,7 +8779,7 @@ void clif_parse_Wis(int fd, struct map_session_data *sd)
char target[NAME_LENGTH+1];
char output[256];
unsigned int len;
- RFIFOHEAD(fd);
+
len = RFIFOW(fd,2); //Packet length
if (len < 28)
{ //Invalid packet, specified size is less than minimum! [Skotlex]
@@ -8973,7 +8953,7 @@ void clif_parse_GMmessage(int fd, struct map_session_data *sd)
{
char* mes;
int size, lv;
- RFIFOHEAD(fd);
+
if (battle_config.atc_gmonly && !pc_isGM(sd))
return;
if (pc_isGM(sd) < (lv=get_atcommand_level(AtCommand_Broadcast)))
@@ -8998,7 +8978,6 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd)
{
struct flooritem_data *fitem;
int map_object_id;
- RFIFOHEAD(fd);
map_object_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
@@ -9041,7 +9020,6 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd)
void clif_parse_DropItem(int fd, struct map_session_data *sd)
{
int item_index, item_amount;
- RFIFOHEAD(fd);
if (pc_isdead(sd)) {
clif_clearchar_area(&sd->bl, 1);
@@ -9072,7 +9050,6 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd)
void clif_parse_UseItem(int fd, struct map_session_data *sd)
{
int n;
- RFIFOHEAD(fd);
if (pc_isdead(sd)) {
clif_clearchar_area(&sd->bl, 1);
@@ -9108,7 +9085,6 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
void clif_parse_EquipItem(int fd,struct map_session_data *sd)
{
int index;
- RFIFOHEAD(fd);
if(pc_isdead(sd)) {
clif_clearchar_area(&sd->bl,1);
@@ -9155,7 +9131,6 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd)
void clif_parse_UnequipItem(int fd,struct map_session_data *sd)
{
int index;
- RFIFOHEAD(fd);
if(pc_isdead(sd)) {
clif_clearchar_area(&sd->bl,1);
@@ -9178,7 +9153,6 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd)
void clif_parse_NpcClicked(int fd,struct map_session_data *sd)
{
struct block_list *bl;
- RFIFOHEAD(fd);
if(pc_isdead(sd)) {
clif_clearchar_area(&sd->bl,1);
@@ -9210,7 +9184,6 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_NpcBuySellSelected(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if (sd->state.trading)
return;
npc_buysellsel(sd,RFIFOL(fd,2),RFIFOB(fd,6));
@@ -9223,7 +9196,6 @@ void clif_parse_NpcBuyListSend(int fd,struct map_session_data *sd)
{
int fail=0,n;
unsigned short *item_list;
- RFIFOHEAD(fd);
n = (RFIFOW(fd,2)-4) /4;
item_list = (unsigned short*)RFIFOP(fd,4);
@@ -9247,7 +9219,6 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
{
int fail=0,n;
unsigned short *item_list;
- RFIFOHEAD(fd);
n = (RFIFOW(fd,2)-4) /4;
item_list = (unsigned short*)RFIFOP(fd,4);
@@ -9270,7 +9241,6 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_CreateChatRoom(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOROOM)
return;
if(battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 4){
@@ -9284,7 +9254,6 @@ void clif_parse_CreateChatRoom(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_ChatAddMember(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
chat_joinchat(sd,RFIFOL(fd,2),(char*)RFIFOP(fd,6));
}
@@ -9293,7 +9262,6 @@ void clif_parse_ChatAddMember(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_ChatRoomStatusChange(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
chat_changechatstatus(sd,RFIFOW(fd,4),RFIFOB(fd,6),(char*)RFIFOP(fd,7),(char*)RFIFOP(fd,15),RFIFOW(fd,2)-15);
}
@@ -9302,7 +9270,6 @@ void clif_parse_ChatRoomStatusChange(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_ChangeChatOwner(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
chat_changechatowner(sd,(char*)RFIFOP(fd,6));
}
@@ -9311,7 +9278,6 @@ void clif_parse_ChangeChatOwner(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_KickFromChat(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
chat_kickchat(sd,(char*)RFIFOP(fd,2));
}
@@ -9344,7 +9310,6 @@ void clif_parse_TradeRequest(int fd,struct map_session_data *sd)
{
struct map_session_data *t_sd;
- RFIFOHEAD(fd);
t_sd = map_id2sd(RFIFOL(fd,2));
if(!sd->chatID && clif_cant_act(sd))
@@ -9367,7 +9332,6 @@ void clif_parse_TradeRequest(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_TradeAck(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
trade_tradeack(sd,RFIFOB(fd,2));
}
@@ -9376,7 +9340,6 @@ void clif_parse_TradeAck(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_TradeAddItem(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
trade_tradeadditem(sd,RFIFOW(fd,2),RFIFOL(fd,4));
}
@@ -9417,8 +9380,6 @@ void clif_parse_StopAttack(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_PutItemToCart(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if (clif_trading(sd))
return;
if (!pc_iscarton(sd))
@@ -9430,7 +9391,6 @@ void clif_parse_PutItemToCart(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if (!pc_iscarton(sd))
return;
pc_getitemfromcart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4));
@@ -9452,7 +9412,6 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
{
int type;
- RFIFOHEAD(fd);
type = (int)RFIFOW(fd,2);
if( (type == 5 && sd->status.base_level <= 90) ||
@@ -9470,7 +9429,6 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_StatusUp(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
pc_statusup(sd,RFIFOW(fd,2));
}
@@ -9479,7 +9437,6 @@ void clif_parse_StatusUp(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_SkillUp(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
pc_skillup(sd,RFIFOW(fd,2));
}
@@ -9518,7 +9475,6 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
{
int skillnum, skilllv, tmp, target_id;
unsigned int tick = gettick();
- RFIFOHEAD(fd);
if (clif_cant_act(sd))
return;
@@ -9634,7 +9590,6 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, int skilll
{
int lv;
unsigned int tick = gettick();
- RFIFOHEAD(fd);
//Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex]
sd->idletime = last_tick;
@@ -9694,8 +9649,6 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, int skilll
void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if (clif_cant_act(sd))
return;
if (pc_issit(sd))
@@ -9712,8 +9665,6 @@ void clif_parse_UseSkillToPos(int fd, struct map_session_data *sd)
void clif_parse_UseSkillToPosMoreInfo(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if (clif_cant_act(sd))
return;
if (pc_issit(sd))
@@ -9733,7 +9684,6 @@ void clif_parse_UseSkillToPosMoreInfo(int fd, struct map_session_data *sd)
void clif_parse_UseSkillMap(int fd,struct map_session_data *sd)
{
int skill_num;
- RFIFOHEAD(fd);
skill_num = RFIFOW(fd,2);
if(skill_num != sd->menuskill_id)
@@ -9761,8 +9711,6 @@ void clif_parse_RequestMemo(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_ProduceMix(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if (sd->menuskill_id != AM_PHARMACY)
return;
@@ -9780,8 +9728,6 @@ void clif_parse_ProduceMix(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_RepairItem(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if (sd->menuskill_id != BS_REPAIRWEAPON)
return;
if (clif_trading(sd)) {
@@ -9800,7 +9746,6 @@ void clif_parse_RepairItem(int fd, struct map_session_data *sd)
void clif_parse_WeaponRefine(int fd, struct map_session_data *sd)
{
int idx;
- RFIFOHEAD(fd);
if (sd->menuskill_id != WS_WEAPONREFINE) //Packet exploit?
return;
@@ -9821,7 +9766,6 @@ void clif_parse_WeaponRefine(int fd, struct map_session_data *sd)
void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd)
{
uint8 select;
- RFIFOHEAD(fd);
select = RFIFOB(fd,6);
if((select > sd->npc_menu && select != 0xff) || !select){
@@ -9838,7 +9782,6 @@ void clif_parse_NpcSelectMenu(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_NpcNextClicked(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
npc_scriptcont(sd,RFIFOL(fd,2));
}
@@ -9847,7 +9790,6 @@ void clif_parse_NpcNextClicked(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
sd->npc_amount=(int)RFIFOL(fd,6);
npc_scriptcont(sd,RFIFOL(fd,2));
}
@@ -9858,7 +9800,6 @@ void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd)
void clif_parse_NpcStringInput(int fd,struct map_session_data *sd)
{
short message_len;
- RFIFOHEAD(fd);
message_len = RFIFOW(fd,2)-7;
if(message_len < 1)
@@ -9880,9 +9821,9 @@ void clif_parse_NpcStringInput(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_NpcCloseClicked(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
- if (sd->npc_id) //Avoid parsing anything when the script was done with. [Skotlex]
- npc_scriptcont(sd,RFIFOL(fd,2));
+ if (!sd->npc_id) //Avoid parsing anything when the script was done with. [Skotlex]
+ return;
+ npc_scriptcont(sd,RFIFOL(fd,2));
}
/*==========================================
@@ -9890,7 +9831,6 @@ void clif_parse_NpcCloseClicked(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_ItemIdentify(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if (sd->menuskill_id != MC_IDENTIFY)
return;
skill_identify(sd,RFIFOW(fd,2)-2);
@@ -9901,7 +9841,6 @@ void clif_parse_ItemIdentify(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_SelectArrow(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if (sd->menuskill_id != AC_MAKINGARROW)
return;
if (clif_trading(sd)) {
@@ -9918,7 +9857,6 @@ void clif_parse_SelectArrow(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_AutoSpell(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if (sd->menuskill_id != SA_AUTOSPELL)
return;
skill_autospell(sd,RFIFOW(fd,2));
@@ -9929,8 +9867,7 @@ void clif_parse_AutoSpell(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_UseCard(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
- if (sd->state.trading!= 0)
+ if (sd->state.trading != 0)
return;
clif_use_card(sd,RFIFOW(fd,2)-2);
}
@@ -9939,8 +9876,7 @@ void clif_parse_UseCard(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_InsertCard(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
- if (sd->state.trading!= 0)
+ if (sd->state.trading != 0)
return;
pc_insert_card(sd,RFIFOW(fd,2)-2,RFIFOW(fd,4)-2);
}
@@ -9951,7 +9887,6 @@ void clif_parse_InsertCard(int fd,struct map_session_data *sd)
void clif_parse_SolveCharName(int fd, struct map_session_data *sd)
{
int char_id;
- RFIFOHEAD(fd);
char_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
clif_solved_charname(sd, char_id);
@@ -9962,7 +9897,6 @@ void clif_parse_SolveCharName(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_ResetChar(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if (battle_config.atc_gmonly && !pc_isGM(sd))
return;
if (pc_isGM(sd) < get_atcommand_level(AtCommand_ResetState))
@@ -9985,7 +9919,6 @@ void clif_parse_LGMmessage(int fd, struct map_session_data *sd)
unsigned char buf[CHAT_SIZE+4];
char *mes;
int len, lv;
- RFIFOHEAD(fd);
if (battle_config.atc_gmonly && !pc_isGM(sd))
return;
@@ -10013,7 +9946,6 @@ void clif_parse_LGMmessage(int fd, struct map_session_data *sd)
void clif_parse_MoveToKafra(int fd, struct map_session_data *sd)
{
int item_index, item_amount;
- RFIFOHEAD(fd);
if (clif_trading(sd))
return;
@@ -10035,7 +9967,6 @@ void clif_parse_MoveToKafra(int fd, struct map_session_data *sd)
void clif_parse_MoveFromKafra(int fd,struct map_session_data *sd)
{
int item_index, item_amount;
- RFIFOHEAD(fd);
item_index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-1;
item_amount = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
@@ -10051,8 +9982,6 @@ void clif_parse_MoveFromKafra(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_MoveToKafraFromCart(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if(sd->vender_id)
return;
if (!pc_iscarton(sd))
@@ -10068,8 +9997,6 @@ void clif_parse_MoveToKafraFromCart(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_MoveFromKafraToCart(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if (sd->vender_id)
return;
if (!pc_iscarton(sd))
@@ -10105,7 +10032,6 @@ void clif_parse_StoragePassword(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_CreateParty(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if(map[sd->bl.m].flag.partylock)
{ //Guild locked.
clif_displaymessage(fd, msg_txt(227));
@@ -10127,10 +10053,9 @@ void clif_parse_CreateParty2(int fd, struct map_session_data *sd)
clif_displaymessage(fd, msg_txt(227));
return;
}
- if (battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 7){
- RFIFOHEAD(fd);
+ if (battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 7)
party_create(sd,(char*)RFIFOP(fd,2),RFIFOB(fd,26),RFIFOB(fd,27));
- } else
+ else
clif_skill_fail(sd,1,0,4);
}
@@ -10141,7 +10066,6 @@ void clif_parse_PartyInvite(int fd, struct map_session_data *sd)
{
struct map_session_data *t_sd;
- RFIFOHEAD(fd);
if(map[sd->bl.m].flag.partylock)
{ //Guild locked.
clif_displaymessage(fd, msg_txt(227));
@@ -10164,7 +10088,6 @@ void clif_parse_PartyInvite(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_ReplyPartyInvite(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if(battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 5){
party_reply_invite(sd,RFIFOL(fd,2),RFIFOL(fd,6));
} else {
@@ -10191,7 +10114,6 @@ void clif_parse_LeaveParty(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if(map[sd->bl.m].flag.partylock)
{ //Guild locked.
clif_displaymessage(fd, msg_txt(227));
@@ -10206,7 +10128,6 @@ void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd)
void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd)
{
struct party_data *p;
- RFIFOHEAD(fd);
if(!sd->status.party_id)
return;
@@ -10227,7 +10148,6 @@ void clif_parse_PartyMessage(int fd, struct map_session_data *sd)
char *mes;
int len;
- RFIFOHEAD(fd);
len = RFIFOW(fd,2) - 4;
mes = RFIFOP(fd,4);
mes_len_check(mes, len, CHAT_SIZE);
@@ -10265,8 +10185,6 @@ void clif_parse_CloseVending(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_VendingListReq(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
vending_vendinglistreq(sd,RFIFOL(fd,2));
if(sd->npc_id)
npc_event_dequeue(sd);
@@ -10277,7 +10195,6 @@ void clif_parse_VendingListReq(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_PurchaseReq(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
vending_purchasereq(sd, RFIFOW(fd,2), RFIFOL(fd,4), RFIFOP(fd,8));
}
@@ -10286,7 +10203,6 @@ void clif_parse_PurchaseReq(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_OpenVending(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if (clif_trading(sd))
return;
if (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOROOM)
@@ -10299,7 +10215,6 @@ void clif_parse_OpenVending(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_CreateGuild(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if(map[sd->bl.m].flag.guildlock)
{ //Guild locked.
clif_displaymessage(fd, msg_txt(228));
@@ -10321,8 +10236,8 @@ void clif_parse_GuildCheckMaster(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildRequestInfo(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
- if (!sd->status.guild_id) return;
+ if (!sd->status.guild_id)
+ return;
switch(RFIFOL(fd,2)){
case 0: // ギルド基本情報、同盟敵対情報
clif_guild_basicinfo(sd);
@@ -10355,7 +10270,6 @@ void clif_parse_GuildRequestInfo(int fd, struct map_session_data *sd)
void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data *sd)
{
int i;
- RFIFOHEAD(fd);
if(!sd->state.gmaster_flag)
return;
@@ -10371,7 +10285,6 @@ void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data *sd)
void clif_parse_GuildChangeMemberPosition(int fd, struct map_session_data *sd)
{
int i;
- RFIFOHEAD(fd);
if(!sd->state.gmaster_flag)
return;
@@ -10387,9 +10300,7 @@ void clif_parse_GuildChangeMemberPosition(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildRequestEmblem(int fd,struct map_session_data *sd)
{
- struct guild *g;
- RFIFOHEAD(fd);
- g=guild_search(RFIFOL(fd,2));
+ struct guild* g = guild_search(RFIFOL(fd,2));
if(g!=NULL)
clif_guild_emblem(sd,g);
}
@@ -10399,8 +10310,6 @@ void clif_parse_GuildRequestEmblem(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if(!sd->state.gmaster_flag)
return;
@@ -10412,8 +10321,6 @@ void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildChangeNotice(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if(!sd->state.gmaster_flag)
return;
@@ -10439,8 +10346,6 @@ void clif_parse_GuildInvite(int fd,struct map_session_data *sd)
{
struct map_session_data *t_sd;
- RFIFOHEAD(fd);
-
if(map[sd->bl.m].flag.guildlock)
{ //Guild locked.
clif_displaymessage(fd, msg_txt(228));
@@ -10463,7 +10368,6 @@ void clif_parse_GuildInvite(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildReplyInvite(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
guild_reply_invite(sd,RFIFOL(fd,2),RFIFOB(fd,6));
}
@@ -10472,7 +10376,6 @@ void clif_parse_GuildReplyInvite(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildLeave(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if(map[sd->bl.m].flag.guildlock)
{ //Guild locked.
clif_displaymessage(fd, msg_txt(228));
@@ -10486,7 +10389,6 @@ void clif_parse_GuildLeave(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if(map[sd->bl.m].flag.guildlock)
{ //Guild locked.
clif_displaymessage(fd, msg_txt(228));
@@ -10503,7 +10405,6 @@ void clif_parse_GuildMessage(int fd,struct map_session_data *sd)
char *mes;
int len;
- RFIFOHEAD(fd);
len = RFIFOW(fd,2) - 4;
mes = RFIFOP(fd,4);
mes_len_check(mes, len, CHAT_SIZE);
@@ -10535,8 +10436,6 @@ void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd)
{
struct map_session_data *t_sd;
- RFIFOHEAD(fd);
-
if(!sd->state.gmaster_flag)
return;
@@ -10562,7 +10461,6 @@ void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildReplyAlliance(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
guild_reply_reqalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
}
@@ -10571,8 +10469,6 @@ void clif_parse_GuildReplyAlliance(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildDelAlliance(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
-
if(!sd->state.gmaster_flag)
return;
@@ -10590,7 +10486,6 @@ void clif_parse_GuildDelAlliance(int fd, struct map_session_data *sd)
void clif_parse_GuildOpposition(int fd, struct map_session_data *sd)
{
struct map_session_data *t_sd;
- RFIFOHEAD(fd);
if(!sd->state.gmaster_flag)
return;
@@ -10617,7 +10512,6 @@ void clif_parse_GuildOpposition(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_GuildBreak(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if(map[sd->bl.m].flag.guildlock)
{ //Guild locked.
clif_displaymessage(fd, msg_txt(228));
@@ -10629,19 +10523,16 @@ void clif_parse_GuildBreak(int fd, struct map_session_data *sd)
// pet
void clif_parse_PetMenu(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
pet_menu(sd,RFIFOB(fd,2));
}
void clif_parse_CatchPet(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
pet_catch_process2(sd,RFIFOL(fd,2));
}
void clif_parse_SelectEgg(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
if (sd->menuskill_id != SA_TAMINGMONSTER || sd->menuskill_lv != -1)
return;
pet_select_egg(sd,RFIFOW(fd,2)-2);
@@ -10650,15 +10541,12 @@ void clif_parse_SelectEgg(int fd, struct map_session_data *sd)
void clif_parse_SendEmotion(int fd, struct map_session_data *sd)
{
- if(sd->pd) {
- RFIFOHEAD(fd);
+ if(sd->pd)
clif_pet_emotion(sd->pd,RFIFOL(fd,2));
- }
}
void clif_parse_ChangePetName(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
pet_change_name(sd,(char*)RFIFOP(fd,2));
}
@@ -10668,7 +10556,6 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd)
struct block_list *target;
int tid,lv;
- RFIFOHEAD(fd);
if (battle_config.atc_gmonly && !pc_isGM(sd))
return;
@@ -10724,7 +10611,6 @@ void clif_parse_Shift(int fd, struct map_session_data *sd)
if (pc_isGM(sd) < (lv=get_atcommand_level(AtCommand_JumpTo)))
return;
- RFIFOHEAD(fd);
player_name = RFIFOP(fd,2);
player_name[NAME_LENGTH-1] = '\0';
atcommand_jumpto(fd, sd, "@jumpto", player_name); // as @jumpto
@@ -10750,7 +10636,6 @@ void clif_parse_Recall(int fd, struct map_session_data *sd)
if (pc_isGM(sd) < (lv=get_atcommand_level(AtCommand_Recall)))
return;
- RFIFOHEAD(fd);
player_name = RFIFOP(fd,2);
player_name[NAME_LENGTH-1] = '\0';
atcommand_recall(fd, sd, "@recall", player_name); // as @recall
@@ -10770,7 +10655,6 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd)
char *monster_item_name;
char message[NAME_LENGTH+10]; //For logging.
int level;
- RFIFOHEAD(fd);
if (battle_config.atc_gmonly && !pc_isGM(sd))
return;
@@ -10837,7 +10721,6 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd)
struct block_list *bl;
struct map_session_data *dstsd;
- RFIFOHEAD(fd);
bl = map_id2bl(RFIFOL(fd,2));
if (!bl || bl->type != BL_PC)
return;
@@ -10875,14 +10758,12 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd)
void clif_parse_GMReqNoChatCount(int fd, struct map_session_data *sd)
{
int tid;
- RFIFOHEAD(fd);
tid = RFIFOL(fd,2);
WFIFOHEAD(fd,packet_len(0x1e0));
WFIFOW(fd,0) = 0x1e0;
WFIFOL(fd,2) = tid;
sprintf((char*)WFIFOP(fd,6),"%d",tid);
-// memcpy(WFIFOP(fd,6), "TESTNAME", 24);
WFIFOSET(fd, packet_len(0x1e0));
return;
@@ -10907,14 +10788,13 @@ void clif_parse_PMIgnore(int fd, struct map_session_data *sd)
char output[512];
char *nick; // S 00cf <nick>.24B <type>.B: 00 (/ex nick) deny speech from nick, 01 (/in nick) allow speech from nick
int i;
- WFIFOHEAD(fd,packet_len(0xd1));
- RFIFOHEAD(fd);
memset(output, '\0', sizeof(output));
nick = (char*)RFIFOP(fd,2); // speed up
nick[NAME_LENGTH-1] = '\0'; // to be sure that the player name have at maximum 23 characters
+ WFIFOHEAD(fd,packet_len(0xd1));
WFIFOW(fd,0) = 0x0d1; // R 00d1 <type>.B <fail>.B: type: 0: deny, 1: allow, fail: 0: success, 1: fail
WFIFOB(fd,2) = RFIFOB(fd,26);
// deny action (we add nick only if it's not already exist
@@ -10990,10 +10870,9 @@ void clif_parse_PMIgnore(int fd, struct map_session_data *sd)
void clif_parse_PMIgnoreAll(int fd, struct map_session_data *sd)
{
//printf("Ignore all: state: %d\n", RFIFOB(fd,2));
- RFIFOHEAD(fd);
- WFIFOHEAD(fd,packet_len(0xd2));
// R 00d2 <type>.B <fail>.B: type: 0: deny, 1: allow, fail: 0: success, 1: fail
// S 00d0 <type>len.B: 00 (/exall) deny all speech, 01 (/inall) allow all speech
+ WFIFOHEAD(fd,packet_len(0xd2));
WFIFOW(fd,0) = 0x0d2;
WFIFOB(fd,2) = RFIFOB(fd,2);
if (RFIFOB(fd,2) == 0) { //Deny all
@@ -11176,7 +11055,6 @@ void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd)
{
struct map_session_data *f_sd;
int i, f_fd;
- RFIFOHEAD(fd);
f_sd = map_nick2sd((char*)RFIFOP(fd,2));
@@ -11223,7 +11101,6 @@ void clif_parse_FriendsListReply(int fd, struct map_session_data *sd)
struct map_session_data *f_sd;
int char_id, account_id;
char reply;
- RFIFOHEAD(fd);
account_id = RFIFOL(fd,2);
char_id = RFIFOL(fd,6);
@@ -11280,7 +11157,6 @@ void clif_parse_FriendsListRemove(int fd, struct map_session_data *sd)
// 0x203 </o> <ID to be removed W 4B>
int account_id, char_id;
int i, j;
- RFIFOHEAD(fd);
account_id = RFIFOL(fd,2);
char_id = RFIFOL(fd,6);
@@ -11528,7 +11404,6 @@ void clif_parse_AdoptRequest(int fd,struct map_session_data *sd)
//[Skotlex]
int account_id;
struct map_session_data *sd2;
- RFIFOHEAD(fd);
account_id = RFIFOL(fd,2);
sd2 = map_id2sd(account_id);
@@ -11546,7 +11421,6 @@ void clif_parse_AdoptRequest(int fd,struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_ChangeHomunculusName(int fd, struct map_session_data *sd)
{
- RFIFOHEAD(fd);
merc_hom_change_name(sd,RFIFOP(fd,2));
}
@@ -11563,7 +11437,6 @@ void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd)
void clif_parse_HomMoveTo(int fd,struct map_session_data *sd)
{ //[orn]
int x,y,cmd;
- RFIFOHEAD(fd);
nullpo_retv(sd);
if(!merc_is_hom_active(sd->hd))
@@ -11580,8 +11453,6 @@ void clif_parse_HomMoveTo(int fd,struct map_session_data *sd)
void clif_parse_HomAttack(int fd,struct map_session_data *sd)
{ //[orn]
- RFIFOHEAD(fd);
-
if(!merc_is_hom_active(sd->hd))
return;
@@ -11592,7 +11463,6 @@ void clif_parse_HomMenu(int fd, struct map_session_data *sd)
{ //[orn]
int cmd;
- RFIFOHEAD(fd);
cmd = RFIFOW(fd,0);
if(!merc_is_hom_active(sd->hd))
@@ -11607,7 +11477,6 @@ void clif_parse_HomMenu(int fd, struct map_session_data *sd)
void clif_parse_debug(int fd,struct map_session_data *sd)
{
int i, cmd, len;
- RFIFOHEAD(fd);
cmd = RFIFOW(fd,0);
len = sd?packet_db[sd->packet_ver][cmd].len:RFIFOREST(fd); //With no session, just read the remaining in the buffer.
@@ -11629,7 +11498,6 @@ int clif_parse(int fd)
{
int packet_len = 0, cmd, packet_ver, err, dump = 0;
TBL_PC *sd;
- RFIFOHEAD(fd);
sd = (TBL_PC *)session[fd]->session_data;
if (session[fd]->eof) {
diff --git a/src/map/intif.c b/src/map/intif.c
index 8b8bcf08c..92c234c56 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -413,7 +413,6 @@ int intif_party_addmember(int party_id,struct party_member *member)
{
if (CheckForCharServer())
return 0;
-
WFIFOHEAD(inter_fd,42);
WFIFOW(inter_fd,0)=0x3022;
WFIFOW(inter_fd,2)=8+sizeof(struct party_member);
@@ -849,7 +848,7 @@ int intif_parse_WisMessage(int fd)
char *wisp_source;
char name[NAME_LENGTH];
int id, i;
- RFIFOHEAD(fd);
+
id=RFIFOL(fd,4);
memcpy(name, RFIFOP(fd,32), NAME_LENGTH);
@@ -885,7 +884,6 @@ int intif_parse_WisMessage(int fd)
int intif_parse_WisEnd(int fd)
{
struct map_session_data* sd;
- RFIFOHEAD(fd);
if (battle_config.etc_log)
ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
@@ -918,7 +916,6 @@ int mapif_parse_WisToGM(int fd)
char Wisp_name[NAME_LENGTH];
char mbuf[255];
char *message;
- RFIFOHEAD(fd);
mes_len = RFIFOW(fd,2) - 30;
message = (char *) (mes_len >= 255 ? (char *) aMallocA(mes_len) : mbuf);
@@ -943,7 +940,6 @@ int intif_parse_Registers(int fd)
struct map_session_data *sd;
struct global_reg *reg;
int *qty;
- RFIFOHEAD(fd);
if( (sd=map_id2sd(RFIFOL(fd,4)))==NULL)
return 1;
@@ -994,7 +990,6 @@ int intif_parse_LoadStorage(int fd)
{
struct storage *stor;
struct map_session_data *sd;
- RFIFOHEAD(fd);
sd=map_id2sd( RFIFOL(fd,4) );
if(sd==NULL){
@@ -1038,7 +1033,6 @@ int intif_parse_LoadStorage(int fd)
// 倉庫データ送信成功
int intif_parse_SaveStorage(int fd)
{
- RFIFOHEAD(fd);
if(battle_config.save_log)
ShowInfo("intif_savestorage: done %d %d\n",RFIFOL(fd,2),RFIFOB(fd,6) );
storage_storage_saved(RFIFOL(fd,2));
@@ -1050,7 +1044,7 @@ int intif_parse_LoadGuildStorage(int fd)
struct guild_storage *gstor;
struct map_session_data *sd;
int guild_id;
- RFIFOHEAD(fd);
+
guild_id = RFIFOL(fd,8);
if(guild_id <= 0)
return 1;
@@ -1093,7 +1087,6 @@ int intif_parse_LoadGuildStorage(int fd)
}
int intif_parse_SaveGuildStorage(int fd)
{
- RFIFOHEAD(fd);
if(battle_config.save_log) {
ShowInfo("intif_save_guild_storage: done %d %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOB(fd,10) );
}
@@ -1104,7 +1097,6 @@ int intif_parse_SaveGuildStorage(int fd)
// パーティ作成可否
int intif_parse_PartyCreated(int fd)
{
- RFIFOHEAD(fd);
if(battle_config.etc_log)
ShowInfo("intif: party created by account %d\n\n", RFIFOL(fd,2));
party_created(RFIFOL(fd,2), RFIFOL(fd,6),RFIFOB(fd,10),RFIFOL(fd,11), (char *)RFIFOP(fd,15));
@@ -1113,7 +1105,6 @@ int intif_parse_PartyCreated(int fd)
// パーティ情報
int intif_parse_PartyInfo(int fd)
{
- RFIFOHEAD(fd);
if( RFIFOW(fd,2)==8){
if(battle_config.error_log)
ShowWarning("intif: party noinfo %d\n",RFIFOL(fd,4));
@@ -1132,7 +1123,6 @@ int intif_parse_PartyInfo(int fd)
// パーティ追加通知
int intif_parse_PartyMemberAdded(int fd)
{
- RFIFOHEAD(fd);
if(battle_config.etc_log)
ShowInfo("intif: party member added Party (%d), Account(%d), Char(%d)\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
party_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10), RFIFOB(fd, 14));
@@ -1141,14 +1131,12 @@ int intif_parse_PartyMemberAdded(int fd)
// パーティ設定変更通知
int intif_parse_PartyOptionChanged(int fd)
{
- RFIFOHEAD(fd);
party_optionchanged(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12),RFIFOB(fd,14));
return 0;
}
// パーティ脱退通知
int intif_parse_PartyMemberLeaved(int fd)
{
- RFIFOHEAD(fd);
if(battle_config.etc_log)
ShowInfo("intif: party member leaved: Party(%d), Account(%d), Char(%d)\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
party_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
@@ -1157,23 +1145,18 @@ int intif_parse_PartyMemberLeaved(int fd)
// パーティ解散通知
int intif_parse_PartyBroken(int fd)
{
- RFIFOHEAD(fd);
party_broken(RFIFOL(fd,2));
return 0;
}
// パーティ移動通知
int intif_parse_PartyMove(int fd)
{
- RFIFOHEAD(fd);
party_recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17));
return 0;
}
// パーティメッセージ
int intif_parse_PartyMessage(int fd)
{
- RFIFOHEAD(fd);
-// if(battle_config.etc_log)
-// printf("intif_parse_PartyMessage: %s\n",RFIFOP(fd,12));
party_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
return 0;
}
@@ -1181,15 +1164,13 @@ int intif_parse_PartyMessage(int fd)
// ギルド作成可否
int intif_parse_GuildCreated(int fd)
{
- RFIFOHEAD(fd);
guild_created(RFIFOL(fd,2),RFIFOL(fd,6));
return 0;
}
// ギルド情報
int intif_parse_GuildInfo(int fd)
{
- RFIFOHEAD(fd);
- if( RFIFOW(fd,2)==8){
+ if(RFIFOW(fd,2) == 8) {
if(battle_config.error_log)
ShowWarning("intif: guild noinfo %d\n",RFIFOL(fd,4));
guild_recv_noinfo(RFIFOL(fd,4));
@@ -1208,7 +1189,6 @@ int intif_parse_GuildInfo(int fd)
// ギルドメンバ追加通知
int intif_parse_GuildMemberAdded(int fd)
{
- RFIFOHEAD(fd);
if(battle_config.etc_log)
ShowInfo("intif: guild member added %d %d %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
guild_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
@@ -1217,23 +1197,19 @@ int intif_parse_GuildMemberAdded(int fd)
// ギルドメンバ脱退/追放通知
int intif_parse_GuildMemberLeaved(int fd)
{
- RFIFOHEAD(fd);
- guild_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),
- (char *) RFIFOP(fd,55), (char *) RFIFOP(fd,15));
+ guild_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),(char *)RFIFOP(fd,55),(char *)RFIFOP(fd,15));
return 0;
}
// ギルドメンバオンライン状態/Lv変更通知
int intif_parse_GuildMemberInfoShort(int fd)
{
- RFIFOHEAD(fd);
guild_recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17));
return 0;
}
// ギルド解散通知
int intif_parse_GuildBroken(int fd)
{
- RFIFOHEAD(fd);
guild_broken(RFIFOL(fd,2),RFIFOB(fd,6));
return 0;
}
@@ -1246,7 +1222,6 @@ int intif_parse_GuildBasicInfoChanged(int fd)
void *data;
struct guild *g;
short dw;
- RFIFOHEAD(fd);
type=RFIFOW(fd,8);
guild_id=RFIFOL(fd,4);
data=RFIFOP(fd,10);
@@ -1268,7 +1243,6 @@ int intif_parse_GuildMemberInfoChanged(int fd)
int type, guild_id, account_id, char_id, idx, dd;
void* data;
struct guild *g;
- RFIFOHEAD(fd);
type=RFIFOW(fd,16);
guild_id=RFIFOL(fd,4);
account_id=RFIFOL(fd,8);
@@ -1311,7 +1285,6 @@ int intif_parse_GuildMemberInfoChanged(int fd)
// ギルド役職変更通知
int intif_parse_GuildPosition(int fd)
{
- RFIFOHEAD(fd);
if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 ){
if(battle_config.error_log)
ShowError("intif: guild info : data size error\n %d %d %d",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild_position)+12);
@@ -1322,14 +1295,12 @@ int intif_parse_GuildPosition(int fd)
// ギルドスキル割り振り通知
int intif_parse_GuildSkillUp(int fd)
{
- RFIFOHEAD(fd);
guild_skillupack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
return 0;
}
// ギルド同盟/敵対通知
int intif_parse_GuildAlliance(int fd)
{
- RFIFOHEAD(fd);
guild_allianceack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),
RFIFOB(fd,18),(char *) RFIFOP(fd,19),(char *) RFIFOP(fd,43));
return 0;
@@ -1337,56 +1308,47 @@ int intif_parse_GuildAlliance(int fd)
// ギルド告知変更通知
int intif_parse_GuildNotice(int fd)
{
- RFIFOHEAD(fd);
guild_notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66));
return 0;
}
// ギルドエンブレム変更通知
int intif_parse_GuildEmblem(int fd)
{
- RFIFOHEAD(fd);
guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12));
return 0;
}
// ギルド会話受信
int intif_parse_GuildMessage(int fd)
{
- RFIFOHEAD(fd);
guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
return 0;
}
// ギルド城データ要求返信
int intif_parse_GuildCastleDataLoad(int fd)
{
- RFIFOHEAD(fd);
return guild_castledataloadack(RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5));
}
// ギルド城データ変更通知
int intif_parse_GuildCastleDataSave(int fd)
{
- RFIFOHEAD(fd);
return guild_castledatasaveack(RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5));
}
// ギルド城データ一括受信(初期化時)
int intif_parse_GuildCastleAllDataLoad(int fd)
{
- RFIFOHEAD(fd);
return guild_castlealldataload(RFIFOW(fd,2),(struct guild_castle *)RFIFOP(fd,4));
}
int intif_parse_GuildMasterChanged(int fd)
{
- RFIFOHEAD(fd);
return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
}
// pet
int intif_parse_CreatePet(int fd)
{
- RFIFOHEAD(fd);
pet_get_egg(RFIFOL(fd,2),RFIFOL(fd,7),RFIFOB(fd,6));
-
return 0;
}
@@ -1394,7 +1356,6 @@ int intif_parse_RecvPetData(int fd)
{
struct s_pet p;
int len;
- RFIFOHEAD(fd);
len=RFIFOW(fd,2);
if(sizeof(struct s_pet)!=len-9) {
if(battle_config.etc_log)
@@ -1409,7 +1370,6 @@ int intif_parse_RecvPetData(int fd)
}
int intif_parse_SavePetOk(int fd)
{
- RFIFOHEAD(fd);
if(RFIFOB(fd,6) == 1) {
if(battle_config.error_log)
ShowError("pet data save failure\n");
@@ -1420,7 +1380,6 @@ int intif_parse_SavePetOk(int fd)
int intif_parse_DeletePetOk(int fd)
{
- RFIFOHEAD(fd);
if(RFIFOB(fd,2) == 1) {
if(battle_config.error_log)
ShowError("pet data delete failure\n");
@@ -1432,7 +1391,6 @@ int intif_parse_DeletePetOk(int fd)
int intif_parse_ChangeNameOk(int fd)
{
struct map_session_data *sd = NULL;
- RFIFOHEAD(fd);
if((sd=map_id2sd(RFIFOL(fd,2)))==NULL ||
sd->status.char_id != RFIFOL(fd,6))
return 0;
@@ -1456,7 +1414,6 @@ int intif_parse_ChangeNameOk(int fd)
int intif_parse_CreateHomunculus(int fd)
{
int len;
- RFIFOHEAD(fd);
len=RFIFOW(fd,2)-9;
if(sizeof(struct s_homunculus)!=len) {
if(battle_config.etc_log)
@@ -1471,7 +1428,6 @@ int intif_parse_RecvHomunculusData(int fd)
{
int len;
- RFIFOHEAD(fd);
len=RFIFOW(fd,2)-9;
if(sizeof(struct s_homunculus)!=len) {
@@ -1485,7 +1441,6 @@ int intif_parse_RecvHomunculusData(int fd)
int intif_parse_SaveHomunculusOk(int fd)
{
- RFIFOHEAD(fd);
if(RFIFOB(fd,6) != 1) {
if(battle_config.error_log)
ShowError("homunculus data save failure for account %d\n", RFIFOL(fd,2));
@@ -1495,7 +1450,6 @@ int intif_parse_SaveHomunculusOk(int fd)
int intif_parse_DeleteHomunculusOk(int fd)
{
- RFIFOHEAD(fd);
if(RFIFOB(fd,2) != 1) {
if(battle_config.error_log)
ShowError("Homunculus data delete failure\n");
@@ -1510,7 +1464,6 @@ int intif_parse_DeleteHomunculusOk(int fd)
int intif_parse(int fd)
{
int packet_len, cmd;
- RFIFOHEAD(fd);
cmd = RFIFOW(fd,0);
// パケットのID確認
if(cmd<0x3800 || cmd>=0x3800+(sizeof(packet_len_table)/sizeof(packet_len_table[0])) ||
diff --git a/src/map/irc.c b/src/map/irc.c
index 7e72b3ea4..e74b89efa 100644
--- a/src/map/irc.c
+++ b/src/map/irc.c
@@ -147,7 +147,6 @@ int irc_parse(int fd)
}
if(RFIFOREST(fd) > 0){
char *incoming_string=aMalloc(RFIFOREST(fd)*sizeof(char));
- RFIFOHEAD(fd);
memcpy(incoming_string,RFIFOP(fd,0),RFIFOREST(fd));
send_to_parser(fd,incoming_string,"\n");
RFIFOSKIP(fd,RFIFOREST(fd));
diff --git a/src/map/log.c b/src/map/log.c
index f6167247e..5ee1a2d83 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -14,12 +14,6 @@
#include "log.h"
#include "battle.h"
-#ifndef SQL_DEBUG
- #define mysql_query(_x, _y) mysql_real_query(_x, _y, strlen(_y)) //supports ' in names and runs faster [Kevin]
-#else
- #define mysql_query(_x, _y) debug_mysql_query(__FILE__, __LINE__, _x, _y)
-#endif
-
struct Log_Config log_config;
char timestring[255];
diff --git a/src/map/mail.c b/src/map/mail.c
index 71c9b8c89..65d6ed3f3 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -24,18 +24,6 @@
#include "pc.h"
#include "mail.h"
-#ifndef TXT_ONLY
- #ifndef SQL_DEBUG
-
- #define mysql_query(_x, _y) mysql_real_query(_x, _y, strlen(_y))
-
- #else
-
- #define mysql_query(_x, _y) debug_mysql_query(__FILE__, __LINE__, _x, _y)
-
- #endif
-#endif
-
int MAIL_CHECK_TIME = 120000;
int mail_timer;
//extern char *msg_table[1000]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
diff --git a/src/map/map.c b/src/map/map.c
index f59f9d148..5af776569 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -179,11 +179,9 @@ int enable_grf = 0; //To enable/disable reading maps from GRF files, bypassing m
*------------------------------------------*/
void map_setusers(int fd)
{
- RFIFOHEAD(fd);
- WFIFOHEAD(fd, 2);
-
map_users = RFIFOL(fd,2);
// send some answer
+ WFIFOHEAD(fd, 2);
WFIFOW(fd,0) = 0x2718;
WFIFOSET(fd,2);
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 2990e655e..caa4b535c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7012,7 +7012,6 @@ int pc_autosave(int tid,unsigned int tick,int id,int data)
int pc_read_gm_account(int fd)
{
int i = 0;
- RFIFOHEAD(fd);
if (gm_account != NULL)
aFree(gm_account);
GM_num = 0;