public static AGSRequestPlayerResponse GetBlankResponseWithError(string error, int userData = 0)
    {
        AGSRequestPlayerResponse response = new AGSRequestPlayerResponse();

        response.error    = error;
        response.userData = userData;
        response.player   = AGSPlayer.GetBlankPlayer();
        return(response);
    }
예제 #2
0
 public AGSSocialUser(AGSPlayer player)
 {
     this.player = player == null?AGSPlayer.GetBlankPlayer() : player;
 }
 public static AGSRequestPlayerResponse FromJSON(string json)
 {
     try {
         AGSRequestPlayerResponse response = new AGSRequestPlayerResponse();
         Hashtable hashtable = json.hashtableFromJson();
         response.error    = hashtable.ContainsKey("error") ? hashtable ["error"].ToString() : "";
         response.userData = hashtable.ContainsKey("userData") ? int.Parse(hashtable ["userData"].ToString()) : 0;
         response.player   = hashtable.ContainsKey("player") ? AGSPlayer.fromHashtable(hashtable ["player"] as Hashtable) : AGSPlayer.GetBlankPlayer();
         return(response);
     } catch (Exception e) {
         AGSClient.LogGameCircleError(e.ToString());
         return(GetBlankResponseWithError(JSON_PARSE_ERROR));
     }
 }
예제 #4
0
 public AGSSocialUser()
 {
     player = AGSPlayer.GetBlankPlayer();
 }