trucoshi 8.0.1 → 8.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 CHANGED
@@ -1,7 +1,6 @@
1
1
  import { EMatchState } from "@trucoshi/prisma";
2
2
  import { SocketError } from "./server";
3
3
  import { IAccountDetails, IChatMessage, ILobbyOptions, IMatchDetails, IPlayerRanking, IPublicChatRoom, IPublicMatch, IPublicMatchInfo, IUserData, IWaitingPlayData, IWaitingSayData } from "./types";
4
- import { User } from "lightning-accounts";
5
4
  export type IEventCallback<T = {}> = (args: {
6
5
  success: boolean;
7
6
  error?: SocketError;
@@ -17,10 +16,16 @@ export declare enum EServerEvent {
17
16
  KICK_PLAYER = "PLAYER_KICKED",
18
17
  UPDATE_ACTIVE_MATCHES = "UPDATE_ACTIVE_MATCHES",
19
18
  WAITING_POSSIBLE_SAY = "WAITING_POSSIBLE_SAY",
20
- UPDATE_CHAT = "UPDAET_CHAT"
19
+ UPDATE_CHAT = "UPDAET_CHAT",
20
+ ERROR = "ERROR"
21
21
  }
22
22
  export interface ServerToClientEvents {
23
23
  [EServerEvent.PONG]: (serverTime: number, clientTime: number) => void;
24
+ [EServerEvent.ERROR]: (error: {
25
+ code: string;
26
+ message: string;
27
+ action: string;
28
+ }) => void;
24
29
  [EServerEvent.UPDATE_CHAT]: (room: IPublicChatRoom) => void;
25
30
  [EServerEvent.NEW_MESSAGE]: (roomId: string, message?: IChatMessage) => void;
26
31
  [EServerEvent.UPDATE_ACTIVE_MATCHES]: (activeMatches: IPublicMatchInfo[]) => void;
@@ -33,7 +38,6 @@ export interface ServerToClientEvents {
33
38
  [EServerEvent.REFRESH_IDENTITY]: (userId: number, callback: (identityJwt: string | null) => void) => void;
34
39
  }
35
40
  export declare enum EClientEvent {
36
- LOGIN = "LOGIN",
37
41
  LOGOUT = "LOGOUT",
38
42
  LEAVE_MATCH = "LEAVE_MATCH",
39
43
  CREATE_MATCH = "CREATE_MATCH",
@@ -96,7 +100,4 @@ export interface ClientToServerEvents {
96
100
  [EClientEvent.LIST_RANKING]: (filters: {}, callback: IEventCallback<{
97
101
  ranking: Array<IPlayerRanking>;
98
102
  }>) => void;
99
- [EClientEvent.LOGIN]: (user: User, identityToken: string, callback: IEventCallback<{
100
- activeMatches?: IPublicMatchInfo[];
101
- }>) => void;
102
103
  }
package/dist/events.js CHANGED
@@ -11,10 +11,10 @@ export var EServerEvent;
11
11
  EServerEvent["UPDATE_ACTIVE_MATCHES"] = "UPDATE_ACTIVE_MATCHES";
12
12
  EServerEvent["WAITING_POSSIBLE_SAY"] = "WAITING_POSSIBLE_SAY";
13
13
  EServerEvent["UPDATE_CHAT"] = "UPDAET_CHAT";
14
+ EServerEvent["ERROR"] = "ERROR";
14
15
  })(EServerEvent || (EServerEvent = {}));
15
16
  export var EClientEvent;
16
17
  (function (EClientEvent) {
17
- EClientEvent["LOGIN"] = "LOGIN";
18
18
  EClientEvent["LOGOUT"] = "LOGOUT";
19
19
  EClientEvent["LEAVE_MATCH"] = "LEAVE_MATCH";
20
20
  EClientEvent["CREATE_MATCH"] = "CREATE_MATCH";
@@ -1,4 +1,4 @@
1
- export const PLAYER_ABANDON_TIMEOUT = 1000 * 60;
1
+ export const PLAYER_ABANDON_TIMEOUT = 1000 * 60 * 2;
2
2
  export const PLAYER_TURN_TIMEOUT = 1000 * 30;
3
3
  export const PREVIOUS_HAND_ACK_TIMEOUT = 1000 * 3;
4
4
  export const CARDS = {
package/dist/types.d.ts CHANGED
@@ -197,7 +197,8 @@ export declare enum GAME_ERROR {
197
197
  INVALID_COMAND = "INVALID_COMAND",
198
198
  INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
199
199
  GAME_REQUIRES_ACCOUNT = "GAME_REQUIRES_ACCOUNT",
200
- NO_FLOR = "NO_FLOR"
200
+ NO_FLOR = "NO_FLOR",
201
+ INVALID_SESSION = "INVALID_SESSION"
201
202
  }
202
203
  export interface EnvidoState {
203
204
  accept: number;
package/dist/types.js CHANGED
@@ -73,6 +73,7 @@ export var GAME_ERROR;
73
73
  GAME_ERROR["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
74
74
  GAME_ERROR["GAME_REQUIRES_ACCOUNT"] = "GAME_REQUIRES_ACCOUNT";
75
75
  GAME_ERROR["NO_FLOR"] = "NO_FLOR";
76
+ GAME_ERROR["INVALID_SESSION"] = "INVALID_SESSION";
76
77
  })(GAME_ERROR || (GAME_ERROR = {}));
77
78
  export const DANGEROUS_COMMANDS = [
78
79
  ESayCommand.MAZO,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trucoshi",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Lightning Truco Server",
5
5
  "main": "dist/types.js",
6
6
  "license": "GPL-3.0",