trucoshi 8.9.2 → 8.10.1
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/events.d.ts +2 -2
- package/dist/lib/classes/Deck.d.ts +2 -2
- package/dist/lib/constants.d.ts +2 -1
- package/dist/lib/utils.d.ts +2 -6
- package/dist/types.d.ts +4 -0
- package/dist/types.js +1 -0
- package/package.json +14 -16
- package/prisma/client/index.d.ts +3258 -1972
- package/prisma/client/index.js +101 -62
package/dist/events.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EMatchState } from "@trucoshi/prisma";
|
|
2
2
|
import { SocketError } from "./server";
|
|
3
|
-
import { IAccountDetails, IChatMessage, ILobbyOptions, IMatchDetails, IPlayerRanking, IPublicChatRoom, IPublicMatch, IPublicMatchInfo, ITrucoshiStats, IUserData, IWaitingPlayData, IWaitingSayData } from "./types";
|
|
3
|
+
import { IAccountDetails, IChatMessage, ILobbyOptions, IMatchDetails, IPlayerRanking, IPublicChatRoom, IPublicMatch, IPublicMatchInfo, IPublicMatchStats, ITrucoshiStats, IUserData, IWaitingPlayData, IWaitingSayData } from "./types";
|
|
4
4
|
export type IEventCallback<T = {}> = (args: {
|
|
5
5
|
success: boolean;
|
|
6
6
|
error?: SocketError;
|
|
@@ -27,7 +27,7 @@ export interface ServerToClientEvents {
|
|
|
27
27
|
[EServerEvent.NEW_MESSAGE]: (roomId: string, message?: IChatMessage) => void;
|
|
28
28
|
[EServerEvent.UPDATE_ACTIVE_MATCHES]: (activeMatches: IPublicMatchInfo[]) => void;
|
|
29
29
|
[EServerEvent.UPDATE_PUBLIC_MATCHES]: (publicMatches: IPublicMatchInfo[]) => void;
|
|
30
|
-
[EServerEvent.UPDATE_MATCH]: (match: IPublicMatch, callback?: () => void) => void;
|
|
30
|
+
[EServerEvent.UPDATE_MATCH]: (match: IPublicMatch, stats?: IPublicMatchStats, callback?: () => void) => void;
|
|
31
31
|
[EServerEvent.KICK_PLAYER]: (match: IPublicMatch, session: string, reason?: string) => void;
|
|
32
32
|
[EServerEvent.MATCH_DELETED]: (matchSessionId: string) => void;
|
|
33
33
|
[EServerEvent.SET_SESSION]: (userData: IUserData, serverVersion: string, activeMatches: Array<IPublicMatchInfo>) => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ICard, IDeck, IPlayedCard, IPlayer, IPublicPlayer } from "../../types";
|
|
2
2
|
import { ITable } from "./Table";
|
|
3
3
|
export declare function Deck(): IDeck;
|
|
4
|
-
export declare const getAllCards: () =>
|
|
4
|
+
export declare const getAllCards: () => Array<ICard>;
|
|
5
5
|
export declare function dealCards<TPlayer extends {
|
|
6
6
|
key: string;
|
|
7
7
|
idx: number;
|
|
8
8
|
setHand(h: Array<ICard>): void;
|
|
9
9
|
} = IPlayer>(table: ITable<TPlayer>, deck: IDeck): void;
|
|
10
|
-
export declare function shuffleArray<T = unknown>(array: Array<T>, getRandom?: (max: number) => number): T
|
|
10
|
+
export declare function shuffleArray<T = unknown>(array: Array<T>, getRandom?: (max: number) => number): Array<T>;
|
|
11
11
|
export declare function PlayedCard(player: IPlayer | IPublicPlayer, card: ICard, burn?: boolean): IPlayedCard;
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ICard } from "../types";
|
|
1
2
|
export declare const PLAYER_ABANDON_TIMEOUT: number;
|
|
2
3
|
export declare const PLAYER_TURN_TIMEOUT: number;
|
|
3
4
|
export declare const PREVIOUS_HAND_ACK_TIMEOUT: number;
|
|
@@ -43,7 +44,7 @@ export declare const CARDS: {
|
|
|
43
44
|
"4b": number;
|
|
44
45
|
"4c": number;
|
|
45
46
|
};
|
|
46
|
-
export declare const BURNT_CARD:
|
|
47
|
+
export declare const BURNT_CARD: ICard;
|
|
47
48
|
export declare const CARDS_HUMAN_READABLE: {
|
|
48
49
|
"1e": string;
|
|
49
50
|
"1b": string;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
|
-
/// <reference types="lodash" />
|
|
3
1
|
import { IHand } from "../truco";
|
|
4
2
|
import { ICard } from "../types";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Cache: import("lodash").MapCacheConstructor;
|
|
8
|
-
};
|
|
3
|
+
import memoize from "lodash.memoize";
|
|
4
|
+
export declare const memoizeMinute: typeof memoize;
|
|
9
5
|
export declare function getMaxNumberIndex<T = number>(array: Array<T>): number;
|
|
10
6
|
export declare function getMinNumberIndex<T = number>(array: Array<T>): number;
|
|
11
7
|
export declare function getCardValue(card: ICard): number;
|
package/dist/types.d.ts
CHANGED
|
@@ -99,6 +99,9 @@ export interface IPublicMatch {
|
|
|
99
99
|
lastCommand?: ECommand | number | null;
|
|
100
100
|
awardedSatsPerPlayer?: number;
|
|
101
101
|
}
|
|
102
|
+
export interface IPublicMatchStats {
|
|
103
|
+
spectators: number;
|
|
104
|
+
}
|
|
102
105
|
export interface IPublicMatchInfo {
|
|
103
106
|
ownerId: string;
|
|
104
107
|
matchSessionId: string;
|
|
@@ -393,6 +396,7 @@ export type IHandRoundLog = {
|
|
|
393
396
|
};
|
|
394
397
|
export type IPublicUser = Pick<User, "id" | "email" | "name" | "role">;
|
|
395
398
|
export declare const DANGEROUS_COMMANDS: ECommand[];
|
|
399
|
+
export declare const WARNING_COMMANDS: ECommand[];
|
|
396
400
|
export type ITrucoshiStats = {
|
|
397
401
|
onlinePlayers: number[];
|
|
398
402
|
};
|
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trucoshi",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.1",
|
|
4
4
|
"description": "Lightning Truco Server",
|
|
5
5
|
"main": "dist/types.js",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -40,20 +40,19 @@
|
|
|
40
40
|
"db:migrate": "prisma migrate dev"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@types/chai": "^
|
|
44
|
-
"@types/expect": "^24.3.0",
|
|
43
|
+
"@types/chai": "^5.2.2",
|
|
45
44
|
"@types/lodash.debounce": "^4.0.9",
|
|
46
45
|
"@types/lodash.memoize": "^4.1.9",
|
|
47
46
|
"@types/lodash.partialright": "^4.2.9",
|
|
48
47
|
"@types/lodash.throttle": "^4.1.9",
|
|
49
48
|
"@types/mocha": "^10.0.1",
|
|
50
|
-
"@types/node": "^
|
|
51
|
-
"chai": "^
|
|
52
|
-
"mocha": "^
|
|
53
|
-
"nodemon": "^
|
|
54
|
-
"prisma": "^
|
|
49
|
+
"@types/node": "^24.1.0",
|
|
50
|
+
"chai": "^5.2.1",
|
|
51
|
+
"mocha": "^11.7.1",
|
|
52
|
+
"nodemon": "^3.1.10",
|
|
53
|
+
"prisma": "^6.13.0",
|
|
55
54
|
"socket.io-client": "4.8.1",
|
|
56
|
-
"ts-mocha": "^
|
|
55
|
+
"ts-mocha": "^11.1.0"
|
|
57
56
|
},
|
|
58
57
|
"files": [
|
|
59
58
|
"dist/lib/*",
|
|
@@ -68,28 +67,27 @@
|
|
|
68
67
|
"prisma/client/schema.prisma"
|
|
69
68
|
],
|
|
70
69
|
"dependencies": {
|
|
71
|
-
"@prisma/client": "^
|
|
70
|
+
"@prisma/client": "^6.13.0",
|
|
72
71
|
"@socket.io/redis-adapter": "8.3.0",
|
|
73
72
|
"@types/jsonwebtoken": "^9.0.5",
|
|
74
73
|
"@types/node-forge": "^1.3.11",
|
|
75
|
-
"@types/pino": "^7.0.5",
|
|
76
74
|
"@types/redis": "^4.0.11",
|
|
77
75
|
"axios": "^1.6.3",
|
|
78
|
-
"axios-cookiejar-support": "^
|
|
76
|
+
"axios-cookiejar-support": "^6.0.4",
|
|
79
77
|
"dotenv": "^16.0.3",
|
|
80
78
|
"dotenv-cli": "^7.3.0",
|
|
81
79
|
"form-data": "^4.0.0",
|
|
82
80
|
"jsonwebtoken": "^9.0.2",
|
|
83
|
-
"lightning-accounts": "
|
|
81
|
+
"lightning-accounts": "6.1.2",
|
|
84
82
|
"lodash.debounce": "^4.0.8",
|
|
85
83
|
"lodash.memoize": "^4.1.2",
|
|
86
84
|
"lodash.partialright": "^4.2.1",
|
|
87
85
|
"lodash.throttle": "^4.1.1",
|
|
88
86
|
"node-forge": "^1.3.1",
|
|
89
|
-
"path-scurry": "^
|
|
87
|
+
"path-scurry": "^2.0.0",
|
|
90
88
|
"pino": "^9.3.2",
|
|
91
|
-
"pino-pretty": "^
|
|
92
|
-
"rimraf": "^
|
|
89
|
+
"pino-pretty": "^13.1.1",
|
|
90
|
+
"rimraf": "^6.0.1",
|
|
93
91
|
"safe-rng": "^1.0.4",
|
|
94
92
|
"socket.io": "4.8.1",
|
|
95
93
|
"ts-node": "^10.9.1",
|