Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/network/scripting/JSInterface_Network.cpp
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
if (!g_NetClient) | if (!g_NetClient) | ||||
return JS::UndefinedValue(); | return JS::UndefinedValue(); | ||||
// Convert from net client context to GUI script context | // Convert from net client context to GUI script context | ||||
ScriptInterface::Request rqNet(g_NetClient->GetScriptInterface()); | ScriptInterface::Request rqNet(g_NetClient->GetScriptInterface()); | ||||
JS::RootedValue pollNet(rqNet.cx); | JS::RootedValue pollNet(rqNet.cx); | ||||
g_NetClient->GuiPoll(&pollNet); | g_NetClient->GuiPoll(&pollNet); | ||||
return pCmptPrivate->pScriptInterface->CloneValueFromOtherContext(g_NetClient->GetScriptInterface(), pollNet); | return pCmptPrivate->pScriptInterface->CloneValueFromOtherCompartment(g_NetClient->GetScriptInterface(), pollNet); | ||||
} | } | ||||
void JSI_Network::SetNetworkGameAttributes(ScriptInterface::CmptPrivate* pCmptPrivate, JS::HandleValue attribs1) | void JSI_Network::SetNetworkGameAttributes(ScriptInterface::CmptPrivate* pCmptPrivate, JS::HandleValue attribs1) | ||||
{ | { | ||||
ENSURE(g_NetClient); | ENSURE(g_NetClient); | ||||
// TODO: This is a workaround because we need to pass a MutableHandle to a JSAPI functions somewhere (with no obvious reason). | // TODO: This is a workaround because we need to pass a MutableHandle to a JSAPI functions somewhere (with no obvious reason). | ||||
ScriptInterface::Request rq(pCmptPrivate); | ScriptInterface::Request rq(pCmptPrivate); | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator