accountclient.cpp

Go to the documentation of this file.
00001 /*
00002  *  The Mana World Server
00003  *  Copyright 2004 The Mana World Development Team
00004  *
00005  *  This file is part of The Mana World.
00006  *
00007  *  The Mana World is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  any later version.
00011  *
00012  *  The Mana World is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with The Mana World; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  *  $Id: accountclient.cpp 3229 2007-03-23 00:38:23Z b_lindeijer $
00022  */
00023 
00024 #include "account-server/accountclient.hpp"
00025 
00026 #include "account-server/account.hpp"
00027 #include "account-server/accounthandler.hpp"
00028 #include "account-server/characterdata.hpp"
00029 
00030 AccountClient::AccountClient(ENetPeer *peer):
00031     NetComputer(peer),
00032     status(CLIENT_LOGIN),
00033     mAccountPtr(NULL),
00034     mCharacterPtr(NULL)
00035 {
00036 }
00037 
00038 AccountClient::~AccountClient()
00039 {
00040     unsetAccount();
00041 }
00042 
00043 
00044 void AccountClient::setAccount(AccountPtr acc)
00045 {
00046     unsetAccount();
00047     mAccountPtr = acc;
00048 }
00049 
00050 void AccountClient::setCharacter(CharacterPtr ch)
00051 {
00052     unsetCharacter();
00053     mCharacterPtr = ch;
00054 }
00055 
00056 void AccountClient::unsetAccount()
00057 {
00058     unsetCharacter();
00059     mAccountPtr = AccountPtr(NULL);
00060 }
00061 
00062 void AccountClient::unsetCharacter()
00063 {
00064     if (mCharacterPtr.get() == NULL) return;
00065     mCharacterPtr = CharacterPtr(NULL);
00066 }

Generated on Fri Mar 30 15:39:16 2007 for TMW Server by  doxygen 1.3.9.1