summaryrefslogtreecommitdiff
path: root/src/accounthandler.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-12-29 22:39:28 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-12-29 22:39:28 +0000
commit6f8cd5e267a27357a54cb35a44e4fedfc975c0f0 (patch)
tree6d4ddd578d177a68a30dcc87b27bcdfcc742c30e /src/accounthandler.cpp
parentf408b59ad69cd9877fd1a657109255545f677e37 (diff)
downloadmanaserv-6f8cd5e267a27357a54cb35a44e4fedfc975c0f0.tar.gz
manaserv-6f8cd5e267a27357a54cb35a44e4fedfc975c0f0.tar.bz2
manaserv-6f8cd5e267a27357a54cb35a44e4fedfc975c0f0.tar.xz
manaserv-6f8cd5e267a27357a54cb35a44e4fedfc975c0f0.zip
Fixing a bug in the Storage::getAccount() function that made the server crash when the first login had a bad password.
Diffstat (limited to 'src/accounthandler.cpp')
-rw-r--r--src/accounthandler.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/accounthandler.cpp b/src/accounthandler.cpp
index ca65cd1e..fff2223f 100644
--- a/src/accounthandler.cpp
+++ b/src/accounthandler.cpp
@@ -73,7 +73,7 @@ void AccountHandler::receiveMessage(NetComputer &computer, MessageIn &message)
}
// see if the account exists
- tmwserv::AccountPtr acc = tmwserv::AccountPtr(store.getAccount(username));
+ tmwserv::AccountPtr acc = store.getAccount(username);
if (!acc.get()) {
// account doesn't exist -- send error to client
@@ -190,8 +190,8 @@ void AccountHandler::receiveMessage(NetComputer &computer, MessageIn &message)
}
// see if the account exists
- Account *accPtr = store.getAccount(username);
- if ( accPtr ) // Account already exists.
+ tmwserv::AccountPtr accPtr = store.getAccount(username);
+ if ( accPtr.get() ) // Account already exists.
{
result.writeShort(SMSG_REGISTER_RESPONSE);
result.writeByte(REGISTER_EXISTS_USERNAME);
@@ -236,15 +236,15 @@ void AccountHandler::receiveMessage(NetComputer &computer, MessageIn &message)
LOG_INFO(username << " wants to be deleted from our accounts.", 1)
// see if the account exists
- Account *acc = store.getAccount(username);
+ tmwserv::AccountPtr accPtr = store.getAccount(username);
- if (!acc) {
+ if (!accPtr.get()) {
// account doesn't exist -- send error to client
LOG_INFO(username << ": Account doesn't exist anyway.", 1)
result.writeShort(SMSG_UNREGISTER_RESPONSE);
result.writeByte(UNREGISTER_INVALID_USERNAME);
- } else if (acc->getPassword() != password) {
+ } else if (accPtr->getPassword() != password) {
// bad password -- send error to client
LOG_INFO("Won't delete it : Bad password for " << username << ".", 1)