diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-08 17:41:49 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-08 17:41:49 +0000 |
commit | 32d8ac256193c2caf9fe705b377739bbde541dc8 (patch) | |
tree | 7118dc27e4a4fa1b6860aa6a866bee110ac06a7b /src/char | |
parent | 83c079bdb0de26af96c2da4155c384663b0e9945 (diff) | |
download | hercules-32d8ac256193c2caf9fe705b377739bbde541dc8.tar.gz hercules-32d8ac256193c2caf9fe705b377739bbde541dc8.tar.bz2 hercules-32d8ac256193c2caf9fe705b377739bbde541dc8.tar.xz hercules-32d8ac256193c2caf9fe705b377739bbde541dc8.zip |
* Cleaned up junk left in the code by the mapcache/mapindex update
- Added mapindex_getmapname(_ext) to help with ".gat" adding/removing
- Moved related processing to the interface (prevents duplicity)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10963 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/char/char.c b/src/char/char.c index 4ae02e360..b1675b7ab 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3446,26 +3446,22 @@ int parse_char(int fd) ShowWarning("Unable to find map-server for '%s', sending to major city '%s'.\n", mapindex_id2name(cd->last_point.map), mapindex_id2name(j)); cd->last_point.map = j; } - { - //Send player to map - uint32 subnet_map_ip; - char map_name[MAP_NAME_LENGTH_EXT]; - snprintf(map_name, MAP_NAME_LENGTH_EXT, "%s.gat", mapindex_id2name(cd->last_point.map)); - - WFIFOHEAD(fd,28); - WFIFOW(fd,0) = 0x71; - WFIFOL(fd,2) = cd->char_id; - memcpy(WFIFOP(fd,6), map_name, MAP_NAME_LENGTH_EXT); - - // Advanced subnet check [LuzZza] - subnet_map_ip = lan_subnetcheck(ipl); - WFIFOL(fd,22) = htonl((subnet_map_ip) ? subnet_map_ip : server[i].ip); - WFIFOW(fd,26) = ntows(htons(server[i].port)); // [!] LE byte order here [!] - WFIFOSET(fd,28); - - ShowInfo("Character selection '%s' (account: %d, slot: %d).\n", - cd->name, sd->account_id, ch); - } + + //Send player to map + WFIFOHEAD(fd,28); + WFIFOW(fd,0) = 0x71; + WFIFOL(fd,2) = cd->char_id; + safestrncpy((char*)WFIFOP(fd,6), mapindex_getmapname_ext(mapindex_id2name(cd->last_point.map),NULL), MAP_NAME_LENGTH_EXT); + { + // Advanced subnet check [LuzZza] + uint32 subnet_map_ip; + subnet_map_ip = lan_subnetcheck(ipl); + WFIFOL(fd,22) = htonl((subnet_map_ip) ? subnet_map_ip : server[i].ip); + WFIFOW(fd,26) = ntows(htons(server[i].port)); // [!] LE byte order here [!] + WFIFOSET(fd,28); + } + ShowInfo("Character selection '%s' (account: %d, slot: %d).\n", cd->name, sd->account_id, ch); + if (auth_fifo_pos >= AUTH_FIFO_SIZE) auth_fifo_pos = 0; auth_fifo[auth_fifo_pos].account_id = sd->account_id; |