ConnectedState::ConnectedState(IState& parentState, Eris::Connection& connection) : StateBase<AccountAvailableState>::StateBase(parentState), DisConnect("disconnect", this, "Disconnect from the server."), mConnection(connection) { mConnection.Disconnecting.connect(sigc::mem_fun(*this, &ConnectedState::disconnecting)); mConnection.Failure.connect(sigc::mem_fun(*this, &ConnectedState::gotFailure)); setChildState(new AccountAvailableState(*this, connection)); }
void AccountAvailableState::loginSuccess() { S_LOG_INFO("Login Success."); ConsoleBackend::getSingleton().pushMessage("Login Successful", "important"); setChildState(new LoggedInState(*this, mAccount)); getSignals().LoginSuccess.emit(&mAccount); }
void ConnectingState::connected() { S_LOG_INFO("Connected"); getSignals().GotConnection.emit(&mConnection); setChildState(new ConnectedState(*this, mConnection)); // Set up the player object // Init OOGChat controller // mOOGChat = new OOGChat(mAccount); ConsoleBackend::getSingleton().pushMessage("Connected to Server", "important"); }
void LoggedInState::gotAvatarSuccess(Eris::Avatar* avatar) { //First check if there are any transfer infos for this server, and if this login operation means that one of them successfully has been used. //If so, it should be removed from the persistent storage. if (mTransferInfos.size() > 0) { for (AvatarTransferInfoStore::iterator I = mTransferInfos.begin(); I != mTransferInfos.end(); ++I) { AvatarTransferInfo& info = *I; if (info.getTransferInfo().getPossessEntityId() == avatar->getEntity()->getId()) { removeTransferInfo(info); break; } } } avatar->TransferRequested.connect(sigc::bind(sigc::mem_fun(*this, &LoggedInState::avatar_transferRequest), avatar)); setChildState(new EnteredWorldState(*this, *avatar, mAccount)); mAccount.AvatarDeactivated.connect(sigc::mem_fun(*this, &LoggedInState::gotAvatarDeactivated)); }