Revert "Disconnect android player from wan race when the window is not active anymore"
This reverts commit e80e0555e1
.
This commit is contained in:
parent
2c79b02088
commit
bc675ffd81
@ -34,8 +34,6 @@
|
||||
#include "input/input_manager.hpp"
|
||||
#include "modes/demo_world.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "network/network_config.hpp"
|
||||
#include "network/stk_host.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "utils/debug.hpp"
|
||||
#include "utils/profiler.hpp"
|
||||
@ -186,21 +184,6 @@ bool EventHandler::OnEvent (const SEvent &event)
|
||||
SFXManager::get()->resumeAll();
|
||||
}
|
||||
}
|
||||
else if (cmd == APP_CMD_TERM_WINDOW)
|
||||
{
|
||||
if (STKHost::existHost() && NetworkConfig::get()->isWAN())
|
||||
{
|
||||
STKHost::get()->requestShutdownDelayed(10000);
|
||||
}
|
||||
}
|
||||
else if (cmd == APP_CMD_INIT_WINDOW)
|
||||
{
|
||||
if (STKHost::existHost() && NetworkConfig::get()->isWAN() &&
|
||||
!STKHost::get()->requestedShutdown())
|
||||
{
|
||||
STKHost::get()->cancelShutdown();
|
||||
}
|
||||
}
|
||||
else if (cmd == APP_CMD_LOW_MEMORY)
|
||||
{
|
||||
Log::warn("EventHandler", "Low memory event received");
|
||||
|
@ -308,7 +308,6 @@ void STKHost::init()
|
||||
{
|
||||
m_network_timer.store(StkTime::getRealTimeMs());
|
||||
m_shutdown = false;
|
||||
m_shutdown_delay = 0;
|
||||
m_authorised = false;
|
||||
m_network = NULL;
|
||||
m_exit_timeout.store(std::numeric_limits<uint64_t>::max());
|
||||
|
@ -117,9 +117,6 @@ private:
|
||||
* triggers a shutdown of the STKHost (and the Protocolmanager). */
|
||||
std::atomic_bool m_shutdown;
|
||||
|
||||
/** Used as a timeout for shedule shutdown. */
|
||||
std::atomic<uint64_t> m_shutdown_delay;
|
||||
|
||||
/** True if this local host is authorised to control a server. */
|
||||
std::atomic_bool m_authorised;
|
||||
|
||||
@ -211,21 +208,8 @@ public:
|
||||
void requestShutdown()
|
||||
{
|
||||
m_shutdown.store(true);
|
||||
m_shutdown_delay.store(0);
|
||||
} // requestExit
|
||||
//-------------------------------------------------------------------------
|
||||
void requestShutdownDelayed(int delay)
|
||||
{
|
||||
m_shutdown.store(true);
|
||||
m_shutdown_delay.store(StkTime::getRealTimeMs() + delay);
|
||||
}
|
||||
//-------------------------------------------------------------------------
|
||||
void cancelShutdown()
|
||||
{
|
||||
m_shutdown.store(false);
|
||||
m_shutdown_delay.store(0);
|
||||
}
|
||||
//-------------------------------------------------------------------------
|
||||
void shutdown();
|
||||
//-------------------------------------------------------------------------
|
||||
void sendPacketToAllPeersInServer(NetworkString *data,
|
||||
@ -282,11 +266,7 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns true if a shutdown of the network infrastructure was
|
||||
* requested. */
|
||||
bool requestedShutdown() const
|
||||
{
|
||||
return m_shutdown.load() &&
|
||||
m_shutdown_delay.load() < StkTime::getRealTimeMs();
|
||||
}
|
||||
bool requestedShutdown() const { return m_shutdown.load(); }
|
||||
// ------------------------------------------------------------------------
|
||||
int receiveRawPacket(char *buffer, int buffer_len,
|
||||
TransportAddress* sender, int max_tries = -1)
|
||||
|
Loading…
Reference in New Issue
Block a user