Skip to content

Commit 9b1301b

Browse files
committed
Minor bug fixes
1 parent 6f36f8c commit 9b1301b

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

Runtime/Client/LootLockerConfig.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ public static LootLockerConfig current
6161
[HideInInspector]
6262
public string token;
6363
[HideInInspector]
64+
public string adminToken;
65+
[HideInInspector]
6466
public int gameID;
6567
public string game_version = "1.0";
6668
[HideInInspector]
6769
public string deviceID = "defaultPlayerId";
6870
public platformType platform;
6971
public enum platformType { Android, iOS, Steam, Windows, GoG, Xbox, PlayStationNetwork, EpicStore, NintendoSwitch, Web, Other }
70-
7172
public bool developmentMode;
7273
[HideInInspector]
7374
public string url = "https://api.lootlocker.io/game/v1";

Runtime/Client/LootLockerServerRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static void CallAPI(string endPoint, LootLockerHTTPMethod httpMethod, str
100100
if (useAuthToken)
101101
{
102102
headers = new Dictionary<string, string>();
103-
headers.Add(callerRole == LootLocker.LootLockerEnums.LootLockerCallerRole.Admin ? "x-auth-token" : "x-session-token", LootLockerConfig.current.token);
103+
headers.Add(callerRole == LootLocker.LootLockerEnums.LootLockerCallerRole.Admin ? "x-auth-token" : "x-session-token", callerRole == LootLocker.LootLockerEnums.LootLockerCallerRole.Admin ? LootLockerConfig.current.adminToken : LootLockerConfig.current.token);
104104
}
105105

106106
LootLockerBaseServerAPI.I.SwitchURL(callerRole);

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ public static void GetScoreListMain(int leaderboardId, int count, int after, Act
16961696
}
16971697
LootLockerGetScoreListRequest request = new LootLockerGetScoreListRequest();
16981698
request.leaderboardId = leaderboardId;
1699-
request.count = count.ToString();
1699+
request.count = count;
17001700
request.after = after > 0 ? after.ToString() : null;
17011701
Action<LootLockerGetScoreListResponse> callback = (response) =>
17021702
{
@@ -1746,7 +1746,7 @@ public static void GetScoreListOriginal(int leaderboardId, int count, int after,
17461746
}
17471747
LootLockerGetScoreListRequest request = new LootLockerGetScoreListRequest();
17481748
request.leaderboardId = leaderboardId;
1749-
request.count = count.ToString();
1749+
request.count = count;
17501750
request.after = after > 0 ? after.ToString() : null;
17511751

17521752
LootLockerAPIManager.GetScoreList(request, onComplete);

Runtime/Game/Requests/LeaderboardRequest.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ public class LootLockerGetMemberRankRequest
7979
public int member_id { get; set; }
8080
}
8181

82-
public class LootLockerGetScoreListRequest
82+
public class LootLockerGetScoreListRequest: LootLockerGetRequests
8383
{
8484
public int leaderboardId { get; set; }
85-
public string count { get; set; }
86-
public string after { get; set; }
87-
8885
public static int? nextCursor;
8986
public static int? prevCursor;
9087
public static void Reset()
@@ -94,6 +91,12 @@ public static void Reset()
9491
}
9592
}
9693

94+
public class LootLockerGetRequests
95+
{
96+
public int count { get; set; }
97+
public string after { get; set; }
98+
}
99+
97100
public class LootLockerGetByListMembersRequest
98101
{
99102
public string[] members { get; set; }
@@ -152,12 +155,12 @@ public static void GetScoreList(LootLockerGetScoreListRequest getRequests, Actio
152155
EndPointClass requestEndPoint = LootLockerEndPoints.getScoreList;
153156

154157
string tempEndpoint = requestEndPoint.endPoint;
155-
string endPoint = string.Format(requestEndPoint.endPoint, getRequests.leaderboardId, int.Parse(getRequests.count));
158+
string endPoint = string.Format(requestEndPoint.endPoint, getRequests.leaderboardId, getRequests.count);
156159

157160
if (!string.IsNullOrEmpty(getRequests.after))
158161
{
159162
tempEndpoint = requestEndPoint.endPoint + "&after={2}";
160-
endPoint = string.Format(tempEndpoint, getRequests.leaderboardId, int.Parse(getRequests.count), int.Parse(getRequests.after));
163+
endPoint = string.Format(tempEndpoint, getRequests.leaderboardId, getRequests.count, int.Parse(getRequests.after));
161164
}
162165

163166
LootLockerServerRequest.CallAPI(endPoint, requestEndPoint.httpMethod, null, (serverResponse) =>

0 commit comments

Comments
 (0)