jp.ms.common.modules 1.0.45 → 1.0.47
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/modules/events/events.gateway.js +2 -0
- package/dist/modules/events/events.gateway.js.map +1 -1
- package/dist/modules/main/main-tables-list-screen.view.d.ts +2 -1
- package/dist/modules/main/main-tables-list-screen.view.js +4 -2
- package/dist/modules/main/main-tables-list-screen.view.js.map +1 -1
- package/dist/modules/main/main.controller.js +1 -1
- package/dist/modules/main/main.controller.js.map +1 -1
- package/dist/modules/main/main.module.js +1 -1
- package/dist/modules/main/main.module.js.map +1 -1
- package/dist/modules/main/main.service.d.ts +1 -1
- package/dist/modules/main/main.service.js +2 -2
- 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 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament-status-screen.view.js +4 -2
- 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.controller.js +1 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament.controller.js.map +1 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament.module.js +1 -1
- 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 +1 -1
- package/dist/modules/many-tables-tournament/many-tables-tournament.service.js +2 -2
- package/dist/modules/many-tables-tournament/many-tables-tournament.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/modules/events/events.gateway.ts +2 -0
- package/src/modules/main/main-tables-list-screen.view.ts +12 -2
- package/src/modules/main/main.controller.ts +1 -0
- package/src/modules/main/main.module.ts +1 -0
- package/src/modules/main/main.service.ts +8 -2
- package/src/modules/many-tables-tournament/many-tables-tournament-status-screen.view.ts +8 -2
- package/src/modules/many-tables-tournament/many-tables-tournament.controller.ts +1 -0
- package/src/modules/many-tables-tournament/many-tables-tournament.module.ts +1 -0
- package/src/modules/many-tables-tournament/many-tables-tournament.service.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jp.ms.common.modules",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.47",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"@nestjs/mongoose": "11.0.4",
|
|
14
14
|
"@nestjs/websockets": "11.1.9",
|
|
15
15
|
"dayjs": "1.11.18",
|
|
16
|
-
"jp.common.models": "1.1.
|
|
16
|
+
"jp.common.models": "1.1.53",
|
|
17
17
|
"jp.common.utils": "1.0.8",
|
|
18
18
|
"jp.db.schemas": "2.2.17",
|
|
19
|
-
"jp.ms.common.engine": "3.0.
|
|
19
|
+
"jp.ms.common.engine": "3.0.29",
|
|
20
20
|
"mongoose": "9.1.5",
|
|
21
21
|
"nestjs-i18n": "10.5.1",
|
|
22
22
|
"node-schedule": "2.1.1",
|
|
@@ -31,6 +31,7 @@ export class EventsGateway
|
|
|
31
31
|
|
|
32
32
|
async handleConnection(client: Socket) {
|
|
33
33
|
const playerId = client.handshake.auth.token as string | undefined;
|
|
34
|
+
const timeOffset = client.handshake.auth.timeOffset as string | undefined;
|
|
34
35
|
|
|
35
36
|
const player = this.playersManager.getPlayerById(playerId ?? '');
|
|
36
37
|
if (player) {
|
|
@@ -48,6 +49,7 @@ export class EventsGateway
|
|
|
48
49
|
level: user.level,
|
|
49
50
|
language: user.normalizedLang,
|
|
50
51
|
cardsSkin: user.cardSkin,
|
|
52
|
+
timeOffset: Number(timeOffset),
|
|
51
53
|
onSendWsMessage: this.handleSendWsMessage,
|
|
52
54
|
onGotWsMessageClientResponse: this.handleGotWsMessageClientResponse,
|
|
53
55
|
});
|
|
@@ -27,7 +27,11 @@ import {
|
|
|
27
27
|
TournamentMaster,
|
|
28
28
|
TournamentRoom,
|
|
29
29
|
} from 'jp.ms.common.engine';
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
formatDate,
|
|
32
|
+
formatTimeWithOffset,
|
|
33
|
+
replacePattern,
|
|
34
|
+
} from 'jp.common.utils';
|
|
31
35
|
|
|
32
36
|
import { TournamentBuyTicketDialogView } from '../../views';
|
|
33
37
|
|
|
@@ -36,6 +40,7 @@ export class MainTablesListScreenView extends UniversalScreenView {
|
|
|
36
40
|
private readonly oneTableTournamentRooms: Array<OneTableTournamentRoom>;
|
|
37
41
|
private readonly manyTablesTournamentRooms: Array<ManyTablesTournamentRoom>;
|
|
38
42
|
private readonly playerId: string;
|
|
43
|
+
private readonly timeOffset: number;
|
|
39
44
|
|
|
40
45
|
constructor(
|
|
41
46
|
localeService: ILocaleService,
|
|
@@ -44,12 +49,14 @@ export class MainTablesListScreenView extends UniversalScreenView {
|
|
|
44
49
|
oneTableTournamentRooms: Array<OneTableTournamentRoom>,
|
|
45
50
|
manyTablesTournamentRooms: Array<ManyTablesTournamentRoom>,
|
|
46
51
|
playerId: string,
|
|
52
|
+
timeOffset: number,
|
|
47
53
|
) {
|
|
48
54
|
super(localeService, lang);
|
|
49
55
|
this.simpleRooms = simpleRooms;
|
|
50
56
|
this.oneTableTournamentRooms = oneTableTournamentRooms;
|
|
51
57
|
this.manyTablesTournamentRooms = manyTablesTournamentRooms;
|
|
52
58
|
this.playerId = playerId;
|
|
59
|
+
this.timeOffset = timeOffset;
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
build(): IAppScreen {
|
|
@@ -233,7 +240,10 @@ export class MainTablesListScreenView extends UniversalScreenView {
|
|
|
233
240
|
lang: this.lang,
|
|
234
241
|
})
|
|
235
242
|
: formatDate(tournament.getScheduleDate() ?? ''),
|
|
236
|
-
SCHEDULE_DATE:
|
|
243
|
+
SCHEDULE_DATE: formatTimeWithOffset(
|
|
244
|
+
tournament.getScheduleDate() ?? '',
|
|
245
|
+
this.timeOffset,
|
|
246
|
+
),
|
|
237
247
|
});
|
|
238
248
|
}
|
|
239
249
|
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
AppScreenRoutesEnum,
|
|
16
16
|
ErrorSnackbarComponent,
|
|
17
17
|
AppScreenRouter,
|
|
18
|
+
IAppHeaders,
|
|
18
19
|
} from 'jp.common.models';
|
|
19
20
|
|
|
20
21
|
import {
|
|
@@ -51,7 +52,11 @@ export class MainService {
|
|
|
51
52
|
dayjs.extend(isToday);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
getScreen(
|
|
55
|
+
getScreen(
|
|
56
|
+
lang: string,
|
|
57
|
+
authToken: string,
|
|
58
|
+
timeOffset: number,
|
|
59
|
+
): BaseAppScreenDto {
|
|
55
60
|
return new BaseAppScreenDto(
|
|
56
61
|
new MainTablesListScreenView(
|
|
57
62
|
this.options.i18n,
|
|
@@ -59,7 +64,8 @@ export class MainService {
|
|
|
59
64
|
this.simpleRoomsManager.getRooms(),
|
|
60
65
|
this.oneTableRoomsManagerService.getRooms(),
|
|
61
66
|
this.manyTablesRoomsManagerService.getRooms(),
|
|
62
|
-
|
|
67
|
+
authToken,
|
|
68
|
+
Number(timeOffset),
|
|
63
69
|
).buildBS(),
|
|
64
70
|
);
|
|
65
71
|
}
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
formatChips,
|
|
19
19
|
formatDate,
|
|
20
|
-
|
|
20
|
+
formatTimeWithOffset,
|
|
21
21
|
replacePattern,
|
|
22
22
|
} from 'jp.common.utils';
|
|
23
23
|
import {
|
|
@@ -27,14 +27,17 @@ import {
|
|
|
27
27
|
|
|
28
28
|
export class ManyTablesTournamentStatusScreenView extends UniversalScreenView {
|
|
29
29
|
private readonly tournament: ManyTablesTournamentRoom;
|
|
30
|
+
private readonly timeOffset: number;
|
|
30
31
|
|
|
31
32
|
constructor(
|
|
32
33
|
localeService: ILocaleService,
|
|
33
34
|
lang: string,
|
|
34
35
|
tournament: ManyTablesTournamentRoom,
|
|
36
|
+
timeOffset: number,
|
|
35
37
|
) {
|
|
36
38
|
super(localeService, lang);
|
|
37
39
|
this.tournament = tournament;
|
|
40
|
+
this.timeOffset = timeOffset;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
build(): IAppScreen {
|
|
@@ -134,7 +137,10 @@ export class ManyTablesTournamentStatusScreenView extends UniversalScreenView {
|
|
|
134
137
|
lang: this.lang,
|
|
135
138
|
})
|
|
136
139
|
: formatDate(this.tournament.getScheduleDate() ?? ''),
|
|
137
|
-
SCHEDULE_DATE:
|
|
140
|
+
SCHEDULE_DATE: formatTimeWithOffset(
|
|
141
|
+
this.tournament.getScheduleDate() ?? '',
|
|
142
|
+
this.timeOffset,
|
|
143
|
+
),
|
|
138
144
|
});
|
|
139
145
|
}
|
|
140
146
|
|
|
@@ -41,7 +41,11 @@ export class ManyTablesTournamentService {
|
|
|
41
41
|
private readonly usersRepository: UsersRepository,
|
|
42
42
|
) {}
|
|
43
43
|
|
|
44
|
-
getStatusScreen(
|
|
44
|
+
getStatusScreen(
|
|
45
|
+
tournamentId: string,
|
|
46
|
+
lang: string,
|
|
47
|
+
timeOffset: number,
|
|
48
|
+
): BaseAppScreenDto {
|
|
45
49
|
const tournament =
|
|
46
50
|
this.manyTablesRoomsManagerService.getRoomById(tournamentId);
|
|
47
51
|
|
|
@@ -54,6 +58,7 @@ export class ManyTablesTournamentService {
|
|
|
54
58
|
this.options.i18n,
|
|
55
59
|
lang,
|
|
56
60
|
tournament,
|
|
61
|
+
timeOffset,
|
|
57
62
|
).buildBS(),
|
|
58
63
|
);
|
|
59
64
|
}
|