protected override void endGame(Dictionary <long, int> playerSessionIdToPlacement) { if (playerSessionIdToPlacement.ContainsKey(localPlayerSessionId)) { didWin = false; if (playerSessionIdToPlacement[localPlayerSessionId] == 0) { didWin = true; } showEndGameUI(); if (didWin) { logWinBi(); } if (currentState != ScavengerHuntState.Hiding) { PartyGameUtils.LogBalkBi(partyGameDefinition.name); } if (base.players[0].UserSessionId == localPlayerSessionId) { PartyGameUtils.StopBiTimer(base.sessionId); PartyGameUtils.LogGameEndBi(partyGameDefinition.name, playerSessionIdToPlacement.Count); } EventManager.Instance.PostEvent("SFX/AO/MarbleHunt/TimeRunningOut", EventAction.StopSound); EventManager.Instance.PostEvent("SFX/AO/MarbleHunt/ClockLoop", EventAction.StopSound); } }
protected override void endGame(Dictionary <long, int> playerSessionIdToPlacement) { if (playerSessionIdToPlacement.Count == 0) { PartyGameUtils.LogBalkBi(partyGameDefinition.name); return; } foreach (FishBucketPlayerData value in playerData.Values) { if (playerSessionIdToPlacement.ContainsKey(value.PlayerId)) { value.Placement = playerSessionIdToPlacement[value.PlayerId]; } } List <PartyGameEndGamePlayerData> list = new List <PartyGameEndGamePlayerData>(); bool flag = false; foreach (FishBucketPlayerData value2 in playerData.Values) { PartyGameEndGamePlayerData item = new PartyGameEndGamePlayerData(value2.PlayerId, value2.Placement, value2.PlayerNum, value2.IsLocalPlayer, value2.Score, hasScore: true); if (list.Count == 0 || value2.Placement == -1) { list.Add(item); continue; } for (int i = 0; i < list.Count; i++) { if (value2.Placement <= list[i].Placement || list[i].Placement == -1) { list.Insert(i, item); flag = true; break; } } if (!flag) { list.Add(item); } flag = false; } loadEndGameScreen(list.ToArray()); if (base.players[0].UserSessionId == localPlayerSessionId) { PartyGameUtils.StopBiTimer(base.sessionId); PartyGameUtils.LogGameEndBi(partyGameDefinition.name, playerSessionIdToPlacement.Count); } }
protected override void endGame(Dictionary <long, int> playerSessionIdToPlacement) { if (playerSessionIdToPlacement.Count == 0) { PartyGameUtils.LogBalkBi(partyGameDefinition.name); return; } List <PartyGameEndGamePlayerData> list = new List <PartyGameEndGamePlayerData>(); foreach (KeyValuePair <long, int> item in playerSessionIdToPlacement) { list.Add(new PartyGameEndGamePlayerData(item.Key, item.Value, (item.Key != base.players[0].UserSessionId) ? 1 : 0, item.Key == localPlayerSessionId)); } list.Sort((PartyGameEndGamePlayerData a, PartyGameEndGamePlayerData b) => a.Placement.CompareTo(b.Placement)); loadEndGameScreen(list.ToArray()); if (base.players[0].UserSessionId == localPlayerSessionId) { bool won = playerSessionIdToPlacement[localPlayerSessionId] == 0; PartyGameUtils.StopBiTimer(base.sessionId); PartyGameUtils.LogGameEndBi(partyGameDefinition.name, playerSessionIdToPlacement.Count, won); } }