void OnNewGameState(GameState gs) { players = gs.AllPlayers.PlayerList as List <PlayerNode>; DataEventArgs args = new DataEventArgs { Data = gs }; OnGameStateReceived?.Invoke(this, args); }
private void Manager_OnDataMessageNoCopyReceived(object sender, PlayFabPlayer from, IntPtr buffer, uint bufferSize) { var messageType = PartyNetworkMessageHelper.GetTypeFromMessageWrapper(buffer, bufferSize); switch (messageType) { case PartyNetworkMessageEnum.GameState: OnGameStateReceived?.Invoke(PartyNetworkMessageHelper.GetDataFromMessageWrapper <GameState>(buffer, bufferSize)); break; case PartyNetworkMessageEnum.Move: OnMoveReceived?.Invoke(from.EntityKey.Id, PartyNetworkMessageHelper.GetDataFromMessageWrapper <TicTacToeMove>(buffer, bufferSize)); break; case PartyNetworkMessageEnum.MatchAbandonment: OnMatchAbandonment?.Invoke(); break; } }