@@ -90,6 +90,18 @@ public LootLockerNintendoSwitchSessionRequest(string nsa_id_token)
90
90
this . nsa_id_token = nsa_id_token ;
91
91
}
92
92
}
93
+
94
+ public class LootLockerXboxOneSessionRequest : LootLockerGetRequest
95
+ {
96
+ public string game_key => LootLockerConfig . current . apiKey ? . ToString ( ) ;
97
+ public string xbox_user_token { get ; private set ; }
98
+ public string game_version => LootLockerConfig . current . game_version ;
99
+ public bool development_mode => LootLockerConfig . current . developmentMode ;
100
+ public LootLockerXboxOneSessionRequest ( string xbox_user_token )
101
+ {
102
+ this . xbox_user_token = xbox_user_token ;
103
+ }
104
+ }
93
105
}
94
106
95
107
namespace LootLocker
@@ -201,6 +213,34 @@ public static void NintendoSwitchSession(LootLockerNintendoSwitchSessionRequest
201
213
} , false ) ;
202
214
}
203
215
216
+ public static void XboxOneSession ( LootLockerXboxOneSessionRequest data , Action < LootLockerSessionResponse > onComplete )
217
+ {
218
+ EndPointClass endPoint = LootLockerEndPoints . xboxSessionRequest ;
219
+
220
+ string json = "" ;
221
+ if ( data == null )
222
+ {
223
+ return ;
224
+ }
225
+
226
+ json = JsonConvert . SerializeObject ( data ) ;
227
+ LootLockerServerRequest . CallAPI ( endPoint . endPoint , endPoint . httpMethod , json , ( serverResponse ) =>
228
+ {
229
+ LootLockerSessionResponse response = new LootLockerSessionResponse ( ) ;
230
+ if ( string . IsNullOrEmpty ( serverResponse . Error ) )
231
+ {
232
+ response = JsonConvert . DeserializeObject < LootLockerSessionResponse > ( serverResponse . text ) ;
233
+ LootLockerConfig . current . UpdateToken ( response . session_token , "" ) ;
234
+ }
235
+
236
+ response . text = serverResponse . text ;
237
+ response . success = serverResponse . success ;
238
+ response . Error = serverResponse . Error ; response . statusCode = serverResponse . statusCode ;
239
+ onComplete ? . Invoke ( response ) ;
240
+
241
+ } , false ) ;
242
+ }
243
+
204
244
public static void EndSession ( LootLockerGetRequest data , Action < LootLockerSessionResponse > onComplete )
205
245
{
206
246
EndPointClass endPoint = LootLockerEndPoints . endingSession ;
0 commit comments