From 5cd75ecd95c257e61c15fef5692918c5642e2aea Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 16 Sep 2012 21:14:33 +0000 Subject: Introducing rAthena's anonymous data collector. This aims at improving rAthena's overall features by letting we know which options are most and least used. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16785 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char/char.c | 31 ++++++++++++++++++++++++++++++- src/char/inter.c | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'src/char') diff --git a/src/char/char.c b/src/char/char.c index 0471c91d6..61e0adaf5 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3285,6 +3285,35 @@ int parse_frommap(int fd) RFIFOSKIP(fd,6); break; + case 0x3008: + 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) ) == -1 ) { + RFIFOSKIP(fd, RFIFOW(fd,2) );/* skip this packet */ + break;/* 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((char*)WFIFOP(sfd,0), (char*)RFIFOP(fd, 0), RFIFOW(fd,2)); + + WFIFOSET(sfd, RFIFOW(fd,2) ); + + flush_fifo(sfd); + + do_close(sfd); + + RFIFOSKIP(fd, RFIFOW(fd,2) );/* skip this packet */ + } + break; + + default: { // inter server - packet @@ -4244,7 +4273,7 @@ int check_connect_login_server(int tid, unsigned int tick, int id, intptr_t data return 0; ShowInfo("Attempt to connect to login-server...\n"); - login_fd = make_connection(login_ip, login_port); + login_fd = make_connection(login_ip, login_port, false); if (login_fd == -1) { //Try again later. [Skotlex] login_fd = 0; diff --git a/src/char/inter.c b/src/char/inter.c index e3fca5e5a..7961b479d 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -1220,6 +1220,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 */ default: if( inter_party_parse_frommap(fd) || inter_guild_parse_frommap(fd) -- cgit v1.2.3-70-g09d2