private IEnumerator finishEndSession() { yield return(null); int placement = 0; Dictionary <long, int> playerSessionIdToPlacement = new Dictionary <long, int>(); foreach (long key in userScores.Keys) { playerSessionIdToPlacement.Add(key, placement); if (placement < 4) { placement++; } } PartyGameEndEvent endEvent = new PartyGameEndEvent { playerSessionIdToPlacement = playerSessionIdToPlacement, sessionId = sessionId }; processEvent(GameServerEvent.PARTY_GAME_END, endEvent); foreach (long key2 in userScores.Keys) { processEvent(GameServerEvent.HELD_OBJECT_DEQUIPPED, key2); PlayerLocomotionStateEvent playerLocomotionStateEvent = default(PlayerLocomotionStateEvent); playerLocomotionStateEvent.SessionId = key2; playerLocomotionStateEvent.State = LocomotionState.Default; processEvent(GameServerEvent.USER_LOCO_STATE_CHANGED, playerLocomotionStateEvent); } }
private PartyGameEndEvent partyGameEndEventFromProps(ISFSObject props) { PartyGameEndEvent result = default(PartyGameEndEvent); List <PartyGameEndPlayerResult> list = mt.JsonService.Deserialize <List <PartyGameEndPlayerResult> >(props.GetUtfString("results")); Dictionary <long, int> dictionary = new Dictionary <long, int>(); for (int i = 0; i < list.Count; i++) { dictionary.Add(list[i].PlayerSessionId, list[i].Placement); } result.playerSessionIdToPlacement = dictionary; result.sessionId = props.GetInt("id"); return(result); }
private void onPartyGameEnd(GameServerEvent gameServerEvent, object data) { PartyGameEndEvent partyGameEndEvent = (PartyGameEndEvent)data; Service.Get <EventDispatcher>().DispatchEvent(new PartyGameServiceEvents.PartyGameEnded(partyGameEndEvent.playerSessionIdToPlacement, partyGameEndEvent.sessionId)); }