1
0
forked from mirrors/0ad

Remove all external usage of CmptPrivate. Header cleanup.

This removes usage of CmptPrivate outside of ScriptInterface.
ScriptRequest can now be used to safely recover the scriptInterface from
a JSContext instead of going through ScriptInterface, which allows more
code cleanup.

Follows 34b1920e7b

Differential Revision: https://code.wildfiregames.com/D3963
This was SVN commit r25442.
This commit is contained in:
wraitii
2021-05-15 13:54:58 +00:00
parent 3ebff376cc
commit 507f44f7f9
20 changed files with 173 additions and 118 deletions
+3 -3
View File
@@ -110,11 +110,11 @@ IXmppClient* XmppGetter(const ScriptRequest&, JS::CallArgs&)
return g_XmppClient;
}
void SendRegisterGame(ScriptInterface::CmptPrivate* pCmptPrivate, JS::HandleValue data)
void SendRegisterGame(const ScriptInterface& scriptInterface, JS::HandleValue data)
{
if (!g_XmppClient)
{
ScriptRequest rq(pCmptPrivate->pScriptInterface);
ScriptRequest rq(scriptInterface);
ScriptException::Raise(rq, "Cannot call SendRegisterGame without an initialized XmppClient!");
return;
}
@@ -126,7 +126,7 @@ void SendRegisterGame(ScriptInterface::CmptPrivate* pCmptPrivate, JS::HandleValu
return;
}
g_XmppClient->SendIqRegisterGame(*(pCmptPrivate->pScriptInterface), data);
g_XmppClient->SendIqRegisterGame(scriptInterface, data);
}
// Unlike other functions, this one just returns Undefined if XmppClient isn't initialised.