teeworlds 2.4.4 → 2.4.5

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,5 +1,6 @@
1
1
 
2
2
  import { MsgPacker } from "../MsgPacker";
3
+ import { PlayerInput, PlayerInfo, Projectile, Laser, Pickup, Flag, GameInfo, GameData, CharacterCore, Character, ClientInfo, SpectatorInfo, Common, Explosion, Spawn, HammerHit, Death, SoundGlobal, SoundWorld, DamageInd } from "../snapshots";
3
4
 
4
5
  import { Client } from "../client";
5
6
  enum NETMSGTYPE { EX, SV_MOTD, SV_BROADCAST, SV_CHAT, SV_KILLMSG, SV_SOUNDGLOBAL, SV_TUNEPARAMS, SV_EXTRAPROJECTILE, SV_READYTOENTER, SV_WEAPONPICKUP, SV_EMOTICON, SV_VOTECLEAROPTIONS, SV_VOTEOPTIONLISTADD, SV_VOTEOPTIONADD, SV_VOTEOPTIONREMOVE, SV_VOTESET, SV_VOTESTATUS, CL_SAY, CL_SETTEAM, CL_SETSPECTATORMODE, CL_STARTINFO, CL_CHANGEINFO, CL_KILL, CL_EMOTICON, CL_VOTE, CL_CALLVOTE, CL_ISDDNETLEGACY, SV_DDRACETIMELEGACY, SV_RECORDLEGACY, UNUSED, SV_TEAMSSTATELEGACY, CL_SHOWOTHERSLEGACY, NUM };
@@ -29,23 +30,26 @@ export class Game {
29
30
  this.send(packer);
30
31
  }
31
32
 
32
- /* Set the team of an bot. (-1 spectator team, 0 team red/normal team, 1 team blue) */
33
- SetTeam(team: number) {
33
+
34
+ /** Set the team of an bot. (-1 spectator team, 0 team red/normal team, 1 team blue) */
35
+ SetTeam(team: number) {
34
36
  var packer = new MsgPacker(NETMSGTYPE.CL_SETTEAM, false, 1);
35
37
  packer.AddInt(team);
36
38
  this.send(packer);
37
39
  }
38
40
 
39
- /* Spectate an player, taking their id as parameter. pretty useless */
40
- SpectatorMode(SpectatorID: number) {
41
+
42
+ /** Spectate an player, taking their id as parameter. pretty useless */
43
+ SpectatorMode(SpectatorID: number) {
41
44
  var packer = new MsgPacker(NETMSGTYPE.CL_SETSPECTATORMODE, false, 1);
42
45
  packer.AddInt(SpectatorID);
43
46
  this.send(packer);
44
47
  }
45
48
 
46
49
 
47
- /* Change the player info */
48
- ChangePlayerInfo(playerInfo: ClientInfo) {
50
+
51
+ /** Change the player info */
52
+ ChangePlayerInfo(playerInfo: ClientInfo) {
49
53
  var packer = new MsgPacker(NETMSGTYPE.CL_CHANGEINFO, false, 1);
50
54
  packer.AddString(playerInfo.name);
51
55
  packer.AddString(playerInfo.clan);
@@ -57,21 +61,24 @@ export class Game {
57
61
  this.send(packer);
58
62
  }
59
63
 
60
- /* Kill */
61
- Kill() {
64
+
65
+ /** Kill */
66
+ Kill() {
62
67
  var packer = new MsgPacker(NETMSGTYPE.CL_KILL, false, 1);
63
68
  this.send(packer);
64
69
  }
65
70
 
66
- /* Send emote */
67
- Emote(emote: number) {
71
+
72
+ /** Send emote */
73
+ Emote(emote: number) {
68
74
  var packer = new MsgPacker(NETMSGTYPE.CL_EMOTICON, false, 1);
69
75
  packer.AddInt(emote);
70
76
  this.send(packer);
71
77
  }
72
78
 
73
- /* Vote for an already running vote (f3 / f4) */
74
- Vote(vote: boolean) {
79
+
80
+ /** Vote for an already running vote (true = f3 / false = f4) */
81
+ Vote(vote: boolean) {
75
82
  var packer = new MsgPacker(NETMSGTYPE.CL_VOTE, false, 1);
76
83
  packer.AddInt(vote ? 1 : -1);
77
84
  this.send(packer);
@@ -84,27 +91,32 @@ export class Game {
84
91
  packer.AddString(Reason);
85
92
  this.send(packer);
86
93
  }
87
- /* Call a vote for an server option (for example ddnet maps) */
88
- CallVoteOption(Value: string, Reason: string) {
94
+
95
+ /** Call a vote for an server option (for example ddnet maps) */
96
+ CallVoteOption(Value: string, Reason: string) {
89
97
  this.CallVote("option", Value, Reason)
90
98
  }
91
- /* Call a vote to kick a player. Requires the player id */
92
- CallVoteKick(PlayerID: string|number, Reason: string) {
99
+
100
+ /** Call a vote to kick a player. Requires the player id */
101
+ CallVoteKick(PlayerID: string|number, Reason: string) {
93
102
  this.CallVote("kick", PlayerID, Reason)
94
103
  }
95
- /* Call a vote to set a player in spectator mode. Requires the player id */
96
- CallVoteSpectate(PlayerID: string|number, Reason: string) {
104
+
105
+ /** Call a vote to set a player in spectator mode. Requires the player id */
106
+ CallVoteSpectate(PlayerID: string|number, Reason: string) {
97
107
  this.CallVote("spectate", PlayerID, Reason)
98
108
  }
99
109
 
100
110
 
101
- /** probably some verification of using ddnet client.*/
111
+
112
+ /** probably some verification of using ddnet client. */
102
113
  IsDDNetLegacy() {
103
114
  var packer = new MsgPacker(NETMSGTYPE.CL_ISDDNETLEGACY, false, 1);
104
115
  this.send(packer);
105
116
  }
106
- /* returns the ping in ms */
107
- Ping(): Promise<number> {
117
+
118
+ /** returns the ping in ms (as a promise) */
119
+ Ping(): Promise<number> {
108
120
  return new Promise((resolve, reject) => {
109
121
  var packer = new MsgPacker(22, true, 0);
110
122
  let startTime = new Date().getTime();
File without changes
File without changes
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.SnapshotWrapper = void 0;
19
+ var stream_1 = require("stream");
20
+ var items;
21
+ (function (items) {
22
+ items[items["OBJ_EX"] = 0] = "OBJ_EX";
23
+ items[items["OBJ_PLAYER_INPUT"] = 1] = "OBJ_PLAYER_INPUT";
24
+ items[items["OBJ_PROJECTILE"] = 2] = "OBJ_PROJECTILE";
25
+ items[items["OBJ_LASER"] = 3] = "OBJ_LASER";
26
+ items[items["OBJ_PICKUP"] = 4] = "OBJ_PICKUP";
27
+ items[items["OBJ_FLAG"] = 5] = "OBJ_FLAG";
28
+ items[items["OBJ_GAME_INFO"] = 6] = "OBJ_GAME_INFO";
29
+ items[items["OBJ_GAME_DATA"] = 7] = "OBJ_GAME_DATA";
30
+ items[items["OBJ_CHARACTER_CORE"] = 8] = "OBJ_CHARACTER_CORE";
31
+ items[items["OBJ_CHARACTER"] = 9] = "OBJ_CHARACTER";
32
+ items[items["OBJ_PLAYER_INFO"] = 10] = "OBJ_PLAYER_INFO";
33
+ items[items["OBJ_CLIENT_INFO"] = 11] = "OBJ_CLIENT_INFO";
34
+ items[items["OBJ_SPECTATOR_INFO"] = 12] = "OBJ_SPECTATOR_INFO";
35
+ items[items["EVENT_COMMON"] = 13] = "EVENT_COMMON";
36
+ items[items["EVENT_EXPLOSION"] = 14] = "EVENT_EXPLOSION";
37
+ items[items["EVENT_SPAWN"] = 15] = "EVENT_SPAWN";
38
+ items[items["EVENT_HAMMERHIT"] = 16] = "EVENT_HAMMERHIT";
39
+ items[items["EVENT_DEATH"] = 17] = "EVENT_DEATH";
40
+ items[items["EVENT_SOUND_GLOBAL"] = 18] = "EVENT_SOUND_GLOBAL";
41
+ items[items["EVENT_SOUND_WORLD"] = 19] = "EVENT_SOUND_WORLD";
42
+ items[items["EVENT_DAMAGE_INDICATOR"] = 20] = "EVENT_DAMAGE_INDICATOR";
43
+ })(items || (items = {}));
44
+ var SnapshotWrapper = /** @class */ (function (_super) {
45
+ __extends(SnapshotWrapper, _super);
46
+ function SnapshotWrapper(_client) {
47
+ var _this =
48
+ // this.SendMsgEx = callback;
49
+ _super.call(this) || this;
50
+ _this._client = _client;
51
+ return _this;
52
+ }
53
+ SnapshotWrapper.prototype.getParsed = function (type_id, id) {
54
+ var _a;
55
+ return (_a = this._client.rawSnapUnpacker.deltas.find(function (delta) { return delta.type_id == type_id && delta.id == id; })) === null || _a === void 0 ? void 0 : _a.parsed;
56
+ };
57
+ SnapshotWrapper.prototype.getAll = function (type_id) {
58
+ var _all = [];
59
+ this._client.rawSnapUnpacker.deltas.forEach(function (delta) {
60
+ if (delta.type_id == type_id)
61
+ _all.push(delta.parsed);
62
+ });
63
+ return _all;
64
+ // return this._client.rawSnapUnpacker.deltas.filter(delta => delta.type_id == type_id && delta.id == id).map(a => a.parsed);
65
+ };
66
+ SnapshotWrapper.prototype.getObjPlayerInput = function (player_id) {
67
+ return this.getParsed(items.OBJ_PLAYER_INPUT, player_id);
68
+ };
69
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjPlayerInput", {
70
+ get: function () {
71
+ return this.getAll(items.OBJ_PLAYER_INPUT);
72
+ },
73
+ enumerable: false,
74
+ configurable: true
75
+ });
76
+ SnapshotWrapper.prototype.getObjProjectile = function (id) {
77
+ return this.getParsed(items.OBJ_PROJECTILE, id);
78
+ };
79
+ Object.defineProperty(SnapshotWrapper.prototype, "AllProjectiles", {
80
+ get: function () {
81
+ return this.getAll(items.OBJ_PROJECTILE);
82
+ },
83
+ enumerable: false,
84
+ configurable: true
85
+ });
86
+ SnapshotWrapper.prototype.getObjLaser = function (id) {
87
+ return this.getParsed(items.OBJ_LASER, id);
88
+ };
89
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjLaser", {
90
+ get: function () {
91
+ return this.getAll(items.OBJ_LASER);
92
+ },
93
+ enumerable: false,
94
+ configurable: true
95
+ });
96
+ SnapshotWrapper.prototype.getObjPickup = function (id) {
97
+ return this.getParsed(items.OBJ_PICKUP, id);
98
+ };
99
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjPickup", {
100
+ get: function () {
101
+ return this.getAll(items.OBJ_PICKUP);
102
+ },
103
+ enumerable: false,
104
+ configurable: true
105
+ });
106
+ SnapshotWrapper.prototype.getObjFlag = function (id) {
107
+ return this.getParsed(items.OBJ_FLAG, id);
108
+ };
109
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjFlag", {
110
+ get: function () {
111
+ return this.getAll(items.OBJ_FLAG);
112
+ },
113
+ enumerable: false,
114
+ configurable: true
115
+ });
116
+ SnapshotWrapper.prototype.getObjGameInfo = function (id) {
117
+ return this.getParsed(items.OBJ_GAME_INFO, id);
118
+ };
119
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjGameInfo", {
120
+ get: function () {
121
+ return this.getAll(items.OBJ_GAME_INFO);
122
+ },
123
+ enumerable: false,
124
+ configurable: true
125
+ });
126
+ SnapshotWrapper.prototype.getObjGameData = function (id) {
127
+ return this.getParsed(items.OBJ_GAME_DATA, id);
128
+ };
129
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjGameData", {
130
+ get: function () {
131
+ return this.getAll(items.OBJ_GAME_DATA);
132
+ },
133
+ enumerable: false,
134
+ configurable: true
135
+ });
136
+ /** NOTICE: x & y positions always differ from the positions in the ingame debug menu. If you want the debug menu positions, you can calculate them like this: Math.round((myChar.character_core.x / 32) * 100)/100 */
137
+ SnapshotWrapper.prototype.getObjCharacterCore = function (player_id) {
138
+ return this.getParsed(items.OBJ_CHARACTER_CORE, player_id);
139
+ };
140
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjCharacterCore", {
141
+ /** NOTICE: x & y positions always differ from the positions in the ingame debug menu. If you want the debug menu positions, you can calculate them like this: Math.round((myChar.character_core.x / 32) * 100)/100 */
142
+ get: function () {
143
+ return this.getAll(items.OBJ_CHARACTER_CORE);
144
+ },
145
+ enumerable: false,
146
+ configurable: true
147
+ });
148
+ /** NOTICE: x & y positions always differ from the positions in the ingame debug menu. If you want the debug menu positions, you can calculate them like this: Math.round((myChar.character_core.x / 32) * 100)/100 */
149
+ SnapshotWrapper.prototype.getObjCharacter = function (player_id) {
150
+ return this.getParsed(items.OBJ_CHARACTER, player_id);
151
+ };
152
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjCharacter", {
153
+ /** NOTICE: x & y positions always differ from the positions in the ingame debug menu. If you want the debug menu positions, you can calculate them like this: Math.round((myChar.character_core.x / 32) * 100)/100 */
154
+ get: function () {
155
+ return this.getAll(items.OBJ_CHARACTER);
156
+ },
157
+ enumerable: false,
158
+ configurable: true
159
+ });
160
+ SnapshotWrapper.prototype.getObjPlayerInfo = function (player_id) {
161
+ return this.getParsed(items.OBJ_PLAYER_INFO, player_id);
162
+ };
163
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjPlayerInfo", {
164
+ get: function () {
165
+ return this.getAll(items.OBJ_PLAYER_INFO);
166
+ },
167
+ enumerable: false,
168
+ configurable: true
169
+ });
170
+ SnapshotWrapper.prototype.getObjClientInfo = function (player_id) {
171
+ return this.getParsed(items.OBJ_CLIENT_INFO, player_id);
172
+ };
173
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjClientInfo", {
174
+ get: function () {
175
+ return this.getAll(items.OBJ_CLIENT_INFO);
176
+ },
177
+ enumerable: false,
178
+ configurable: true
179
+ });
180
+ SnapshotWrapper.prototype.getObjSpectatorInfo = function (player_id) {
181
+ return this.getParsed(items.OBJ_SPECTATOR_INFO, player_id);
182
+ };
183
+ Object.defineProperty(SnapshotWrapper.prototype, "AllObjSpectatorInfo", {
184
+ get: function () {
185
+ return this.getAll(items.OBJ_SPECTATOR_INFO);
186
+ },
187
+ enumerable: false,
188
+ configurable: true
189
+ });
190
+ Object.defineProperty(SnapshotWrapper.prototype, "OwnID", {
191
+ get: function () {
192
+ var _a;
193
+ return (_a = this.AllObjPlayerInfo.find(function (parsed) { return parsed.local; })) === null || _a === void 0 ? void 0 : _a.client_id;
194
+ },
195
+ enumerable: false,
196
+ configurable: true
197
+ });
198
+ return SnapshotWrapper;
199
+ }(stream_1.EventEmitter));
200
+ exports.SnapshotWrapper = SnapshotWrapper;
@@ -0,0 +1,174 @@
1
+
2
+ import { Client } from "../client";
3
+ import { EventEmitter } from "stream";
4
+ import { PlayerInput, PlayerInfo, Projectile, Laser, Pickup, Flag, GameInfo, GameData, CharacterCore, Character, ClientInfo, SpectatorInfo, Common, Explosion, Spawn, HammerHit, Death, SoundGlobal, SoundWorld, DamageInd } from "../snapshots";
5
+
6
+ enum items {
7
+ OBJ_EX,
8
+ OBJ_PLAYER_INPUT,
9
+ OBJ_PROJECTILE,
10
+ OBJ_LASER,
11
+ OBJ_PICKUP,
12
+ OBJ_FLAG,
13
+ OBJ_GAME_INFO,
14
+ OBJ_GAME_DATA,
15
+ OBJ_CHARACTER_CORE,
16
+ OBJ_CHARACTER,
17
+ OBJ_PLAYER_INFO,
18
+ OBJ_CLIENT_INFO,
19
+ OBJ_SPECTATOR_INFO,
20
+ EVENT_COMMON,
21
+ EVENT_EXPLOSION,
22
+ EVENT_SPAWN,
23
+ EVENT_HAMMERHIT,
24
+ EVENT_DEATH,
25
+ EVENT_SOUND_GLOBAL,
26
+ EVENT_SOUND_WORLD,
27
+ EVENT_DAMAGE_INDICATOR
28
+ }
29
+ export declare interface SnapshotWrapper {
30
+
31
+
32
+ // on(event: 'connected', listener: () => void): this;
33
+ // on(event: 'disconnect', listener: (reason: string) => void): this;
34
+
35
+ // on(event: 'emote', listener: (message: iEmoticon) => void): this;
36
+ // on(event: 'message', listener: (message: iMessage) => void): this;
37
+ // on(event: 'broadcast', listener: (message: string) => void): this;
38
+ // on(event: 'kill', listener: (kill: iKillMsg) => void): this;
39
+ // on(event: 'motd', listener: (message: string) => void): this;
40
+
41
+ on(event: 'common', listener: (common: Common) => void): this;
42
+ on(event: 'explosion', listener: (explosion: Explosion) => void): this;
43
+ on(event: 'spawn', listener: (spawn: Spawn) => void): this;
44
+ on(event: 'hammerhit', listener: (hammerhit: HammerHit) => void): this;
45
+ on(event: 'death', listener: (death: Death) => void): this;
46
+ on(event: 'sound_global', listener: (sound_global: SoundGlobal) => void): this;
47
+ on(event: 'sound_world', listener: (sound_world: SoundWorld) => void): this;
48
+ on(event: 'damage_indicator', listener: (damage_indicator: DamageInd) => void): this;
49
+
50
+ }
51
+
52
+ export class SnapshotWrapper extends EventEmitter {
53
+ private _client: Client;
54
+ constructor(_client: Client) {
55
+ // this.SendMsgEx = callback;
56
+ super();
57
+ this._client = _client;
58
+ }
59
+
60
+ private getParsed<T>(type_id: number, id: number) {
61
+ return this._client.rawSnapUnpacker.deltas.find(delta => delta.type_id == type_id && delta.id == id)?.parsed as unknown as T;
62
+ }
63
+
64
+ private getAll<T>(type_id: number): T[] {
65
+ let _all: T[] = [];
66
+
67
+ this._client.rawSnapUnpacker.deltas.forEach(delta => {
68
+ if (delta.type_id == type_id)
69
+ _all.push(delta.parsed as T);
70
+ })
71
+
72
+
73
+ return _all;
74
+ // return this._client.rawSnapUnpacker.deltas.filter(delta => delta.type_id == type_id && delta.id == id).map(a => a.parsed);
75
+ }
76
+
77
+ getObjPlayerInput(player_id: number): PlayerInput | undefined {
78
+ return this.getParsed(items.OBJ_PLAYER_INPUT, player_id);
79
+ }
80
+
81
+ get AllObjPlayerInput(): PlayerInput[] {
82
+ return this.getAll(items.OBJ_PLAYER_INPUT);
83
+ }
84
+
85
+ getObjProjectile(id: number): Projectile | undefined {
86
+ return this.getParsed(items.OBJ_PROJECTILE, id);
87
+ }
88
+ get AllProjectiles(): Projectile[] {
89
+ return this.getAll(items.OBJ_PROJECTILE);
90
+ }
91
+
92
+ getObjLaser(id: number): Laser | undefined {
93
+ return this.getParsed(items.OBJ_LASER, id);
94
+ }
95
+ get AllObjLaser(): Laser[] {
96
+ return this.getAll(items.OBJ_LASER);
97
+ }
98
+
99
+ getObjPickup(id: number): Pickup | undefined {
100
+ return this.getParsed(items.OBJ_PICKUP, id);
101
+ }
102
+ get AllObjPickup(): Pickup[] {
103
+ return this.getAll(items.OBJ_PICKUP);
104
+ }
105
+
106
+ getObjFlag(id: number): Flag | undefined {
107
+ return this.getParsed(items.OBJ_FLAG, id);
108
+ }
109
+ get AllObjFlag(): Flag[] {
110
+ return this.getAll(items.OBJ_FLAG);
111
+ }
112
+
113
+ getObjGameInfo(id: number): GameInfo | undefined {
114
+ return this.getParsed(items.OBJ_GAME_INFO, id);
115
+ }
116
+ get AllObjGameInfo(): GameInfo[] {
117
+ return this.getAll(items.OBJ_GAME_INFO);
118
+ }
119
+
120
+ getObjGameData(id: number): GameData | undefined {
121
+ return this.getParsed(items.OBJ_GAME_DATA, id);
122
+ }
123
+ get AllObjGameData(): GameData[] {
124
+ return this.getAll(items.OBJ_GAME_DATA);
125
+ }
126
+
127
+ /** NOTICE: x & y positions always differ from the positions in the ingame debug menu. If you want the debug menu positions, you can calculate them like this: Math.round((myChar.character_core.x / 32) * 100)/100 */
128
+ getObjCharacterCore(player_id: number): CharacterCore | undefined {
129
+ return this.getParsed(items.OBJ_CHARACTER_CORE, player_id);
130
+ }
131
+ /** NOTICE: x & y positions always differ from the positions in the ingame debug menu. If you want the debug menu positions, you can calculate them like this: Math.round((myChar.character_core.x / 32) * 100)/100 */
132
+ get AllObjCharacterCore(): CharacterCore[] {
133
+ return this.getAll(items.OBJ_CHARACTER_CORE);
134
+ }
135
+
136
+ /** NOTICE: x & y positions always differ from the positions in the ingame debug menu. If you want the debug menu positions, you can calculate them like this: Math.round((myChar.character_core.x / 32) * 100)/100 */
137
+ getObjCharacter(player_id: number): Character | undefined {
138
+ return this.getParsed(items.OBJ_CHARACTER, player_id);
139
+ }
140
+ /** NOTICE: x & y positions always differ from the positions in the ingame debug menu. If you want the debug menu positions, you can calculate them like this: Math.round((myChar.character_core.x / 32) * 100)/100 */
141
+ get AllObjCharacter(): Character[] {
142
+
143
+ return this.getAll(items.OBJ_CHARACTER);
144
+ }
145
+
146
+ getObjPlayerInfo(player_id: number): PlayerInfo | undefined {
147
+ return this.getParsed(items.OBJ_PLAYER_INFO, player_id);
148
+ }
149
+ get AllObjPlayerInfo(): PlayerInfo[] {
150
+ return this.getAll(items.OBJ_PLAYER_INFO);
151
+ }
152
+
153
+ getObjClientInfo(player_id: number): ClientInfo | undefined {
154
+ return this.getParsed(items.OBJ_CLIENT_INFO, player_id);
155
+ }
156
+ get AllObjClientInfo(): ClientInfo[] {
157
+ return this.getAll(items.OBJ_CLIENT_INFO);
158
+ }
159
+
160
+ getObjSpectatorInfo(player_id: number): SpectatorInfo | undefined {
161
+ return this.getParsed(items.OBJ_SPECTATOR_INFO, player_id);
162
+ }
163
+ get AllObjSpectatorInfo(): SpectatorInfo[] {
164
+ return this.getAll(items.OBJ_SPECTATOR_INFO);
165
+ }
166
+
167
+
168
+ get OwnID(): number | undefined {
169
+ return this.AllObjPlayerInfo.find(parsed => parsed.local)?.client_id;
170
+ }
171
+
172
+
173
+
174
+ }