Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/network/NetServer.cpp
Show First 20 Lines • Show All 382 Lines • ▼ Show 20 Lines | |||||
void CNetServerWorker::Run() | void CNetServerWorker::Run() | ||||
{ | { | ||||
// The script runtime uses the profiler and therefore the thread must be registered before the runtime is created | // The script runtime uses the profiler and therefore the thread must be registered before the runtime is created | ||||
g_Profiler2.RegisterCurrentThread("Net server"); | g_Profiler2.RegisterCurrentThread("Net server"); | ||||
// To avoid the need for JS_SetContextThread, we create and use and destroy | // To avoid the need for JS_SetContextThread, we create and use and destroy | ||||
// the script interface entirely within this network thread | // the script interface entirely within this network thread | ||||
m_ScriptInterface = new ScriptInterface("Engine", "Net server", ScriptInterface::CreateRuntime(g_ScriptRuntime)); | shared_ptr<ScriptRuntime> netServerRuntime = ScriptRuntime::CreateRuntime(); | ||||
m_ScriptInterface = new ScriptInterface("Engine", "Net server", netServerRuntime); | |||||
m_GameAttributes.init(m_ScriptInterface->GetJSRuntime(), JS::UndefinedValue()); | m_GameAttributes.init(m_ScriptInterface->GetJSRuntime(), JS::UndefinedValue()); | ||||
while (true) | while (true) | ||||
{ | { | ||||
if (!RunStep()) | if (!RunStep()) | ||||
break; | break; | ||||
// Implement autostart mode | // Implement autostart mode | ||||
▲ Show 20 Lines • Show All 1,239 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator