diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-03-24 01:57:39 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-03-24 01:57:39 +0000 |
commit | d5e8513e085b6fc8da2ea4bb7151ac8e98be74c8 (patch) | |
tree | 0990fc8565e99c321344283139eb419829769d7a /src/net | |
parent | a34741f590ed24c2a6e0c0ebbde832572c606b94 (diff) | |
download | mana-client-d5e8513e085b6fc8da2ea4bb7151ac8e98be74c8.tar.gz mana-client-d5e8513e085b6fc8da2ea4bb7151ac8e98be74c8.tar.bz2 mana-client-d5e8513e085b6fc8da2ea4bb7151ac8e98be74c8.tar.xz mana-client-d5e8513e085b6fc8da2ea4bb7151ac8e98be74c8.zip |
Go back to login or register state on error, depending on what the user was
doing, and fixed the error message when registering an account that already
exists. Also another crash fix following from previous commit.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/charserverhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/loginhandler.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 01a8756b..a54a17de 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -134,6 +134,7 @@ void CharServerHandler::handleMessage(MessageIn *msg) case 0x0071: player_node = mCharInfo->getEntry(); + slot = mCharInfo->getPos(); msg->skip(4); // CharID, must be the same as player_node->charID map_path = msg->readString(16); mLoginData->hostname = iptostring(msg->readInt32()); @@ -145,10 +146,14 @@ void CharServerHandler::handleMessage(MessageIn *msg) { LocalPlayer *tmp = mCharInfo->getEntry(); if (tmp != player_node) + { delete tmp; + mCharInfo->setEntry(0); + } mCharInfo->next(); } while (mCharInfo->getPos()); + mCharInfo->select(slot); state = CONNECTING_STATE; break; diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 195e54e9..ab788e41 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -53,7 +53,8 @@ void LoginHandler::handleMessage(MessageIn *msg) msg->skip(2); n_server = (msg->getLength() - 47) / 32; - server_info = (SERVER_INFO**)malloc(sizeof(SERVER_INFO*) * n_server); + server_info = + (SERVER_INFO**) malloc(sizeof(SERVER_INFO*) * n_server); mLoginData->session_ID1 = msg->readInt32(); mLoginData->account_ID = msg->readInt32(); @@ -103,7 +104,7 @@ void LoginHandler::handleMessage(MessageIn *msg) errorMessage = "You have been banned for 5 minutes"; break; case 9: - errorMessage = "This account is already logged in"; + errorMessage = "This user name is already taken"; break; default: errorMessage = "Unknown error"; |