trucoshi 12.0.2 → 12.1.0
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 +13 -1
- package/dist/events.js +5 -0
- package/dist/types.d.ts +28 -0
- package/package.json +1 -1
package/dist/events.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SocketError } from "./server";
|
|
2
|
-
import { EMatchState, IAdminCreateChestRewardCodeInput, IAdminCreateChestRewardCodeResult, IAdminDashboard, IAdminSetNoticeBannerInput, IAdminSetNoticeBannerResult, IAccountDetails, CardSkinId, ICard, IChatMessage, IEquippedDeck, ILobbyOptions, IInventoryCardGroup, IMatchDetails, IPlayerRanking, IPublicChatRoom, IPublicMatch, IPublicMatchInfo, IPublicMatchStats, IJoinQueueOptions, IQueueMatchFound, IQueueStatus, IRewardCodeRedeemResult, IPublicNoticeBanner, ITreasureOpenResult, ITreasureStatus, ITrucoshiStats, IUserData, IWaitingPlayData, IWaitingSayData } from "./types";
|
|
2
|
+
import { EMatchState, IAdminCreateChestRewardCodeInput, IAdminCreateChestRewardCodeResult, IAdminDashboard, IAdminSetNoticeBannerInput, IAdminSetNoticeBannerResult, IAccountDetails, CardSkinId, ICard, IChatMessage, IEquippedDeck, ILobbyOptions, IInventoryCardGroup, IMatchDetails, IPlayerRanking, IPublicChatRoom, IPublicMatch, IPublicMatchInfo, IPublicMatchStats, IJoinQueueOptions, IQueueMatchFound, IQueueMatchCancelled, IQueueMatchStarting, IQueueReadyUpdate, IQueueStatus, IRewardCodeRedeemResult, IPublicNoticeBanner, ITreasureOpenResult, ITreasureStatus, ITrucoshiStats, IUserData, IWaitingPlayData, IWaitingSayData } from "./types";
|
|
3
3
|
export type IEventCallback<T = {}> = (args: {
|
|
4
4
|
success: boolean;
|
|
5
5
|
error?: SocketError;
|
|
@@ -23,6 +23,9 @@ export declare enum EServerEvent {
|
|
|
23
23
|
UPDATE_STATS = "UPDATE_STATS",
|
|
24
24
|
QUEUE_UPDATE = "QUEUE_UPDATE",
|
|
25
25
|
QUEUE_MATCH_FOUND = "QUEUE_MATCH_FOUND",
|
|
26
|
+
QUEUE_READY_UPDATE = "QUEUE_READY_UPDATE",
|
|
27
|
+
QUEUE_MATCH_STARTING = "QUEUE_MATCH_STARTING",
|
|
28
|
+
QUEUE_MATCH_CANCELLED = "QUEUE_MATCH_CANCELLED",
|
|
26
29
|
UPDATE_NOTICE_BANNER = "UPDATE_NOTICE_BANNER"
|
|
27
30
|
}
|
|
28
31
|
export interface ServerToClientEvents {
|
|
@@ -31,6 +34,9 @@ export interface ServerToClientEvents {
|
|
|
31
34
|
[EServerEvent.UPDATE_STATS]: (room: ITrucoshiStats) => void;
|
|
32
35
|
[EServerEvent.QUEUE_UPDATE]: (status: IQueueStatus) => void;
|
|
33
36
|
[EServerEvent.QUEUE_MATCH_FOUND]: (match: IQueueMatchFound) => void;
|
|
37
|
+
[EServerEvent.QUEUE_READY_UPDATE]: (update: IQueueReadyUpdate) => void;
|
|
38
|
+
[EServerEvent.QUEUE_MATCH_STARTING]: (starting: IQueueMatchStarting) => void;
|
|
39
|
+
[EServerEvent.QUEUE_MATCH_CANCELLED]: (cancelled: IQueueMatchCancelled) => void;
|
|
34
40
|
[EServerEvent.UPDATE_NOTICE_BANNER]: (noticeBanner: IPublicNoticeBanner | null) => void;
|
|
35
41
|
[EServerEvent.NEW_MESSAGE]: (roomId: string, message?: IChatMessage) => void;
|
|
36
42
|
[EServerEvent.UPDATE_ACTIVE_MATCHES]: (activeMatches: IPublicMatchInfo[]) => void;
|
|
@@ -62,6 +68,8 @@ export declare enum EClientEvent {
|
|
|
62
68
|
PLAY_AGAIN = "PLAY_AGAIN",
|
|
63
69
|
JOIN_QUEUE = "JOIN_QUEUE",
|
|
64
70
|
LEAVE_QUEUE = "LEAVE_QUEUE",
|
|
71
|
+
CONFIRM_QUEUE_MATCH = "CONFIRM_QUEUE_MATCH",
|
|
72
|
+
DECLINE_QUEUE_MATCH = "DECLINE_QUEUE_MATCH",
|
|
65
73
|
FETCH_INVENTORY = "FETCH_INVENTORY",
|
|
66
74
|
SET_DECK_CARD_SKIN = "SET_DECK_CARD_SKIN",
|
|
67
75
|
FETCH_TREASURE_STATUS = "FETCH_TREASURE_STATUS",
|
|
@@ -125,6 +133,10 @@ export interface ClientToServerEvents {
|
|
|
125
133
|
status?: IQueueStatus;
|
|
126
134
|
}>) => void;
|
|
127
135
|
[EClientEvent.LEAVE_QUEUE]: (callback?: IEventCallback<{}>) => void;
|
|
136
|
+
[EClientEvent.CONFIRM_QUEUE_MATCH]: (proposalId: string, callback?: IEventCallback<{
|
|
137
|
+
update?: IQueueReadyUpdate;
|
|
138
|
+
}>) => void;
|
|
139
|
+
[EClientEvent.DECLINE_QUEUE_MATCH]: (proposalId: string, callback?: IEventCallback<{}>) => void;
|
|
128
140
|
[EClientEvent.FETCH_INVENTORY]: (callback: IEventCallback<{
|
|
129
141
|
inventory: IInventoryCardGroup[];
|
|
130
142
|
equippedDeck: IEquippedDeck;
|
package/dist/events.js
CHANGED
|
@@ -18,6 +18,9 @@ export var EServerEvent;
|
|
|
18
18
|
EServerEvent["UPDATE_STATS"] = "UPDATE_STATS";
|
|
19
19
|
EServerEvent["QUEUE_UPDATE"] = "QUEUE_UPDATE";
|
|
20
20
|
EServerEvent["QUEUE_MATCH_FOUND"] = "QUEUE_MATCH_FOUND";
|
|
21
|
+
EServerEvent["QUEUE_READY_UPDATE"] = "QUEUE_READY_UPDATE";
|
|
22
|
+
EServerEvent["QUEUE_MATCH_STARTING"] = "QUEUE_MATCH_STARTING";
|
|
23
|
+
EServerEvent["QUEUE_MATCH_CANCELLED"] = "QUEUE_MATCH_CANCELLED";
|
|
21
24
|
EServerEvent["UPDATE_NOTICE_BANNER"] = "UPDATE_NOTICE_BANNER";
|
|
22
25
|
})(EServerEvent || (EServerEvent = {}));
|
|
23
26
|
export var EClientEvent;
|
|
@@ -37,6 +40,8 @@ export var EClientEvent;
|
|
|
37
40
|
EClientEvent["PLAY_AGAIN"] = "PLAY_AGAIN";
|
|
38
41
|
EClientEvent["JOIN_QUEUE"] = "JOIN_QUEUE";
|
|
39
42
|
EClientEvent["LEAVE_QUEUE"] = "LEAVE_QUEUE";
|
|
43
|
+
EClientEvent["CONFIRM_QUEUE_MATCH"] = "CONFIRM_QUEUE_MATCH";
|
|
44
|
+
EClientEvent["DECLINE_QUEUE_MATCH"] = "DECLINE_QUEUE_MATCH";
|
|
40
45
|
EClientEvent["FETCH_INVENTORY"] = "FETCH_INVENTORY";
|
|
41
46
|
EClientEvent["SET_DECK_CARD_SKIN"] = "SET_DECK_CARD_SKIN";
|
|
42
47
|
EClientEvent["FETCH_TREASURE_STATUS"] = "FETCH_TREASURE_STATUS";
|
package/dist/types.d.ts
CHANGED
|
@@ -59,12 +59,40 @@ export interface IQueueStatus {
|
|
|
59
59
|
queuedAt: number;
|
|
60
60
|
botFallbackAt?: number;
|
|
61
61
|
}
|
|
62
|
+
export interface IQueueProposalParticipant {
|
|
63
|
+
accountId?: number;
|
|
64
|
+
session: string;
|
|
65
|
+
name: string;
|
|
66
|
+
avatarUrl?: string | null;
|
|
67
|
+
bot: boolean;
|
|
68
|
+
ready: boolean;
|
|
69
|
+
}
|
|
62
70
|
export interface IQueueMatchFound {
|
|
71
|
+
proposalId: string;
|
|
63
72
|
matchSessionId: string;
|
|
64
73
|
maxPlayers: 2 | 4 | 6;
|
|
65
74
|
humanPlayers: number;
|
|
66
75
|
botPlayers: number;
|
|
67
76
|
filledWithBots: boolean;
|
|
77
|
+
readyExpiresAt: number;
|
|
78
|
+
lobbyOptions: ILobbyOptions;
|
|
79
|
+
participants: IQueueProposalParticipant[];
|
|
80
|
+
}
|
|
81
|
+
export interface IQueueReadyUpdate {
|
|
82
|
+
proposalId: string;
|
|
83
|
+
matchSessionId: string;
|
|
84
|
+
readyExpiresAt: number;
|
|
85
|
+
participants: IQueueProposalParticipant[];
|
|
86
|
+
}
|
|
87
|
+
export interface IQueueMatchStarting {
|
|
88
|
+
proposalId: string;
|
|
89
|
+
matchSessionId: string;
|
|
90
|
+
startsAt: number;
|
|
91
|
+
}
|
|
92
|
+
export interface IQueueMatchCancelled {
|
|
93
|
+
proposalId: string;
|
|
94
|
+
matchSessionId: string;
|
|
95
|
+
reason: "declined" | "timeout" | "cancelled" | "error";
|
|
68
96
|
}
|
|
69
97
|
export interface ISaidCommand {
|
|
70
98
|
player: IPlayer | IPublicPlayer;
|