raspberry_games_server_game_logic 1.8.369 → 1.8.370

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.
@@ -379,7 +379,7 @@
379
379
  initMetadataForClass(AppEnvironmentValue, 'AppEnvironmentValue', VOID, Enum);
380
380
  //endregion
381
381
  function GameEngineConfig() {
382
- this.version = '1.8.369';
382
+ this.version = '1.8.370';
383
383
  }
384
384
  protoOf(GameEngineConfig).y3v = function () {
385
385
  return this.version;
@@ -42708,7 +42708,7 @@
42708
42708
  }
42709
42709
  }
42710
42710
  function clampAndRound($this, value, minUserRating, maxUserRating) {
42711
- var upper = false ? maxUserRating : 1.7976931348623157E308;
42711
+ var upper = maxUserRating;
42712
42712
  var clamped = coerceIn(value, minUserRating, upper);
42713
42713
  // Inline function 'kotlin.math.pow' call
42714
42714
  var factor = Math.pow(10.0, 2);
@@ -49997,6 +49997,54 @@
49997
49997
  // Inline function 'com.logic.redux.store.definitions.middlewareForActionType' call
49998
49998
  return new roundLifecycleMiddleware$$inlined$middlewareForActionType$1(scenePositionProvider, logger);
49999
49999
  }
50000
+ function validateRatingChange(logger, playerAchievements) {
50001
+ var tmp;
50002
+ if (playerAchievements == null) {
50003
+ tmp = null;
50004
+ } else {
50005
+ // Inline function 'kotlin.collections.filter' call
50006
+ // Inline function 'kotlin.collections.filterTo' call
50007
+ var destination = ArrayList_init_$Create$_0();
50008
+ var _iterator__ex2g4s = playerAchievements.l();
50009
+ while (_iterator__ex2g4s.m()) {
50010
+ var element = _iterator__ex2g4s.n();
50011
+ // Inline function 'kotlin.math.absoluteValue' call
50012
+ var this_0 = element.oldRating - element.newRating;
50013
+ if (Math.abs(this_0) >= 80) {
50014
+ destination.j(element);
50015
+ }
50016
+ }
50017
+ tmp = destination;
50018
+ }
50019
+ var tmp1_elvis_lhs = tmp;
50020
+ var suspiciousRatingChange = tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs;
50021
+ // Inline function 'kotlin.collections.isNotEmpty' call
50022
+ if (!suspiciousRatingChange.r()) {
50023
+ logger.w('roundLifecycleMiddleware', 'Suspicious rating change: ' + toString(suspiciousRatingChange));
50024
+ }
50025
+ var tmp_0;
50026
+ if (playerAchievements == null) {
50027
+ tmp_0 = null;
50028
+ } else {
50029
+ // Inline function 'kotlin.collections.filter' call
50030
+ // Inline function 'kotlin.collections.filterTo' call
50031
+ var destination_0 = ArrayList_init_$Create$_0();
50032
+ var _iterator__ex2g4s_0 = playerAchievements.l();
50033
+ while (_iterator__ex2g4s_0.m()) {
50034
+ var element_0 = _iterator__ex2g4s_0.n();
50035
+ if (element_0.oldRating < 2000 && element_0.newRating > 2000) {
50036
+ destination_0.j(element_0);
50037
+ }
50038
+ }
50039
+ tmp_0 = destination_0;
50040
+ }
50041
+ var tmp3_elvis_lhs = tmp_0;
50042
+ var ratingChangeAboveLimit = tmp3_elvis_lhs == null ? emptyList() : tmp3_elvis_lhs;
50043
+ // Inline function 'kotlin.collections.isNotEmpty' call
50044
+ if (!ratingChangeAboveLimit.r()) {
50045
+ logger.w('roundLifecycleMiddleware', 'Rating change above limit: ' + toString(suspiciousRatingChange));
50046
+ }
50047
+ }
50000
50048
  function roundLifecycleMiddleware$$inlined$middlewareForActionType$1($scenePositionProvider, $logger) {
50001
50049
  this.v91_1 = $scenePositionProvider;
50002
50050
  this.w91_1 = $logger;
@@ -50116,105 +50164,60 @@
50116
50164
  tmp_3 = destination_2;
50117
50165
  }
50118
50166
  var playerAchievements = tmp_3;
50119
- var tmp_4;
50120
- if (playerAchievements == null) {
50121
- tmp_4 = null;
50122
- } else {
50123
- // Inline function 'kotlin.collections.filter' call
50124
- // Inline function 'kotlin.collections.filterTo' call
50125
- var destination_3 = ArrayList_init_$Create$_0();
50126
- var _iterator__ex2g4s_3 = playerAchievements.l();
50127
- while (_iterator__ex2g4s_3.m()) {
50128
- var element_0 = _iterator__ex2g4s_3.n();
50129
- // Inline function 'kotlin.math.absoluteValue' call
50130
- var this_2 = element_0.oldRating - element_0.newRating;
50131
- if (Math.abs(this_2) >= 60) {
50132
- destination_3.j(element_0);
50133
- }
50134
- }
50135
- tmp_4 = destination_3;
50136
- }
50137
- var tmp14_elvis_lhs = tmp_4;
50138
- var suspiciousRatingChange = tmp14_elvis_lhs == null ? emptyList() : tmp14_elvis_lhs;
50139
- // Inline function 'kotlin.collections.isNotEmpty' call
50140
- if (!suspiciousRatingChange.r()) {
50141
- this.w91_1.w('roundLifecycleMiddleware', 'Suspicious rating change: ' + toString(suspiciousRatingChange));
50142
- }
50167
+ validateRatingChange(this.w91_1, playerAchievements);
50168
+ var tmp_4 = store.dispatch;
50169
+ var tmp15_id = table_0.id;
50170
+ var tmp16_gameId = table_0.gameId;
50171
+ var tmp17_roundNumber = table_0.gameInfo.round.roundNumber;
50172
+ var tmp18_earnedBiggestPointPlayerId = sceneData.b79_1;
50143
50173
  var tmp_5;
50144
- if (playerAchievements == null) {
50145
- tmp_5 = null;
50146
- } else {
50147
- // Inline function 'kotlin.collections.filter' call
50148
- // Inline function 'kotlin.collections.filterTo' call
50149
- var destination_4 = ArrayList_init_$Create$_0();
50150
- var _iterator__ex2g4s_4 = playerAchievements.l();
50151
- while (_iterator__ex2g4s_4.m()) {
50152
- var element_1 = _iterator__ex2g4s_4.n();
50153
- if (element_1.oldRating < 2000 && element_1.newRating > 2000) {
50154
- destination_4.j(element_1);
50155
- }
50156
- }
50157
- tmp_5 = destination_4;
50158
- }
50159
- var tmp16_elvis_lhs = tmp_5;
50160
- var ratingChangeAboveLimit = tmp16_elvis_lhs == null ? emptyList() : tmp16_elvis_lhs;
50161
- // Inline function 'kotlin.collections.isNotEmpty' call
50162
- if (!ratingChangeAboveLimit.r()) {
50163
- this.w91_1.w('roundLifecycleMiddleware', 'Rating change above limit: ' + toString(suspiciousRatingChange));
50164
- }
50165
- var tmp_6 = store.dispatch;
50166
- var tmp19_id = table_0.id;
50167
- var tmp20_gameId = table_0.gameId;
50168
- var tmp21_roundNumber = table_0.gameInfo.round.roundNumber;
50169
- var tmp22_earnedBiggestPointPlayerId = sceneData.b79_1;
50170
- var tmp_7;
50171
50174
  if (gameWinners == null) {
50172
- tmp_7 = null;
50175
+ tmp_5 = null;
50173
50176
  } else {
50174
50177
  // Inline function 'kotlin.collections.toTypedArray' call
50175
- tmp_7 = copyToArray(gameWinners);
50178
+ tmp_5 = copyToArray(gameWinners);
50176
50179
  }
50177
- var tmp23_gameWinners = tmp_7;
50178
- var tmp_8;
50180
+ var tmp19_gameWinners = tmp_5;
50181
+ var tmp_6;
50179
50182
  if (isGameFinished) {
50180
50183
  // Inline function 'kotlin.collections.map' call
50181
- var this_3 = table_0.players;
50184
+ var this_2 = table_0.players;
50182
50185
  // Inline function 'kotlin.collections.mapTo' call
50183
- var destination_5 = ArrayList_init_$Create$(collectionSizeOrDefault(this_3, 10));
50184
- var _iterator__ex2g4s_5 = this_3.l();
50185
- while (_iterator__ex2g4s_5.m()) {
50186
- var item_2 = _iterator__ex2g4s_5.n();
50187
- var tmp$ret$32 = mapToGameAnalytics(item_2, table_0.gameDuration);
50188
- destination_5.j(tmp$ret$32);
50186
+ var destination_3 = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10));
50187
+ var _iterator__ex2g4s_3 = this_2.l();
50188
+ while (_iterator__ex2g4s_3.m()) {
50189
+ var item_2 = _iterator__ex2g4s_3.n();
50190
+ var tmp$ret$23 = mapToGameAnalytics(item_2, table_0.gameDuration);
50191
+ destination_3.j(tmp$ret$23);
50189
50192
  }
50190
50193
  // Inline function 'kotlin.collections.toTypedArray' call
50191
- tmp_8 = copyToArray(destination_5);
50194
+ tmp_6 = copyToArray(destination_3);
50192
50195
  } else {
50193
- tmp_8 = null;
50196
+ tmp_6 = null;
50194
50197
  }
50195
- var tmp24_playersGameAnalytics = tmp_8;
50198
+ var tmp20_playersGameAnalytics = tmp_6;
50196
50199
  // Inline function 'kotlin.collections.map' call
50197
- var this_4 = table_0.players;
50200
+ var this_3 = table_0.players;
50198
50201
  // Inline function 'kotlin.collections.mapTo' call
50199
- var destination_6 = ArrayList_init_$Create$(collectionSizeOrDefault(this_4, 10));
50200
- var _iterator__ex2g4s_6 = this_4.l();
50201
- while (_iterator__ex2g4s_6.m()) {
50202
- var item_3 = _iterator__ex2g4s_6.n();
50203
- var tmp$ret$36 = mapToRoundAnalytics(item_3, table_0.gameDuration);
50204
- destination_6.j(tmp$ret$36);
50202
+ var destination_4 = ArrayList_init_$Create$(collectionSizeOrDefault(this_3, 10));
50203
+ var _iterator__ex2g4s_4 = this_3.l();
50204
+ while (_iterator__ex2g4s_4.m()) {
50205
+ var item_3 = _iterator__ex2g4s_4.n();
50206
+ var tmp$ret$27 = mapToRoundAnalytics(item_3, table_0.gameDuration);
50207
+ destination_4.j(tmp$ret$27);
50205
50208
  }
50206
50209
  // Inline function 'kotlin.collections.toTypedArray' call
50207
- var tmp25_playersRoundAnalytics = copyToArray(destination_6);
50208
- var tmp26_gameHistory = table_0.gameHistory;
50209
- var tmp_9;
50210
+ var tmp21_playersRoundAnalytics = copyToArray(destination_4);
50211
+ var tmp22_gameHistory = table_0.gameHistory;
50212
+ var tmp_7;
50210
50213
  if (playerAchievements == null) {
50211
- tmp_9 = null;
50214
+ tmp_7 = null;
50212
50215
  } else {
50213
50216
  // Inline function 'kotlin.collections.toTypedArray' call
50214
- tmp_9 = copyToArray(playerAchievements);
50217
+ tmp_7 = copyToArray(playerAchievements);
50215
50218
  }
50216
- var tmp27_achievements = tmp_9;
50217
- tmp_6(new RoundEndedAction(tmp19_id, tmp20_gameId, tmp21_roundNumber, tmp22_earnedBiggestPointPlayerId, gameLosers, tmp23_gameWinners, tmp24_playersGameAnalytics, tmp25_playersRoundAnalytics, tmp27_achievements, tmp26_gameHistory));
50219
+ var tmp23_achievements = tmp_7;
50220
+ tmp_4(new RoundEndedAction(tmp15_id, tmp16_gameId, tmp17_roundNumber, tmp18_earnedBiggestPointPlayerId, gameLosers, tmp19_gameWinners, tmp20_playersGameAnalytics, tmp21_playersRoundAnalytics, tmp23_achievements, tmp22_gameHistory));
50218
50221
  }
50219
50222
  }
50220
50223
  }
@@ -54745,7 +54748,7 @@
54745
54748
  var tmp3_bribes = emptyList();
54746
54749
  var tmp4_gameInfo = roundFinishedGameInfoReducer(this, table);
54747
54750
  var tmp5_gameHistory = this.a9a_1.v99(table.gameHistory);
54748
- return table.copy(VOID, VOID, VOID, VOID, destination, VOID, tmp0_sceneInfo, tmp2_cardsOnTable, tmp3_bribes, null, VOID, tmp4_gameInfo, tmp5_gameHistory);
54751
+ return table.copy(VOID, VOID, VOID, VOID, destination, VOID, tmp0_sceneInfo, tmp2_cardsOnTable, tmp3_bribes, VOID, VOID, tmp4_gameInfo, tmp5_gameHistory);
54749
54752
  };
54750
54753
  protoOf(TableLifecycleReducerImpl).p99 = function (table) {
54751
54754
  // Inline function 'kotlin.collections.map' call