summaryrefslogtreecommitdiff
path: root/src/char_sql/char.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-08 17:41:49 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-08 17:41:49 +0000
commit32d8ac256193c2caf9fe705b377739bbde541dc8 (patch)
tree7118dc27e4a4fa1b6860aa6a866bee110ac06a7b /src/char_sql/char.c
parent83c079bdb0de26af96c2da4155c384663b0e9945 (diff)
downloadhercules-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_sql/char.c')
-rw-r--r--src/char_sql/char.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 430f0832a..1b598b662 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -3182,22 +3182,20 @@ int parse_char(int fd)
ShowWarning("Unable to find map-server for '%s', sending to major city '%s'.\n", mapindex_id2name(char_dat.last_point.map), mapindex_id2name(j));
char_dat.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(char_dat.last_point.map));
- WFIFOHEAD(fd,28);
- WFIFOW(fd,0) = 0x71;
- WFIFOL(fd,2) = char_dat.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);
- }
+
+ //Send player to map
+ WFIFOHEAD(fd,28);
+ WFIFOW(fd,0) = 0x71;
+ WFIFOL(fd,2) = char_dat.char_id;
+ safestrncpy((char*)WFIFOP(fd,6), mapindex_getmapname_ext(mapindex_id2name(char_dat.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);
+ }
if (auth_fifo_pos >= AUTH_FIFO_SIZE)
auth_fifo_pos = 0;
auth_fifo[auth_fifo_pos].account_id = sd->account_id;