diff options
author | panikon <panikon@zoho.com> | 2014-01-15 20:49:18 -0200 |
---|---|---|
committer | panikon <panikon@zoho.com> | 2014-01-15 20:49:18 -0200 |
commit | 761d3eb8291c997a627dc42da39913eb52abfce3 (patch) | |
tree | 1455c1339d9b46a8614aeae6b4d4378615c064ba | |
parent | 6860ff92acdb9a018e9085676299ef631ecea57c (diff) | |
download | hercules-761d3eb8291c997a627dc42da39913eb52abfce3.tar.gz hercules-761d3eb8291c997a627dc42da39913eb52abfce3.tar.bz2 hercules-761d3eb8291c997a627dc42da39913eb52abfce3.tar.xz hercules-761d3eb8291c997a627dc42da39913eb52abfce3.zip |
Reverted some minor mistakes in chrif_parse, char_ask_name_answer and changemapserverack.
-rw-r--r-- | src/map/chrif.c | 22 | ||||
-rw-r--r-- | src/map/chrif.h | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index 964354e24..3723cb4ac 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1360,18 +1360,18 @@ int chrif_parse(int fd) { if ( fd != chrif->fd ) { ShowDebug("chrif_parse: Disconnecting invalid session #%d (is not the char-server)\n", fd); do_close(fd); - return false; + return 0; } if ( session[fd]->flag.eof ) { do_close(fd); chrif->fd = -1; chrif->on_disconnect(); - return false; + return 0; } else if ( session[fd]->flag.ping ) {/* we've reached stall time */ if( DIFF_TICK(last_tick, session[fd]->rdata_tick) > (stall_time * 2) ) {/* we can't wait any longer */ set_eof(fd); - return false; + return 0; } else if( session[fd]->flag.ping != 2 ) { /* we haven't sent ping out yet */ chrif->keepalive(fd); session[fd]->flag.ping = 2; @@ -1383,7 +1383,7 @@ int chrif_parse(int fd) { if( HPM->packetsc[hpChrif_Parse] ) { if( (r = HPM->parse_packets(fd,hpChrif_Parse)) ) { if( r == 1 ) continue; - if( r == 2 ) return false; + if( r == 2 ) return 0; } } @@ -1392,22 +1392,22 @@ int chrif_parse(int fd) { if (cmd < 0x2af8 || cmd >= 0x2af8 + ARRAYLENGTH(chrif->packet_len_table) || chrif->packet_len_table[cmd-0x2af8] == 0) { r = intif->parse(fd); // Passed on to the intif - if (r == 1) continue; // Treated in intif - if (r == 2) return false; // Didn't have enough data (len==-1) + if (r == 1) continue; // Treated in intif + if (r == 2) return 0; // Didn't have enough data (len==-1) ShowWarning("chrif_parse: session #%d, intif->parse failed (unrecognized command 0x%.4x).\n", fd, cmd); set_eof(fd); - return false; + return 0; } if ( ( packet_len = chrif->packet_len_table[cmd-0x2af8] ) == -1) { // dynamic-length packet, second WORD holds the length if (RFIFOREST(fd) < 4) - return false; + return 0; packet_len = RFIFOW(fd,2); } if ((int)RFIFOREST(fd) < packet_len) - return false; + return 0; //ShowDebug("Received packet 0x%4x (%d bytes) from char-server (connection %d)\n", RFIFOW(fd,0), packet_len, fd); @@ -1438,13 +1438,13 @@ int chrif_parse(int fd) { default: ShowError("chrif_parse : unknown packet (session #%d): 0x%x. Disconnecting.\n", fd, cmd); set_eof(fd); - return false; + return 0; } if ( fd == chrif->fd ) //There's the slight chance we lost the connection during parse, in which case this would segfault if not checked [Skotlex] RFIFOSKIP(fd, packet_len); } - return true; + return 0; } int send_usercount_tochar(int tid, int64 tick, int id, intptr_t data) { diff --git a/src/map/chrif.h b/src/map/chrif.h index a7460875f..da3f2fb3c 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -113,7 +113,7 @@ struct chrif_interface { void (*save_ack) (int fd); int (*reconnect) (DBKey key, DBData *data, va_list ap); int (*auth_db_cleanup_sub) (DBKey key, DBData *data, va_list ap); - void (*char_ask_name_answer) (int acc, const char* player_name, uint16 type, uint16 answer); + bool (*char_ask_name_answer) (int acc, const char* player_name, uint16 type, uint16 answer); int (*auth_db_final) (DBKey key, DBData *data, va_list ap); int (*send_usercount_tochar) (int tid, int64 tick, int id, intptr_t data); int (*auth_db_cleanup) (int tid, int64 tick, int id, intptr_t data); @@ -123,7 +123,7 @@ struct chrif_interface { void (*sendmap) (int fd); void (*sendmapack) (int fd); void (*recvmap) (int fd); - void (*changemapserverack) (int account_id, int login_id1, int login_id2, int char_id, short map_index, short x, short y, uint32 ip, uint16 port); + bool (*changemapserverack) (int account_id, int login_id1, int login_id2, int char_id, short map_index, short x, short y, uint32 ip, uint16 port); void (*changedsex) (int fd); bool (*divorceack) (int char_id, int partner_id); void (*idbanned) (int fd); |