public void SendBattleWinEvent() { var userProfile = Whiteboard.Get <UserProfile>(GameConstants.Player.PLAYER_PROFILE); RewardEvent rewardEvent = new RewardEvent(); rewardEvent.EventType = RewardEvent.Types.RewardEventType.BattleWin; rewardEvent.UserId = userProfile.UserId; Request request = RequestGenerator.CreateRequest(RequestType.RewardUser, rewardEvent.ToByteString()); NetworkManager.Instance.SendRequest(request, OnRewardReceived); }
void Start() { var playerStatus = Whiteboard.Get <StartUpResponse.Types.PlayerStatus>(GameConstants.Player.STARTUP_PLAYER_STATUS); var playerProfile = Whiteboard.Get <UserProfile>(GameConstants.Player.PLAYER_PROFILE); if (playerStatus == StartUpResponse.Types.PlayerStatus.PlayerFound) { Util.Log("Player Found"); Hashtable table = new Hashtable(); table.Add(GameConstants.Player.PLAYER_PROFILE, playerProfile); ActionManager.instance.TriggerEvent(StringConstants.EventNames.UPDATE_PLAYER_PROFILE, table); } else if (playerStatus == StartUpResponse.Types.PlayerStatus.PlayerNotFound) { Hashtable table = new Hashtable(); table.Add(StringConstants.PropertyName.EVENT_NAME, StringConstants.EventNames.OPEN_USER_REGISTRATION); ActionManager.instance.TriggerEvent(StringConstants.EventNames.OPEN_USER_REGISTRATION, table); } }