public static JsonRequest <Score[], ScoreRequestResult> CreateGetRequest(string gameId, string privateKey, string username, string userToken, int limit, string tableId) { var output = new JsonRequest <Score[], ScoreRequestResult>(gameId, privateKey, Constants.ScoreUrls.GetUrl); if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(userToken)) { if (!string.IsNullOrWhiteSpace(username)) { Logging.LogError("If you do not want user specific scores you cannot supply a username or a user token."); throw new Exception("User token is null, but username is not."); } if (!string.IsNullOrWhiteSpace(userToken)) { Logging.LogError("If you do not want user specific scores you cannot supply a username or a user token."); throw new Exception("Username is null, but user token is not."); } } else { output.Parameters.Add(RequestParameter.CreateUsername(username)); output.Parameters.Add(RequestParameter.CreateUserToken(userToken)); } if (limit > 0) { output.Parameters.Add(RequestParameter.CreateLimit(limit)); } if (!string.IsNullOrWhiteSpace(tableId)) { output.Parameters.Add(RequestParameter.CreateTableId(tableId)); } return(output); }