@@ -103,6 +103,12 @@ public class LootLockerAppleSessionResponse : LootLockerSessionResponse
103
103
public string refresh_token { get ; set ; }
104
104
}
105
105
106
+ [ System . Serializable ]
107
+ public class LootLockerEpicSessionResponse : LootLockerSessionResponse
108
+ {
109
+ public string refresh_token { get ; set ; }
110
+ }
111
+
106
112
[ System . Serializable ]
107
113
public class LootLockerLevel_Thresholds
108
114
{
@@ -125,6 +131,32 @@ public LootLockerNintendoSwitchSessionRequest(string nsa_id_token)
125
131
}
126
132
}
127
133
134
+ [ System . Serializable ]
135
+ public class LootLockerEpicSessionRequest : LootLockerGetRequest
136
+ {
137
+ public string game_key => LootLockerConfig . current . apiKey ? . ToString ( ) ;
138
+ public string id_token { get ; private set ; }
139
+ public string game_version => LootLockerConfig . current . game_version ;
140
+
141
+ public LootLockerEpicSessionRequest ( string id_token )
142
+ {
143
+ this . id_token = id_token ;
144
+ }
145
+ }
146
+
147
+ [ System . Serializable ]
148
+ public class LootLockerEpicRefreshSessionRequest : LootLockerGetRequest
149
+ {
150
+ public string game_key => LootLockerConfig . current . apiKey ? . ToString ( ) ;
151
+ public string refresh_token { get ; private set ; }
152
+ public string game_version => LootLockerConfig . current . game_version ;
153
+
154
+ public LootLockerEpicRefreshSessionRequest ( string refresh_token )
155
+ {
156
+ this . refresh_token = refresh_token ;
157
+ }
158
+ }
159
+
128
160
public class LootLockerXboxOneSessionRequest : LootLockerGetRequest
129
161
{
130
162
public string game_key => LootLockerConfig . current . apiKey ? . ToString ( ) ;
@@ -310,13 +342,51 @@ public static void NintendoSwitchSession(LootLockerNintendoSwitchSessionRequest
310
342
LootLockerConfig . AddDevelopmentModeFieldToJsonStringIfNeeded ( ref json ) ; // TODO: Deprecated, remove in version 1.2.0
311
343
LootLockerServerRequest . CallAPI ( endPoint . endPoint , endPoint . httpMethod , json , ( serverResponse ) =>
312
344
{
313
- var response = LootLockerResponse . Deserialize < LootLockerGuestSessionResponse > ( serverResponse ) ;
345
+ var response = LootLockerResponse . Deserialize < LootLockerSessionResponse > ( serverResponse ) ;
314
346
LootLockerConfig . current . token = response . session_token ;
315
347
LootLockerConfig . current . deviceID = "" ;
316
348
onComplete ? . Invoke ( response ) ;
317
349
} , false ) ;
318
350
}
319
351
352
+ public static void EpicSession ( LootLockerEpicSessionRequest data , Action < LootLockerEpicSessionResponse > onComplete )
353
+ {
354
+ if ( data == null )
355
+ {
356
+ onComplete ? . Invoke ( LootLockerResponseFactory . InputUnserializableError < LootLockerEpicSessionResponse > ( ) ) ;
357
+ return ;
358
+ }
359
+
360
+ string json = JsonConvert . SerializeObject ( data ) ;
361
+ EpicSession ( json , onComplete ) ;
362
+ }
363
+
364
+ public static void EpicSession ( LootLockerEpicRefreshSessionRequest data , Action < LootLockerEpicSessionResponse > onComplete )
365
+ {
366
+ if ( data == null )
367
+ {
368
+ onComplete ? . Invoke ( LootLockerResponseFactory . InputUnserializableError < LootLockerEpicSessionResponse > ( ) ) ;
369
+ return ;
370
+ }
371
+
372
+ string json = JsonConvert . SerializeObject ( data ) ;
373
+ EpicSession ( json , onComplete ) ;
374
+ }
375
+
376
+ private static void EpicSession ( string json , Action < LootLockerEpicSessionResponse > onComplete )
377
+ {
378
+ EndPointClass endPoint = LootLockerEndPoints . epicSessionRequest ;
379
+ LootLockerConfig . AddDevelopmentModeFieldToJsonStringIfNeeded ( ref json ) ; // TODO: Deprecated, remove in version 1.2.0
380
+ LootLockerServerRequest . CallAPI ( endPoint . endPoint , endPoint . httpMethod , json , ( serverResponse ) =>
381
+ {
382
+ var response = LootLockerResponse . Deserialize < LootLockerEpicSessionResponse > ( serverResponse ) ;
383
+ LootLockerConfig . current . token = response . session_token ;
384
+ LootLockerConfig . current . refreshToken = response . refresh_token ;
385
+ LootLockerConfig . current . deviceID = "" ;
386
+ onComplete ? . Invoke ( response ) ;
387
+ } , false ) ;
388
+ }
389
+
320
390
public static void XboxOneSession ( LootLockerXboxOneSessionRequest data , Action < LootLockerSessionResponse > onComplete )
321
391
{
322
392
EndPointClass endPoint = LootLockerEndPoints . xboxSessionRequest ;
0 commit comments