Example #1
0
    public void OnResponseReceived(string requestId)
    {
        CreateUserResponseProto response = NetworkManager.Instance.GetResponse <CreateUserResponseProto>(requestId);

        if (response.Status == ResponseStatus.Success)
        {
            UserProfile user = UserProfile.Parser.ParseFrom(response.Payload);
            Util.Log(" New User Created " + user.Username);
            Hashtable parameters = new Hashtable();
            parameters.Add(GameConstants.Player.PLAYER_PROFILE, user);
            ActionManager.instance.TriggerEvent(StringConstants.EventNames.UPDATE_PLAYER_PROFILE, parameters);
        }
        else if (response.Status == ResponseStatus.UserExist)
        {
            UserProfile user       = UserProfile.Parser.ParseFrom(response.Payload);
            Hashtable   parameters = new Hashtable();
            parameters.Add(GameConstants.Player.PLAYER_PROFILE, user);
            ActionManager.instance.TriggerEvent(StringConstants.EventNames.UPDATE_PLAYER_PROFILE, parameters);
            Debug.Log("User with same device id already exist : " + user.Username);
        }
        DataManager.SendDataRequest();
        Close();
    }
Example #2
0
 public void OnResponseReceived(CreateUserResponseProto response)
 {
     _response            = response;
     responseNotProcessed = true;
 }