trucoshi 0.4.4 → 0.4.7
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/README.md +6 -2
- package/dist/types.d.ts +7 -2
- package/dist/types.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,10 @@ Proba la demo actual en [Trucoshi](https://trucoshi.com)
|
|
|
20
20
|
|
|
21
21
|
Right now there's only a local CLI way of playing as there is no socket server implementation and its just the game logic.
|
|
22
22
|
|
|
23
|
+
# Client
|
|
24
|
+
|
|
25
|
+
[Trucoshi React Client](https://github.com/jfrader/trucoshi-client)
|
|
26
|
+
|
|
23
27
|
### Installation
|
|
24
28
|
|
|
25
29
|
`yarn`
|
|
@@ -41,10 +45,10 @@ Right now there's only a local CLI way of playing as there is no socket server i
|
|
|
41
45
|
[x] Logica de turnos, rondas y battalla de cartas
|
|
42
46
|
[x] Irse al mazo
|
|
43
47
|
[x] Cantar truco
|
|
44
|
-
[] Cantar envido
|
|
48
|
+
[x] Cantar envido
|
|
45
49
|
[] Cantar flor
|
|
46
50
|
[x] Socket server
|
|
47
|
-
[
|
|
51
|
+
[x] Unit tests
|
|
48
52
|
[] Bitcoin Lightning integration
|
|
49
53
|
|
|
50
54
|
# Donations
|
package/dist/types.d.ts
CHANGED
|
@@ -99,6 +99,7 @@ export declare enum EServerEvent {
|
|
|
99
99
|
PREVIOUS_HAND = "PREVIOUS_HAND",
|
|
100
100
|
UPDATE_MATCH = "UPDATE_MATCH",
|
|
101
101
|
WAITING_PLAY = "WAITING_PLAY",
|
|
102
|
+
UPDATE_ACTIVE_MATCHES = "UPDATE_ACTIVE_MATCHES",
|
|
102
103
|
PLAYER_USED_CARD = "PLAYER_USED_CARD",
|
|
103
104
|
PLAYER_SAID_COMMAND = "PLAYER_SAID_COMMAND",
|
|
104
105
|
WAITING_POSSIBLE_SAY = "WAITING_POSSIBLE_SAY",
|
|
@@ -125,6 +126,7 @@ export interface ServerToClientEvents {
|
|
|
125
126
|
[EServerEvent.WAITING_POSSIBLE_SAY]: (match: IPublicMatch, callback: (data: IWaitingSayData) => void) => void;
|
|
126
127
|
[EServerEvent.PREVIOUS_HAND]: (value: IMatchPreviousHand, callback: () => void) => void;
|
|
127
128
|
[EServerEvent.UPDATE_CHAT]: (room: IPublicChatRoom, message?: IChatMessage) => void;
|
|
129
|
+
[EServerEvent.UPDATE_ACTIVE_MATCHES]: (activeMatches: IPublicMatchInfo[]) => void;
|
|
128
130
|
[EServerEvent.UPDATE_MATCH]: (match: IPublicMatch) => void;
|
|
129
131
|
[EServerEvent.PLAYER_USED_CARD]: (match: IPublicMatch, card: IPlayedCard) => void;
|
|
130
132
|
[EServerEvent.PLAYER_SAID_COMMAND]: (match: IPublicMatch, command: ISaidCommand) => void;
|
|
@@ -151,6 +153,7 @@ export interface ClientToServerEvents {
|
|
|
151
153
|
}>) => void;
|
|
152
154
|
[EClientEvent.SET_SESSION]: (id: string | null, session: string | null, callback?: IEventCallback<{
|
|
153
155
|
session?: string;
|
|
156
|
+
serverVersion: string;
|
|
154
157
|
activeMatches: Array<IPublicMatchInfo>;
|
|
155
158
|
}>) => void;
|
|
156
159
|
[EClientEvent.JOIN_MATCH]: (matchSessionId: string, teamIdx: 0 | 1 | undefined, callback: IEventCallback<{
|
|
@@ -236,7 +239,7 @@ export type IPublicPlayer = Pick<IPlayer, "id" | "key" | "disabled" | "ready" |
|
|
|
236
239
|
hasFlor?: undefined;
|
|
237
240
|
envido?: undefined;
|
|
238
241
|
});
|
|
239
|
-
export type IPublicTeam = Pick<ITeam, "points"> & {
|
|
242
|
+
export type IPublicTeam = Pick<ITeam, "points" | "id" | "name"> & {
|
|
240
243
|
players: Array<IPublicPlayer>;
|
|
241
244
|
};
|
|
242
245
|
export interface IPlayer {
|
|
@@ -271,13 +274,15 @@ export interface IPlayer {
|
|
|
271
274
|
}
|
|
272
275
|
export interface ITeam {
|
|
273
276
|
_players: Map<string, IPlayer>;
|
|
277
|
+
id: 0 | 1;
|
|
278
|
+
name: string;
|
|
274
279
|
players: Array<IPlayer>;
|
|
275
280
|
points: ITeamPoints;
|
|
276
281
|
getPublicTeam(playerSession?: string): IPublicTeam;
|
|
277
282
|
isTeamDisabled(): boolean;
|
|
278
283
|
disable(player: IPlayer): boolean;
|
|
279
284
|
enable(player?: IPlayer): boolean;
|
|
280
|
-
addPoints(matchPoint: number, points: number): ITeamPoints;
|
|
285
|
+
addPoints(matchPoint: number, points: number, simulate?: boolean): ITeamPoints;
|
|
281
286
|
}
|
|
282
287
|
export interface ITeamPoints {
|
|
283
288
|
buenas: number;
|
package/dist/types.js
CHANGED
|
@@ -61,6 +61,7 @@ var EServerEvent;
|
|
|
61
61
|
EServerEvent["PREVIOUS_HAND"] = "PREVIOUS_HAND";
|
|
62
62
|
EServerEvent["UPDATE_MATCH"] = "UPDATE_MATCH";
|
|
63
63
|
EServerEvent["WAITING_PLAY"] = "WAITING_PLAY";
|
|
64
|
+
EServerEvent["UPDATE_ACTIVE_MATCHES"] = "UPDATE_ACTIVE_MATCHES";
|
|
64
65
|
EServerEvent["PLAYER_USED_CARD"] = "PLAYER_USED_CARD";
|
|
65
66
|
EServerEvent["PLAYER_SAID_COMMAND"] = "PLAYER_SAID_COMMAND";
|
|
66
67
|
EServerEvent["WAITING_POSSIBLE_SAY"] = "WAITING_POSSIBLE_SAY";
|