diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-09-13 17:23:45 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-09-13 17:23:45 +0000 |
commit | a4ebc80ec3aa5d5b7faf51ad878d11bd4a8915e9 (patch) | |
tree | ce8b3a08278fe4d6c51f8dad128f0e7051d53168 | |
parent | e7c5d55d6286ca3c535248c76649863b03fb208b (diff) | |
download | mana-a4ebc80ec3aa5d5b7faf51ad878d11bd4a8915e9.tar.gz mana-a4ebc80ec3aa5d5b7faf51ad878d11bd4a8915e9.tar.bz2 mana-a4ebc80ec3aa5d5b7faf51ad878d11bd4a8915e9.tar.xz mana-a4ebc80ec3aa5d5b7faf51ad878d11bd4a8915e9.zip |
Removed some globals.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/gui/char_select.cpp | 9 | ||||
-rw-r--r-- | src/gui/login.cpp | 6 | ||||
-rw-r--r-- | src/main.cpp | 3 | ||||
-rw-r--r-- | src/main.h | 4 |
5 files changed, 12 insertions, 14 deletions
@@ -4,7 +4,9 @@ 2005-09-13 Björn Steinbrink <B.Steinbrink@gmx.de> - * M src/main.cpp, src/main.h, src/gui/char_select.cpp, + * src/main.cpp, src/main.h, src/gui/char_select.cpp, + src/gui/login.cpp: Removed some globals. + * src/main.cpp, src/main.h, src/gui/char_select.cpp, src/gui/char_select.h, src/gui/char_server.cpp, src/gui/char_server.h, src/gui/login.cpp, src/gui/login.h, src/gui/updatewindow.cpp, src/gui/updatewindow.h: Unified the loops for the various dialogs that 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); diff --git a/src/main.cpp b/src/main.cpp index 408b67b1..4ea181a5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -73,11 +73,8 @@ PLAYER_INFO *char_info = new PLAYER_INFO; Spriteset *hairset = NULL, *playerset = NULL; Graphics *graphics; -std::string username; -std::string password; int map_address, char_ID; short map_port; -std::string map_name; unsigned char state; unsigned char screen_mode; volatile int framesToDraw = 0; @@ -56,12 +56,8 @@ enum { #define LEN_MAX_PASSWORD 25 #define LEN_MIN_PASSWORD 4 -#include <string> -extern std::string username; -extern std::string password; extern int map_address, char_ID; extern short map_port; -extern std::string map_name; extern int account_ID, session_ID1, session_ID2; extern char sex, n_server, n_character; extern unsigned char state; |