Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/network/NetServer.cpp
Show First 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | |||||
void CNetServerWorker::Run() | void CNetServerWorker::Run() | ||||
{ | { | ||||
// The script context uses the profiler and therefore the thread must be registered before the context is created | // The script context uses the profiler and therefore the thread must be registered before the context is created | ||||
g_Profiler2.RegisterCurrentThread("Net server"); | g_Profiler2.RegisterCurrentThread("Net server"); | ||||
// We create a new ScriptContext for this network thread, with a single ScriptInterface. | // We create a new ScriptContext for this network thread, with a single ScriptInterface. | ||||
shared_ptr<ScriptContext> netServerContext = ScriptContext::CreateContext(); | shared_ptr<ScriptContext> netServerContext = ScriptContext::CreateContext(); | ||||
m_ScriptInterface = new ScriptInterface("Engine", "Net server", netServerContext); | m_ScriptInterface = new ScriptInterface("Engine", "Net server", netServerContext); | ||||
m_GameAttributes.init(m_ScriptInterface->GetJSRuntime(), JS::UndefinedValue()); | m_GameAttributes.init(m_ScriptInterface->GetGeneralJSContext(), JS::UndefinedValue()); | ||||
while (true) | while (true) | ||||
{ | { | ||||
if (!RunStep()) | if (!RunStep()) | ||||
break; | break; | ||||
// Implement autostart mode | // Implement autostart mode | ||||
if (m_State == SERVER_STATE_PREGAME && (int)m_PlayerAssignments.size() == m_AutostartPlayers) | if (m_State == SERVER_STATE_PREGAME && (int)m_PlayerAssignments.size() == m_AutostartPlayers) | ||||
▲ Show 20 Lines • Show All 1,236 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator