void Game::processGameEnd() { g_lua.callGlobalField("g_game", "onGameEnd"); // reset game state resetGameStates(); m_worldName = ""; m_characterName = ""; // clean map creatures g_map.cleanDynamicThings(); }
void Game::loginWorld(const std::string& account, const std::string& password, const std::string& worldName, const std::string& worldHost, int worldPort, const std::string& characterName) { if(m_protocolGame || isOnline()) stdext::throw_exception("Unable to login into a world while already online or logging."); if(m_clientVersion == 0) stdext::throw_exception("Must set a valid game protocol version before logging."); // reset the new game state resetGameStates(); m_localPlayer = LocalPlayerPtr(new LocalPlayer); m_localPlayer->setName(characterName); m_protocolGame = ProtocolGamePtr(new ProtocolGame); m_protocolGame->login(account, password, worldHost, (uint16)worldPort, characterName); m_characterName = characterName; m_worldName = worldName; }
void Game::processGameEnd() { m_online = false; g_lua.callGlobalField("g_game", "onGameEnd"); if(m_connectionFailWarned) { g_lua.callGlobalField("g_game", "onConnectionFailing", false); m_connectionFailWarned = false; } // reset game state resetGameStates(); m_worldName = ""; m_characterName = ""; // clean map creatures g_map.cleanDynamicThings(); }
void Game::terminate() { resetGameStates(); m_protocolGame = nullptr; }
Game::Game() { resetGameStates(); m_clientVersion = 0; }
void Game::init() { resetGameStates(); }