diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-05 18:49:57 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-05 18:49:57 +0000 |
commit | 88a5d0cdda513357496b9d53878618e1620f47e8 (patch) | |
tree | 4f3c2bedbac4b715ff783de5e1c8d1aefe4395af /src/map/pc.c | |
parent | a7fd6bfe9bcce1862b554f5841d9ff1aedf473e3 (diff) | |
download | hercules-88a5d0cdda513357496b9d53878618e1620f47e8.tar.gz hercules-88a5d0cdda513357496b9d53878618e1620f47e8.tar.bz2 hercules-88a5d0cdda513357496b9d53878618e1620f47e8.tar.xz hercules-88a5d0cdda513357496b9d53878618e1620f47e8.zip |
* Made a crazy attempt to at least partially synchronize login&char code
* Major edit to the way the servers handle ip addresses, making them obey the "host byte order inside, network byte order outside" rule
- hopefully covered all entry- and exit-points for IP address data
- discovered several places where Gravity's client breaks the convention, will need to come up with a suitable countermeasure for that
- other than that, the code should be portable, except for printing and ipban mask testing (those still assume a specific byte order)
- tested both txt and sql in all usual situations; tested single- and multi-server setups, all seems to work (but watch out for hidden bugs!)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10162 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 7ba8a8b87..24088ff61 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -698,20 +698,20 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t sd->state.event_kill_mob = 1; { //Add IP field - unsigned char *ip = (unsigned char *) &session[sd->fd]->client_addr.sin_addr; + uint32 ip = session[sd->fd]->client_addr; if (pc_isGM(sd)) ShowInfo("GM '"CL_WHITE"%s"CL_RESET"' logged in." " (AID/CID: '"CL_WHITE"%d/%d"CL_RESET"'," " Packet Ver: '"CL_WHITE"%d"CL_RESET"', IP: '"CL_WHITE"%d.%d.%d.%d"CL_RESET"'," " GM Level '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id, sd->status.char_id, - sd->packet_ver, ip[0],ip[1],ip[2],ip[3], pc_isGM(sd)); + sd->packet_ver, CONVIP(ip), pc_isGM(sd)); else ShowInfo("'"CL_WHITE"%s"CL_RESET"' logged in." " (AID/CID: '"CL_WHITE"%d/%d"CL_RESET"'," " Packet Ver: '"CL_WHITE"%d"CL_RESET"', IP: '"CL_WHITE"%d.%d.%d.%d"CL_RESET"').\n", sd->status.name, sd->status.account_id, sd->status.char_id, - sd->packet_ver, ip[0],ip[1],ip[2],ip[3]); + sd->packet_ver, CONVIP(ip)); } // Send friends list @@ -3371,10 +3371,11 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in sd->regen.state.gc = 0; } - if(m<0){ - if(sd->mapindex){ - int ip,port; - if(map_mapname2ipport(mapindex,&ip,&port)==0){ + if(m<0) { + if(sd->mapindex) { + uint32 ip; + uint16 port; + if(map_mapname2ipport(mapindex,&ip,&port)==0) { unit_remove_map(&sd->bl,clrtype); sd->mapindex = mapindex; sd->bl.x=x; |