diff options
Diffstat (limited to 'src/map/intif.c')
-rw-r--r-- | src/map/intif.c | 109 |
1 files changed, 36 insertions, 73 deletions
diff --git a/src/map/intif.c b/src/map/intif.c index 3cced222f..1cecf5ab0 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -282,8 +282,7 @@ int intif_saveregistry(struct map_session_data *sd, int type) sd->state.reg_dirty &= ~0x1; break; default: //Broken code? - if (battle_config.error_log) - ShowError("intif_saveregistry: Invalid type %d\n", type); + ShowError("intif_saveregistry: Invalid type %d\n", type); return -1; } WFIFOHEAD(inter_fd, 288 * MAX_REG_NUM+13); @@ -962,8 +961,7 @@ int intif_parse_Registers(int fd) max = ACCOUNT_REG2_NUM; break; default: - if (battle_config.error_log) - ShowError("intif_parse_Registers: Unrecognized type %d\n",RFIFOB(fd,12)); + ShowError("intif_parse_Registers: Unrecognized type %d\n",RFIFOB(fd,12)); return 0; } for(j=0,p=13;j<max && p<RFIFOW(fd,2);j++){ @@ -989,8 +987,7 @@ int intif_parse_LoadStorage(int fd) sd=map_id2sd( RFIFOL(fd,4) ); if(sd==NULL){ - if(battle_config.error_log) - ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4)); + ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4)); return 1; } @@ -1000,18 +997,15 @@ int intif_parse_LoadStorage(int fd) stor = account2storage( RFIFOL(fd,4)); if (stor->storage_status == 1) { // Already open.. lets ignore this update - if (battle_config.error_log) - ShowWarning("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id); + ShowWarning("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id); return 1; } if (stor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex] - if (battle_config.error_log) - ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id); + ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id); return 1; } if (RFIFOW(fd,2)-8 != sizeof(struct storage)) { - if (battle_config.error_log) - ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage)); + ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage)); return 1; } if(battle_config.save_log) @@ -1046,30 +1040,24 @@ int intif_parse_LoadGuildStorage(int fd) return 1; sd=map_id2sd( RFIFOL(fd,4) ); if(sd==NULL){ - if(battle_config.error_log) - ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4)); + ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4)); return 1; } gstor=guild2storage(guild_id); if(!gstor) { - if(battle_config.error_log) - ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id); - return 1; + ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id); } if (gstor->storage_status == 1) { // Already open.. lets ignore this update - if (battle_config.error_log) - ShowWarning("intif_parse_LoadGuildStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id); + ShowWarning("intif_parse_LoadGuildStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id); return 1; } if (gstor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex] - if (battle_config.error_log) - ShowWarning("intif_parse_LoadGuildStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id); + ShowWarning("intif_parse_LoadGuildStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id); return 1; } if( RFIFOW(fd,2)-12 != sizeof(struct guild_storage) ){ + ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage)); gstor->storage_status = 0; - if(battle_config.error_log) - ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage)); return 1; } if(battle_config.save_log) @@ -1102,17 +1090,14 @@ int intif_parse_PartyCreated(int fd) int intif_parse_PartyInfo(int fd) { if( RFIFOW(fd,2)==8){ - if(battle_config.error_log) - ShowWarning("intif: party noinfo %d\n",RFIFOL(fd,4)); + ShowWarning("intif: party noinfo %d\n",RFIFOL(fd,4)); party_recv_noinfo(RFIFOL(fd,4)); return 0; } // printf("intif: party info %d\n",RFIFOL(fd,4)); - if( RFIFOW(fd,2)!=sizeof(struct party)+4 ){ - if(battle_config.error_log) - ShowError("intif: party info : data size error %d %d %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct party)+4); - } + if( RFIFOW(fd,2)!=sizeof(struct party)+4 ) + ShowError("intif: party info : data size error %d %d %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct party)+4); party_recv_info((struct party *)RFIFOP(fd,4)); return 0; } @@ -1167,18 +1152,13 @@ int intif_parse_GuildCreated(int fd) int intif_parse_GuildInfo(int fd) { if(RFIFOW(fd,2) == 8) { - if(battle_config.error_log) - ShowWarning("intif: guild noinfo %d\n",RFIFOL(fd,4)); + ShowWarning("intif: guild noinfo %d\n",RFIFOL(fd,4)); guild_recv_noinfo(RFIFOL(fd,4)); return 0; } -// if(battle_config.etc_log) -// printf("intif: guild info %d\n",RFIFOL(fd,4)); - if( RFIFOW(fd,2)!=sizeof(struct guild)+4 ){ - if(battle_config.error_log) - ShowError("intif: guild info : data size error Gid: %d recv size: %d Expected size: %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4); - } + if( RFIFOW(fd,2)!=sizeof(struct guild)+4 ) + ShowError("intif: guild info : data size error Gid: %d recv size: %d Expected size: %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4); guild_recv_info((struct guild *)RFIFOP(fd,4)); return 0; } @@ -1270,10 +1250,8 @@ int intif_parse_GuildMemberInfoChanged(int fd) // ギルド役職変更通知 int intif_parse_GuildPosition(int 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); - } + if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 ) + ShowError("intif: guild info : data size error\n %d %d %d",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild_position)+12); guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12)); return 0; } @@ -1354,20 +1332,16 @@ int intif_parse_RecvPetData(int fd) } int intif_parse_SavePetOk(int fd) { - if(RFIFOB(fd,6) == 1) { - if(battle_config.error_log) - ShowError("pet data save failure\n"); - } + if(RFIFOB(fd,6) == 1) + ShowError("pet data save failure\n"); return 0; } int intif_parse_DeletePetOk(int fd) { - if(RFIFOB(fd,2) == 1) { - if(battle_config.error_log) - ShowError("pet data delete failure\n"); - } + if(RFIFOB(fd,2) == 1) + ShowError("pet data delete failure\n"); return 0; } @@ -1425,19 +1399,16 @@ int intif_parse_RecvHomunculusData(int fd) int intif_parse_SaveHomunculusOk(int fd) { - if(RFIFOB(fd,6) != 1) { - if(battle_config.error_log) - ShowError("homunculus data save failure for account %d\n", RFIFOL(fd,2)); - } + if(RFIFOB(fd,6) != 1) + ShowError("homunculus data save failure for account %d\n", RFIFOL(fd,2)); + return 0; } int intif_parse_DeleteHomunculusOk(int fd) { - if(RFIFOB(fd,2) != 1) { - if(battle_config.error_log) - ShowError("Homunculus data delete failure\n"); - } + if(RFIFOB(fd,2) != 1) + ShowError("Homunculus data delete failure\n"); return 0; } @@ -1475,8 +1446,7 @@ int intif_parse_Mail_inboxreceived(int fd) if (sd == NULL) { - if (battle_config.error_log) - ShowError("intif_parse_Mail_inboxreceived: char not found %d\n",RFIFOL(fd,4)); + ShowError("intif_parse_Mail_inboxreceived: char not found %d\n",RFIFOL(fd,4)); return 1; } @@ -1485,8 +1455,7 @@ int intif_parse_Mail_inboxreceived(int fd) if (RFIFOW(fd,2) - 9 != sizeof(struct mail_data)) { - if (battle_config.error_log) - ShowError("intif_parse_Mail_inboxreceived: data size error %d %d\n", RFIFOW(fd,2) - 9, sizeof(struct mail_data)); + ShowError("intif_parse_Mail_inboxreceived: data size error %d %d\n", RFIFOW(fd,2) - 9, sizeof(struct mail_data)); return 1; } @@ -1545,8 +1514,7 @@ int intif_parse_Mail_getattach(int fd) if (sd == NULL) { - if (battle_config.error_log) - ShowError("intif_parse_Mail_getattach: char not found %d\n",RFIFOL(fd,4)); + ShowError("intif_parse_Mail_getattach: char not found %d\n",RFIFOL(fd,4)); return 1; } @@ -1555,8 +1523,7 @@ int intif_parse_Mail_getattach(int fd) if (RFIFOW(fd,2) - 12 != sizeof(struct item)) { - if (battle_config.error_log) - ShowError("intif_parse_Mail_getattach: data size error %d %d\n", RFIFOW(fd,2) - 16, sizeof(struct item)); + ShowError("intif_parse_Mail_getattach: data size error %d %d\n", RFIFOW(fd,2) - 16, sizeof(struct item)); return 1; } @@ -1591,8 +1558,7 @@ int intif_parse_Mail_delete(int fd) struct map_session_data *sd = map_charid2sd(char_id); if (sd == NULL) { - if (battle_config.error_log) - ShowError("intif_parse_Mail_delete: char not found %d\n", char_id); + ShowError("intif_parse_Mail_delete: char not found %d\n", char_id); return 1; } @@ -1641,8 +1607,7 @@ int intif_parse_Mail_return(int fd) if( sd == NULL ) { - if (battle_config.error_log) - ShowError("intif_parse_Mail_return: char not found %d\n",RFIFOL(fd,2)); + ShowError("intif_parse_Mail_return: char not found %d\n",RFIFOL(fd,2)); return 1; } @@ -1691,8 +1656,7 @@ static void intif_parse_Mail_send(int fd) if( RFIFOW(fd,2) - 4 != sizeof(struct mail_message) ) { - if (battle_config.error_log) - ShowError("intif_parse_Mail_send: data size error %d %d\n", RFIFOW(fd,2) - 4, sizeof(struct mail_message)); + ShowError("intif_parse_Mail_send: data size error %d %d\n", RFIFOW(fd,2) - 4, sizeof(struct mail_message)); return; } @@ -1829,8 +1793,7 @@ int intif_parse(int fd) case 0x3892: intif_parse_SaveHomunculusOk(fd); break; case 0x3893: intif_parse_DeleteHomunculusOk(fd); break; default: - if(battle_config.error_log) - ShowError("intif_parse : unknown packet %d %x\n",fd,RFIFOW(fd,0)); + ShowError("intif_parse : unknown packet %d %x\n",fd,RFIFOW(fd,0)); return 0; } // パケット読み飛ばし |