1
0
forked from 0ad/0ad

Remove JSInterface_Lobby IsRankedGame function duplicitous with g_GameAttributes.settings.RatingEnabled && !g_IsReplay, refs #3550, D2483.

This was SVN commit r23329.
This commit is contained in:
elexis 2020-01-04 17:10:12 +00:00
parent b9dc24d5ec
commit cf7635f57b
2 changed files with 5 additions and 7 deletions

View File

@ -49,5 +49,9 @@ class LobbyRatingReporter
*/ */
LobbyRatingReporter.Available = function() LobbyRatingReporter.Available = function()
{ {
return Engine.HasXmppClient() && Engine.IsRankedGame() && g_GameAttributes.settings.PlayerData.length == 3; return Engine.HasXmppClient() &&
!g_IsReplay &&
Engine.GetPlayerID() != -1 &&
g_GameAttributes.settings.RatingEnabled &&
g_GameAttributes.settings.PlayerData.length == 3;
}; };

View File

@ -37,7 +37,6 @@ void JSI_Lobby::RegisterScriptFunctions(const ScriptInterface& scriptInterface)
{ {
// Lobby functions // Lobby functions
scriptInterface.RegisterFunction<bool, &JSI_Lobby::HasXmppClient>("HasXmppClient"); scriptInterface.RegisterFunction<bool, &JSI_Lobby::HasXmppClient>("HasXmppClient");
scriptInterface.RegisterFunction<bool, &JSI_Lobby::IsRankedGame>("IsRankedGame");
scriptInterface.RegisterFunction<void, bool, &JSI_Lobby::SetRankedGame>("SetRankedGame"); scriptInterface.RegisterFunction<void, bool, &JSI_Lobby::SetRankedGame>("SetRankedGame");
#if CONFIG2_LOBBY // Allow the lobby to be disabled #if CONFIG2_LOBBY // Allow the lobby to be disabled
scriptInterface.RegisterFunction<void, std::wstring, std::wstring, std::wstring, std::wstring, int, &JSI_Lobby::StartXmppClient>("StartXmppClient"); scriptInterface.RegisterFunction<void, std::wstring, std::wstring, std::wstring, std::wstring, int, &JSI_Lobby::StartXmppClient>("StartXmppClient");
@ -78,11 +77,6 @@ bool JSI_Lobby::HasXmppClient(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
return g_XmppClient; return g_XmppClient;
} }
bool JSI_Lobby::IsRankedGame(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
{
return g_rankedGame;
}
void JSI_Lobby::SetRankedGame(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), bool isRanked) void JSI_Lobby::SetRankedGame(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), bool isRanked)
{ {
g_rankedGame = isRanked; g_rankedGame = isRanked;