summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-16 21:14:33 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-16 21:14:33 +0000
commit5cd75ecd95c257e61c15fef5692918c5642e2aea (patch)
tree76433fa0e32f228d737b651a81ded6da34fbf1aa /src/char/char.c
parent77912311a7ad7151e4a2476cac73f3ec181d27bd (diff)
downloadhercules-5cd75ecd95c257e61c15fef5692918c5642e2aea.tar.gz
hercules-5cd75ecd95c257e61c15fef5692918c5642e2aea.tar.bz2
hercules-5cd75ecd95c257e61c15fef5692918c5642e2aea.tar.xz
hercules-5cd75ecd95c257e61c15fef5692918c5642e2aea.zip
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
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c31
1 files changed, 30 insertions, 1 deletions
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;