From 32d8ac256193c2caf9fe705b377739bbde541dc8 Mon Sep 17 00:00:00 2001 From: ultramage Date: Wed, 8 Aug 2007 17:41:49 +0000 Subject: * 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 --- src/char/char.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'src/char/char.c') 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; -- cgit v1.2.3-70-g09d2