diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/char_select.cpp | 9 | ||||
-rw-r--r-- | src/gui/login.cpp | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index cb85d39c..6389f5b0 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -235,14 +235,19 @@ void CharSelectDialog::serverCharSelect() flush(); } char_ID = RFIFOL(2); + + char mapName[17]; + mapName[17] = 0; + strncpy(mapName, RFIFOP(6), 16); + memset(map_path, '\0', 480); strcat(map_path, "maps/"); - strncat(map_path, RFIFOP(6), 479 - strlen(map_path)); + strncat(map_path, mapName, 479 - strlen(map_path)); map_address = RFIFOL(22); map_port = RFIFOW(26); state = GAME; - logger->log("CharSelect: Map: %s", map_name.c_str()); + logger->log("CharSelect: Map: %s", mapName); logger->log("CharSelect: Server: %s:%d", iptostring(map_address), map_port); RFIFOSKIP(28); close_session(); diff --git a/src/gui/login.cpp b/src/gui/login.cpp index a8ecf6a2..9913eb25 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -294,8 +294,6 @@ void loginInputHandler(SDL_KeyboardEvent *keyEvent) } int attemptLogin(const std::string& user, const std::string& pass) { - username = user; - password = pass; int ret; // Connect to login server @@ -315,8 +313,8 @@ int attemptLogin(const std::string& user, const std::string& pass) { WFIFOL(2) = 0; - memcpy(WFIFOP(6), username.c_str(), LEN_MAX_USERNAME - 1); - memcpy(WFIFOP(30), password.c_str(), LEN_MAX_PASSWORD - 1); + memcpy(WFIFOP(6), user.c_str(), LEN_MAX_USERNAME - 1); + memcpy(WFIFOP(30), pass.c_str(), LEN_MAX_PASSWORD - 1); WFIFOB(54) = 0; WFIFOSET(55); |