aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Northstar.Client/mod/scripts/vscripts/presence/cl_presence.nut16
1 files changed, 13 insertions, 3 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/presence/cl_presence.nut b/Northstar.Client/mod/scripts/vscripts/presence/cl_presence.nut
index 142c94ba..191ef144 100644
--- a/Northstar.Client/mod/scripts/vscripts/presence/cl_presence.nut
+++ b/Northstar.Client/mod/scripts/vscripts/presence/cl_presence.nut
@@ -22,14 +22,21 @@ GameStateStruct function DiscordRPC_GenerateGameState( GameStateStruct gs )
gs.mapDisplayname = Localize(GetMapDisplayName(GetMapName()))
gs.playlist = GetCurrentPlaylistName()
- gs.playlistDisplayname = Localize(GetCurrentPlaylistVarString("name", GetCurrentPlaylistName()))
+ gs.playlistDisplayname = Localize( GetCurrentPlaylistVarString( "name", GetCurrentPlaylistName() ) )
- gs.currentPlayers = GetPlayerArray().len()
- gs.maxPlayers = GetCurrentPlaylistVarInt( "maxPlayers", -1 )
+ int reservedCount = GetTotalPendingPlayersReserved()
+ int connectingCount = GetTotalPendingPlayersConnecting()
+ int loadingCount = GetTotalPendingPlayersLoading()
+ int connectedCount = GetPlayerArray().len()
+ int allKnownPlayersCount = reservedCount + connectingCount + loadingCount + connectedCount
+
+ gs.currentPlayers = allKnownPlayersCount
+ gs.maxPlayers = GetCurrentPlaylistVarInt( "max_players", 16 )
if ( IsValid( GetLocalClientPlayer() ) )
gs.ownScore = GameRules_GetTeamScore( GetLocalClientPlayer().GetTeam() )
+ #if MP
if ( GameRules_GetGameMode() == FD )
{
gs.playlist = "fd" // So it returns only one thing to the plugin side instead of the 5 separate difficulties FD have
@@ -41,6 +48,9 @@ GameStateStruct function DiscordRPC_GenerateGameState( GameStateStruct gs )
else
gs.fd_waveNumber = -1 // Tells plugin it's on Wave Break
}
+ #else
+ gs.fd_waveNumber = -1 // Unecessary for campaign so return -1
+ #endif
gs.serverGameState = GetGameState() == -1 ? 0 : GetGameState()
gs.otherHighestScore = gs.ownScore == highestScore ? secondHighest : highestScore