mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-27 13:24:37 +00:00
Allow kicking/banning players from gamesetup and session. Patch by elexis. Fixes #3241.
This was SVN commit r17217.
This commit is contained in:
@@ -353,6 +353,14 @@ void DisconnectNetworkGame(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
||||
SAFE_DELETE(g_Game);
|
||||
}
|
||||
|
||||
bool KickPlayer(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), CStrW playerName, bool ban)
|
||||
{
|
||||
if (!g_NetServer)
|
||||
return false;
|
||||
|
||||
return g_NetServer->KickPlayer(playerName, ban);
|
||||
}
|
||||
|
||||
JS::Value PollNetworkClient(ScriptInterface::CxPrivate* pCxPrivate)
|
||||
{
|
||||
if (!g_NetClient)
|
||||
@@ -963,6 +971,7 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
|
||||
scriptInterface.RegisterFunction<void, std::wstring, &StartNetworkHost>("StartNetworkHost");
|
||||
scriptInterface.RegisterFunction<void, std::wstring, std::string, &StartNetworkJoin>("StartNetworkJoin");
|
||||
scriptInterface.RegisterFunction<void, &DisconnectNetworkGame>("DisconnectNetworkGame");
|
||||
scriptInterface.RegisterFunction<bool, CStrW, bool, &KickPlayer>("KickPlayer");
|
||||
scriptInterface.RegisterFunction<JS::Value, &PollNetworkClient>("PollNetworkClient");
|
||||
scriptInterface.RegisterFunction<void, JS::HandleValue, &SetNetworkGameAttributes>("SetNetworkGameAttributes");
|
||||
scriptInterface.RegisterFunction<void, int, std::string, &AssignNetworkPlayer>("AssignNetworkPlayer");
|
||||
|
||||
Reference in New Issue
Block a user