ygopro-msg-encode 1.0.2 → 1.0.3

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.
@@ -1,7 +1,8 @@
1
+ import { GameMode } from '../network-enums';
1
2
  export declare class HostInfo {
2
3
  lflist: number;
3
4
  rule: number;
4
- mode: number;
5
+ mode: GameMode;
5
6
  duel_rule: number;
6
7
  no_check_deck: number;
7
8
  no_shuffle_deck: number;
@@ -3,6 +3,6 @@ import { YGOProCtosBase } from '../base';
3
3
  export declare class YGOProCtosCreateGame extends YGOProCtosBase {
4
4
  static identifier: number;
5
5
  info: HostInfo;
6
- name: number[];
7
- pass: number[];
6
+ name: string;
7
+ pass: string;
8
8
  }
@@ -1,5 +1,6 @@
1
1
  import { YGOProCtosBase } from '../base';
2
+ import { HandResult } from '../../network-enums';
2
3
  export declare class YGOProCtosHandResult extends YGOProCtosBase {
3
4
  static identifier: number;
4
- res: number;
5
+ res: HandResult;
5
6
  }
@@ -3,5 +3,5 @@ export declare class YGOProCtosJoinGame extends YGOProCtosBase {
3
3
  static identifier: number;
4
4
  version: number;
5
5
  gameid: number;
6
- pass: number[];
6
+ pass: string;
7
7
  }
@@ -1,5 +1,6 @@
1
1
  import { YGOProCtosBase } from '../base';
2
+ import { NetPlayerType } from '../../network-enums';
2
3
  export declare class YGOProCtosKick extends YGOProCtosBase {
3
4
  static identifier: number;
4
- pos: number;
5
+ pos: NetPlayerType;
5
6
  }
@@ -1,5 +1,5 @@
1
1
  import { YGOProCtosBase } from '../base';
2
2
  export declare class YGOProCtosPlayerInfo extends YGOProCtosBase {
3
3
  static identifier: number;
4
- name: number[];
4
+ name: string;
5
5
  }
@@ -1,5 +1,6 @@
1
1
  import { YGOProCtosBase } from '../base';
2
+ import { TurnPlayerResult } from '../../network-enums';
2
3
  export declare class YGOProCtosTpResult extends YGOProCtosBase {
3
4
  static identifier: number;
4
- res: number;
5
+ res: TurnPlayerResult;
5
6
  }
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Network protocol enums
3
+ * These enums are derived from gframe/network.h
4
+ */
5
+ /**
6
+ * Hand result (rock-paper-scissors)
7
+ */
8
+ export declare enum HandResult {
9
+ ROCK = 1,
10
+ SCISSORS = 2,
11
+ PAPER = 3
12
+ }
13
+ /**
14
+ * Turn player result (first/second)
15
+ */
16
+ export declare enum TurnPlayerResult {
17
+ SECOND = 0,
18
+ FIRST = 1
19
+ }
20
+ /**
21
+ * Player type / position
22
+ */
23
+ export declare enum NetPlayerType {
24
+ PLAYER1 = 0,
25
+ PLAYER2 = 1,
26
+ PLAYER3 = 2,
27
+ PLAYER4 = 3,
28
+ PLAYER5 = 4,
29
+ PLAYER6 = 5,
30
+ OBSERVER = 7
31
+ }
32
+ /**
33
+ * Chat message colors (used in STOC_Chat.player_type)
34
+ */
35
+ export declare enum ChatColor {
36
+ LIGHTBLUE = 8,
37
+ RED = 11,
38
+ GREEN = 12,
39
+ BLUE = 13,
40
+ BABYBLUE = 14,
41
+ PINK = 15,
42
+ YELLOW = 16,
43
+ WHITE = 17,
44
+ GRAY = 18,
45
+ DARKGRAY = 19
46
+ }
47
+ /**
48
+ * Game mode
49
+ */
50
+ export declare enum GameMode {
51
+ SINGLE = 0,
52
+ MATCH = 1,
53
+ TAG = 2
54
+ }
55
+ /**
56
+ * Error message type
57
+ */
58
+ export declare enum ErrorMessageType {
59
+ JOINERROR = 1,
60
+ DECKERROR = 2,
61
+ SIDEERROR = 3,
62
+ VERERROR = 4
63
+ }
64
+ /**
65
+ * Deck error type (used in high 4 bits of error code)
66
+ */
67
+ export declare enum DeckErrorType {
68
+ LFLIST = 1,
69
+ OCGONLY = 2,
70
+ TCGONLY = 3,
71
+ UNKNOWNCARD = 4,
72
+ CARDCOUNT = 5,
73
+ MAINCOUNT = 6,
74
+ EXTRACOUNT = 7,
75
+ SIDECOUNT = 8,
76
+ NOTAVAIL = 9
77
+ }
78
+ /**
79
+ * Player change state
80
+ */
81
+ export declare enum PlayerChangeState {
82
+ OBSERVE = 8,
83
+ READY = 9,
84
+ NOTREADY = 10,
85
+ LEAVE = 11
86
+ }
87
+ /**
88
+ * Room status (SRVPro)
89
+ */
90
+ export declare enum RoomStatus {
91
+ WAITING = 0,
92
+ DUELING = 1,
93
+ SIDING = 2
94
+ }
@@ -1,6 +1,7 @@
1
1
  import { YGOProStocBase } from '../base';
2
+ import { ErrorMessageType } from '../../network-enums';
2
3
  export declare class YGOProStocErrorMsg extends YGOProStocBase {
3
4
  static identifier: number;
4
- msg: number;
5
+ msg: ErrorMessageType;
5
6
  code: number;
6
7
  }
@@ -1,6 +1,6 @@
1
1
  import { YGOProStocBase } from '../base';
2
2
  export declare class YGOProStocHsPlayerEnter extends YGOProStocBase {
3
3
  static identifier: number;
4
- name: number[];
4
+ name: string;
5
5
  pos: number;
6
6
  }
@@ -1,7 +1,8 @@
1
1
  import { YGOProStocBase } from '../base';
2
+ import { RoomStatus } from '../../network-enums';
2
3
  export declare class SrvproRoomInfo {
3
4
  roomname: string;
4
- room_status: number;
5
+ room_status: RoomStatus;
5
6
  room_duel_count: number;
6
7
  room_turn_count: number;
7
8
  player1: string;
package/index.ts CHANGED
@@ -4,5 +4,6 @@ export * from './src/protos/common';
4
4
  export * from './src/protos/ctos';
5
5
  export * from './src/protos/stoc';
6
6
  export * from './src/protos/msg';
7
+ export * from './src/protos/network-enums';
7
8
  export * from './src/vendor/ocgcore-constants';
8
9
  export * from './src/vendor/script-constants';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ygopro-msg-encode",
3
3
  "description": "TS lib for encode / decode YGOPro proto",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",