@@ -77,6 +77,19 @@ public class LootLockerLevel_Thresholds
77
77
public int next { get ; set ; }
78
78
public bool next_is_prestige { get ; set ; }
79
79
}
80
+
81
+ [ System . Serializable ]
82
+ public class LootLockerNintendoSwitchSessionRequest : LootLockerGetRequest
83
+ {
84
+ public string game_key => LootLockerConfig . current . apiKey ? . ToString ( ) ;
85
+ public string nsa_id_token { get ; private set ; }
86
+ public string game_version => LootLockerConfig . current . game_version ;
87
+ public bool development_mode => LootLockerConfig . current . developmentMode ;
88
+ public LootLockerNintendoSwitchSessionRequest ( string nsa_id_token )
89
+ {
90
+ this . nsa_id_token = nsa_id_token ;
91
+ }
92
+ }
80
93
}
81
94
82
95
namespace LootLocker
@@ -160,6 +173,34 @@ public static void GuestSession(LootLockerGetRequest data, Action<LootLockerGues
160
173
} , false ) ;
161
174
}
162
175
176
+ public static void NintendoSwitchSession ( LootLockerNintendoSwitchSessionRequest data , Action < LootLockerSessionResponse > onComplete )
177
+ {
178
+ EndPointClass endPoint = LootLockerEndPoints . nintendoSwitchSessionRequest ;
179
+
180
+ string json = "" ;
181
+ if ( data == null )
182
+ {
183
+ return ;
184
+ }
185
+
186
+ json = JsonConvert . SerializeObject ( data ) ;
187
+ LootLockerServerRequest . CallAPI ( endPoint . endPoint , endPoint . httpMethod , json , ( serverResponse ) =>
188
+ {
189
+ LootLockerSessionResponse response = new LootLockerSessionResponse ( ) ;
190
+ if ( string . IsNullOrEmpty ( serverResponse . Error ) )
191
+ {
192
+ response = JsonConvert . DeserializeObject < LootLockerSessionResponse > ( serverResponse . text ) ;
193
+ LootLockerConfig . current . UpdateToken ( response . session_token , ( data as LootLockerSessionRequest ) ? . player_identifier ) ;
194
+ }
195
+
196
+ response . text = serverResponse . text ;
197
+ response . success = serverResponse . success ;
198
+ response . Error = serverResponse . Error ; response . statusCode = serverResponse . statusCode ;
199
+ onComplete ? . Invoke ( response ) ;
200
+
201
+ } , false ) ;
202
+ }
203
+
163
204
public static void EndSession ( LootLockerGetRequest data , Action < LootLockerSessionResponse > onComplete )
164
205
{
165
206
EndPointClass endPoint = LootLockerEndPoints . endingSession ;
0 commit comments