Don't start a STKHost if neither client nor server is requested.
This commit is contained in:
parent
4aea491ed0
commit
1334a467e3
@ -779,7 +779,7 @@ int handleCmdLine()
|
|||||||
STKHost::create(/*is_Server*/true);
|
STKHost::create(/*is_Server*/true);
|
||||||
Log::info("main", "Creating a server.");
|
Log::info("main", "Creating a server.");
|
||||||
}
|
}
|
||||||
else
|
else if(CommandLine::has("--client"))
|
||||||
{
|
{
|
||||||
STKHost::create(/*is_server*/false);
|
STKHost::create(/*is_server*/false);
|
||||||
Log::info("main", "Creating a client.");
|
Log::info("main", "Creating a client.");
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "modes/world.hpp"
|
#include "modes/world.hpp"
|
||||||
#include "network/protocol_manager.hpp"
|
#include "network/protocol_manager.hpp"
|
||||||
#include "network/network_world.hpp"
|
#include "network/network_world.hpp"
|
||||||
|
#include "network/stk_host.hpp"
|
||||||
#include "online/request_manager.hpp"
|
#include "online/request_manager.hpp"
|
||||||
#include "race/race_manager.hpp"
|
#include "race/race_manager.hpp"
|
||||||
#include "states_screens/state_manager.hpp"
|
#include "states_screens/state_manager.hpp"
|
||||||
@ -176,6 +177,7 @@ void MainLoop::run()
|
|||||||
PROFILER_POP_CPU_MARKER();
|
PROFILER_POP_CPU_MARKER();
|
||||||
|
|
||||||
PROFILER_PUSH_CPU_MARKER("Protocol manager update", 0x7F, 0x00, 0x7F);
|
PROFILER_PUSH_CPU_MARKER("Protocol manager update", 0x7F, 0x00, 0x7F);
|
||||||
|
if (STKHost::isNetworking())
|
||||||
ProtocolManager::getInstance()->update();
|
ProtocolManager::getInstance()->update();
|
||||||
PROFILER_POP_CPU_MARKER();
|
PROFILER_POP_CPU_MARKER();
|
||||||
|
|
||||||
@ -186,6 +188,7 @@ void MainLoop::run()
|
|||||||
else if (!m_abort && ProfileWorld::isNoGraphics())
|
else if (!m_abort && ProfileWorld::isNoGraphics())
|
||||||
{
|
{
|
||||||
PROFILER_PUSH_CPU_MARKER("Protocol manager update", 0x7F, 0x00, 0x7F);
|
PROFILER_PUSH_CPU_MARKER("Protocol manager update", 0x7F, 0x00, 0x7F);
|
||||||
|
if(STKHost::isNetworking())
|
||||||
ProtocolManager::getInstance()->update();
|
ProtocolManager::getInstance()->update();
|
||||||
PROFILER_POP_CPU_MARKER();
|
PROFILER_POP_CPU_MARKER();
|
||||||
|
|
||||||
|
@ -124,6 +124,10 @@ public:
|
|||||||
m_stk_host = NULL;
|
m_stk_host = NULL;
|
||||||
}
|
}
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
/** Return if a network setting is happening. A network setting is active
|
||||||
|
* if a host (server or client) exists. */
|
||||||
|
static bool isNetworking() { return m_stk_host!=NULL; }
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
static void* mainLoop(void* self);
|
static void* mainLoop(void* self);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user