Read default multiplayer server name/IP address from config. Patch by Aurium. Refs #1778.

This was SVN commit r13003.
This commit is contained in:
leper
2012-12-20 21:44:56 +00:00
parent 6ab0ab586a
commit 9a2dfa3fc0
5 changed files with 24 additions and 7 deletions
+7
View File
@@ -179,6 +179,12 @@ std::wstring GetDefaultPlayerName(void* UNUSED(cbdata))
return name;
}
std::wstring GetDefaultMPServer(void* UNUSED(cbdata))
{
std::wstring server = g_MPServer.FromUTF8();
return server;
}
void StartNetworkGame(void* UNUSED(cbdata))
{
ENSURE(g_NetServer);
@@ -634,6 +640,7 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
scriptInterface.RegisterFunction<std::wstring, std::wstring, &SetCursor>("SetCursor");
scriptInterface.RegisterFunction<int, &GetPlayerID>("GetPlayerID");
scriptInterface.RegisterFunction<std::wstring, &GetDefaultPlayerName>("GetDefaultPlayerName");
scriptInterface.RegisterFunction<std::wstring, &GetDefaultMPServer>("GetDefaultMPServer");
scriptInterface.RegisterFunction<void, std::string, &OpenURL>("OpenURL");
scriptInterface.RegisterFunction<void, &RestartInAtlas>("RestartInAtlas");
scriptInterface.RegisterFunction<bool, &AtlasIsAvailable>("AtlasIsAvailable");