raspberry_games_server_game_logic 1.8.369 → 1.8.371

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.
@@ -380,7 +380,7 @@
380
380
  function addFormatStructureForTime(structure) {
381
381
  this.t5k(structure);
382
382
  }
383
- initMetadataForInterface(AbstractWithDateTimeBuilder, 'AbstractWithDateTimeBuilder', VOID, VOID, [AbstractWithDateBuilder, AbstractWithTimeBuilder, WithTime, WithDate]);
383
+ initMetadataForInterface(AbstractWithDateTimeBuilder, 'AbstractWithDateTimeBuilder', VOID, VOID, [AbstractWithDateBuilder, AbstractWithTimeBuilder, WithDate, WithTime]);
384
384
  initMetadataForClass(Builder_0, 'Builder', VOID, VOID, [AbstractDateTimeFormatBuilder, AbstractWithDateTimeBuilder]);
385
385
  initMetadataForClass(LocalDateTimeFormat, 'LocalDateTimeFormat', VOID, AbstractDateTimeFormat);
386
386
  function set_fractionOfSecond(value) {
@@ -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.371';
383
383
  }
384
384
  protoOf(GameEngineConfig).y3v = function () {
385
385
  return this.version;
@@ -42577,6 +42577,9 @@
42577
42577
  var kLoss = Math.max(tmp0, b_0);
42578
42578
  var raw = item.h70_1 + kBase * (kWin * diffPos + kLoss * diffNeg);
42579
42579
  var newRating = clampAndRound($this, raw, minUserRating, maxUserRating);
42580
+ if (item.j70_1 && newRating < item.h70_1) {
42581
+ newRating = item.h70_1;
42582
+ }
42580
42583
  tmp$ret$3 = new PlayerRatingOutput(item.g70_1, item.h70_1, newRating, item.j70_1);
42581
42584
  }
42582
42585
  destination.j(tmp$ret$3);
@@ -42708,7 +42711,7 @@
42708
42711
  }
42709
42712
  }
42710
42713
  function clampAndRound($this, value, minUserRating, maxUserRating) {
42711
- var upper = false ? maxUserRating : 1.7976931348623157E308;
42714
+ var upper = maxUserRating;
42712
42715
  var clamped = coerceIn(value, minUserRating, upper);
42713
42716
  // Inline function 'kotlin.math.pow' call
42714
42717
  var factor = Math.pow(10.0, 2);
@@ -49997,6 +50000,54 @@
49997
50000
  // Inline function 'com.logic.redux.store.definitions.middlewareForActionType' call
49998
50001
  return new roundLifecycleMiddleware$$inlined$middlewareForActionType$1(scenePositionProvider, logger);
49999
50002
  }
50003
+ function validateRatingChange(logger, playerAchievements) {
50004
+ var tmp;
50005
+ if (playerAchievements == null) {
50006
+ tmp = null;
50007
+ } else {
50008
+ // Inline function 'kotlin.collections.filter' call
50009
+ // Inline function 'kotlin.collections.filterTo' call
50010
+ var destination = ArrayList_init_$Create$_0();
50011
+ var _iterator__ex2g4s = playerAchievements.l();
50012
+ while (_iterator__ex2g4s.m()) {
50013
+ var element = _iterator__ex2g4s.n();
50014
+ // Inline function 'kotlin.math.absoluteValue' call
50015
+ var this_0 = element.oldRating - element.newRating;
50016
+ if (Math.abs(this_0) >= 80) {
50017
+ destination.j(element);
50018
+ }
50019
+ }
50020
+ tmp = destination;
50021
+ }
50022
+ var tmp1_elvis_lhs = tmp;
50023
+ var suspiciousRatingChange = tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs;
50024
+ // Inline function 'kotlin.collections.isNotEmpty' call
50025
+ if (!suspiciousRatingChange.r()) {
50026
+ logger.w('roundLifecycleMiddleware', 'Suspicious rating change: ' + toString(suspiciousRatingChange));
50027
+ }
50028
+ var tmp_0;
50029
+ if (playerAchievements == null) {
50030
+ tmp_0 = null;
50031
+ } else {
50032
+ // Inline function 'kotlin.collections.filter' call
50033
+ // Inline function 'kotlin.collections.filterTo' call
50034
+ var destination_0 = ArrayList_init_$Create$_0();
50035
+ var _iterator__ex2g4s_0 = playerAchievements.l();
50036
+ while (_iterator__ex2g4s_0.m()) {
50037
+ var element_0 = _iterator__ex2g4s_0.n();
50038
+ if (element_0.oldRating < 2000 && element_0.newRating > 2000) {
50039
+ destination_0.j(element_0);
50040
+ }
50041
+ }
50042
+ tmp_0 = destination_0;
50043
+ }
50044
+ var tmp3_elvis_lhs = tmp_0;
50045
+ var ratingChangeAboveLimit = tmp3_elvis_lhs == null ? emptyList() : tmp3_elvis_lhs;
50046
+ // Inline function 'kotlin.collections.isNotEmpty' call
50047
+ if (!ratingChangeAboveLimit.r()) {
50048
+ logger.w('roundLifecycleMiddleware', 'Rating change above limit: ' + toString(suspiciousRatingChange));
50049
+ }
50050
+ }
50000
50051
  function roundLifecycleMiddleware$$inlined$middlewareForActionType$1($scenePositionProvider, $logger) {
50001
50052
  this.v91_1 = $scenePositionProvider;
50002
50053
  this.w91_1 = $logger;
@@ -50116,105 +50167,60 @@
50116
50167
  tmp_3 = destination_2;
50117
50168
  }
50118
50169
  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
- }
50170
+ validateRatingChange(this.w91_1, playerAchievements);
50171
+ var tmp_4 = store.dispatch;
50172
+ var tmp15_id = table_0.id;
50173
+ var tmp16_gameId = table_0.gameId;
50174
+ var tmp17_roundNumber = table_0.gameInfo.round.roundNumber;
50175
+ var tmp18_earnedBiggestPointPlayerId = sceneData.b79_1;
50143
50176
  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
50177
  if (gameWinners == null) {
50172
- tmp_7 = null;
50178
+ tmp_5 = null;
50173
50179
  } else {
50174
50180
  // Inline function 'kotlin.collections.toTypedArray' call
50175
- tmp_7 = copyToArray(gameWinners);
50181
+ tmp_5 = copyToArray(gameWinners);
50176
50182
  }
50177
- var tmp23_gameWinners = tmp_7;
50178
- var tmp_8;
50183
+ var tmp19_gameWinners = tmp_5;
50184
+ var tmp_6;
50179
50185
  if (isGameFinished) {
50180
50186
  // Inline function 'kotlin.collections.map' call
50181
- var this_3 = table_0.players;
50187
+ var this_2 = table_0.players;
50182
50188
  // 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);
50189
+ var destination_3 = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10));
50190
+ var _iterator__ex2g4s_3 = this_2.l();
50191
+ while (_iterator__ex2g4s_3.m()) {
50192
+ var item_2 = _iterator__ex2g4s_3.n();
50193
+ var tmp$ret$23 = mapToGameAnalytics(item_2, table_0.gameDuration);
50194
+ destination_3.j(tmp$ret$23);
50189
50195
  }
50190
50196
  // Inline function 'kotlin.collections.toTypedArray' call
50191
- tmp_8 = copyToArray(destination_5);
50197
+ tmp_6 = copyToArray(destination_3);
50192
50198
  } else {
50193
- tmp_8 = null;
50199
+ tmp_6 = null;
50194
50200
  }
50195
- var tmp24_playersGameAnalytics = tmp_8;
50201
+ var tmp20_playersGameAnalytics = tmp_6;
50196
50202
  // Inline function 'kotlin.collections.map' call
50197
- var this_4 = table_0.players;
50203
+ var this_3 = table_0.players;
50198
50204
  // 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);
50205
+ var destination_4 = ArrayList_init_$Create$(collectionSizeOrDefault(this_3, 10));
50206
+ var _iterator__ex2g4s_4 = this_3.l();
50207
+ while (_iterator__ex2g4s_4.m()) {
50208
+ var item_3 = _iterator__ex2g4s_4.n();
50209
+ var tmp$ret$27 = mapToRoundAnalytics(item_3, table_0.gameDuration);
50210
+ destination_4.j(tmp$ret$27);
50205
50211
  }
50206
50212
  // Inline function 'kotlin.collections.toTypedArray' call
50207
- var tmp25_playersRoundAnalytics = copyToArray(destination_6);
50208
- var tmp26_gameHistory = table_0.gameHistory;
50209
- var tmp_9;
50213
+ var tmp21_playersRoundAnalytics = copyToArray(destination_4);
50214
+ var tmp22_gameHistory = table_0.gameHistory;
50215
+ var tmp_7;
50210
50216
  if (playerAchievements == null) {
50211
- tmp_9 = null;
50217
+ tmp_7 = null;
50212
50218
  } else {
50213
50219
  // Inline function 'kotlin.collections.toTypedArray' call
50214
- tmp_9 = copyToArray(playerAchievements);
50220
+ tmp_7 = copyToArray(playerAchievements);
50215
50221
  }
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));
50222
+ var tmp23_achievements = tmp_7;
50223
+ tmp_4(new RoundEndedAction(tmp15_id, tmp16_gameId, tmp17_roundNumber, tmp18_earnedBiggestPointPlayerId, gameLosers, tmp19_gameWinners, tmp20_playersGameAnalytics, tmp21_playersRoundAnalytics, tmp23_achievements, tmp22_gameHistory));
50218
50224
  }
50219
50225
  }
50220
50226
  }
@@ -54745,7 +54751,7 @@
54745
54751
  var tmp3_bribes = emptyList();
54746
54752
  var tmp4_gameInfo = roundFinishedGameInfoReducer(this, table);
54747
54753
  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);
54754
+ return table.copy(VOID, VOID, VOID, VOID, destination, VOID, tmp0_sceneInfo, tmp2_cardsOnTable, tmp3_bribes, VOID, VOID, tmp4_gameInfo, tmp5_gameHistory);
54749
54755
  };
54750
54756
  protoOf(TableLifecycleReducerImpl).p99 = function (table) {
54751
54757
  // Inline function 'kotlin.collections.map' call