yolkbot 0.1.0-alpha.6 → 0.1.0-alpha.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/types/bot.d.ts +30 -5
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yolkbot",
3
3
  "description": "create a shell shockers (self) bot in under 10 lines.",
4
- "version": "0.1.0-alpha.6",
4
+ "version": "0.1.0-alpha.7",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "shellshock.io",
@@ -1,10 +1,11 @@
1
1
  import { CommCode } from '../comm/Codes.js';
2
- import { GamePlayer } from '../bot/GamePlayer.js';
3
2
  import { Matchmaker } from '../matchmaker.js';
4
3
  import { yolkws } from '../socket.js';
5
4
  import { NodeList } from '../pathing/mapnode.js';
6
5
  import { Maps } from '../constants/maps.js';
7
6
 
7
+ import { GamePlayer } from './bot/GamePlayer.js';
8
+
8
9
  export interface BotParams {
9
10
  name?: string;
10
11
  proxy?: string;
@@ -51,8 +52,32 @@ export interface GameOptions {
51
52
  mustUseSecondary: boolean;
52
53
  }
53
54
 
55
+ export interface RawGameData {
56
+ command: 'gameFound';
57
+ region: string;
58
+ subdomain: string;
59
+ id: string;
60
+ uuid: string;
61
+ private: boolean;
62
+ noobLobby: boolean;
63
+ }
64
+
65
+ export interface RawMapData {
66
+ filename: string;
67
+ hash: string;
68
+ name: string;
69
+ modes: {
70
+ FFA: boolean;
71
+ Teams: boolean;
72
+ Spatula: boolean;
73
+ King?: boolean;
74
+ };
75
+ availability: string;
76
+ numPlayers: string;
77
+ }
78
+
54
79
  export interface Game {
55
- raw: any;
80
+ raw: RawGameData;
56
81
  code: string;
57
82
  gameModeId: number;
58
83
  gameMode: string;
@@ -69,7 +94,7 @@ export interface Game {
69
94
  };
70
95
  availability: string;
71
96
  numPlayers: string;
72
- raw: any;
97
+ raw: RawMapData;
73
98
  nodes: any;
74
99
  };
75
100
  playerLimit: number;
@@ -142,8 +167,8 @@ export class Bot {
142
167
  dispatch(disp: any): void;
143
168
  drain(): void;
144
169
  initMatchmaker(): Promise<boolean>;
145
- createPrivateGame(opts: { region: string; mode: string; map: string }): Promise<any>;
146
- join(data: string | any): Promise<void>;
170
+ createPrivateGame(opts: { region: string; mode: string; map: string }): Promise<RawGameData>;
171
+ join(data: string | RawGameData): Promise<void>;
147
172
  update(): void;
148
173
  on(event: string, cb: Function): void;
149
174
  onAny(cb: Function): void;