raspberry_games_server_game_logic 1.8.307 → 1.8.309
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Kosi-Kaverit-kaverit.js +56 -56
- package/Kosi-Kodein-kodein-di.js +511 -511
- package/Kotlin-DateTime-library-kotlinx-datetime.js +1 -1
- package/Logic_Debertz-core.js +1050 -1050
- package/Logic_Debertz-engine.js +11026 -11019
- package/Logic_Debertz-engine.js.map +1 -1
- package/Logic_Debertz-game_server.js +863 -863
- package/kotlinx-coroutines-core.js +7 -7
- package/kotlinx-coroutines-core.js.map +1 -1
- package/kotlinx-io-kotlinx-io-core.js +311 -311
- package/package.json +1 -1
- package/raspberry-cardgame-lib-core.js +168 -168
- package/raspberry-cardgame-lib-random.js +324 -222
- package/raspberry-cardgame-lib-random.js.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports', './kotlin-kotlin-stdlib.js', './kotlinx-serialization-kotlinx-serialization-core.js', './kotlinx-serialization-kotlinx-serialization-json.js', './ktor-ktor-client-core.js', './ktor-ktor-utils.js', './ktor-ktor-http.js', './kotlinx-
|
|
3
|
+
define(['exports', './kotlin-kotlin-stdlib.js', './kotlinx-serialization-kotlinx-serialization-core.js', './kotlinx-serialization-kotlinx-serialization-json.js', './ktor-ktor-client-core.js', './ktor-ktor-utils.js', './ktor-ktor-http.js', './Kotlin-DateTime-library-kotlinx-datetime.js', './kotlinx-coroutines-core.js', './uuid.js', './ktor-ktor-client-logging.js', './ktor-ktor-serialization-kotlinx-json.js', './ktor-ktor-client-content-negotiation.js', './secure-random-secure-random.js', './raspberry-cardgame-lib-logger.js'], factory);
|
|
4
4
|
else if (typeof exports === 'object')
|
|
5
|
-
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js'), require('./kotlinx-serialization-kotlinx-serialization-json.js'), require('./ktor-ktor-client-core.js'), require('./ktor-ktor-utils.js'), require('./ktor-ktor-http.js'), require('./kotlinx-
|
|
5
|
+
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js'), require('./kotlinx-serialization-kotlinx-serialization-json.js'), require('./ktor-ktor-client-core.js'), require('./ktor-ktor-utils.js'), require('./ktor-ktor-http.js'), require('./Kotlin-DateTime-library-kotlinx-datetime.js'), require('./kotlinx-coroutines-core.js'), require('./uuid.js'), require('./ktor-ktor-client-logging.js'), require('./ktor-ktor-serialization-kotlinx-json.js'), require('./ktor-ktor-client-content-negotiation.js'), require('./secure-random-secure-random.js'), require('./raspberry-cardgame-lib-logger.js'));
|
|
6
6
|
else {
|
|
7
7
|
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
8
|
throw new Error("Error loading module 'raspberry-cardgame-lib-random'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'raspberry-cardgame-lib-random'.");
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
if (typeof globalThis['ktor-ktor-http'] === 'undefined') {
|
|
23
23
|
throw new Error("Error loading module 'raspberry-cardgame-lib-random'. Its dependency 'ktor-ktor-http' was not found. Please, check whether 'ktor-ktor-http' is loaded prior to 'raspberry-cardgame-lib-random'.");
|
|
24
24
|
}
|
|
25
|
+
if (typeof globalThis['Kotlin-DateTime-library-kotlinx-datetime'] === 'undefined') {
|
|
26
|
+
throw new Error("Error loading module 'raspberry-cardgame-lib-random'. Its dependency 'Kotlin-DateTime-library-kotlinx-datetime' was not found. Please, check whether 'Kotlin-DateTime-library-kotlinx-datetime' is loaded prior to 'raspberry-cardgame-lib-random'.");
|
|
27
|
+
}
|
|
25
28
|
if (typeof globalThis['kotlinx-coroutines-core'] === 'undefined') {
|
|
26
29
|
throw new Error("Error loading module 'raspberry-cardgame-lib-random'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'raspberry-cardgame-lib-random'.");
|
|
27
30
|
}
|
|
28
31
|
if (typeof uuid === 'undefined') {
|
|
29
32
|
throw new Error("Error loading module 'raspberry-cardgame-lib-random'. Its dependency 'uuid' was not found. Please, check whether 'uuid' is loaded prior to 'raspberry-cardgame-lib-random'.");
|
|
30
33
|
}
|
|
31
|
-
if (typeof globalThis['Kotlin-DateTime-library-kotlinx-datetime'] === 'undefined') {
|
|
32
|
-
throw new Error("Error loading module 'raspberry-cardgame-lib-random'. Its dependency 'Kotlin-DateTime-library-kotlinx-datetime' was not found. Please, check whether 'Kotlin-DateTime-library-kotlinx-datetime' is loaded prior to 'raspberry-cardgame-lib-random'.");
|
|
33
|
-
}
|
|
34
34
|
if (typeof globalThis['ktor-ktor-client-logging'] === 'undefined') {
|
|
35
35
|
throw new Error("Error loading module 'raspberry-cardgame-lib-random'. Its dependency 'ktor-ktor-client-logging' was not found. Please, check whether 'ktor-ktor-client-logging' is loaded prior to 'raspberry-cardgame-lib-random'.");
|
|
36
36
|
}
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
if (typeof globalThis['raspberry-cardgame-lib-logger'] === 'undefined') {
|
|
47
47
|
throw new Error("Error loading module 'raspberry-cardgame-lib-random'. Its dependency 'raspberry-cardgame-lib-logger' was not found. Please, check whether 'raspberry-cardgame-lib-logger' is loaded prior to 'raspberry-cardgame-lib-random'.");
|
|
48
48
|
}
|
|
49
|
-
globalThis['raspberry-cardgame-lib-random'] = factory(typeof globalThis['raspberry-cardgame-lib-random'] === 'undefined' ? {} : globalThis['raspberry-cardgame-lib-random'], globalThis['kotlin-kotlin-stdlib'], globalThis['kotlinx-serialization-kotlinx-serialization-core'], globalThis['kotlinx-serialization-kotlinx-serialization-json'], globalThis['ktor-ktor-client-core'], globalThis['ktor-ktor-utils'], globalThis['ktor-ktor-http'], globalThis['kotlinx-
|
|
49
|
+
globalThis['raspberry-cardgame-lib-random'] = factory(typeof globalThis['raspberry-cardgame-lib-random'] === 'undefined' ? {} : globalThis['raspberry-cardgame-lib-random'], globalThis['kotlin-kotlin-stdlib'], globalThis['kotlinx-serialization-kotlinx-serialization-core'], globalThis['kotlinx-serialization-kotlinx-serialization-json'], globalThis['ktor-ktor-client-core'], globalThis['ktor-ktor-utils'], globalThis['ktor-ktor-http'], globalThis['Kotlin-DateTime-library-kotlinx-datetime'], globalThis['kotlinx-coroutines-core'], uuid, globalThis['ktor-ktor-client-logging'], globalThis['ktor-ktor-serialization-kotlinx-json'], globalThis['ktor-ktor-client-content-negotiation'], globalThis['secure-random-secure-random'], globalThis['raspberry-cardgame-lib-logger']);
|
|
50
50
|
}
|
|
51
|
-
}(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json, kotlin_io_ktor_ktor_client_core, kotlin_io_ktor_ktor_utils, kotlin_io_ktor_ktor_http, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_com_benasher44_uuid,
|
|
51
|
+
}(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json, kotlin_io_ktor_ktor_client_core, kotlin_io_ktor_ktor_utils, kotlin_io_ktor_ktor_http, kotlin_org_jetbrains_kotlinx_kotlinx_datetime, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_com_benasher44_uuid, kotlin_io_ktor_ktor_client_logging, kotlin_io_ktor_ktor_serialization_kotlinx_json, kotlin_io_ktor_ktor_client_content_negotiation, kotlin_org_kotlincrypto_secure_random, kotlin_io_raspberryapps_cardgame_logger) {
|
|
52
52
|
'use strict';
|
|
53
53
|
//region block: imports
|
|
54
54
|
var imul = Math.imul;
|
|
@@ -118,15 +118,15 @@
|
|
|
118
118
|
var toMutableMap = kotlin_kotlin.$_$.y9;
|
|
119
119
|
var toMap = kotlin_kotlin.$_$.v9;
|
|
120
120
|
var get_lastIndex = kotlin_kotlin.$_$.i8;
|
|
121
|
+
var System_instance = kotlin_org_jetbrains_kotlinx_kotlinx_datetime.$_$.b;
|
|
122
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.s1;
|
|
121
123
|
var withContext = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.f;
|
|
122
124
|
var uuid4 = kotlin_com_benasher44_uuid.$_$.a;
|
|
123
125
|
var Result = kotlin_kotlin.$_$.qg;
|
|
124
126
|
var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h1;
|
|
125
|
-
var System_instance = kotlin_org_jetbrains_kotlinx_kotlinx_datetime.$_$.b;
|
|
126
127
|
var Companion_instance = kotlin_kotlin.$_$.k5;
|
|
127
128
|
var createFailure = kotlin_kotlin.$_$.ih;
|
|
128
129
|
var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.f3;
|
|
129
|
-
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.s1;
|
|
130
130
|
var initMetadataForLambda = kotlin_kotlin.$_$.yb;
|
|
131
131
|
var Duration__compareTo_impl_pchp0f = kotlin_kotlin.$_$.n2;
|
|
132
132
|
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.w;
|
|
@@ -208,10 +208,10 @@
|
|
|
208
208
|
initMetadataForClass(RandomPoolValue, 'RandomPoolValue');
|
|
209
209
|
initMetadataForCompanion(Companion_9);
|
|
210
210
|
initMetadataForLambda(RandomPoolProviderImpl$getCardDeck$slambda, CoroutineImpl, VOID, [1]);
|
|
211
|
+
initMetadataForLambda(RandomPoolProviderImpl$prefetchCardDecks$slambda, CoroutineImpl, VOID, [1]);
|
|
211
212
|
initMetadataForLambda(RandomPoolProviderImpl$requestNewPool$slambda, CoroutineImpl, VOID, [1]);
|
|
212
|
-
initMetadataForCoroutine($
|
|
213
|
-
initMetadataForCoroutine($
|
|
214
|
-
initMetadataForCoroutine($getPreparedOrRequestPoolCOROUTINE$5, CoroutineImpl);
|
|
213
|
+
initMetadataForCoroutine($getOrLoadGameCardDeckDataCOROUTINE$3, CoroutineImpl);
|
|
214
|
+
initMetadataForCoroutine($getPreparedOrRequestPoolCOROUTINE$4, CoroutineImpl);
|
|
215
215
|
initMetadataForClass(RandomPoolProviderImpl, 'RandomPoolProviderImpl', VOID, VOID, [RandomPoolProvider], [7, 5]);
|
|
216
216
|
initMetadataForClass(ApiCommonConfigs$setupLogging$1$1);
|
|
217
217
|
initMetadataForObject(ApiCommonConfigs, 'ApiCommonConfigs');
|
|
@@ -2235,14 +2235,54 @@
|
|
|
2235
2235
|
return false;
|
|
2236
2236
|
return true;
|
|
2237
2237
|
};
|
|
2238
|
+
function getExceptionIfCooldown($this) {
|
|
2239
|
+
var failedAttemptTime = $this.o5r_1;
|
|
2240
|
+
var currentTime = System_instance.m55();
|
|
2241
|
+
if (!(failedAttemptTime == null) && $this.p5r_1 >= $this.g5r_1.failedRequestAttempts) {
|
|
2242
|
+
var allowedRequestTime = failedAttemptTime.a5l($this.g5r_1.failedAttemptCooldown);
|
|
2243
|
+
if (allowedRequestTime.e5l(currentTime) > 0) {
|
|
2244
|
+
var exception = new RandomException(VOID, 'getCardDeck: cooldown ends in ' + allowedRequestTime.toString() + ', ' + ('failedAttemptTime = ' + toString_0(failedAttemptTime) + ', ') + ('currentTime = ' + currentTime.toString()));
|
|
2245
|
+
return exception;
|
|
2246
|
+
} else {
|
|
2247
|
+
$this.o5r_1 = null;
|
|
2248
|
+
$this.p5r_1 = 0;
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
return null;
|
|
2252
|
+
}
|
|
2253
|
+
function mapToRandomExceptionIfError($this, error) {
|
|
2254
|
+
$this.o5r_1 = System_instance.m55();
|
|
2255
|
+
$this.p5r_1 = $this.p5r_1 + 1 | 0;
|
|
2256
|
+
var tmp = 'getCardDeck: error message = ' + error.message + ', ';
|
|
2257
|
+
// Inline function 'kotlin.requireNotNull' call
|
|
2258
|
+
var value = $this.o5r_1;
|
|
2259
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2260
|
+
var tmp$ret$1;
|
|
2261
|
+
$l$block: {
|
|
2262
|
+
// Inline function 'kotlin.requireNotNull' call
|
|
2263
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2264
|
+
if (value == null) {
|
|
2265
|
+
// Inline function 'kotlin.requireNotNull.<anonymous>' call
|
|
2266
|
+
var message = 'Required value was null.';
|
|
2267
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
2268
|
+
} else {
|
|
2269
|
+
tmp$ret$1 = value;
|
|
2270
|
+
break $l$block;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
var tmp$ret$2 = tmp$ret$1;
|
|
2274
|
+
var randomException = new RandomException(VOID, tmp + ('cooldown ends in ' + tmp$ret$2.a5l($this.g5r_1.failedAttemptCooldown).toString() + ', ') + ('currentTime = ' + toString_0($this.o5r_1)), error);
|
|
2275
|
+
$this.i5r_1.w('RandomPoolProvider', VOID, randomException);
|
|
2276
|
+
return randomException;
|
|
2277
|
+
}
|
|
2238
2278
|
function getOrLoadGameCardDeckData($this, minRoundsCountInPool, userData, min, max, cardsCount, signed, requestDurationWarnMillis, $completion) {
|
|
2239
|
-
var tmp = new $getOrLoadGameCardDeckDataCOROUTINE$
|
|
2279
|
+
var tmp = new $getOrLoadGameCardDeckDataCOROUTINE$3($this, minRoundsCountInPool, userData, min, max, cardsCount, signed, requestDurationWarnMillis, $completion);
|
|
2240
2280
|
tmp.h9_1 = Unit_instance;
|
|
2241
2281
|
tmp.i9_1 = null;
|
|
2242
2282
|
return tmp.n9();
|
|
2243
2283
|
}
|
|
2244
2284
|
function getPreparedGameCardDecksRecord($this, poolId, signature, cardDeckData, userData) {
|
|
2245
|
-
var existingCardDeck = $this.
|
|
2285
|
+
var existingCardDeck = $this.n5r_1.h2(userData.gameId);
|
|
2246
2286
|
var tmp;
|
|
2247
2287
|
if (!(existingCardDeck == null)) {
|
|
2248
2288
|
tmp = Companion_instance_2.nextRound(existingCardDeck, cardDeckData);
|
|
@@ -2252,13 +2292,13 @@
|
|
|
2252
2292
|
return tmp;
|
|
2253
2293
|
}
|
|
2254
2294
|
function getPreparedOrRequestPool($this, gameId, min, max, minRoundsCount, cardsCount, signed, requestDurationWarnMillis, $completion) {
|
|
2255
|
-
var tmp = new $getPreparedOrRequestPoolCOROUTINE$
|
|
2295
|
+
var tmp = new $getPreparedOrRequestPoolCOROUTINE$4($this, gameId, min, max, minRoundsCount, cardsCount, signed, requestDurationWarnMillis, $completion);
|
|
2256
2296
|
tmp.h9_1 = Unit_instance;
|
|
2257
2297
|
tmp.i9_1 = null;
|
|
2258
2298
|
return tmp.n9();
|
|
2259
2299
|
}
|
|
2260
2300
|
function requestNewPool($this, min, max, cardsCount, signed, requestDurationWarnMillis, $completion) {
|
|
2261
|
-
return withContext($this.
|
|
2301
|
+
return withContext($this.j5r_1, RandomPoolProviderImpl$requestNewPool$slambda_0($this, min, max, cardsCount, signed, requestDurationWarnMillis, null), $completion);
|
|
2262
2302
|
}
|
|
2263
2303
|
function Companion_9() {
|
|
2264
2304
|
this.z5s_1 = 100;
|
|
@@ -2284,7 +2324,7 @@
|
|
|
2284
2324
|
this.s5t_1 = $requestDurationWarnMillis;
|
|
2285
2325
|
CoroutineImpl.call(this, resultContinuation);
|
|
2286
2326
|
}
|
|
2287
|
-
protoOf(RandomPoolProviderImpl$getCardDeck$slambda).
|
|
2327
|
+
protoOf(RandomPoolProviderImpl$getCardDeck$slambda).z5t = function ($this$withContext, $completion) {
|
|
2288
2328
|
var tmp = this.z1d($this$withContext, $completion);
|
|
2289
2329
|
tmp.h9_1 = Unit_instance;
|
|
2290
2330
|
tmp.i9_1 = null;
|
|
@@ -2294,7 +2334,7 @@
|
|
|
2294
2334
|
return tmp_0;
|
|
2295
2335
|
};
|
|
2296
2336
|
protoOf(RandomPoolProviderImpl$getCardDeck$slambda).x9 = function (p1, $completion) {
|
|
2297
|
-
return this.
|
|
2337
|
+
return this.z5t((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
2298
2338
|
};
|
|
2299
2339
|
protoOf(RandomPoolProviderImpl$getCardDeck$slambda).n9 = function () {
|
|
2300
2340
|
var suspendResult = this.h9_1;
|
|
@@ -2303,9 +2343,9 @@
|
|
|
2303
2343
|
var tmp = this.f9_1;
|
|
2304
2344
|
switch (tmp) {
|
|
2305
2345
|
case 0:
|
|
2306
|
-
this.g9_1 =
|
|
2346
|
+
this.g9_1 = 10;
|
|
2307
2347
|
var tmp_0 = this;
|
|
2308
|
-
tmp_0.u5t_1 = this.l5t_1.
|
|
2348
|
+
tmp_0.u5t_1 = this.l5t_1.l5r_1;
|
|
2309
2349
|
var tmp_1 = this;
|
|
2310
2350
|
tmp_1.v5t_1 = null;
|
|
2311
2351
|
this.f9_1 = 1;
|
|
@@ -2320,103 +2360,73 @@
|
|
|
2320
2360
|
this.f9_1 = 2;
|
|
2321
2361
|
continue $sm;
|
|
2322
2362
|
case 2:
|
|
2323
|
-
this.g9_1 =
|
|
2363
|
+
this.g9_1 = 9;
|
|
2324
2364
|
this.x5t_1 = Unit_instance;
|
|
2325
2365
|
this.f9_1 = 3;
|
|
2326
2366
|
continue $sm;
|
|
2327
2367
|
case 3:
|
|
2328
|
-
this.y5t_1 = this.l5t_1
|
|
2329
|
-
this.
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
var exception = this.b5u_1;
|
|
2336
|
-
tmp_2.x5t_1 = new Result(_Result___init__impl__xyqfz8(createFailure(exception)));
|
|
2337
|
-
this.f9_1 = 8;
|
|
2338
|
-
continue $sm;
|
|
2339
|
-
} else {
|
|
2340
|
-
this.l5t_1.f5s_1 = null;
|
|
2341
|
-
this.l5t_1.g5s_1 = 0;
|
|
2342
|
-
this.f9_1 = 4;
|
|
2343
|
-
continue $sm;
|
|
2344
|
-
}
|
|
2368
|
+
this.y5t_1 = getExceptionIfCooldown(this.l5t_1);
|
|
2369
|
+
if (!(this.y5t_1 == null)) {
|
|
2370
|
+
var tmp_2 = this;
|
|
2371
|
+
var exception = this.y5t_1;
|
|
2372
|
+
tmp_2.x5t_1 = new Result(_Result___init__impl__xyqfz8(createFailure(exception)));
|
|
2373
|
+
this.f9_1 = 7;
|
|
2374
|
+
continue $sm;
|
|
2345
2375
|
} else {
|
|
2346
|
-
this.f9_1 =
|
|
2376
|
+
this.f9_1 = 4;
|
|
2347
2377
|
continue $sm;
|
|
2348
2378
|
}
|
|
2349
2379
|
|
|
2350
2380
|
case 4:
|
|
2381
|
+
this.g9_1 = 6;
|
|
2351
2382
|
this.f9_1 = 5;
|
|
2352
|
-
continue $sm;
|
|
2353
|
-
case 5:
|
|
2354
|
-
this.g9_1 = 7;
|
|
2355
|
-
this.f9_1 = 6;
|
|
2356
2383
|
suspendResult = getOrLoadGameCardDeckData(this.l5t_1, this.m5t_1, this.n5t_1, this.o5t_1, this.p5t_1, this.q5t_1, this.r5t_1, this.s5t_1, this);
|
|
2357
2384
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2358
2385
|
return suspendResult;
|
|
2359
2386
|
}
|
|
2360
2387
|
|
|
2361
2388
|
continue $sm;
|
|
2362
|
-
case
|
|
2389
|
+
case 5:
|
|
2363
2390
|
var cardDeckData = suspendResult;
|
|
2364
2391
|
var tmp_3 = this;
|
|
2365
2392
|
tmp_3.x5t_1 = new Result(_Result___init__impl__xyqfz8(cardDeckData));
|
|
2366
|
-
this.f9_1 =
|
|
2393
|
+
this.f9_1 = 7;
|
|
2367
2394
|
continue $sm;
|
|
2368
|
-
case
|
|
2369
|
-
this.g9_1 =
|
|
2395
|
+
case 6:
|
|
2396
|
+
this.g9_1 = 9;
|
|
2370
2397
|
var tmp_4 = this.i9_1;
|
|
2371
2398
|
if (tmp_4 instanceof Error) {
|
|
2372
2399
|
var error = this.i9_1;
|
|
2373
|
-
|
|
2374
|
-
var
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
var value = this.l5t_1.f5s_1;
|
|
2378
|
-
var tmp$ret$2 = Unit_instance;
|
|
2379
|
-
l$ret$3: do {
|
|
2380
|
-
if (value == null) {
|
|
2381
|
-
var message = 'Required value was null.';
|
|
2382
|
-
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
2383
|
-
} else {
|
|
2384
|
-
tmp$ret$2 = value;
|
|
2385
|
-
break l$ret$3;
|
|
2386
|
-
}
|
|
2387
|
-
}
|
|
2388
|
-
while (false);
|
|
2389
|
-
var exception_0 = new RandomException(VOID, tmp_5 + ('cooldown ends in ' + tmp$ret$2.a5l(this.l5t_1.x5r_1.failedAttemptCooldown).toString() + ', ') + ('failedAttemptTime = ' + toString_0(this.y5t_1) + ', ') + ('currentTime = ' + this.z5t_1.toString()), error);
|
|
2390
|
-
this.l5t_1.z5r_1.w('RandomPoolProvider', VOID, exception_0);
|
|
2391
|
-
var tmp_6 = this;
|
|
2392
|
-
tmp_6.x5t_1 = new Result(_Result___init__impl__xyqfz8(createFailure(exception_0)));
|
|
2393
|
-
this.f9_1 = 8;
|
|
2400
|
+
var tmp_5 = this;
|
|
2401
|
+
var exception_0 = mapToRandomExceptionIfError(this.l5t_1, error);
|
|
2402
|
+
tmp_5.x5t_1 = new Result(_Result___init__impl__xyqfz8(createFailure(exception_0)));
|
|
2403
|
+
this.f9_1 = 7;
|
|
2394
2404
|
continue $sm;
|
|
2395
2405
|
} else {
|
|
2396
2406
|
throw this.i9_1;
|
|
2397
2407
|
}
|
|
2398
2408
|
|
|
2399
|
-
case
|
|
2409
|
+
case 7:
|
|
2400
2410
|
this.w5t_1 = this.x5t_1;
|
|
2401
|
-
this.g9_1 =
|
|
2402
|
-
this.f9_1 =
|
|
2411
|
+
this.g9_1 = 10;
|
|
2412
|
+
this.f9_1 = 8;
|
|
2403
2413
|
continue $sm;
|
|
2404
|
-
case
|
|
2405
|
-
var
|
|
2406
|
-
this.g9_1 =
|
|
2414
|
+
case 8:
|
|
2415
|
+
var tmp_6 = this.w5t_1;
|
|
2416
|
+
this.g9_1 = 10;
|
|
2407
2417
|
this.u5t_1.r1l(this.v5t_1);
|
|
2408
|
-
return
|
|
2409
|
-
case
|
|
2410
|
-
this.g9_1 =
|
|
2418
|
+
return tmp_6;
|
|
2419
|
+
case 9:
|
|
2420
|
+
this.g9_1 = 10;
|
|
2411
2421
|
var t = this.i9_1;
|
|
2412
2422
|
this.u5t_1.r1l(this.v5t_1);
|
|
2413
2423
|
throw t;
|
|
2414
|
-
case
|
|
2424
|
+
case 10:
|
|
2415
2425
|
throw this.i9_1;
|
|
2416
2426
|
}
|
|
2417
2427
|
} catch ($p) {
|
|
2418
2428
|
var e = $p;
|
|
2419
|
-
if (this.g9_1 ===
|
|
2429
|
+
if (this.g9_1 === 10) {
|
|
2420
2430
|
throw e;
|
|
2421
2431
|
} else {
|
|
2422
2432
|
this.f9_1 = this.g9_1;
|
|
@@ -2433,66 +2443,126 @@
|
|
|
2433
2443
|
function RandomPoolProviderImpl$getCardDeck$slambda_0(this$0, $minRoundsCountInPool, $userData, $min, $max, $cardsCount, $signed, $requestDurationWarnMillis, resultContinuation) {
|
|
2434
2444
|
var i = new RandomPoolProviderImpl$getCardDeck$slambda(this$0, $minRoundsCountInPool, $userData, $min, $max, $cardsCount, $signed, $requestDurationWarnMillis, resultContinuation);
|
|
2435
2445
|
var l = function ($this$withContext, $completion) {
|
|
2436
|
-
return i.
|
|
2446
|
+
return i.z5t($this$withContext, $completion);
|
|
2437
2447
|
};
|
|
2438
2448
|
l.$arity = 1;
|
|
2439
2449
|
return l;
|
|
2440
2450
|
}
|
|
2441
|
-
function RandomPoolProviderImpl$
|
|
2442
|
-
this.
|
|
2443
|
-
this.
|
|
2444
|
-
this.
|
|
2445
|
-
this.
|
|
2446
|
-
this.
|
|
2447
|
-
this.
|
|
2451
|
+
function RandomPoolProviderImpl$prefetchCardDecks$slambda(this$0, $min, $max, $cardsCount, $signed, $requestDurationWarnMillis, resultContinuation) {
|
|
2452
|
+
this.i5u_1 = this$0;
|
|
2453
|
+
this.j5u_1 = $min;
|
|
2454
|
+
this.k5u_1 = $max;
|
|
2455
|
+
this.l5u_1 = $cardsCount;
|
|
2456
|
+
this.m5u_1 = $signed;
|
|
2457
|
+
this.n5u_1 = $requestDurationWarnMillis;
|
|
2448
2458
|
CoroutineImpl.call(this, resultContinuation);
|
|
2449
2459
|
}
|
|
2450
|
-
protoOf(RandomPoolProviderImpl$
|
|
2460
|
+
protoOf(RandomPoolProviderImpl$prefetchCardDecks$slambda).u5u = function ($this$withContext, $completion) {
|
|
2451
2461
|
var tmp = this.z1d($this$withContext, $completion);
|
|
2452
2462
|
tmp.h9_1 = Unit_instance;
|
|
2453
2463
|
tmp.i9_1 = null;
|
|
2454
|
-
|
|
2464
|
+
var tmp_0 = tmp.n9();
|
|
2465
|
+
if (tmp_0 === get_COROUTINE_SUSPENDED())
|
|
2466
|
+
return tmp_0;
|
|
2467
|
+
return tmp_0;
|
|
2455
2468
|
};
|
|
2456
|
-
protoOf(RandomPoolProviderImpl$
|
|
2457
|
-
return this.
|
|
2469
|
+
protoOf(RandomPoolProviderImpl$prefetchCardDecks$slambda).x9 = function (p1, $completion) {
|
|
2470
|
+
return this.u5u((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
2458
2471
|
};
|
|
2459
|
-
protoOf(RandomPoolProviderImpl$
|
|
2472
|
+
protoOf(RandomPoolProviderImpl$prefetchCardDecks$slambda).n9 = function () {
|
|
2460
2473
|
var suspendResult = this.h9_1;
|
|
2461
2474
|
$sm: do
|
|
2462
2475
|
try {
|
|
2463
2476
|
var tmp = this.f9_1;
|
|
2464
2477
|
switch (tmp) {
|
|
2465
2478
|
case 0:
|
|
2466
|
-
this.g9_1 =
|
|
2467
|
-
|
|
2479
|
+
this.g9_1 = 10;
|
|
2480
|
+
var tmp_0 = this;
|
|
2481
|
+
tmp_0.p5u_1 = this.i5u_1.l5r_1;
|
|
2482
|
+
var tmp_1 = this;
|
|
2483
|
+
tmp_1.q5u_1 = null;
|
|
2468
2484
|
this.f9_1 = 1;
|
|
2469
|
-
suspendResult = this.
|
|
2485
|
+
suspendResult = this.p5u_1.g1m(this.q5u_1, this);
|
|
2470
2486
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2471
2487
|
return suspendResult;
|
|
2472
2488
|
}
|
|
2473
2489
|
|
|
2474
2490
|
continue $sm;
|
|
2475
2491
|
case 1:
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2492
|
+
this.r5u_1 = Unit_instance;
|
|
2493
|
+
this.f9_1 = 2;
|
|
2494
|
+
continue $sm;
|
|
2495
|
+
case 2:
|
|
2496
|
+
this.g9_1 = 9;
|
|
2497
|
+
this.s5u_1 = Unit_instance;
|
|
2498
|
+
this.f9_1 = 3;
|
|
2499
|
+
continue $sm;
|
|
2500
|
+
case 3:
|
|
2501
|
+
this.t5u_1 = getExceptionIfCooldown(this.i5u_1);
|
|
2502
|
+
if (!(this.t5u_1 == null)) {
|
|
2503
|
+
var tmp_2 = this;
|
|
2504
|
+
var exception = this.t5u_1;
|
|
2505
|
+
tmp_2.s5u_1 = new Result(_Result___init__impl__xyqfz8(createFailure(exception)));
|
|
2506
|
+
this.f9_1 = 7;
|
|
2507
|
+
continue $sm;
|
|
2508
|
+
} else {
|
|
2509
|
+
this.f9_1 = 4;
|
|
2510
|
+
continue $sm;
|
|
2486
2511
|
}
|
|
2487
2512
|
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2513
|
+
case 4:
|
|
2514
|
+
this.g9_1 = 6;
|
|
2515
|
+
this.f9_1 = 5;
|
|
2516
|
+
suspendResult = requestNewPool(this.i5u_1, this.j5u_1, this.k5u_1, this.l5u_1, this.m5u_1, this.n5u_1, this);
|
|
2517
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2518
|
+
return suspendResult;
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
continue $sm;
|
|
2522
|
+
case 5:
|
|
2523
|
+
var randomPoolValue = suspendResult;
|
|
2524
|
+
var this_0 = this.i5u_1.m5r_1;
|
|
2525
|
+
var key = randomPoolValue.w5q_1.h5m_1;
|
|
2526
|
+
this_0.k2(key, randomPoolValue);
|
|
2527
|
+
var tmp_3 = this;
|
|
2528
|
+
tmp_3.s5u_1 = new Result(_Result___init__impl__xyqfz8(Unit_instance));
|
|
2529
|
+
this.f9_1 = 7;
|
|
2530
|
+
continue $sm;
|
|
2531
|
+
case 6:
|
|
2532
|
+
this.g9_1 = 9;
|
|
2533
|
+
var tmp_4 = this.i9_1;
|
|
2534
|
+
if (tmp_4 instanceof Error) {
|
|
2535
|
+
var error = this.i9_1;
|
|
2536
|
+
var tmp_5 = this;
|
|
2537
|
+
var exception_0 = mapToRandomExceptionIfError(this.i5u_1, error);
|
|
2538
|
+
tmp_5.s5u_1 = new Result(_Result___init__impl__xyqfz8(createFailure(exception_0)));
|
|
2539
|
+
this.f9_1 = 7;
|
|
2540
|
+
continue $sm;
|
|
2541
|
+
} else {
|
|
2542
|
+
throw this.i9_1;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
case 7:
|
|
2546
|
+
this.r5u_1 = this.s5u_1;
|
|
2547
|
+
this.g9_1 = 10;
|
|
2548
|
+
this.f9_1 = 8;
|
|
2549
|
+
continue $sm;
|
|
2550
|
+
case 8:
|
|
2551
|
+
var tmp_6 = this.r5u_1;
|
|
2552
|
+
this.g9_1 = 10;
|
|
2553
|
+
this.p5u_1.r1l(this.q5u_1);
|
|
2554
|
+
return tmp_6;
|
|
2555
|
+
case 9:
|
|
2556
|
+
this.g9_1 = 10;
|
|
2557
|
+
var t = this.i9_1;
|
|
2558
|
+
this.p5u_1.r1l(this.q5u_1);
|
|
2559
|
+
throw t;
|
|
2560
|
+
case 10:
|
|
2491
2561
|
throw this.i9_1;
|
|
2492
2562
|
}
|
|
2493
2563
|
} catch ($p) {
|
|
2494
2564
|
var e = $p;
|
|
2495
|
-
if (this.g9_1 ===
|
|
2565
|
+
if (this.g9_1 === 10) {
|
|
2496
2566
|
throw e;
|
|
2497
2567
|
} else {
|
|
2498
2568
|
this.f9_1 = this.g9_1;
|
|
@@ -2501,29 +2571,38 @@
|
|
|
2501
2571
|
}
|
|
2502
2572
|
while (true);
|
|
2503
2573
|
};
|
|
2504
|
-
protoOf(RandomPoolProviderImpl$
|
|
2505
|
-
var i = new RandomPoolProviderImpl$
|
|
2506
|
-
i.
|
|
2574
|
+
protoOf(RandomPoolProviderImpl$prefetchCardDecks$slambda).z1d = function ($this$withContext, completion) {
|
|
2575
|
+
var i = new RandomPoolProviderImpl$prefetchCardDecks$slambda(this.i5u_1, this.j5u_1, this.k5u_1, this.l5u_1, this.m5u_1, this.n5u_1, completion);
|
|
2576
|
+
i.o5u_1 = $this$withContext;
|
|
2507
2577
|
return i;
|
|
2508
2578
|
};
|
|
2509
|
-
function RandomPoolProviderImpl$
|
|
2510
|
-
var i = new RandomPoolProviderImpl$
|
|
2579
|
+
function RandomPoolProviderImpl$prefetchCardDecks$slambda_0(this$0, $min, $max, $cardsCount, $signed, $requestDurationWarnMillis, resultContinuation) {
|
|
2580
|
+
var i = new RandomPoolProviderImpl$prefetchCardDecks$slambda(this$0, $min, $max, $cardsCount, $signed, $requestDurationWarnMillis, resultContinuation);
|
|
2511
2581
|
var l = function ($this$withContext, $completion) {
|
|
2512
|
-
return i.
|
|
2582
|
+
return i.u5u($this$withContext, $completion);
|
|
2513
2583
|
};
|
|
2514
2584
|
l.$arity = 1;
|
|
2515
2585
|
return l;
|
|
2516
2586
|
}
|
|
2517
|
-
function $
|
|
2587
|
+
function RandomPoolProviderImpl$requestNewPool$slambda(this$0, $min, $max, $cardsCount, $signed, $requestDurationWarnMillis, resultContinuation) {
|
|
2588
|
+
this.d5v_1 = this$0;
|
|
2589
|
+
this.e5v_1 = $min;
|
|
2590
|
+
this.f5v_1 = $max;
|
|
2591
|
+
this.g5v_1 = $cardsCount;
|
|
2592
|
+
this.h5v_1 = $signed;
|
|
2593
|
+
this.i5v_1 = $requestDurationWarnMillis;
|
|
2518
2594
|
CoroutineImpl.call(this, resultContinuation);
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
this.
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
}
|
|
2526
|
-
protoOf($
|
|
2595
|
+
}
|
|
2596
|
+
protoOf(RandomPoolProviderImpl$requestNewPool$slambda).l5v = function ($this$withContext, $completion) {
|
|
2597
|
+
var tmp = this.z1d($this$withContext, $completion);
|
|
2598
|
+
tmp.h9_1 = Unit_instance;
|
|
2599
|
+
tmp.i9_1 = null;
|
|
2600
|
+
return tmp.n9();
|
|
2601
|
+
};
|
|
2602
|
+
protoOf(RandomPoolProviderImpl$requestNewPool$slambda).x9 = function (p1, $completion) {
|
|
2603
|
+
return this.l5v((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
2604
|
+
};
|
|
2605
|
+
protoOf(RandomPoolProviderImpl$requestNewPool$slambda).n9 = function () {
|
|
2527
2606
|
var suspendResult = this.h9_1;
|
|
2528
2607
|
$sm: do
|
|
2529
2608
|
try {
|
|
@@ -2531,19 +2610,29 @@
|
|
|
2531
2610
|
switch (tmp) {
|
|
2532
2611
|
case 0:
|
|
2533
2612
|
this.g9_1 = 2;
|
|
2613
|
+
this.k5v_1 = System_instance.m55();
|
|
2534
2614
|
this.f9_1 = 1;
|
|
2535
|
-
suspendResult =
|
|
2615
|
+
suspendResult = this.d5v_1.h5r_1.a5p(this.e5v_1, this.f5v_1, this.d5v_1.g5r_1.poolSize, this.g5v_1, new CardDecksRequestUserData(this.d5v_1.k5r_1(), this.d5v_1.g5r_1.poolSize), this.h5v_1, this);
|
|
2536
2616
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2537
2617
|
return suspendResult;
|
|
2538
2618
|
}
|
|
2539
2619
|
|
|
2540
2620
|
continue $sm;
|
|
2541
2621
|
case 1:
|
|
2542
|
-
var
|
|
2543
|
-
var
|
|
2544
|
-
var
|
|
2545
|
-
|
|
2546
|
-
|
|
2622
|
+
var result = suspendResult;
|
|
2623
|
+
var requestEndTime = System_instance.m55();
|
|
2624
|
+
var requestDuration = requestEndTime.d5l(this.k5v_1);
|
|
2625
|
+
Companion_getInstance_0();
|
|
2626
|
+
var this_0 = this.i5v_1;
|
|
2627
|
+
if (Duration__compareTo_impl_pchp0f(requestDuration, toDuration(this_0, DurationUnit_MILLISECONDS_getInstance())) > 0) {
|
|
2628
|
+
var tmp_0 = 'Card deck request took longer then expected: ' + ('actual = ' + Duration__toString_impl_8d916b(requestDuration) + ', ');
|
|
2629
|
+
Companion_getInstance_0();
|
|
2630
|
+
var this_1 = this.i5v_1;
|
|
2631
|
+
this.d5v_1.i5r_1.w('RandomPoolProvider', tmp_0 + ('expected = ' + Duration__toString_impl_8d916b(toDuration(this_1, DurationUnit_MILLISECONDS_getInstance()))));
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
var newCardDecksValue = new RandomPoolValue(result);
|
|
2635
|
+
return newCardDecksValue;
|
|
2547
2636
|
case 2:
|
|
2548
2637
|
throw this.i9_1;
|
|
2549
2638
|
}
|
|
@@ -2558,18 +2647,31 @@
|
|
|
2558
2647
|
}
|
|
2559
2648
|
while (true);
|
|
2560
2649
|
};
|
|
2561
|
-
|
|
2650
|
+
protoOf(RandomPoolProviderImpl$requestNewPool$slambda).z1d = function ($this$withContext, completion) {
|
|
2651
|
+
var i = new RandomPoolProviderImpl$requestNewPool$slambda(this.d5v_1, this.e5v_1, this.f5v_1, this.g5v_1, this.h5v_1, this.i5v_1, completion);
|
|
2652
|
+
i.j5v_1 = $this$withContext;
|
|
2653
|
+
return i;
|
|
2654
|
+
};
|
|
2655
|
+
function RandomPoolProviderImpl$requestNewPool$slambda_0(this$0, $min, $max, $cardsCount, $signed, $requestDurationWarnMillis, resultContinuation) {
|
|
2656
|
+
var i = new RandomPoolProviderImpl$requestNewPool$slambda(this$0, $min, $max, $cardsCount, $signed, $requestDurationWarnMillis, resultContinuation);
|
|
2657
|
+
var l = function ($this$withContext, $completion) {
|
|
2658
|
+
return i.l5v($this$withContext, $completion);
|
|
2659
|
+
};
|
|
2660
|
+
l.$arity = 1;
|
|
2661
|
+
return l;
|
|
2662
|
+
}
|
|
2663
|
+
function $getOrLoadGameCardDeckDataCOROUTINE$3(_this__u8e3s4, minRoundsCountInPool, userData, min, max, cardsCount, signed, requestDurationWarnMillis, resultContinuation) {
|
|
2562
2664
|
CoroutineImpl.call(this, resultContinuation);
|
|
2563
|
-
this.
|
|
2564
|
-
this.
|
|
2565
|
-
this.
|
|
2566
|
-
this.
|
|
2567
|
-
this.
|
|
2568
|
-
this.
|
|
2569
|
-
this.
|
|
2570
|
-
this.
|
|
2571
|
-
}
|
|
2572
|
-
protoOf($getOrLoadGameCardDeckDataCOROUTINE$
|
|
2665
|
+
this.y5r_1 = _this__u8e3s4;
|
|
2666
|
+
this.z5r_1 = minRoundsCountInPool;
|
|
2667
|
+
this.a5s_1 = userData;
|
|
2668
|
+
this.b5s_1 = min;
|
|
2669
|
+
this.c5s_1 = max;
|
|
2670
|
+
this.d5s_1 = cardsCount;
|
|
2671
|
+
this.e5s_1 = signed;
|
|
2672
|
+
this.f5s_1 = requestDurationWarnMillis;
|
|
2673
|
+
}
|
|
2674
|
+
protoOf($getOrLoadGameCardDeckDataCOROUTINE$3).n9 = function () {
|
|
2573
2675
|
var suspendResult = this.h9_1;
|
|
2574
2676
|
$sm: do
|
|
2575
2677
|
try {
|
|
@@ -2577,9 +2679,9 @@
|
|
|
2577
2679
|
switch (tmp) {
|
|
2578
2680
|
case 0:
|
|
2579
2681
|
this.g9_1 = 2;
|
|
2580
|
-
this.
|
|
2682
|
+
this.g5s_1 = this.a5s_1.gameId;
|
|
2581
2683
|
this.f9_1 = 1;
|
|
2582
|
-
suspendResult = getPreparedOrRequestPool(this.
|
|
2684
|
+
suspendResult = getPreparedOrRequestPool(this.y5r_1, this.g5s_1, this.b5s_1, this.c5s_1, this.z5r_1, this.d5s_1, this.e5s_1, this.f5s_1, this);
|
|
2583
2685
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2584
2686
|
return suspendResult;
|
|
2585
2687
|
}
|
|
@@ -2587,15 +2689,15 @@
|
|
|
2587
2689
|
continue $sm;
|
|
2588
2690
|
case 1:
|
|
2589
2691
|
var randomPoolValue = suspendResult;
|
|
2590
|
-
var this_0 = this.
|
|
2692
|
+
var this_0 = this.y5r_1.m5r_1;
|
|
2591
2693
|
var key = randomPoolValue.w5q_1.h5m_1;
|
|
2592
2694
|
this_0.k2(key, randomPoolValue);
|
|
2593
|
-
var cardDeckData = randomPoolValue.e5r(this.
|
|
2695
|
+
var cardDeckData = randomPoolValue.e5r(this.a5s_1.gameId);
|
|
2594
2696
|
var tmp21_poolId = randomPoolValue.w5q_1.h5m_1;
|
|
2595
2697
|
var tmp22_signature = randomPoolValue.w5q_1.i5m_1;
|
|
2596
|
-
var cardDecksRecord = getPreparedGameCardDecksRecord(this.
|
|
2597
|
-
var this_1 = this.
|
|
2598
|
-
var key_0 = this.
|
|
2698
|
+
var cardDecksRecord = getPreparedGameCardDecksRecord(this.y5r_1, tmp21_poolId, tmp22_signature, cardDeckData, this.a5s_1);
|
|
2699
|
+
var this_1 = this.y5r_1.n5r_1;
|
|
2700
|
+
var key_0 = this.a5s_1.gameId;
|
|
2599
2701
|
this_1.k2(key_0, cardDecksRecord);
|
|
2600
2702
|
return cardDeckData;
|
|
2601
2703
|
case 2:
|
|
@@ -2612,7 +2714,7 @@
|
|
|
2612
2714
|
}
|
|
2613
2715
|
while (true);
|
|
2614
2716
|
};
|
|
2615
|
-
function $getPreparedOrRequestPoolCOROUTINE$
|
|
2717
|
+
function $getPreparedOrRequestPoolCOROUTINE$4(_this__u8e3s4, gameId, min, max, minRoundsCount, cardsCount, signed, requestDurationWarnMillis, resultContinuation) {
|
|
2616
2718
|
CoroutineImpl.call(this, resultContinuation);
|
|
2617
2719
|
this.p5s_1 = _this__u8e3s4;
|
|
2618
2720
|
this.q5s_1 = gameId;
|
|
@@ -2623,7 +2725,7 @@
|
|
|
2623
2725
|
this.v5s_1 = signed;
|
|
2624
2726
|
this.w5s_1 = requestDurationWarnMillis;
|
|
2625
2727
|
}
|
|
2626
|
-
protoOf($getPreparedOrRequestPoolCOROUTINE$
|
|
2728
|
+
protoOf($getPreparedOrRequestPoolCOROUTINE$4).n9 = function () {
|
|
2627
2729
|
var suspendResult = this.h9_1;
|
|
2628
2730
|
$sm: do
|
|
2629
2731
|
try {
|
|
@@ -2632,7 +2734,7 @@
|
|
|
2632
2734
|
case 0:
|
|
2633
2735
|
this.g9_1 = 2;
|
|
2634
2736
|
var tmp_0 = this;
|
|
2635
|
-
var this_0 = this.p5s_1.
|
|
2737
|
+
var this_0 = this.p5s_1.m5r_1;
|
|
2636
2738
|
var destination = LinkedHashMap_init_$Create$();
|
|
2637
2739
|
var tmp0_iterator = this_0.s().j();
|
|
2638
2740
|
while (tmp0_iterator.k()) {
|
|
@@ -2650,7 +2752,7 @@
|
|
|
2650
2752
|
}
|
|
2651
2753
|
|
|
2652
2754
|
var tmp_1 = this;
|
|
2653
|
-
var this_2 = this.p5s_1.
|
|
2755
|
+
var this_2 = this.p5s_1.m5r_1;
|
|
2654
2756
|
var destination_0 = LinkedHashMap_init_$Create$();
|
|
2655
2757
|
var tmp0_iterator_0 = this_2.s().j();
|
|
2656
2758
|
while (tmp0_iterator_0.k()) {
|
|
@@ -2662,7 +2764,7 @@
|
|
|
2662
2764
|
|
|
2663
2765
|
tmp_1.y5s_1 = firstOrNull(destination_0.s());
|
|
2664
2766
|
if (!(this.y5s_1 == null)) {
|
|
2665
|
-
return this.y5s_1.u().b5r(this.q5s_1, this.t5s_1, this.p5s_1.
|
|
2767
|
+
return this.y5s_1.u().b5r(this.q5s_1, this.t5s_1, this.p5s_1.g5r_1.thresholdForUsedPool);
|
|
2666
2768
|
}
|
|
2667
2769
|
|
|
2668
2770
|
this.f9_1 = 1;
|
|
@@ -2674,7 +2776,7 @@
|
|
|
2674
2776
|
continue $sm;
|
|
2675
2777
|
case 1:
|
|
2676
2778
|
var cardDecks = suspendResult;
|
|
2677
|
-
return cardDecks.b5r(this.q5s_1, this.t5s_1, this.p5s_1.
|
|
2779
|
+
return cardDecks.b5r(this.q5s_1, this.t5s_1, this.p5s_1.g5r_1.thresholdForUsedPool);
|
|
2678
2780
|
case 2:
|
|
2679
2781
|
throw this.i9_1;
|
|
2680
2782
|
}
|
|
@@ -2698,55 +2800,55 @@
|
|
|
2698
2800
|
tmp = idsProvider;
|
|
2699
2801
|
}
|
|
2700
2802
|
idsProvider = tmp;
|
|
2701
|
-
this.
|
|
2702
|
-
this.
|
|
2703
|
-
this.
|
|
2704
|
-
this.
|
|
2705
|
-
this.
|
|
2706
|
-
this.
|
|
2803
|
+
this.g5r_1 = params;
|
|
2804
|
+
this.h5r_1 = randomOrgApiService;
|
|
2805
|
+
this.i5r_1 = logger;
|
|
2806
|
+
this.j5r_1 = dispatcher;
|
|
2807
|
+
this.k5r_1 = idsProvider;
|
|
2808
|
+
this.l5r_1 = Mutex();
|
|
2707
2809
|
var tmp_0 = this;
|
|
2708
2810
|
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
2709
|
-
tmp_0.
|
|
2811
|
+
tmp_0.m5r_1 = LinkedHashMap_init_$Create$();
|
|
2710
2812
|
var tmp_1 = this;
|
|
2711
2813
|
// Inline function 'kotlin.collections.mutableMapOf' call
|
|
2712
|
-
tmp_1.
|
|
2713
|
-
this.
|
|
2714
|
-
this.
|
|
2814
|
+
tmp_1.n5r_1 = LinkedHashMap_init_$Create$();
|
|
2815
|
+
this.o5r_1 = null;
|
|
2816
|
+
this.p5r_1 = 0;
|
|
2715
2817
|
}
|
|
2716
2818
|
protoOf(RandomPoolProviderImpl).s5q = function (minRoundsCountInPool, userData, min, max, cardsCount, signed, requestDurationWarnMillis, $completion) {
|
|
2717
|
-
var tmp = withContext(this.
|
|
2819
|
+
var tmp = withContext(this.j5r_1, RandomPoolProviderImpl$getCardDeck$slambda_0(this, minRoundsCountInPool, userData, min, max, cardsCount, signed, requestDurationWarnMillis, null), $completion);
|
|
2718
2820
|
if (tmp === get_COROUTINE_SUSPENDED())
|
|
2719
2821
|
return tmp;
|
|
2720
2822
|
return tmp;
|
|
2721
2823
|
};
|
|
2722
2824
|
protoOf(RandomPoolProviderImpl).u5q = function (min, max, cardsCount, signed, requestDurationWarnMillis, $completion) {
|
|
2723
|
-
var tmp =
|
|
2724
|
-
tmp
|
|
2725
|
-
|
|
2726
|
-
return tmp
|
|
2825
|
+
var tmp = withContext(this.j5r_1, RandomPoolProviderImpl$prefetchCardDecks$slambda_0(this, min, max, cardsCount, signed, requestDurationWarnMillis, null), $completion);
|
|
2826
|
+
if (tmp === get_COROUTINE_SUSPENDED())
|
|
2827
|
+
return tmp;
|
|
2828
|
+
return tmp;
|
|
2727
2829
|
};
|
|
2728
|
-
protoOf(RandomPoolProviderImpl).
|
|
2729
|
-
return this.
|
|
2830
|
+
protoOf(RandomPoolProviderImpl).m5v = function (gameId) {
|
|
2831
|
+
return this.n5r_1.h2(gameId);
|
|
2730
2832
|
};
|
|
2731
2833
|
protoOf(RandomPoolProviderImpl).getGame = function (gameId) {
|
|
2732
|
-
return this.
|
|
2834
|
+
return this.m5v(gameId);
|
|
2733
2835
|
};
|
|
2734
|
-
protoOf(RandomPoolProviderImpl).
|
|
2735
|
-
return this.
|
|
2836
|
+
protoOf(RandomPoolProviderImpl).n5v = function (id) {
|
|
2837
|
+
return this.m5r_1.h2(id);
|
|
2736
2838
|
};
|
|
2737
2839
|
protoOf(RandomPoolProviderImpl).getRandomPool = function (id) {
|
|
2738
|
-
return this.
|
|
2840
|
+
return this.n5v(id);
|
|
2739
2841
|
};
|
|
2740
|
-
protoOf(RandomPoolProviderImpl).
|
|
2741
|
-
return this.
|
|
2842
|
+
protoOf(RandomPoolProviderImpl).o5v = function () {
|
|
2843
|
+
return this.m5r_1.m();
|
|
2742
2844
|
};
|
|
2743
2845
|
protoOf(RandomPoolProviderImpl).getRandomPoolsCount = function () {
|
|
2744
|
-
return this.
|
|
2846
|
+
return this.o5v();
|
|
2745
2847
|
};
|
|
2746
2848
|
protoOf(RandomPoolProviderImpl).v5q = function (gameId) {
|
|
2747
|
-
var gameCardDecksRecord = this.
|
|
2849
|
+
var gameCardDecksRecord = this.n5r_1.h2(gameId);
|
|
2748
2850
|
if (!(gameCardDecksRecord == null)) {
|
|
2749
|
-
var randomPoolValue = this.
|
|
2851
|
+
var randomPoolValue = this.m5r_1.h2(gameCardDecksRecord.poolId);
|
|
2750
2852
|
if (!(randomPoolValue == null)) {
|
|
2751
2853
|
// Inline function 'kotlin.apply' call
|
|
2752
2854
|
var this_0 = toMutableMap(randomPoolValue.x5q_1);
|
|
@@ -2755,16 +2857,16 @@
|
|
|
2755
2857
|
this_0.l2(gameId);
|
|
2756
2858
|
var newPoolValue = randomPoolValue.c5r(VOID, toMap(this_0));
|
|
2757
2859
|
if (newPoolValue.x5q_1.p()) {
|
|
2758
|
-
this.
|
|
2860
|
+
this.m5r_1.l2(gameCardDecksRecord.poolId);
|
|
2759
2861
|
} else {
|
|
2760
2862
|
// Inline function 'kotlin.collections.set' call
|
|
2761
|
-
var this_1 = this.
|
|
2863
|
+
var this_1 = this.m5r_1;
|
|
2762
2864
|
var key = gameCardDecksRecord.poolId;
|
|
2763
2865
|
this_1.k2(key, newPoolValue);
|
|
2764
2866
|
}
|
|
2765
2867
|
}
|
|
2766
2868
|
}
|
|
2767
|
-
this.
|
|
2869
|
+
this.n5r_1.l2(gameId);
|
|
2768
2870
|
};
|
|
2769
2871
|
function ApiCommonConfigs$setupJsonDefaultRequest$lambda($url) {
|
|
2770
2872
|
return function ($this$defaultRequest) {
|
|
@@ -2774,15 +2876,15 @@
|
|
|
2774
2876
|
};
|
|
2775
2877
|
}
|
|
2776
2878
|
function ApiCommonConfigs$setupLogging$1$1($externalLogger) {
|
|
2777
|
-
this.
|
|
2879
|
+
this.p5v_1 = $externalLogger;
|
|
2778
2880
|
}
|
|
2779
2881
|
protoOf(ApiCommonConfigs$setupLogging$1$1).v3u = function (message) {
|
|
2780
|
-
this.
|
|
2882
|
+
this.p5v_1(message);
|
|
2781
2883
|
};
|
|
2782
2884
|
function ApiCommonConfigs$setupLogging$lambda($config, $externalLogger) {
|
|
2783
2885
|
return function ($this$install) {
|
|
2784
2886
|
$this$install.l3w(get_DEFAULT(Companion_instance_0));
|
|
2785
|
-
$this$install.k3w_1 = $config.
|
|
2887
|
+
$this$install.k3w_1 = $config.s5v_1;
|
|
2786
2888
|
$this$install.l3w(new ApiCommonConfigs$setupLogging$1$1($externalLogger));
|
|
2787
2889
|
return Unit_instance;
|
|
2788
2890
|
};
|
|
@@ -2795,20 +2897,20 @@
|
|
|
2795
2897
|
}
|
|
2796
2898
|
function ApiCommonConfigs() {
|
|
2797
2899
|
}
|
|
2798
|
-
protoOf(ApiCommonConfigs).
|
|
2900
|
+
protoOf(ApiCommonConfigs).u5v = function (_this__u8e3s4, config, externalLogger) {
|
|
2799
2901
|
_this__u8e3s4.x2v_1 = true;
|
|
2800
|
-
this.
|
|
2801
|
-
this.
|
|
2802
|
-
this.
|
|
2902
|
+
this.v5v(_this__u8e3s4, config.q5v_1);
|
|
2903
|
+
this.w5v(_this__u8e3s4, config.t5v_1);
|
|
2904
|
+
this.x5v(_this__u8e3s4, config, externalLogger);
|
|
2803
2905
|
};
|
|
2804
|
-
protoOf(ApiCommonConfigs).
|
|
2906
|
+
protoOf(ApiCommonConfigs).v5v = function (_this__u8e3s4, url) {
|
|
2805
2907
|
defaultRequest(_this__u8e3s4, ApiCommonConfigs$setupJsonDefaultRequest$lambda(url));
|
|
2806
2908
|
};
|
|
2807
|
-
protoOf(ApiCommonConfigs).
|
|
2909
|
+
protoOf(ApiCommonConfigs).x5v = function (_this__u8e3s4, config, externalLogger) {
|
|
2808
2910
|
var tmp = Companion_getInstance_1();
|
|
2809
2911
|
_this__u8e3s4.s2w(tmp, ApiCommonConfigs$setupLogging$lambda(config, externalLogger));
|
|
2810
2912
|
};
|
|
2811
|
-
protoOf(ApiCommonConfigs).
|
|
2913
|
+
protoOf(ApiCommonConfigs).w5v = function (_this__u8e3s4, json) {
|
|
2812
2914
|
var tmp = Plugin_getInstance();
|
|
2813
2915
|
_this__u8e3s4.s2w(tmp, ApiCommonConfigs$setupContentNegotiation$lambda(json));
|
|
2814
2916
|
};
|
|
@@ -2833,19 +2935,19 @@
|
|
|
2833
2935
|
tmp = json;
|
|
2834
2936
|
}
|
|
2835
2937
|
json = tmp;
|
|
2836
|
-
this.
|
|
2837
|
-
this.
|
|
2838
|
-
this.
|
|
2839
|
-
this.
|
|
2938
|
+
this.q5v_1 = baseUrl;
|
|
2939
|
+
this.r5v_1 = timeoutMillis;
|
|
2940
|
+
this.s5v_1 = loggingLevel;
|
|
2941
|
+
this.t5v_1 = json;
|
|
2840
2942
|
}
|
|
2841
2943
|
protoOf(HttpParams).toString = function () {
|
|
2842
|
-
return 'HttpParams(baseUrl=' + this.
|
|
2944
|
+
return 'HttpParams(baseUrl=' + this.q5v_1 + ', timeoutMillis=' + this.r5v_1.toString() + ', loggingLevel=' + this.s5v_1.toString() + ', json=' + toString(this.t5v_1) + ')';
|
|
2843
2945
|
};
|
|
2844
2946
|
protoOf(HttpParams).hashCode = function () {
|
|
2845
|
-
var result = getStringHashCode(this.
|
|
2846
|
-
result = imul(result, 31) + this.
|
|
2847
|
-
result = imul(result, 31) + this.
|
|
2848
|
-
result = imul(result, 31) + hashCode(this.
|
|
2947
|
+
var result = getStringHashCode(this.q5v_1);
|
|
2948
|
+
result = imul(result, 31) + this.r5v_1.hashCode() | 0;
|
|
2949
|
+
result = imul(result, 31) + this.s5v_1.hashCode() | 0;
|
|
2950
|
+
result = imul(result, 31) + hashCode(this.t5v_1) | 0;
|
|
2849
2951
|
return result;
|
|
2850
2952
|
};
|
|
2851
2953
|
protoOf(HttpParams).equals = function (other) {
|
|
@@ -2854,13 +2956,13 @@
|
|
|
2854
2956
|
if (!(other instanceof HttpParams))
|
|
2855
2957
|
return false;
|
|
2856
2958
|
var tmp0_other_with_cast = other instanceof HttpParams ? other : THROW_CCE();
|
|
2857
|
-
if (!(this.
|
|
2959
|
+
if (!(this.q5v_1 === tmp0_other_with_cast.q5v_1))
|
|
2858
2960
|
return false;
|
|
2859
|
-
if (!this.
|
|
2961
|
+
if (!this.r5v_1.equals(tmp0_other_with_cast.r5v_1))
|
|
2860
2962
|
return false;
|
|
2861
|
-
if (!this.
|
|
2963
|
+
if (!this.s5v_1.equals(tmp0_other_with_cast.s5v_1))
|
|
2862
2964
|
return false;
|
|
2863
|
-
if (!equals(this.
|
|
2965
|
+
if (!equals(this.t5v_1, tmp0_other_with_cast.t5v_1))
|
|
2864
2966
|
return false;
|
|
2865
2967
|
return true;
|
|
2866
2968
|
};
|
|
@@ -2884,12 +2986,12 @@
|
|
|
2884
2986
|
}
|
|
2885
2987
|
function nextBytesCopyTo($this, bytes) {
|
|
2886
2988
|
try {
|
|
2887
|
-
$this.
|
|
2989
|
+
$this.z5v_1.t5l(bytes);
|
|
2888
2990
|
} catch ($p) {
|
|
2889
2991
|
if ($p instanceof SecRandomCopyException) {
|
|
2890
2992
|
var error = $p;
|
|
2891
|
-
$this.
|
|
2892
|
-
$this.
|
|
2993
|
+
$this.y5v_1.e('SecureGameRandom', 'nextBytesCopyTo error ' + error.toString());
|
|
2994
|
+
$this.a5w_1.tg(bytes);
|
|
2893
2995
|
return Unit_instance;
|
|
2894
2996
|
} else {
|
|
2895
2997
|
throw $p;
|
|
@@ -2915,9 +3017,9 @@
|
|
|
2915
3017
|
}
|
|
2916
3018
|
function SecureRandom_0(logger) {
|
|
2917
3019
|
logger = logger === VOID ? new PlatformRaspberryLogger() : logger;
|
|
2918
|
-
this.
|
|
2919
|
-
this.
|
|
2920
|
-
this.
|
|
3020
|
+
this.y5v_1 = logger;
|
|
3021
|
+
this.z5v_1 = new SecureRandom();
|
|
3022
|
+
this.a5w_1 = Default_getInstance();
|
|
2921
3023
|
}
|
|
2922
3024
|
protoOf(SecureRandom_0).qg = function (from, until) {
|
|
2923
3025
|
checkRangeBounds(this, from, until);
|
|
@@ -2946,7 +3048,7 @@
|
|
|
2946
3048
|
}
|
|
2947
3049
|
}
|
|
2948
3050
|
};
|
|
2949
|
-
protoOf(SecureRandom_0).
|
|
3051
|
+
protoOf(SecureRandom_0).c5w = function () {
|
|
2950
3052
|
return !(nextBits(this, 1) === 0);
|
|
2951
3053
|
};
|
|
2952
3054
|
function CustomRandom() {
|
|
@@ -2969,7 +3071,7 @@
|
|
|
2969
3071
|
while (pile.m() > 0) {
|
|
2970
3072
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
2971
3073
|
var a = pile.m();
|
|
2972
|
-
var b = 1 + random.
|
|
3074
|
+
var b = 1 + random.b5w(VOID, twentypc) | 0;
|
|
2973
3075
|
var cards = Math.min(a, b);
|
|
2974
3076
|
pile2.b2(0, take(pile, cards));
|
|
2975
3077
|
// Inline function 'kotlin.repeat' call
|
|
@@ -3004,11 +3106,11 @@
|
|
|
3004
3106
|
// Inline function 'games.raspberry.card_game.random.utils.random.riffle.<anonymous>' call
|
|
3005
3107
|
var mid = deck.m() / 2 | 0;
|
|
3006
3108
|
var tenpc = mid / 10 | 0;
|
|
3007
|
-
var cut = (mid - tenpc | 0) + random.
|
|
3109
|
+
var cut = (mid - tenpc | 0) + random.b5w(VOID, imul(2, tenpc) + 1 | 0) | 0;
|
|
3008
3110
|
var deck1 = toMutableList(take(pile, cut));
|
|
3009
3111
|
var deck2 = toMutableList(drop(pile, cut));
|
|
3010
3112
|
pile.a2();
|
|
3011
|
-
var fromTop = random.
|
|
3113
|
+
var fromTop = random.c5w();
|
|
3012
3114
|
while (deck1.m() > 0 && deck2.m() > 0) {
|
|
3013
3115
|
if (fromTop) {
|
|
3014
3116
|
pile.e(deck1.e2(0));
|
|
@@ -3030,8 +3132,8 @@
|
|
|
3030
3132
|
}
|
|
3031
3133
|
function HttpFactory$provideHttpClient$lambda$lambda($config) {
|
|
3032
3134
|
return function ($this$install) {
|
|
3033
|
-
$this$install.j3g($config.
|
|
3034
|
-
$this$install.h3g($config.
|
|
3135
|
+
$this$install.j3g($config.r5v_1);
|
|
3136
|
+
$this$install.h3g($config.r5v_1);
|
|
3035
3137
|
return Unit_instance;
|
|
3036
3138
|
};
|
|
3037
3139
|
}
|
|
@@ -3039,13 +3141,13 @@
|
|
|
3039
3141
|
return function ($this$HttpClient) {
|
|
3040
3142
|
var tmp = Plugin_getInstance_0();
|
|
3041
3143
|
$this$HttpClient.s2w(tmp, HttpFactory$provideHttpClient$lambda$lambda($config));
|
|
3042
|
-
ApiCommonConfigs_instance.
|
|
3144
|
+
ApiCommonConfigs_instance.u5v($this$HttpClient, $config, $externalLogger);
|
|
3043
3145
|
return Unit_instance;
|
|
3044
3146
|
};
|
|
3045
3147
|
}
|
|
3046
3148
|
function HttpFactory() {
|
|
3047
3149
|
}
|
|
3048
|
-
protoOf(HttpFactory).
|
|
3150
|
+
protoOf(HttpFactory).e5w = function (config, externalLogger) {
|
|
3049
3151
|
var tmp = Js_instance;
|
|
3050
3152
|
return HttpClient(tmp, HttpFactory$provideHttpClient$lambda(config, externalLogger));
|
|
3051
3153
|
};
|
|
@@ -3061,8 +3163,8 @@
|
|
|
3061
3163
|
protoOf($serializer_5).a4g = typeParametersSerializers;
|
|
3062
3164
|
protoOf($serializer_6).a4g = typeParametersSerializers;
|
|
3063
3165
|
protoOf(RandomPoolProviderImpl).t5q = getCardDeck$default;
|
|
3064
|
-
protoOf(SecureRandom_0).
|
|
3065
|
-
protoOf(SecureRandom_0).
|
|
3166
|
+
protoOf(SecureRandom_0).b5w = nextInt$default;
|
|
3167
|
+
protoOf(SecureRandom_0).d5w = shuffle;
|
|
3066
3168
|
//endregion
|
|
3067
3169
|
//region block: init
|
|
3068
3170
|
Companion_instance_1 = new Companion();
|