diff options
Diffstat (limited to 'src/netcomputer.cpp')
-rw-r--r-- | src/netcomputer.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/netcomputer.cpp b/src/netcomputer.cpp index 7a06ba34..2a8ecc22 100644 --- a/src/netcomputer.cpp +++ b/src/netcomputer.cpp @@ -50,47 +50,3 @@ void NetComputer::send(const Packet *p) // Send the packet to the peer over channel id 0. enet_peer_send(peer, 0, packet); } - -void ClientComputer::setAccount(tmwserv::AccountPtr acc) -{ - mAccountPtr = acc; -} - -void ClientComputer::setCharacter(tmwserv::BeingPtr ch) -{ - tmwserv::State &state = tmwserv::State::instance(); - if (mCharacterPtr.get() != NULL) - { - // Remove being from the world. - unsetCharacter(); - } - mCharacterPtr = ch; - state.addBeing(mCharacterPtr, mCharacterPtr->getMapId()); -} - -void ClientComputer::unsetAccount() -{ - unsetCharacter(); - mAccountPtr = tmwserv::AccountPtr(NULL); -} - -void ClientComputer::unsetCharacter() -{ - // remove being from world - tmwserv::State &state = tmwserv::State::instance(); - state.removeBeing(mCharacterPtr); - chatChannelManager->removeUserFromEveryChannels(mCharacterPtr); - mCharacterPtr = tmwserv::BeingPtr(NULL); -} - -ClientComputer::ClientComputer(ClientConnectionHandler *handler, ENetPeer *peer): - NetComputer(handler, peer), - mAccountPtr(NULL), - mCharacterPtr(NULL) -{ -} - -ClientComputer::~ClientComputer() -{ - unsetAccount(); -} |