trucoshi 0.3.52 → 0.3.54

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.
@@ -18,6 +18,9 @@ function PlayInstance(hand, prevHand, teams) {
18
18
  },
19
19
  say(command, player) {
20
20
  try {
21
+ if (player.disabled) {
22
+ return null;
23
+ }
21
24
  const fn = hand.say[command];
22
25
  if (fn) {
23
26
  if (!player.commands.includes(command)) {
@@ -23,6 +23,7 @@ export interface IPlayer {
23
23
  setEnvidoTurn(turn: boolean): void;
24
24
  getPublicPlayer(): IPublicPlayer;
25
25
  setSession(session: string): void;
26
+ setIsOwner(isOwner: boolean): void;
26
27
  enable(): void;
27
28
  disable(): void;
28
29
  setReady(ready: boolean): void;
@@ -27,6 +27,9 @@ function Player(key, id, teamIdx, isOwner = false) {
27
27
  setTurn(turn) {
28
28
  player.isTurn = turn;
29
29
  },
30
+ setIsOwner(isOwner) {
31
+ player.isOwner = isOwner;
32
+ },
30
33
  setEnvidoTurn(turn) {
31
34
  player.isTurn = turn;
32
35
  player.isEnvidoTurn = turn;
package/dist/types.d.ts CHANGED
@@ -27,6 +27,7 @@ export interface IPublicMatchInfo {
27
27
  }
28
28
  export type IPublicChatRoom = Pick<IChatRoom, "id" | "messages">;
29
29
  export interface IChatMessage {
30
+ id: string;
30
31
  date: number;
31
32
  user: {
32
33
  id: string;
@@ -154,7 +155,7 @@ export interface ClientToServerEvents {
154
155
  [EClientEvent.CREATE_MATCH]: (callback: IEventCallback<{
155
156
  match?: IPublicMatch;
156
157
  }>) => void;
157
- [EClientEvent.START_MATCH]: (callback: IEventCallback<{
158
+ [EClientEvent.START_MATCH]: (matchId: string, callback: IEventCallback<{
158
159
  matchSessionId?: string;
159
160
  }>) => void;
160
161
  [EClientEvent.FETCH_MATCH]: (session: string | null, matchId: string, callback: IEventCallback) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trucoshi",
3
- "version": "0.3.52",
3
+ "version": "0.3.54",
4
4
  "main": "dist/index.js",
5
5
  "license": "GPL-3.0",
6
6
  "scripts": {