Skip to content

Commit 7e74289

Browse files
Erik Bylundkirre-bylund
authored andcommitted
Removed all deprecated code in the SDK
1 parent 6ddf4f2 commit 7e74289

14 files changed

+26
-741
lines changed

Runtime/Client/LootLockerServerRequest.cs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -143,24 +143,6 @@ public class LootLockerResponse
143143
/// </summary>
144144
public LootLockerErrorData errorData { get; set; }
145145

146-
/// <summary>
147-
/// TRUE if http error OR server returns an error status
148-
/// </summary>
149-
[Obsolete("This property is deprecated, use success instead")]
150-
public bool hasError { get { return !success; } }
151-
152-
/// <summary>
153-
/// If the request was not a success this property will hold any error messages
154-
/// </summary>
155-
[Obsolete("This property is deprecated, replaced by the errorData.message property")]
156-
public string Error { get { return errorData?.message; } }
157-
158-
/// <summary>
159-
/// A texture downloaded in the webrequest, if applicable, otherwise this will be null.
160-
/// </summary>
161-
[Obsolete("This property is deprecated")]
162-
public Texture2D texture { get; set; }
163-
164146
/// <summary>
165147
/// inheritdoc added this because unity main thread executing style cut the calling stack and make the event orphan see also calling multiple events
166148
/// of the same type makes use unable to identify each one
@@ -497,7 +479,7 @@ public static void CallDomainAuthAPI(string endPoint, LootLockerHTTPMethod httpM
497479
Dictionary<string, string> headers = new Dictionary<string, string>();
498480
headers.Add("domain-key", LootLockerConfig.current.domainKey);
499481

500-
if((!LootLockerConfig.current.IsPrefixedApiKey() && LootLockerConfig.current.developmentMode) || LootLockerConfig.current.apiKey.StartsWith("dev_"))
482+
if(LootLockerConfig.current.apiKey.StartsWith("dev_"))
501483
{
502484
headers.Add("is-development", "true");
503485
}

Runtime/Editor/ProjectSettings.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,6 @@ private void DrawGameSettings()
7979
gameSettings.apiKey = m_CustomSettings.FindProperty("apiKey").stringValue;
8080
}
8181

82-
bool deprecatedApiKey = !gameSettings.IsPrefixedApiKey();
83-
if (deprecatedApiKey)
84-
{
85-
EditorGUILayout.HelpBox(
86-
"WARNING: this is a legacy API Key, please visit https://console.lootlocker.com/settings/api-keys and generate a new one",
87-
MessageType.Warning, false);
88-
}
89-
9082
var content = new GUIContent();
9183
content.text = "API key can be found in `Settings > API Keys` in the Web Console: https://console.lootlocker.com/settings/api-keys";
9284
EditorGUILayout.HelpBox(content, false);
@@ -129,19 +121,6 @@ private void DrawGameSettings()
129121
gameSettings.allowTokenRefresh = m_CustomSettings.FindProperty("allowTokenRefresh").boolValue;
130122
}
131123
EditorGUILayout.Space();
132-
133-
if (deprecatedApiKey)
134-
{
135-
EditorGUI.BeginChangeCheck();
136-
EditorGUILayout.PropertyField(m_CustomSettings.FindProperty("developmentMode"));
137-
138-
if (EditorGUI.EndChangeCheck())
139-
{
140-
gameSettings.developmentMode = m_CustomSettings.FindProperty("developmentMode").boolValue;
141-
}
142-
143-
EditorGUILayout.Space();
144-
}
145124
}
146125

147126
[SettingsProvider]

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 10 additions & 357 deletions
Large diffs are not rendered by default.

Runtime/Game/Platforms/PlatformManager.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -125,30 +125,6 @@ public static PlatformRepresentation GetPlatformRepresentation(Platforms platfor
125125
};
126126
}
127127

128-
// TODO: Deprecated, remove in version 1.2.0
129-
public static void Set(LootLockerConfig.platformType platform)
130-
{
131-
switch (platform)
132-
{
133-
case LootLockerConfig.platformType.Android:
134-
Set(Platforms.Android);
135-
break;
136-
case LootLockerConfig.platformType.iOS:
137-
Set(Platforms.AppleSignIn);
138-
break;
139-
case LootLockerConfig.platformType.Steam:
140-
Set(Platforms.Steam);
141-
break;
142-
case LootLockerConfig.platformType.PlayStationNetwork:
143-
Set(Platforms.PlayStationNetwork);
144-
break;
145-
case LootLockerConfig.platformType.Unused:
146-
default:
147-
Set(Platforms.None);
148-
break;
149-
}
150-
}
151-
152128

153129
#if UNITY_EDITOR
154130
[InitializeOnEnterPlayMode]

Runtime/Game/Requests/AssetRequest.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,6 @@ public class LootLockerFavouritesListResponse : LootLockerResponse
183183
public int[] favourites { get; set; }
184184
}
185185

186-
[Obsolete("This class is deprecated and will be removed at a later stage. Please use LootLockerActivateRentalAssetResponse instead")]
187-
public class LootLockerActivateARentalAssetResponse : LootLockerResponse
188-
{
189-
public int time_left { get; set; }
190-
}
191-
192186
public class LootLockerActivateRentalAssetResponse : LootLockerResponse
193187
{
194188
public int time_left { get; set; }

Runtime/Game/Requests/CollectableRequest.cs

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ public class LootLockerGetCollectablesResponse : LootLockerResponse
1111
public LootLockerCollectable[] collectables { get; set; }
1212
}
1313

14-
[Obsolete("This class is deprecated and will be removed at a later stage. Please use LootLockerGetCollectablesResponse instead")]
15-
public class LootLockerGettingCollectablesResponse : LootLockerResponse
16-
{
17-
public LootLockerCollectable[] collectables { get; set; }
18-
}
19-
2014
public class LootLockerCollectable
2115
{
2216
public string name { get; set; }
@@ -62,19 +56,6 @@ public class LootLockerCollectingAnItemRequest
6256
public string slug { get; set; }
6357
}
6458

65-
[Obsolete("This class is deprecated and will be removed at a later stage. Please use LootLockerCollectItemResponse instead")]
66-
public class LootLockerCollectingAnItemResponse : LootLockerResponse
67-
{
68-
public LootLockerCollectable[] collectables { get; set; }
69-
70-
public LootLockerCollectable mainCollectable { get; set; }
71-
72-
public LootLockerGroup mainGroup { get; set; }
73-
74-
public LootLockerItem mainItem { get; set; }
75-
76-
}
77-
7859
public class LootLockerCollectItemResponse : LootLockerResponse
7960
{
8061
public LootLockerCollectable[] collectables { get; set; }
@@ -103,17 +84,6 @@ public static void GetCollectables(Action<LootLockerGetCollectablesResponse> onC
10384
});
10485
}
10586

106-
[Obsolete("This function is deprecated and will be removed soon. Please use the function GetCollectables() instead")]
107-
public static void GettingCollectables(Action<LootLockerGettingCollectablesResponse> onComplete)
108-
{
109-
EndPointClass endPoint = LootLockerEndPoints.gettingCollectables;
110-
111-
LootLockerServerRequest.CallAPI(endPoint.endPoint, endPoint.httpMethod, "", (serverResponse) =>
112-
{
113-
onComplete?.Invoke(LootLockerResponse.Deserialize<LootLockerGettingCollectablesResponse>(serverResponse));
114-
}, true);
115-
}
116-
11787
public static void CollectItem(LootLockerCollectingAnItemRequest data, Action<LootLockerCollectItemResponse> onComplete)
11888
{
11989
if(data == null)
@@ -150,43 +120,5 @@ public static void CollectItem(LootLockerCollectingAnItemRequest data, Action<Lo
150120
onComplete?.Invoke(response);
151121
}, true);
152122
}
153-
154-
[Obsolete("This function is deprecated and will be removed soon. Please use the function CollectItem() instead")]
155-
public static void CollectingAnItem(LootLockerCollectingAnItemRequest data, Action<LootLockerCollectingAnItemResponse> onComplete)
156-
{
157-
if(data == null)
158-
{
159-
onComplete?.Invoke(LootLockerResponseFactory.InputUnserializableError<LootLockerCollectingAnItemResponse>());
160-
return;
161-
}
162-
163-
string json = LootLockerJson.SerializeObject(data);
164-
165-
EndPointClass endPoint = LootLockerEndPoints.collectingAnItem;
166-
167-
LootLockerServerRequest.CallAPI(endPoint.endPoint, endPoint.httpMethod, json, (serverResponse) =>
168-
{
169-
LootLockerCollectingAnItemResponse response = new LootLockerCollectingAnItemResponse();
170-
if (serverResponse.success)
171-
{
172-
response = LootLockerJson.DeserializeObject<LootLockerCollectingAnItemResponse>(serverResponse.text);
173-
string[] collectableStrings = data.slug.Split('.');
174-
175-
string collectable = collectableStrings[0];
176-
string group = collectableStrings[1];
177-
string item = collectableStrings[2];
178-
179-
response.mainCollectable = response.collectables?.FirstOrDefault(x => x.name == collectable);
180-
response.mainGroup = response.mainCollectable?.groups?.FirstOrDefault(x => x.name == group);
181-
response.mainItem = response.mainGroup?.items?.FirstOrDefault(x => x.name == item);
182-
}
183-
184-
response.text = serverResponse.text;
185-
response.success = serverResponse.success;
186-
response.errorData = serverResponse.errorData;
187-
response.statusCode = serverResponse.statusCode;
188-
onComplete?.Invoke(response);
189-
}, true);
190-
}
191123
}
192124
}

0 commit comments

Comments
 (0)