jp.ms.common.modules 1.0.34 → 1.0.36
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/dist/dto/app-screen/app-screen-field-list-item.dto.js.map +1 -1
- package/dist/dto/app-screen/app-screen-field.dto.js.map +1 -1
- package/dist/dto/app-screen/app-screen-section-list-item.dto.js.map +1 -1
- package/dist/dto/app-screen/app-screen.dto.js +3 -1
- package/dist/dto/app-screen/app-screen.dto.js.map +1 -1
- package/dist/dto/app-screen/base-app-screen.dto.js +3 -1
- package/dist/dto/app-screen/base-app-screen.dto.js.map +1 -1
- package/dist/dto/app-table/card.dto.js.map +1 -1
- package/dist/dto/app-table/cards-deck.dto.d.ts +2 -2
- package/dist/dto/app-table/cards-deck.dto.js.map +1 -1
- package/dist/dto/app-table/cards-player.dto.js.map +1 -1
- package/dist/dto/common/find-free-table.dto.js.map +1 -1
- package/dist/dto/common/join-tournament.dto.js.map +1 -1
- package/dist/dto/common/many-tables-tournament-create.dto.js +3 -1
- package/dist/dto/common/many-tables-tournament-create.dto.js.map +1 -1
- package/dist/dto/common/player-check-state.dto.js.map +1 -1
- package/dist/dto/common/player-connected.dto.js.map +1 -1
- package/dist/dto/games/fool/fool-player.dto.d.ts +1 -1
- package/dist/dto/games/fool/fool-player.dto.js.map +1 -1
- package/dist/dto/games/fool/fool-table.dto.d.ts +4 -4
- package/dist/dto/games/fool/fool-table.dto.js +3 -1
- package/dist/dto/games/fool/fool-table.dto.js.map +1 -1
- package/dist/dto/index.js.map +1 -1
- package/dist/exception/error-code.enum.js.map +1 -1
- package/dist/exception/global-exception-filter.js +3 -9
- package/dist/exception/global-exception-filter.js.map +1 -1
- package/dist/exception/http-exception-wth-snackbar.js.map +1 -1
- package/dist/exception/index.js.map +1 -1
- package/dist/exception/not-enough-money-for-purchase.exception.js.map +1 -1
- package/dist/exception/not-found-free-room-for-fast-game.exception.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/anti-freeze-system/anti-freeze-system.interfaces.d.ts +3 -3
- package/dist/modules/anti-freeze-system/anti-freeze-system.module.d.ts +3 -5
- package/dist/modules/anti-freeze-system/anti-freeze-system.module.js +6 -12
- package/dist/modules/anti-freeze-system/anti-freeze-system.module.js.map +1 -1
- package/dist/modules/anti-freeze-system/anti-freeze-system.service.d.ts +3 -3
- package/dist/modules/anti-freeze-system/anti-freeze-system.service.js +8 -6
- package/dist/modules/anti-freeze-system/anti-freeze-system.service.js.map +1 -1
- package/dist/modules/base-achievements/base-achievements.module.d.ts +1 -1
- package/dist/modules/base-achievements/base-achievements.module.js +24 -16
- package/dist/modules/base-achievements/base-achievements.module.js.map +1 -1
- package/dist/modules/event-bus/events-bus.app.subscribe.service.js.map +1 -1
- package/dist/modules/event-bus/events-bus.main-tables.subscribe.service.d.ts +1 -1
- package/dist/modules/event-bus/events-bus.main-tables.subscribe.service.js.map +1 -1
- package/dist/modules/event-bus/events-bus.module.js +1 -1
- package/dist/modules/event-bus/events-bus.module.js.map +1 -1
- package/dist/modules/event-bus/events-bus.tournament.subscribe.service.js.map +1 -1
- package/dist/modules/events/events.gateway.js.map +1 -1
- package/dist/modules/events/events.module.js.map +1 -1
- package/dist/modules/index.d.ts +4 -4
- package/dist/modules/index.js +7 -7
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/logger/jp-logger.module.js.map +1 -1
- package/dist/modules/logger/jp-logger.service.d.ts +1 -1
- package/dist/modules/logger/jp-logger.service.js +1 -1
- package/dist/modules/logger/jp-logger.service.js.map +1 -1
- package/dist/modules/main/main-tables-list-screen.view.d.ts +2 -2
- package/dist/modules/main/main-tables-list-screen.view.js +32 -13
- package/dist/modules/main/main-tables-list-screen.view.js.map +1 -1
- package/dist/modules/main/main.controller.js.map +1 -1
- package/dist/modules/main/main.module.d.ts +1 -1
- package/dist/modules/main/main.module.js +8 -8
- package/dist/modules/main/main.module.js.map +1 -1
- package/dist/modules/main/main.service.d.ts +3 -3
- package/dist/modules/main/main.service.js +9 -6
- package/dist/modules/main/main.service.js.map +1 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament-status-screen.view.d.ts +2 -2
- package/dist/modules/many-tables-tournament/many-tables-tournament-status-screen.view.js +20 -10
- package/dist/modules/many-tables-tournament/many-tables-tournament-status-screen.view.js.map +1 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament-tables-list-screen.view.d.ts +2 -2
- package/dist/modules/many-tables-tournament/many-tables-tournament-tables-list-screen.view.js +7 -2
- package/dist/modules/many-tables-tournament/many-tables-tournament-tables-list-screen.view.js.map +1 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament.constants.js.map +1 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament.controller.d.ts +3 -3
- package/dist/modules/many-tables-tournament/many-tables-tournament.controller.js +5 -7
- package/dist/modules/many-tables-tournament/many-tables-tournament.controller.js.map +1 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament.module.d.ts +3 -3
- package/dist/modules/many-tables-tournament/many-tables-tournament.module.js +14 -6
- package/dist/modules/many-tables-tournament/many-tables-tournament.module.js.map +1 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament.service.d.ts +3 -3
- package/dist/modules/many-tables-tournament/many-tables-tournament.service.js +5 -4
- package/dist/modules/many-tables-tournament/many-tables-tournament.service.js.map +1 -1
- package/dist/modules/many-tables-tournament-rooms-manager/index.d.ts +2 -0
- package/dist/modules/many-tables-tournament-rooms-manager/index.js +8 -0
- package/dist/modules/{tournament-many-tables-rooms-manager → many-tables-tournament-rooms-manager}/index.js.map +1 -1
- package/dist/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.constants.d.ts +1 -0
- package/dist/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.constants.js +5 -0
- package/dist/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.constants.js.map +1 -0
- package/dist/modules/{tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.interfaces.d.ts → many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.interfaces.d.ts} +13 -7
- package/dist/modules/{tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.interfaces.js → many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.interfaces.js} +1 -1
- package/dist/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.interfaces.js.map +1 -0
- package/dist/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.module.d.ts +11 -0
- package/dist/modules/{tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.module.js → many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.module.js} +29 -21
- package/dist/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.module.js.map +1 -0
- package/dist/modules/{tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.service.d.ts → many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.service.d.ts} +4 -4
- package/dist/modules/{tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.service.js → many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.service.js} +33 -31
- package/dist/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.service.js.map +1 -0
- package/dist/modules/menu/menu-screen.view.d.ts +2 -2
- package/dist/modules/menu/menu-screen.view.js +1 -1
- package/dist/modules/menu/menu-screen.view.js.map +1 -1
- package/dist/modules/menu/menu.controller.js.map +1 -1
- package/dist/modules/menu/menu.module.js.map +1 -1
- package/dist/modules/menu/menu.service.js +1 -1
- package/dist/modules/menu/menu.service.js.map +1 -1
- package/dist/modules/one-table-tournament/one-table-tournament-status-screen.view.d.ts +2 -2
- package/dist/modules/one-table-tournament/one-table-tournament-status-screen.view.js +18 -10
- package/dist/modules/one-table-tournament/one-table-tournament-status-screen.view.js.map +1 -1
- package/dist/modules/one-table-tournament/one-table-tournament.constants.js.map +1 -1
- package/dist/modules/one-table-tournament/one-table-tournament.controller.js.map +1 -1
- package/dist/modules/one-table-tournament/one-table-tournament.module.d.ts +3 -3
- package/dist/modules/one-table-tournament/one-table-tournament.module.js +14 -6
- package/dist/modules/one-table-tournament/one-table-tournament.module.js.map +1 -1
- package/dist/modules/one-table-tournament/one-table-tournament.service.d.ts +2 -2
- package/dist/modules/one-table-tournament/one-table-tournament.service.js +2 -2
- package/dist/modules/one-table-tournament/one-table-tournament.service.js.map +1 -1
- package/dist/modules/one-table-tournament-rooms-manager/index.d.ts +2 -0
- package/dist/modules/one-table-tournament-rooms-manager/index.js +8 -0
- package/dist/modules/{tournament-one-table-rooms-manager → one-table-tournament-rooms-manager}/index.js.map +1 -1
- package/dist/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.constants.d.ts +1 -0
- package/dist/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.constants.js +5 -0
- package/dist/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.constants.js.map +1 -0
- package/dist/modules/{tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.interfaces.d.ts → one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.interfaces.d.ts} +9 -7
- package/dist/modules/{tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.interfaces.js → one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.interfaces.js} +1 -1
- package/dist/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.interfaces.js.map +1 -0
- package/dist/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.module.d.ts +9 -0
- package/dist/modules/{tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.module.js → one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.module.js} +24 -17
- package/dist/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.module.js.map +1 -0
- package/dist/modules/{tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.service.d.ts → one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.service.d.ts} +4 -4
- package/dist/modules/{tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.service.js → one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.service.js} +19 -20
- package/dist/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.service.js.map +1 -0
- package/dist/modules/players-manager/players-manager.module.js +1 -1
- package/dist/modules/players-manager/players-manager.module.js.map +1 -1
- package/dist/modules/players-manager/players-manager.service.js.map +1 -1
- package/dist/modules/simple-rooms/simple-rooms.controller.js.map +1 -1
- package/dist/modules/simple-rooms/simple-rooms.module.js +4 -3
- package/dist/modules/simple-rooms/simple-rooms.module.js.map +1 -1
- package/dist/modules/simple-rooms/simple-rooms.service.js.map +1 -1
- package/dist/modules/simple-rooms-manager/simple-rooms-manager.constants.js.map +1 -1
- package/dist/modules/simple-rooms-manager/simple-rooms-manager.interfaces.d.ts +6 -4
- package/dist/modules/simple-rooms-manager/simple-rooms-manager.module.js +6 -2
- package/dist/modules/simple-rooms-manager/simple-rooms-manager.module.js.map +1 -1
- package/dist/modules/simple-rooms-manager/simple-rooms-manager.service.js +14 -10
- package/dist/modules/simple-rooms-manager/simple-rooms-manager.service.js.map +1 -1
- package/dist/modules/support/dump.service.d.ts +1 -1
- package/dist/modules/support/dump.service.js +2 -3
- package/dist/modules/support/dump.service.js.map +1 -1
- package/dist/modules/support/metric.service.d.ts +3 -3
- package/dist/modules/support/metric.service.js +1 -1
- package/dist/modules/support/metric.service.js.map +1 -1
- package/dist/modules/support/support.controller.d.ts +2 -2
- package/dist/modules/support/support.controller.js +7 -7
- package/dist/modules/support/support.controller.js.map +1 -1
- package/dist/modules/support/support.interfaces.d.ts +10 -4
- package/dist/modules/support/support.module.d.ts +1 -0
- package/dist/modules/support/support.module.js +13 -0
- package/dist/modules/support/support.module.js.map +1 -1
- package/dist/modules/support/support.service.d.ts +1 -1
- package/dist/modules/support/support.service.js +7 -3
- package/dist/modules/support/support.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/game-table-result.d.ts +2 -2
- package/dist/utils/game-table-result.js +17 -5
- package/dist/utils/game-table-result.js.map +1 -1
- package/dist/views/index.js.map +1 -1
- package/dist/views/many-tables-tournament-conifrm-exit-dialog.view.d.ts +1 -1
- package/dist/views/many-tables-tournament-conifrm-exit-dialog.view.js.map +1 -1
- package/dist/views/one-table-tournament-conifrm-exit-dialog.view.d.ts +1 -1
- package/dist/views/one-table-tournament-conifrm-exit-dialog.view.js.map +1 -1
- package/dist/views/simple-room-conifrm-exit-dialog.view.d.ts +1 -1
- package/dist/views/simple-room-conifrm-exit-dialog.view.js.map +1 -1
- package/dist/views/table-summary.view.d.ts +2 -2
- package/dist/views/table-summary.view.js +17 -5
- package/dist/views/table-summary.view.js.map +1 -1
- package/dist/views/tournament-buy-ticket-dialog.view.d.ts +1 -1
- package/dist/views/tournament-buy-ticket-dialog.view.js +7 -1
- package/dist/views/tournament-buy-ticket-dialog.view.js.map +1 -1
- package/package.json +18 -7
- package/src/dto/app-screen/app-screen-field-list-item.dto.ts +33 -33
- package/src/dto/app-screen/app-screen-field.dto.ts +45 -45
- package/src/dto/app-screen/app-screen-section-list-item.dto.ts +84 -84
- package/src/dto/app-screen/app-screen.dto.ts +3 -1
- package/src/dto/app-screen/base-app-screen.dto.ts +3 -1
- package/src/dto/app-table/card.dto.ts +7 -1
- package/src/dto/app-table/cards-deck.dto.ts +18 -18
- package/src/dto/app-table/cards-player.dto.ts +5 -5
- package/src/dto/app-table/index.ts +1 -1
- package/src/dto/common/find-free-table.dto.ts +1 -1
- package/src/dto/common/index.ts +1 -1
- package/src/dto/common/join-tournament.dto.ts +25 -22
- package/src/dto/common/log.dto.ts +4 -4
- package/src/dto/common/many-tables-tournament-create.dto.ts +4 -2
- package/src/dto/common/player-check-state.dto.ts +25 -22
- package/src/dto/common/player-connected.dto.ts +45 -45
- package/src/dto/games/fool/fool-player.dto.ts +2 -2
- package/src/dto/games/fool/fool-table.dto.ts +65 -63
- package/src/dto/games/index.ts +1 -1
- package/src/dto/index.ts +3 -3
- package/src/exception/error-code.enum.ts +3 -3
- package/src/exception/global-exception-filter.ts +26 -23
- package/src/exception/http-exception-wth-snackbar.ts +18 -14
- package/src/exception/index.ts +2 -2
- package/src/exception/not-enough-money-for-purchase.exception.ts +8 -9
- package/src/exception/not-found-free-room-for-fast-game.exception.ts +8 -9
- package/src/index.ts +1 -2
- package/src/modules/anti-freeze-system/anti-freeze-system.interfaces.ts +9 -6
- package/src/modules/anti-freeze-system/anti-freeze-system.module.ts +44 -44
- package/src/modules/anti-freeze-system/anti-freeze-system.service.ts +83 -72
- package/src/modules/base-achievements/base-achievements.module.ts +198 -61
- package/src/modules/base-achievements/index.ts +1 -1
- package/src/modules/event-bus/events-bus.app.subscribe.service.ts +11 -12
- package/src/modules/event-bus/events-bus.main-tables.subscribe.service.ts +24 -24
- package/src/modules/event-bus/events-bus.many-tables-tournament.subscribe.service.ts +2 -2
- package/src/modules/event-bus/events-bus.module.ts +2 -2
- package/src/modules/event-bus/events-bus.one-table-tournament.subscribe.service.ts +2 -2
- package/src/modules/event-bus/events-bus.tournament.subscribe.service.ts +11 -12
- package/src/modules/event-bus/index.ts +1 -1
- package/src/modules/events/events.gateway.ts +51 -49
- package/src/modules/events/events.interfaces.ts +6 -5
- package/src/modules/events/events.module.ts +18 -19
- package/src/modules/index.ts +15 -9
- package/src/modules/logger/jp-logger.module.ts +2 -2
- package/src/modules/logger/jp-logger.service.ts +28 -22
- package/src/modules/main/main-tables-list-screen.view.ts +247 -201
- package/src/modules/main/main.controller.ts +64 -43
- package/src/modules/main/main.interfaces.ts +6 -4
- package/src/modules/main/main.module.ts +56 -39
- package/src/modules/main/main.service.ts +151 -107
- package/src/modules/many-tables-tournament/index.ts +1 -1
- package/src/modules/many-tables-tournament/many-tables-tournament-status-screen.view.ts +129 -111
- package/src/modules/many-tables-tournament/many-tables-tournament-tables-list-screen.view.ts +57 -55
- package/src/modules/many-tables-tournament/many-tables-tournament.constants.ts +3 -1
- package/src/modules/many-tables-tournament/many-tables-tournament.controller.ts +131 -92
- package/src/modules/many-tables-tournament/many-tables-tournament.interfaces.ts +8 -5
- package/src/modules/many-tables-tournament/many-tables-tournament.module.ts +63 -36
- package/src/modules/many-tables-tournament/many-tables-tournament.service.ts +162 -127
- package/src/modules/many-tables-tournament-rooms-manager/index.ts +2 -0
- package/src/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.constants.ts +3 -0
- package/src/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.interfaces.ts +35 -0
- package/src/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.module.ts +84 -0
- package/src/modules/many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.service.ts +331 -0
- package/src/modules/menu/menu-screen.view.ts +64 -63
- package/src/modules/menu/menu.controller.ts +5 -6
- package/src/modules/menu/menu.interfaces.ts +6 -4
- package/src/modules/menu/menu.module.ts +28 -22
- package/src/modules/menu/menu.service.ts +21 -21
- package/src/modules/one-table-tournament/one-table-tournament-status-screen.view.ts +147 -138
- package/src/modules/one-table-tournament/one-table-tournament.constants.ts +3 -1
- package/src/modules/one-table-tournament/one-table-tournament.controller.ts +91 -60
- package/src/modules/one-table-tournament/one-table-tournament.interfaces.ts +8 -5
- package/src/modules/one-table-tournament/one-table-tournament.module.ts +59 -36
- package/src/modules/one-table-tournament/one-table-tournament.service.ts +104 -80
- package/src/modules/one-table-tournament-rooms-manager/index.ts +2 -0
- package/src/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.constants.ts +3 -0
- package/src/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.interfaces.ts +29 -0
- package/src/modules/one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.module.ts +66 -0
- package/src/modules/{tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.service.ts → one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.service.ts} +71 -54
- package/src/modules/players-manager/players-manager.module.ts +1 -2
- package/src/modules/players-manager/players-manager.service.ts +5 -5
- package/src/modules/simple-rooms/simple-rooms.controller.ts +52 -43
- package/src/modules/simple-rooms/simple-rooms.interfaces.ts +8 -5
- package/src/modules/simple-rooms/simple-rooms.module.ts +26 -23
- package/src/modules/simple-rooms/simple-rooms.service.ts +62 -57
- package/src/modules/simple-rooms-manager/simple-rooms-manager.constants.ts +3 -1
- package/src/modules/simple-rooms-manager/simple-rooms-manager.interfaces.ts +13 -8
- package/src/modules/simple-rooms-manager/simple-rooms-manager.module.ts +44 -42
- package/src/modules/simple-rooms-manager/simple-rooms-manager.service.ts +160 -149
- package/src/modules/support/dump.service.ts +4 -5
- package/src/modules/support/metric.service.ts +30 -30
- package/src/modules/support/support.controller.ts +57 -48
- package/src/modules/support/support.interfaces.ts +14 -5
- package/src/modules/support/support.module.ts +23 -10
- package/src/modules/support/support.service.ts +15 -12
- package/src/utils/date.ts +4 -4
- package/src/utils/game-table-result.ts +110 -91
- package/src/views/index.ts +1 -1
- package/src/views/many-tables-tournament-conifrm-exit-dialog.view.ts +33 -17
- package/src/views/one-table-tournament-conifrm-exit-dialog.view.ts +33 -17
- package/src/views/simple-room-conifrm-exit-dialog.view.ts +33 -17
- package/src/views/table-summary.view.ts +89 -76
- package/src/views/tournament-buy-ticket-dialog.view.ts +30 -17
- package/dist/config/cert.d.ts +0 -6
- package/dist/config/cert.js +0 -49
- package/dist/config/cert.js.map +0 -1
- package/dist/config/cors.d.ts +0 -5
- package/dist/config/cors.js +0 -48
- package/dist/config/cors.js.map +0 -1
- package/dist/config/database.d.ts +0 -2
- package/dist/config/database.js +0 -12
- package/dist/config/database.js.map +0 -1
- package/dist/config/index.d.ts +0 -5
- package/dist/config/index.js +0 -14
- package/dist/config/index.js.map +0 -1
- package/dist/config/locale.d.ts +0 -2
- package/dist/config/locale.js +0 -24
- package/dist/config/locale.js.map +0 -1
- package/dist/config/menu.d.ts +0 -2
- package/dist/config/menu.js +0 -10
- package/dist/config/menu.js.map +0 -1
- package/dist/modules/tournament-many-tables-rooms-manager/index.d.ts +0 -2
- package/dist/modules/tournament-many-tables-rooms-manager/index.js +0 -8
- package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.constants.d.ts +0 -1
- package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.constants.js +0 -5
- package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.constants.js.map +0 -1
- package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.interfaces.js.map +0 -1
- package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.module.d.ts +0 -11
- package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.module.js.map +0 -1
- package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.service.js.map +0 -1
- package/dist/modules/tournament-one-table-rooms-manager/index.d.ts +0 -2
- package/dist/modules/tournament-one-table-rooms-manager/index.js +0 -8
- package/dist/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.constants.d.ts +0 -1
- package/dist/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.constants.js +0 -5
- package/dist/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.constants.js.map +0 -1
- package/dist/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.interfaces.js.map +0 -1
- package/dist/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.module.d.ts +0 -9
- package/dist/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.module.js.map +0 -1
- package/dist/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.service.js.map +0 -1
- package/readme.md +0 -3
- package/src/config/cert.ts +0 -13
- package/src/config/cors.ts +0 -13
- package/src/config/database.ts +0 -11
- package/src/config/index.ts +0 -5
- package/src/config/locale.ts +0 -22
- package/src/config/menu.ts +0 -10
- package/src/modules/tournament-many-tables-rooms-manager/index.ts +0 -2
- package/src/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.constants.ts +0 -1
- package/src/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.interfaces.ts +0 -20
- package/src/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.module.ts +0 -69
- package/src/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.service.ts +0 -295
- package/src/modules/tournament-one-table-rooms-manager/index.ts +0 -2
- package/src/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.constants.ts +0 -1
- package/src/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.interfaces.ts +0 -20
- package/src/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.module.ts +0 -59
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
import { ApiProperty } from
|
|
2
|
-
import { Expose, plainToInstance, Type } from
|
|
3
|
-
import { IsArray, IsNumber, ValidateNested } from
|
|
4
|
-
import { IFoolTable } from
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose, plainToInstance, Type } from 'class-transformer';
|
|
3
|
+
import { IsArray, IsNumber, ValidateNested } from 'class-validator';
|
|
4
|
+
import { IFoolTable } from 'jp.common.models';
|
|
5
5
|
|
|
6
|
-
import { AppScreenAppBarDto, AppScreenDialogDto } from
|
|
6
|
+
import { AppScreenAppBarDto, AppScreenDialogDto } from '../../app-screen';
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from
|
|
8
|
+
CardsPairSlotsDto,
|
|
9
|
+
CardsDeckDto,
|
|
10
|
+
CardsPanelDto,
|
|
11
|
+
MovesPanelDto,
|
|
12
|
+
SummaryDto,
|
|
13
|
+
} from '../../app-table';
|
|
14
14
|
|
|
15
|
-
import { FoolPlayerDto } from
|
|
15
|
+
import { FoolPlayerDto } from './fool-player.dto';
|
|
16
16
|
|
|
17
17
|
export class FoolTableDto implements IFoolTable {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
@Type(() => AppScreenAppBarDto)
|
|
19
|
+
@Expose()
|
|
20
|
+
appBar: AppScreenAppBarDto;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
@Type(() => AppScreenDialogDto)
|
|
23
|
+
@Expose()
|
|
24
|
+
confirmExitDialog: AppScreenDialogDto | undefined;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
@ApiProperty({
|
|
27
|
+
description: 'Player Turn Timer Remain',
|
|
28
|
+
type: Number,
|
|
29
|
+
})
|
|
30
|
+
@IsNumber()
|
|
31
|
+
@Expose()
|
|
32
|
+
playersTurnTimer: number | undefined;
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
@ApiProperty({
|
|
35
|
+
description: 'Restart Timer Remain',
|
|
36
|
+
type: Number,
|
|
37
|
+
})
|
|
38
|
+
@IsNumber()
|
|
39
|
+
@Expose()
|
|
40
|
+
restartTimer: number | undefined;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
@ApiProperty({
|
|
43
|
+
description: 'Table size',
|
|
44
|
+
type: Number,
|
|
45
|
+
})
|
|
46
|
+
@IsNumber()
|
|
47
|
+
@Expose()
|
|
48
|
+
tableSize: number;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
@IsArray()
|
|
51
|
+
@ValidateNested({ each: true })
|
|
52
|
+
@Type(() => FoolPlayerDto)
|
|
53
|
+
@Expose()
|
|
54
|
+
players: FoolPlayerDto[];
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
@Type(() => CardsPairSlotsDto)
|
|
57
|
+
@Expose()
|
|
58
|
+
cardsSlots: CardsPairSlotsDto;
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
@Type(() => CardsDeckDto)
|
|
61
|
+
@Expose()
|
|
62
|
+
cardsDeck: CardsDeckDto;
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
@Type(() => SummaryDto)
|
|
65
|
+
@Expose()
|
|
66
|
+
summary: SummaryDto;
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
@Type(() => CardsPanelDto)
|
|
69
|
+
@Expose()
|
|
70
|
+
cardsPanel: CardsPanelDto;
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
@Type(() => MovesPanelDto)
|
|
73
|
+
@Expose()
|
|
74
|
+
movesPanel: MovesPanelDto;
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
76
|
+
constructor(entity: IFoolTable) {
|
|
77
|
+
return plainToInstance(FoolTableDto, entity, {
|
|
78
|
+
excludeExtraneousValues: true,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
package/src/dto/games/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './fool/fool-table.dto';
|
|
1
|
+
export * from './fool/fool-table.dto';
|
package/src/dto/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './app-table'
|
|
2
|
-
export * from './app-screen'
|
|
3
|
-
export * from './common'
|
|
1
|
+
export * from './app-table';
|
|
2
|
+
export * from './app-screen';
|
|
3
|
+
export * from './common';
|
|
4
4
|
export * from './games';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export enum ErrorCodeEnum {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
NOT_ENOUGH_MONEY_FOR_PURCHASE = '1001',
|
|
3
|
+
NOT_FOUND_FREE_ROOM_FOR_FAST_GAME = '1002',
|
|
4
|
+
}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ExceptionFilter,
|
|
3
|
+
Catch,
|
|
4
|
+
ArgumentsHost,
|
|
5
|
+
HttpException,
|
|
6
|
+
HttpStatus,
|
|
7
|
+
} from '@nestjs/common';
|
|
2
8
|
import { Response } from 'express';
|
|
3
9
|
|
|
4
10
|
import { JpLoggerService } from '../modules';
|
|
5
11
|
|
|
6
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
ErrorResponseWithSnackbar,
|
|
14
|
+
HttpExceptionWithSnackbar,
|
|
15
|
+
} from './http-exception-wth-snackbar';
|
|
7
16
|
|
|
8
17
|
@Catch(Error)
|
|
9
18
|
export class GlobalExceptionFilter implements ExceptionFilter {
|
|
10
19
|
private readonly logger = new JpLoggerService();
|
|
11
20
|
|
|
12
|
-
catch
|
|
21
|
+
catch(exception: Error, host: ArgumentsHost) {
|
|
13
22
|
this.logger.error(exception);
|
|
14
23
|
const ctx = host.switchToHttp();
|
|
15
24
|
const response = ctx.getResponse<Response>();
|
|
@@ -18,33 +27,27 @@ export class GlobalExceptionFilter implements ExceptionFilter {
|
|
|
18
27
|
const data = exception.getResponse() as ErrorResponseWithSnackbar;
|
|
19
28
|
const status = exception.getStatus();
|
|
20
29
|
|
|
21
|
-
response
|
|
22
|
-
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
snackbar: data.snackbar,
|
|
27
|
-
});
|
|
30
|
+
response.status(status).json({
|
|
31
|
+
statusCode: status,
|
|
32
|
+
message: exception.message,
|
|
33
|
+
snackbar: data.snackbar,
|
|
34
|
+
});
|
|
28
35
|
|
|
29
36
|
return;
|
|
30
37
|
} else if (exception instanceof HttpException) {
|
|
31
38
|
const status = exception.getStatus();
|
|
32
39
|
|
|
33
|
-
response
|
|
34
|
-
|
|
35
|
-
.
|
|
36
|
-
|
|
37
|
-
message: exception.message,
|
|
38
|
-
});
|
|
40
|
+
response.status(status).json({
|
|
41
|
+
statusCode: status,
|
|
42
|
+
message: exception.message,
|
|
43
|
+
});
|
|
39
44
|
|
|
40
45
|
return;
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
response
|
|
44
|
-
|
|
45
|
-
.
|
|
46
|
-
|
|
47
|
-
message: exception.message,
|
|
48
|
-
});
|
|
48
|
+
response.status(HttpStatus.INTERNAL_SERVER_ERROR).json({
|
|
49
|
+
statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
|
|
50
|
+
message: exception.message,
|
|
51
|
+
});
|
|
49
52
|
}
|
|
50
|
-
}
|
|
53
|
+
}
|
|
@@ -4,20 +4,24 @@ import { IAppScreenSnackbar } from 'jp.common.models';
|
|
|
4
4
|
import { ErrorCodeEnum } from './error-code.enum';
|
|
5
5
|
|
|
6
6
|
export interface ErrorResponseWithSnackbar {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
statusCode: number;
|
|
8
|
+
message: string;
|
|
9
|
+
errorCode: string;
|
|
10
|
+
snackbar: IAppScreenSnackbar;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export class HttpExceptionWithSnackbar extends HttpException {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
constructor(
|
|
15
|
+
message: string,
|
|
16
|
+
errorCode: ErrorCodeEnum,
|
|
17
|
+
snackbar: IAppScreenSnackbar,
|
|
18
|
+
) {
|
|
19
|
+
const response: ErrorResponseWithSnackbar = {
|
|
20
|
+
statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
|
|
21
|
+
message,
|
|
22
|
+
errorCode,
|
|
23
|
+
snackbar,
|
|
24
|
+
};
|
|
25
|
+
super(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/exception/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { GlobalExceptionFilter
|
|
1
|
+
export { GlobalExceptionFilter } from './global-exception-filter';
|
|
2
2
|
export { NotEnoughMoneyForPurchaseException } from './not-enough-money-for-purchase.exception';
|
|
3
3
|
export { NotFoundFreeRoomForFastGameException } from './not-found-free-room-for-fast-game.exception';
|
|
4
|
-
export { ErrorCodeEnum } from './error-code.enum';
|
|
4
|
+
export { ErrorCodeEnum } from './error-code.enum';
|
|
@@ -3,13 +3,12 @@ import { IAppScreenSnackbar } from 'jp.common.models';
|
|
|
3
3
|
import { ErrorCodeEnum } from './error-code.enum';
|
|
4
4
|
import { HttpExceptionWithSnackbar } from './http-exception-wth-snackbar';
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
export class NotEnoughMoneyForPurchaseException extends HttpExceptionWithSnackbar {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
7
|
+
constructor(snackbar: IAppScreenSnackbar) {
|
|
8
|
+
super(
|
|
9
|
+
'Not enough money for purchase',
|
|
10
|
+
ErrorCodeEnum.NOT_ENOUGH_MONEY_FOR_PURCHASE,
|
|
11
|
+
snackbar,
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -3,13 +3,12 @@ import { IAppScreenSnackbar } from 'jp.common.models';
|
|
|
3
3
|
import { ErrorCodeEnum } from './error-code.enum';
|
|
4
4
|
import { HttpExceptionWithSnackbar } from './http-exception-wth-snackbar';
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
export class NotFoundFreeRoomForFastGameException extends HttpExceptionWithSnackbar {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
7
|
+
constructor(snackbar: IAppScreenSnackbar) {
|
|
8
|
+
super(
|
|
9
|
+
'Not found free room for fast game',
|
|
10
|
+
ErrorCodeEnum.NOT_FOUND_FREE_ROOM_FOR_FAST_GAME,
|
|
11
|
+
snackbar,
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -2,14 +2,17 @@ import { ModuleMetadata } from '@nestjs/common';
|
|
|
2
2
|
import { Type } from '@nestjs/common/interfaces/type.interface';
|
|
3
3
|
import { DynamicModule } from '@nestjs/common/interfaces/modules/dynamic-module.interface';
|
|
4
4
|
import { ForwardReference } from '@nestjs/common/interfaces/modules/forward-reference.interface';
|
|
5
|
-
import { ConfigService } from '@nestjs/config';
|
|
6
5
|
|
|
7
|
-
export interface AntiFreezeSystemOptions
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export interface AntiFreezeSystemOptions
|
|
7
|
+
extends Pick<ModuleMetadata, 'imports'> {
|
|
8
|
+
imports?: Array<
|
|
9
|
+
Type<any> | DynamicModule | Promise<DynamicModule> | ForwardReference
|
|
10
|
+
>;
|
|
11
|
+
inject?: any[];
|
|
12
|
+
useFactory?: (...args: any[]) => AntiFreezeSystemFactoryOptions;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export interface AntiFreezeSystemFactoryOptions {
|
|
14
|
-
|
|
16
|
+
antiFreezeSystemTime: string;
|
|
17
|
+
antiFreezeSystemCheckCount: number;
|
|
15
18
|
}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DynamicModule,
|
|
3
|
+
Global,
|
|
4
|
+
Inject,
|
|
5
|
+
Module,
|
|
6
|
+
Provider,
|
|
7
|
+
} from '@nestjs/common';
|
|
2
8
|
import schedule, { Job } from 'node-schedule';
|
|
3
9
|
|
|
4
|
-
import { JpLoggerService } from '../logger';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
AntiFreezeSystemFactoryOptions,
|
|
8
|
-
AntiFreezeSystemOptions,
|
|
9
|
-
} from './anti-freeze-system.interfaces';
|
|
10
10
|
import { AntiFreezeSystemService } from './anti-freeze-system.service';
|
|
11
11
|
import { ANTI_FREEZE_SYSTEM_OPTIONS } from './anti-freeze-system.constants';
|
|
12
|
+
import {
|
|
13
|
+
AntiFreezeSystemFactoryOptions,
|
|
14
|
+
AntiFreezeSystemOptions,
|
|
15
|
+
} from './anti-freeze-system.interfaces';
|
|
12
16
|
|
|
13
17
|
@Global()
|
|
14
18
|
@Module({
|
|
15
|
-
|
|
16
|
-
AntiFreezeSystemService,
|
|
17
|
-
],
|
|
19
|
+
providers: [AntiFreezeSystemService],
|
|
18
20
|
})
|
|
19
21
|
export class AntiFreezeSystemModule {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
);
|
|
52
|
-
}
|
|
22
|
+
private antiFreezeSystemJob: Job;
|
|
23
|
+
|
|
24
|
+
constructor(
|
|
25
|
+
private readonly antiFreezeSystemService: AntiFreezeSystemService,
|
|
26
|
+
@Inject(ANTI_FREEZE_SYSTEM_OPTIONS)
|
|
27
|
+
private readonly options: AntiFreezeSystemFactoryOptions,
|
|
28
|
+
) {}
|
|
29
|
+
|
|
30
|
+
static forRootAsync(options: AntiFreezeSystemOptions): DynamicModule {
|
|
31
|
+
return {
|
|
32
|
+
module: AntiFreezeSystemModule,
|
|
33
|
+
imports: options.imports ?? [],
|
|
34
|
+
providers: [
|
|
35
|
+
{
|
|
36
|
+
provide: ANTI_FREEZE_SYSTEM_OPTIONS,
|
|
37
|
+
useFactory: options.useFactory,
|
|
38
|
+
inject: options.inject || [],
|
|
39
|
+
} as Provider,
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onModuleInit() {
|
|
45
|
+
const antiFreezeSystemTime = this.options.antiFreezeSystemTime;
|
|
46
|
+
const antiFreezeSystemCheckCount = this.options.antiFreezeSystemCheckCount;
|
|
47
|
+
|
|
48
|
+
if (antiFreezeSystemTime) {
|
|
49
|
+
this.antiFreezeSystemJob = schedule.scheduleJob(
|
|
50
|
+
antiFreezeSystemTime,
|
|
51
|
+
() => this.antiFreezeSystemService.process(antiFreezeSystemCheckCount),
|
|
52
|
+
);
|
|
53
53
|
}
|
|
54
|
+
}
|
|
54
55
|
}
|
|
55
|
-
|
|
@@ -1,94 +1,105 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
GameRoom,
|
|
4
|
+
ManyTablesTournamentRoom,
|
|
5
|
+
OneTableTournamentRoom,
|
|
6
|
+
TournamentMaster,
|
|
7
|
+
} from 'jp.ms.common.engine';
|
|
3
8
|
|
|
4
9
|
import { SimpleRoomsManagerService } from '../simple-rooms-manager/simple-rooms-manager.service';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
10
|
+
import { OneTableTournamentRoomsManagerService } from '../one-table-tournament-rooms-manager/one-table-tournament-rooms-manager.service';
|
|
11
|
+
import { ManyTablesTournamentRoomsManagerService } from '../many-tables-tournament-rooms-manager/many-tables-tournament-rooms-manager.service';
|
|
7
12
|
|
|
8
13
|
export interface IRoomSetItem {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
tableId: string;
|
|
15
|
+
hash: string;
|
|
16
|
+
count: number;
|
|
17
|
+
room: GameRoom;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
@Injectable()
|
|
16
21
|
export class AntiFreezeSystemService {
|
|
17
|
-
|
|
22
|
+
private prevSet: Map<string, IRoomSetItem>;
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
constructor(
|
|
25
|
+
private readonly simpleRoomsManagerService: SimpleRoomsManagerService,
|
|
26
|
+
private readonly oneTableRoomsManagerService: OneTableTournamentRoomsManagerService,
|
|
27
|
+
private readonly manyTablesRoomsManagerService: ManyTablesTournamentRoomsManagerService,
|
|
28
|
+
) {
|
|
29
|
+
this.prevSet = new Map<string, IRoomSetItem>();
|
|
30
|
+
}
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
process(checkCount: number) {
|
|
33
|
+
this.mergeSets();
|
|
34
|
+
this.clear(checkCount);
|
|
35
|
+
}
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
private mergeSets() {
|
|
38
|
+
if (this.prevSet.size === 0) {
|
|
39
|
+
this.prevSet = this.getCurrentSet();
|
|
40
|
+
} else {
|
|
41
|
+
const newSet = new Map<string, IRoomSetItem>();
|
|
42
|
+
const currentSet = this.getCurrentSet();
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
this.prevSet = newSet;
|
|
44
|
+
currentSet.forEach((currentSetItem, currentSetKey) => {
|
|
45
|
+
const prevSetItem = this.prevSet.get(currentSetKey);
|
|
46
|
+
if (prevSetItem && prevSetItem.hash === currentSetItem.hash) {
|
|
47
|
+
newSet.set(currentSetKey, {
|
|
48
|
+
...currentSetItem,
|
|
49
|
+
count: prevSetItem.count + 1,
|
|
50
|
+
});
|
|
51
|
+
} else {
|
|
52
|
+
newSet.set(currentSetKey, currentSetItem);
|
|
52
53
|
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
this.prevSet = newSet;
|
|
53
57
|
}
|
|
58
|
+
}
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
private getCurrentSet() {
|
|
61
|
+
const newSet = new Map<string, IRoomSetItem>();
|
|
62
|
+
const allTables = [
|
|
63
|
+
...this.simpleRoomsManagerService.getTables(),
|
|
64
|
+
...this.oneTableRoomsManagerService.getTables(),
|
|
65
|
+
...this.manyTablesRoomsManagerService.getTables(),
|
|
66
|
+
];
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
const list: Array<IRoomSetItem> = allTables
|
|
69
|
+
.filter((item) => item.isInProgress())
|
|
70
|
+
.map((item) => ({
|
|
71
|
+
tableId: item.getId(),
|
|
72
|
+
hash: item.getHash(),
|
|
73
|
+
count: 0,
|
|
74
|
+
room: item.getRoom(),
|
|
75
|
+
}));
|
|
71
76
|
|
|
72
|
-
|
|
77
|
+
list.forEach((obj) => newSet.set(obj.tableId, obj));
|
|
73
78
|
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
return newSet;
|
|
80
|
+
}
|
|
76
81
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
private clear(checkCount: number) {
|
|
83
|
+
this.prevSet.forEach((item) => {
|
|
84
|
+
if (item.count === checkCount) {
|
|
85
|
+
if (item.room instanceof OneTableTournamentRoom) {
|
|
86
|
+
const room = this.oneTableRoomsManagerService.getRoomByTableId(
|
|
87
|
+
item.tableId,
|
|
88
|
+
);
|
|
89
|
+
room?.getRoomMaster<TournamentMaster>().cancelTournament();
|
|
90
|
+
} else if (item.room instanceof ManyTablesTournamentRoom) {
|
|
91
|
+
const room = this.manyTablesRoomsManagerService.getRoomByTableId(
|
|
92
|
+
item.tableId,
|
|
93
|
+
);
|
|
94
|
+
room?.getRoomMaster<TournamentMaster>().cancelTournament();
|
|
95
|
+
} else {
|
|
96
|
+
this.simpleRoomsManagerService
|
|
97
|
+
.getRoomByTableId(item.tableId)
|
|
98
|
+
?.restartTable(item.tableId);
|
|
99
|
+
}
|
|
89
100
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
101
|
+
this.prevSet.delete(item.tableId);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
94
105
|
}
|