private void OnRoundResult(GameEvent evt) { RoundResultVO vo = JsonConvert.DeserializeObject <RoundResultVO>(evt.response.data); Player player = GetPlayerById(vo.sender); player.spinHandler.Spin(vo.spinTime); }
private void DispatchCardDealt() { RoundResultVO vo = new RoundResultVO(); vo.api = (int)(NetworkConstants.API.ROUND_RESULT); vo.sender = Networking.hostId; vo.api_id = ++APIHandler.GetInstance().runningId; vo.spinTime = GetLocalPlayer.spinHandler.LastSpinTime; vo.cardValueType = GetLocalPlayer.SelectedCard.ValueType; vo.selectedSymbolIndex = GetLocalPlayer.SelectedCardIndex; vo.roundId = _roundHandler.GetRoundNumber; string data = JsonConvert.SerializeObject(vo); API api = new API(); api.api = vo.api; api.data = data; api.id = vo.api_id; api.playerIds = Utility.DeepCloneList <string>(network.PlayersIdsExcludingThis); APIHandler.GetInstance().SendDataToAll(api); }