From 00fd5e70786da5ebc48d5bf96e7cc0dca88e6999 Mon Sep 17 00:00:00 2001 From: aleos89 Date: Tue, 15 Nov 2016 10:19:58 -0500 Subject: [PATCH] Removed rAthena Stat Reporter * Follow up to 0ffeec0. * No longer being used so it will now be completely removed. --- doc/packet_interserv.txt | 12 ---- src/char/char_mapif.c | 29 --------- src/char/char_mapif.h | 1 - src/char/inter.c | 2 +- src/config/core.h | 4 -- src/map/battle.c | 133 --------------------------------------- src/map/chrif.c | 13 ---- src/map/chrif.h | 1 - 8 files changed, 1 insertion(+), 194 deletions(-) diff --git a/doc/packet_interserv.txt b/doc/packet_interserv.txt index 286a6d769c..76211c47a9 100644 --- a/doc/packet_interserv.txt +++ b/doc/packet_interserv.txt @@ -501,7 +501,6 @@ Currently the max packet size is 0xFFFF (see 'WFIFOSET()' in 'src/common/socket. - mes: message to send desc: - Broadcasts a message to all map-servs connected to this char-serv - - NB carefull (also using cmd=3000 rAthena_report but encapsulate it into cmd 3008 for map-char) 0x3001 @@ -2940,14 +2939,3 @@ Currently the max packet size is 0xFFFF (see 'WFIFOSET()' in 'src/common/socket. - count desc: - Stores bonus_script data(s) to the table - -0x3008 - Type: ZA - Structure: .W .?B - index: 0,2 - len: variable: 2+len - parameter: - - cmd : packet identification (0x3008) - - buf - desc: - - chrif_send_report diff --git a/src/char/char_mapif.c b/src/char/char_mapif.c index 125c1dba16..2b469ce616 100644 --- a/src/char/char_mapif.c +++ b/src/char/char_mapif.c @@ -1114,34 +1114,6 @@ int chmapif_parse_updmapip(int fd, int id){ return 1; } -/** - * transmit emu usage for anom stats - * @param fd: wich fd to parse from - * @return : 0 not enough data received, 1 success - */ -int chmapif_parse_fw_configstats(int fd){ - if( RFIFOREST(fd) < RFIFOW(fd,4) ) - return 0;/* packet wasn't fully received yet (still fragmented) */ - else { - int sfd;/* stat server fd */ - RFIFOSKIP(fd, 2);/* we skip first 2 bytes which are the 0x3008, so we end up with a buffer equal to the one we send */ - - if( (sfd = make_connection(host2ip("stats.rathena.org"),(uint16)25421,true,10) ) == -1 ) { - RFIFOSKIP(fd, RFIFOW(fd,2) );/* skip this packet */ - return 0;/* connection not possible, we drop the report */ - } - - session[sfd]->flag.server = 1;/* to ensure we won't drop our own packet */ - WFIFOHEAD(sfd, RFIFOW(fd,2) ); - memcpy(WFIFOCP(sfd,0), RFIFOCP(fd, 0), RFIFOW(fd,2)); - WFIFOSET(sfd, RFIFOW(fd,2) ); - flush_fifo(sfd); - do_close(sfd); - RFIFOSKIP(fd, RFIFOW(fd,2) );/* skip this packet */ - } - return 1; -} - /** * Received an update of fame point for char_id cid * Update the list associated and transmit the new ranking @@ -1485,7 +1457,6 @@ int chmapif_parse(int fd){ //case 0x2b2c: /*free*/; break; case 0x2b2d: next=chmapif_bonus_script_get(fd); break; //Load data case 0x2b2e: next=chmapif_bonus_script_save(fd); break;//Save data - case 0x3008: next=chmapif_parse_fw_configstats(fd); break; default: { // inter server - packet diff --git a/src/char/char_mapif.h b/src/char/char_mapif.h index 141f4ac5c2..7128ef7eeb 100644 --- a/src/char/char_mapif.h +++ b/src/char/char_mapif.h @@ -45,7 +45,6 @@ int chmapif_parse_save_scdata(int fd); int chmapif_parse_keepalive(int fd); int chmapif_parse_reqauth(int fd, int id); int chmapif_parse_updmapip(int fd, int id); -int chmapif_parse_fw_configstats(int fd); int chmapif_vipack(int mapfd, uint32 aid, uint32 vip_time, uint32 groupid, uint8 flag); int chmapif_parse_reqcharban(int fd); diff --git a/src/char/inter.c b/src/char/inter.c index c0aeb2d7dc..0adc9c5064 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -1364,7 +1364,7 @@ int inter_parse_frommap(int fd) case 0x3005: mapif_parse_RegistryRequest(fd); break; case 0x3006: mapif_parse_NameChangeRequest(fd); break; case 0x3007: mapif_parse_accinfo(fd); break; - /* 0x3008 is used by the report stuff */ + /* 0x3008 unused */ case 0x3009: mapif_parse_broadcast_item(fd); break; default: if( inter_party_parse_frommap(fd) diff --git a/src/config/core.h b/src/config/core.h index e22bea1f22..24d3d4ee87 100644 --- a/src/config/core.h +++ b/src/config/core.h @@ -27,10 +27,6 @@ /// your map-server using more resources while this is active, comment the line #define SCRIPT_CALLFUNC_CHECK -/// Comment to enable rAthena's anonymous stat report -/// We kindly ask you to consider keeping it enabled, it helps us improve rAthena. -#define STATS_OPT_OUT - /// uncomment to enable query_sql script command and mysql logs to function on it's own thread /// be aware this feature is under tests and you should use at your own risk, we however /// welcome any feedback you may have regarding this feature, please send us all bug reports. diff --git a/src/map/battle.c b/src/map/battle.c index af8f88ba9e..e9b8b47b78 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -8353,133 +8353,6 @@ static const struct _battle_data { #include "../custom/battle_config_init.inc" }; -#ifndef STATS_OPT_OUT -// rAthena anonymous statistic usage report -- packet is built here, and sent to char server to report. -void rAthena_report(char* date, char *time_c) { - int i, rev = 0, bd_size = ARRAYLENGTH(battle_data); - unsigned int config = 0; - const char* rev_str; - char timestring[25]; - time_t curtime; - char* buf; - - enum config_table { - C_CIRCULAR_AREA = 0x0001, - C_CELLNOSTACK = 0x0002, - C_BETA_THREAD_TEST = 0x0004, - C_SCRIPT_CALLFUNC_CHECK = 0x0008, - C_OFFICIAL_WALKPATH = 0x0010, - C_RENEWAL = 0x0020, - C_RENEWAL_CAST = 0x0040, - C_RENEWAL_DROP = 0x0080, - C_RENEWAL_EXP = 0x0100, - C_RENEWAL_LVDMG = 0x0200, - C_RENEWAL_ASPD = 0x0400, - C_SECURE_NPCTIMEOUT = 0x0800, - C_SQL_DBS = 0x1000, - C_SQL_LOGS = 0x2000, - }; - - if( (rev_str = get_svn_revision()) != 0 ) - rev = atoi(rev_str); - - /* we get the current time */ - time(&curtime); - strftime(timestring, 24, "%Y-%m-%d %H:%M:%S", localtime(&curtime)); - -// Various compile-time options -#ifdef CIRCULAR_AREA - config |= C_CIRCULAR_AREA; -#endif - -#ifdef CELL_NOSTACK - config |= C_CELLNOSTACK; -#endif - -#ifdef BETA_THREAD_TEST - config |= C_BETA_THREAD_TEST; -#endif - -#ifdef SCRIPT_CALLFUNC_CHECK - config |= C_SCRIPT_CALLFUNC_CHECK; -#endif - -#ifdef OFFICIAL_WALKPATH - config |= C_OFFICIAL_WALKPATH; -#endif - -#ifdef RENEWAL - config |= C_RENEWAL; -#endif - -#ifdef RENEWAL_CAST - config |= C_RENEWAL_CAST; -#endif - -#ifdef RENEWAL_DROP - config |= C_RENEWAL_DROP; -#endif - -#ifdef RENEWAL_EXP - config |= C_RENEWAL_EXP; -#endif - -#ifdef RENEWAL_LVDMG - config |= C_RENEWAL_LVDMG; -#endif - -#ifdef RENEWAL_ASPD - config |= C_RENEWAL_ASPD; -#endif - -#ifdef SECURE_NPCTIMEOUT - config |= C_SECURE_NPCTIMEOUT; -#endif - /* non-define part */ - if( db_use_sqldbs ) - config |= C_SQL_DBS; - - if( log_config.sql_logs ) - config |= C_SQL_LOGS; - -#define BFLAG_LENGTH 35 - - CREATE(buf, char, 6 + 12 + 9 + 24 + 4 + 4 + 4 + 4 + ( bd_size * ( BFLAG_LENGTH + 4 ) ) + 1 ); - - /* build packet */ - WBUFW(buf,0) = 0x3000; - WBUFW(buf,2) = 6 + 12 + 9 + 24 + 4 + 4 + 4 + 4 + ( bd_size * ( BFLAG_LENGTH + 4 ) ); - WBUFW(buf,4) = 0x9c; - - safestrncpy(WBUFCP(buf,6), date, 12); - safestrncpy(WBUFCP(buf,6 + 12), time_c, 9); - safestrncpy(WBUFCP(buf,6 + 12 + 9), timestring, 24); - - WBUFL(buf,6 + 12 + 9 + 24) = rev; - WBUFL(buf,6 + 12 + 9 + 24 + 4) = map_getusers(); - - WBUFL(buf,6 + 12 + 9 + 24 + 4 + 4) = config; - WBUFL(buf,6 + 12 + 9 + 24 + 4 + 4 + 4) = bd_size; - - for( i = 0; i < bd_size; i++ ) { - safestrncpy(WBUFCP(buf,6 + 12 + 9+ 24 + 4 + 4 + 4 + 4 + ( i * ( BFLAG_LENGTH + 4 ) ) ), battle_data[i].str, 35); - WBUFL(buf,6 + 12 + 9 + 24 + 4 + 4 + 4 + 4 + BFLAG_LENGTH + ( i * ( BFLAG_LENGTH + 4 ) ) ) = *battle_data[i].val; - } - - chrif_send_report(buf, 6 + 12 + 9 + 24 + 4 + 4 + 4 + 4 + ( bd_size * ( BFLAG_LENGTH + 4 ) ) ); - - aFree(buf); - -#undef BFLAG_LENGTH -} -static int rAthena_report_timer(int tid, unsigned int tick, int id, intptr_t data) { - if( chrif_isconnected() ) { /* char server relays it, so it must be online. */ - rAthena_report(__DATE__,__TIME__); - } - return 0; -} -#endif - /*========================== * Set battle settings *--------------------------*/ @@ -8654,12 +8527,6 @@ void do_init_battle(void) { delay_damage_ers = ers_new(sizeof(struct delay_damage),"battle.c::delay_damage_ers",ERS_OPT_CLEAR); add_timer_func_list(battle_delay_damage_sub, "battle_delay_damage_sub"); - -#ifndef STATS_OPT_OUT - add_timer_func_list(rAthena_report_timer, "rAthena_report_timer"); - add_timer_interval(gettick() + 30000, rAthena_report_timer, 0, 0, 60000 * 30); -#endif - } /*================== diff --git a/src/map/chrif.c b/src/map/chrif.c index 6065337a8d..0b106233b4 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1938,19 +1938,6 @@ int chrif_removefriend(uint32 char_id, int friend_id) { return 0; } -int chrif_send_report(char* buf, int len) { - -#ifndef STATS_OPT_OUT - chrif_check(-1); - WFIFOHEAD(char_fd,len + 2); - WFIFOW(char_fd,0) = 0x3008; - memcpy(WFIFOP(char_fd,2), buf, len); - WFIFOSET(char_fd,len + 2); - flush_fifo(char_fd); /* ensure it's sent now. */ -#endif - return 0; -} - /** * @see DBApply */ diff --git a/src/map/chrif.h b/src/map/chrif.h index e2c1d93a2f..012847d919 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -64,7 +64,6 @@ int chrif_chardisconnect(struct map_session_data *sd); int chrif_divorce(int partner_id1, int partner_id2); int chrif_removefriend(uint32 char_id, int friend_id); -int chrif_send_report(char* buf, int len); void chrif_parse_ack_vipActive(int fd);