teeworlds 2.5.3 → 2.5.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.
@@ -0,0 +1,114 @@
1
+
2
+ import { EventEmitter } from "stream";
3
+ import { MsgPacker } from "../MsgPacker";
4
+ import { MsgUnpacker } from "../MsgUnpacker";
5
+ import { Client } from "../client";
6
+ import { NETMSG } from "../enums_types/protocol";
7
+ import { Chunk, RconCommand } from "../enums_types/types";
8
+
9
+ interface RconEvents {
10
+ rcon_line: (line: string) => void;
11
+ rcon_auth_status: (info: {AuthLevel: number, ReceiveCommands: number}) => void;
12
+ rcon_cmd_add: (info: {command: string, description: string, params: string}) => void;
13
+ rcon_cmd_rem: (info: {command: string}) => void;
14
+ }
15
+
16
+
17
+ export class Rcon extends EventEmitter {
18
+ on<K extends keyof RconEvents>(event: K, listener: RconEvents[K]): this {
19
+ return super.on(event, listener);
20
+ }
21
+
22
+ emit<K extends keyof RconEvents>(event: K, ...args: Parameters<RconEvents[K]>): boolean {
23
+ return super.emit(event, ...args);
24
+ }
25
+
26
+ CommandList: RconCommand[] = [];
27
+
28
+
29
+ private _client: Client;
30
+ constructor(_client: Client) {
31
+ super();
32
+ this._client = _client;
33
+ }
34
+
35
+ // SendMsgEx: (Msgs: MsgPacker[] | MsgPacker) => void;
36
+ private send(packer: MsgPacker | MsgPacker[]) {
37
+ if (!this._client.options?.lightweight)
38
+ this._client.QueueChunkEx(packer);
39
+ else
40
+ this._client.SendMsgEx(packer);
41
+
42
+ }
43
+ public auth(username: string, password: string): void;
44
+ public auth(password: string): void;
45
+
46
+
47
+ /** Rcon auth, set the `username` to empty string for authentication w/o username **/
48
+ auth(usernameOrPassword: string, password?: string) {
49
+ const rconAuthMsg = new MsgPacker(NETMSG.System.NETMSG_RCON_AUTH, true, 1);
50
+ if (password == undefined) {
51
+ rconAuthMsg.AddString("");
52
+ rconAuthMsg.AddString(usernameOrPassword);
53
+
54
+ } else {
55
+ rconAuthMsg.AddString(usernameOrPassword);
56
+ rconAuthMsg.AddString(password);
57
+ }
58
+ rconAuthMsg.AddInt(1);
59
+ this.send(rconAuthMsg);
60
+ }
61
+
62
+ /** Send rcon command **/
63
+ rcon(cmds: string[] | string) {
64
+ let _cmds: string[];
65
+ if (cmds instanceof Array) _cmds = cmds
66
+ else _cmds = [cmds];
67
+ const msgs: MsgPacker[] = [];
68
+ _cmds.forEach((cmd) => {
69
+ const rconCmdMsg = new MsgPacker(NETMSG.System.NETMSG_RCON_CMD, true, 1);
70
+ rconCmdMsg.AddString(cmd);
71
+ msgs.push(rconCmdMsg);
72
+ })
73
+ this.send(msgs);
74
+ }
75
+ /** This method is called by the Client to handle the chunks. It should not be called directly. */
76
+ _checkChunks(chunk: Chunk): boolean {
77
+ if (chunk.msgid == NETMSG.System.NETMSG_RCON_LINE) {
78
+ const unpacker = new MsgUnpacker(chunk.raw);
79
+ const msg = unpacker.unpackString();
80
+ this.emit('rcon_line', msg);
81
+
82
+ } else if (chunk.msgid == NETMSG.System.NETMSG_RCON_AUTH_STATUS) {
83
+ const unpacker = new MsgUnpacker(chunk.raw);
84
+ const AuthLevel = unpacker.unpackInt();
85
+ const ReceiveCommands = unpacker.unpackInt();
86
+ this.emit('rcon_auth_status', {AuthLevel, ReceiveCommands});
87
+ } else if (chunk.msgid == NETMSG.System.NETMSG_RCON_CMD_ADD) {
88
+ const unpacker = new MsgUnpacker(chunk.raw);
89
+ const command = unpacker.unpackString();
90
+ const description = unpacker.unpackString();
91
+ const params = unpacker.unpackString();
92
+
93
+ this.CommandList.push({command, description, params});
94
+
95
+ this.emit('rcon_cmd_add', {command, description, params});
96
+ } else if (chunk.msgid == NETMSG.System.NETMSG_RCON_CMD_REM) {
97
+ const unpacker = new MsgUnpacker(chunk.raw);
98
+ const command = unpacker.unpackString();
99
+ this.emit('rcon_cmd_rem', {command});
100
+
101
+ let index = this.CommandList.findIndex(a => a.command == command);
102
+ if (index -1 >= 0)
103
+ this.CommandList.splice(index, 1);
104
+ }
105
+ else {
106
+ return false;
107
+ }
108
+ return true;
109
+ }
110
+
111
+
112
+
113
+
114
+ }
@@ -1,258 +1,143 @@
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
- if (type_id == -1)
56
- return undefined;
57
- 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;
58
- };
59
- SnapshotWrapper.prototype.getAll = function (type_id) {
60
- var _all = [];
61
- if (type_id == -1)
62
- return _all;
63
- this._client.rawSnapUnpacker.deltas.forEach(function (delta) {
64
- if (delta.type_id == type_id)
65
- _all.push(delta.parsed);
66
- });
67
- return _all;
68
- // return this._client.rawSnapUnpacker.deltas.filter(delta => delta.type_id == type_id && delta.id == id).map(a => a.parsed);
69
- };
70
- SnapshotWrapper.prototype.getObjPlayerInput = function (player_id) {
71
- return this.getParsed(items.OBJ_PLAYER_INPUT, player_id);
72
- };
73
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjPlayerInput", {
74
- get: function () {
75
- return this.getAll(items.OBJ_PLAYER_INPUT);
76
- },
77
- enumerable: false,
78
- configurable: true
79
- });
80
- SnapshotWrapper.prototype.getObjProjectile = function (id) {
81
- return this.getParsed(items.OBJ_PROJECTILE, id);
82
- };
83
- Object.defineProperty(SnapshotWrapper.prototype, "AllProjectiles", {
84
- get: function () {
85
- return this.getAll(items.OBJ_PROJECTILE);
86
- },
87
- enumerable: false,
88
- configurable: true
89
- });
90
- SnapshotWrapper.prototype.getObjLaser = function (id) {
91
- return this.getParsed(items.OBJ_LASER, id);
92
- };
93
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjLaser", {
94
- get: function () {
95
- return this.getAll(items.OBJ_LASER);
96
- },
97
- enumerable: false,
98
- configurable: true
99
- });
100
- SnapshotWrapper.prototype.getObjPickup = function (id) {
101
- return this.getParsed(items.OBJ_PICKUP, id);
102
- };
103
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjPickup", {
104
- get: function () {
105
- return this.getAll(items.OBJ_PICKUP);
106
- },
107
- enumerable: false,
108
- configurable: true
109
- });
110
- SnapshotWrapper.prototype.getObjFlag = function (id) {
111
- return this.getParsed(items.OBJ_FLAG, id);
112
- };
113
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjFlag", {
114
- get: function () {
115
- return this.getAll(items.OBJ_FLAG);
116
- },
117
- enumerable: false,
118
- configurable: true
119
- });
120
- SnapshotWrapper.prototype.getObjGameInfo = function (id) {
121
- return this.getParsed(items.OBJ_GAME_INFO, id);
122
- };
123
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjGameInfo", {
124
- get: function () {
125
- return this.getAll(items.OBJ_GAME_INFO);
126
- },
127
- enumerable: false,
128
- configurable: true
129
- });
130
- SnapshotWrapper.prototype.getObjGameData = function (id) {
131
- return this.getParsed(items.OBJ_GAME_DATA, id);
132
- };
133
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjGameData", {
134
- get: function () {
135
- return this.getAll(items.OBJ_GAME_DATA);
136
- },
137
- enumerable: false,
138
- configurable: true
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
- SnapshotWrapper.prototype.getObjCharacterCore = function (player_id) {
142
- return this.getParsed(items.OBJ_CHARACTER_CORE, player_id);
143
- };
144
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjCharacterCore", {
145
- /** 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 */
146
- get: function () {
147
- return this.getAll(items.OBJ_CHARACTER_CORE);
148
- },
149
- enumerable: false,
150
- configurable: true
151
- });
152
- /** 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 */
153
- SnapshotWrapper.prototype.getObjCharacter = function (player_id) {
154
- return this.getParsed(items.OBJ_CHARACTER, player_id);
155
- };
156
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjCharacter", {
157
- /** 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 */
158
- get: function () {
159
- return this.getAll(items.OBJ_CHARACTER);
160
- },
161
- enumerable: false,
162
- configurable: true
163
- });
164
- SnapshotWrapper.prototype.getObjPlayerInfo = function (player_id) {
165
- return this.getParsed(items.OBJ_PLAYER_INFO, player_id);
166
- };
167
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjPlayerInfo", {
168
- get: function () {
169
- return this.getAll(items.OBJ_PLAYER_INFO);
170
- },
171
- enumerable: false,
172
- configurable: true
173
- });
174
- SnapshotWrapper.prototype.getObjClientInfo = function (player_id) {
175
- return this.getParsed(items.OBJ_CLIENT_INFO, player_id);
176
- };
177
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjClientInfo", {
178
- get: function () {
179
- return this.getAll(items.OBJ_CLIENT_INFO);
180
- },
181
- enumerable: false,
182
- configurable: true
183
- });
184
- SnapshotWrapper.prototype.getObjSpectatorInfo = function (player_id) {
185
- return this.getParsed(items.OBJ_SPECTATOR_INFO, player_id);
186
- };
187
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjSpectatorInfo", {
188
- get: function () {
189
- return this.getAll(items.OBJ_SPECTATOR_INFO);
190
- },
191
- enumerable: false,
192
- configurable: true
193
- });
194
- SnapshotWrapper.prototype.getTypeId = function (name) {
195
- var _a;
196
- return ((_a = this._client.rawSnapUnpacker.uuid_manager.LookupName(name)) === null || _a === void 0 ? void 0 : _a.type_id) || -1;
197
- };
198
- SnapshotWrapper.prototype.getObjExMyOwnObject = function (id) {
199
- return this.getParsed(this.getTypeId("my-own-object@heinrich5991.de"), id);
200
- };
201
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExMyOwnObject", {
202
- get: function () {
203
- return this.getAll(this.getTypeId("my-own-object@heinrich5991.de"));
204
- },
205
- enumerable: false,
206
- configurable: true
207
- });
208
- SnapshotWrapper.prototype.getObjExDDNetCharacter = function (id) {
209
- return this.getParsed(this.getTypeId("character@netobj.ddnet.tw"), id);
210
- };
211
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExDDNetCharacter", {
212
- get: function () {
213
- return this.getAll(this.getTypeId("character@netobj.ddnet.tw"));
214
- },
215
- enumerable: false,
216
- configurable: true
217
- });
218
- SnapshotWrapper.prototype.getObjExGameInfo = function (id) {
219
- return this.getParsed(this.getTypeId("gameinfo@netobj.ddnet.tw"), id);
220
- };
221
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExGameInfo", {
222
- get: function () {
223
- return this.getAll(this.getTypeId("gameinfo@netobj.ddnet.tw"));
224
- },
225
- enumerable: false,
226
- configurable: true
227
- });
228
- SnapshotWrapper.prototype.getObjExDDNetProjectile = function (id) {
229
- return this.getParsed(this.getTypeId("projectile@netobj.ddnet.tw"), id);
230
- };
231
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExDDNetProjectile", {
232
- get: function () {
233
- return this.getAll(this.getTypeId("projectile@netobj.ddnet.tw"));
234
- },
235
- enumerable: false,
236
- configurable: true
237
- });
238
- SnapshotWrapper.prototype.getObjExLaser = function (id) {
239
- return this.getParsed(this.getTypeId("laser@netobj.ddnet.tw"), id);
240
- };
241
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExLaser", {
242
- get: function () {
243
- return this.getAll(this.getTypeId("laser@netobj.ddnet.tw"));
244
- },
245
- enumerable: false,
246
- configurable: true
247
- });
248
- Object.defineProperty(SnapshotWrapper.prototype, "OwnID", {
249
- get: function () {
250
- var _a;
251
- return (_a = this.AllObjPlayerInfo.find(function (parsed) { return parsed.local; })) === null || _a === void 0 ? void 0 : _a.client_id;
252
- },
253
- enumerable: false,
254
- configurable: true
255
- });
256
- return SnapshotWrapper;
257
- }(stream_1.EventEmitter));
258
- exports.SnapshotWrapper = SnapshotWrapper;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SnapshotWrapper = void 0;
4
+ const stream_1 = require("stream");
5
+ class SnapshotWrapper extends stream_1.EventEmitter {
6
+ constructor(_client) {
7
+ // this.SendMsgEx = callback;
8
+ super();
9
+ this._client = _client;
10
+ }
11
+ getParsed(type_id, id) {
12
+ var _a;
13
+ if (type_id == -1)
14
+ return undefined;
15
+ return (_a = this._client.rawSnapUnpacker.deltas.find(delta => delta.type_id == type_id && delta.id == id)) === null || _a === void 0 ? void 0 : _a.parsed;
16
+ }
17
+ getAll(type_id) {
18
+ let _all = [];
19
+ if (type_id == -1)
20
+ return _all;
21
+ this._client.rawSnapUnpacker.deltas.forEach(delta => {
22
+ if (delta.type_id == type_id)
23
+ _all.push(delta.parsed);
24
+ });
25
+ return _all;
26
+ // return this._client.rawSnapUnpacker.deltas.filter(delta => delta.type_id == type_id && delta.id == id).map(a => a.parsed);
27
+ }
28
+ getObjPlayerInput(player_id) {
29
+ return this.getParsed(1 /* SnapshotItemIDs.OBJ_PLAYER_INPUT */, player_id);
30
+ }
31
+ get AllObjPlayerInput() {
32
+ return this.getAll(1 /* SnapshotItemIDs.OBJ_PLAYER_INPUT */);
33
+ }
34
+ getObjProjectile(id) {
35
+ return this.getParsed(2 /* SnapshotItemIDs.OBJ_PROJECTILE */, id);
36
+ }
37
+ get AllProjectiles() {
38
+ return this.getAll(2 /* SnapshotItemIDs.OBJ_PROJECTILE */);
39
+ }
40
+ getObjLaser(id) {
41
+ return this.getParsed(3 /* SnapshotItemIDs.OBJ_LASER */, id);
42
+ }
43
+ get AllObjLaser() {
44
+ return this.getAll(3 /* SnapshotItemIDs.OBJ_LASER */);
45
+ }
46
+ getObjPickup(id) {
47
+ return this.getParsed(4 /* SnapshotItemIDs.OBJ_PICKUP */, id);
48
+ }
49
+ get AllObjPickup() {
50
+ return this.getAll(4 /* SnapshotItemIDs.OBJ_PICKUP */);
51
+ }
52
+ getObjFlag(id) {
53
+ return this.getParsed(5 /* SnapshotItemIDs.OBJ_FLAG */, id);
54
+ }
55
+ get AllObjFlag() {
56
+ return this.getAll(5 /* SnapshotItemIDs.OBJ_FLAG */);
57
+ }
58
+ getObjGameInfo(id) {
59
+ return this.getParsed(6 /* SnapshotItemIDs.OBJ_GAME_INFO */, id);
60
+ }
61
+ get AllObjGameInfo() {
62
+ return this.getAll(6 /* SnapshotItemIDs.OBJ_GAME_INFO */);
63
+ }
64
+ getObjGameData(id) {
65
+ return this.getParsed(7 /* SnapshotItemIDs.OBJ_GAME_DATA */, id);
66
+ }
67
+ get AllObjGameData() {
68
+ return this.getAll(7 /* SnapshotItemIDs.OBJ_GAME_DATA */);
69
+ }
70
+ /** 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 */
71
+ getObjCharacterCore(player_id) {
72
+ return this.getParsed(8 /* SnapshotItemIDs.OBJ_CHARACTER_CORE */, player_id);
73
+ }
74
+ /** 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 */
75
+ get AllObjCharacterCore() {
76
+ return this.getAll(8 /* SnapshotItemIDs.OBJ_CHARACTER_CORE */);
77
+ }
78
+ /** 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 */
79
+ getObjCharacter(player_id) {
80
+ return this.getParsed(9 /* SnapshotItemIDs.OBJ_CHARACTER */, player_id);
81
+ }
82
+ /** 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 */
83
+ get AllObjCharacter() {
84
+ return this.getAll(9 /* SnapshotItemIDs.OBJ_CHARACTER */);
85
+ }
86
+ getObjPlayerInfo(player_id) {
87
+ return this.getParsed(10 /* SnapshotItemIDs.OBJ_PLAYER_INFO */, player_id);
88
+ }
89
+ get AllObjPlayerInfo() {
90
+ return this.getAll(10 /* SnapshotItemIDs.OBJ_PLAYER_INFO */);
91
+ }
92
+ getObjClientInfo(player_id) {
93
+ return this.getParsed(11 /* SnapshotItemIDs.OBJ_CLIENT_INFO */, player_id);
94
+ }
95
+ get AllObjClientInfo() {
96
+ return this.getAll(11 /* SnapshotItemIDs.OBJ_CLIENT_INFO */);
97
+ }
98
+ getObjSpectatorInfo(player_id) {
99
+ return this.getParsed(12 /* SnapshotItemIDs.OBJ_SPECTATOR_INFO */, player_id);
100
+ }
101
+ get AllObjSpectatorInfo() {
102
+ return this.getAll(12 /* SnapshotItemIDs.OBJ_SPECTATOR_INFO */);
103
+ }
104
+ getTypeId(name) {
105
+ var _a;
106
+ return ((_a = this._client.rawSnapUnpacker.uuid_manager.LookupName(name)) === null || _a === void 0 ? void 0 : _a.type_id) || -1;
107
+ }
108
+ getObjExMyOwnObject(id) {
109
+ return this.getParsed(this.getTypeId("my-own-object@heinrich5991.de"), id);
110
+ }
111
+ get AllObjExMyOwnObject() {
112
+ return this.getAll(this.getTypeId("my-own-object@heinrich5991.de"));
113
+ }
114
+ getObjExDDNetCharacter(id) {
115
+ return this.getParsed(this.getTypeId("character@netobj.ddnet.tw"), id);
116
+ }
117
+ get AllObjExDDNetCharacter() {
118
+ return this.getAll(this.getTypeId("character@netobj.ddnet.tw"));
119
+ }
120
+ getObjExGameInfo(id) {
121
+ return this.getParsed(this.getTypeId("gameinfo@netobj.ddnet.tw"), id);
122
+ }
123
+ get AllObjExGameInfo() {
124
+ return this.getAll(this.getTypeId("gameinfo@netobj.ddnet.tw"));
125
+ }
126
+ getObjExDDNetProjectile(id) {
127
+ return this.getParsed(this.getTypeId("projectile@netobj.ddnet.tw"), id);
128
+ }
129
+ get AllObjExDDNetProjectile() {
130
+ return this.getAll(this.getTypeId("projectile@netobj.ddnet.tw"));
131
+ }
132
+ getObjExLaser(id) {
133
+ return this.getParsed(this.getTypeId("laser@netobj.ddnet.tw"), id);
134
+ }
135
+ get AllObjExLaser() {
136
+ return this.getAll(this.getTypeId("laser@netobj.ddnet.tw"));
137
+ }
138
+ get OwnID() {
139
+ var _a;
140
+ return (_a = this.AllObjPlayerInfo.find(parsed => parsed.local)) === null || _a === void 0 ? void 0 : _a.client_id;
141
+ }
142
+ }
143
+ exports.SnapshotWrapper = SnapshotWrapper;