Skip to content

Commit e3b17d5

Browse files
kirre-bylundkristijan-ujevic
authored andcommitted
Make 'Other character' methods use player id as intended
1 parent 1967297 commit e3b17d5

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,11 +1962,22 @@ public static void GetCharacterLoadout(Action<LootLockerCharacterLoadoutResponse
19621962
}
19631963

19641964
/// <summary>
1965-
/// Get a character loadout from a specific characterID.
1965+
/// Get a character loadout from a specific player on the current platform.
19661966
/// </summary>
1967-
/// <param name="characterID">ID of the character</param>
1967+
/// <param name="player_id">ID of the player</param>
1968+
/// <param name="onComplete">onComplete Action for handling the response of type LootLockerCharacterLoadoutResponse</param>
1969+
public static void GetOtherPlayersCharacterLoadout(string player_id, Action<LootLockerCharacterLoadoutResponse> onComplete)
1970+
{
1971+
GetOtherPlayersCharacterLoadout(player_id, CurrentPlatform.Get(), onComplete);
1972+
}
1973+
1974+
/// <summary>
1975+
/// Get a character loadout from a specific player and platform
1976+
/// </summary>
1977+
/// <param name="player_id">ID of the player</param>
1978+
/// <param name="platform">The platform that the ID of the player is for</param>
19681979
/// <param name="onComplete">onComplete Action for handling the response of type LootLockerCharacterLoadoutResponse</param>
1969-
public static void GetOtherPlayersCharacterLoadout(string characterID, Action<LootLockerCharacterLoadoutResponse> onComplete)
1980+
public static void GetOtherPlayersCharacterLoadout(string player_id, Platforms platform, Action<LootLockerCharacterLoadoutResponse> onComplete)
19701981
{
19711982
if (!CheckInitialized())
19721983
{
@@ -1975,8 +1986,8 @@ public static void GetOtherPlayersCharacterLoadout(string characterID, Action<Lo
19751986
}
19761987
LootLockerGetRequest data = new LootLockerGetRequest();
19771988

1978-
data.getRequests.Add(characterID);
1979-
data.getRequests.Add(CurrentPlatform.GetString());
1989+
data.getRequests.Add(player_id);
1990+
data.getRequests.Add(CurrentPlatform.GetPlatformRepresentation(platform).PlatformString);
19801991
LootLockerAPIManager.GetOtherPlayersCharacterLoadout(data, onComplete);
19811992
}
19821993

@@ -2162,19 +2173,30 @@ public static void GetCurrentLoadOutToDefaultCharacter(Action<LootLockerGetCurre
21622173
}
21632174

21642175
/// <summary>
2165-
/// Get the loadout for a specific character.
2176+
/// Get the current loadout for the default character of the specified player on the current platform
21662177
/// </summary>
2167-
/// <param name="characterID">ID of the character to get the loadout for</param>
2178+
/// <param name="playerID">ID of the player to get the loadout for</param>
21682179
/// <param name="onComplete">onComplete Action for handling the response of type LootLockerGetCurrentLoadouttoDefaultCharacterResponse</param>
2169-
public static void GetCurrentLoadOutToOtherCharacter(string characterID, Action<LootLockerGetCurrentLoadouttoDefaultCharacterResponse> onComplete)
2180+
public static void GetCurrentLoadOutToOtherCharacter(string playerID, Action<LootLockerGetCurrentLoadouttoDefaultCharacterResponse> onComplete)
2181+
{
2182+
GetCurrentLoadOutToOtherCharacter(playerID, CurrentPlatform.Get(), onComplete);
2183+
}
2184+
2185+
/// <summary>
2186+
/// Get the current loadout for the default character of the specified player and platform
2187+
/// </summary>
2188+
/// <param name="playerID">ID of the player to get the loadout for</param>
2189+
/// <param name="platform">The platform that the ID of the player is for</param>
2190+
/// <param name="onComplete">onComplete Action for handling the response of type LootLockerGetCurrentLoadouttoDefaultCharacterResponse</param>
2191+
public static void GetCurrentLoadOutToOtherCharacter(string playerID, Platforms platform, Action<LootLockerGetCurrentLoadouttoDefaultCharacterResponse> onComplete)
21702192
{
21712193
if (!CheckInitialized())
21722194
{
21732195
onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerGetCurrentLoadouttoDefaultCharacterResponse>());
21742196
}
21752197
LootLockerGetRequest lootLockerGetRequest = new LootLockerGetRequest();
2176-
lootLockerGetRequest.getRequests.Add(characterID);
2177-
lootLockerGetRequest.getRequests.Add(CurrentPlatform.GetString());
2198+
lootLockerGetRequest.getRequests.Add(playerID);
2199+
lootLockerGetRequest.getRequests.Add(CurrentPlatform.GetPlatformRepresentation(platform).PlatformString);
21782200
LootLockerAPIManager.GetCurrentLoadOutToOtherCharacter(lootLockerGetRequest, onComplete);
21792201
}
21802202

Runtime/Game/Requests/CharacterRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ public static void GetCurrentLoadOutToDefaultCharacter(Action<LootLockerGetCurre
286286

287287
public static void GetCurrentLoadOutToOtherCharacter(LootLockerGetRequest lootLockerGetRequest, Action<LootLockerGetCurrentLoadouttoDefaultCharacterResponse> onComplete)
288288
{
289-
EndPointClass endPoint = LootLockerEndPoints.getOtherPlayersCharacterLoadouts;
289+
EndPointClass endPoint = LootLockerEndPoints.getOtherPlayersLoadoutToDefaultCharacter;
290290

291-
string getVariable = string.Format(endPoint.endPoint, lootLockerGetRequest.getRequests[0]);
291+
string getVariable = string.Format(endPoint.endPoint, lootLockerGetRequest.getRequests[0], lootLockerGetRequest.getRequests[1]);
292292

293293
LootLockerServerRequest.CallAPI(getVariable, endPoint.httpMethod, null, (serverResponse) => { LootLockerResponse.Deserialize(onComplete, serverResponse); });
294294
}

0 commit comments

Comments
 (0)