teeworlds 2.5.4 → 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.
@@ -1,234 +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 SnapshotWrapper = /** @class */ (function (_super) {
21
- __extends(SnapshotWrapper, _super);
22
- function SnapshotWrapper(_client) {
23
- var _this =
24
- // this.SendMsgEx = callback;
25
- _super.call(this) || this;
26
- _this._client = _client;
27
- return _this;
28
- }
29
- SnapshotWrapper.prototype.getParsed = function (type_id, id) {
30
- var _a;
31
- if (type_id == -1)
32
- return undefined;
33
- 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;
34
- };
35
- SnapshotWrapper.prototype.getAll = function (type_id) {
36
- var _all = [];
37
- if (type_id == -1)
38
- return _all;
39
- this._client.rawSnapUnpacker.deltas.forEach(function (delta) {
40
- if (delta.type_id == type_id)
41
- _all.push(delta.parsed);
42
- });
43
- return _all;
44
- // return this._client.rawSnapUnpacker.deltas.filter(delta => delta.type_id == type_id && delta.id == id).map(a => a.parsed);
45
- };
46
- SnapshotWrapper.prototype.getObjPlayerInput = function (player_id) {
47
- return this.getParsed(1 /* SnapshotItemIDs.OBJ_PLAYER_INPUT */, player_id);
48
- };
49
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjPlayerInput", {
50
- get: function () {
51
- return this.getAll(1 /* SnapshotItemIDs.OBJ_PLAYER_INPUT */);
52
- },
53
- enumerable: false,
54
- configurable: true
55
- });
56
- SnapshotWrapper.prototype.getObjProjectile = function (id) {
57
- return this.getParsed(2 /* SnapshotItemIDs.OBJ_PROJECTILE */, id);
58
- };
59
- Object.defineProperty(SnapshotWrapper.prototype, "AllProjectiles", {
60
- get: function () {
61
- return this.getAll(2 /* SnapshotItemIDs.OBJ_PROJECTILE */);
62
- },
63
- enumerable: false,
64
- configurable: true
65
- });
66
- SnapshotWrapper.prototype.getObjLaser = function (id) {
67
- return this.getParsed(3 /* SnapshotItemIDs.OBJ_LASER */, id);
68
- };
69
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjLaser", {
70
- get: function () {
71
- return this.getAll(3 /* SnapshotItemIDs.OBJ_LASER */);
72
- },
73
- enumerable: false,
74
- configurable: true
75
- });
76
- SnapshotWrapper.prototype.getObjPickup = function (id) {
77
- return this.getParsed(4 /* SnapshotItemIDs.OBJ_PICKUP */, id);
78
- };
79
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjPickup", {
80
- get: function () {
81
- return this.getAll(4 /* SnapshotItemIDs.OBJ_PICKUP */);
82
- },
83
- enumerable: false,
84
- configurable: true
85
- });
86
- SnapshotWrapper.prototype.getObjFlag = function (id) {
87
- return this.getParsed(5 /* SnapshotItemIDs.OBJ_FLAG */, id);
88
- };
89
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjFlag", {
90
- get: function () {
91
- return this.getAll(5 /* SnapshotItemIDs.OBJ_FLAG */);
92
- },
93
- enumerable: false,
94
- configurable: true
95
- });
96
- SnapshotWrapper.prototype.getObjGameInfo = function (id) {
97
- return this.getParsed(6 /* SnapshotItemIDs.OBJ_GAME_INFO */, id);
98
- };
99
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjGameInfo", {
100
- get: function () {
101
- return this.getAll(6 /* SnapshotItemIDs.OBJ_GAME_INFO */);
102
- },
103
- enumerable: false,
104
- configurable: true
105
- });
106
- SnapshotWrapper.prototype.getObjGameData = function (id) {
107
- return this.getParsed(7 /* SnapshotItemIDs.OBJ_GAME_DATA */, id);
108
- };
109
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjGameData", {
110
- get: function () {
111
- return this.getAll(7 /* SnapshotItemIDs.OBJ_GAME_DATA */);
112
- },
113
- enumerable: false,
114
- configurable: true
115
- });
116
- /** 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 */
117
- SnapshotWrapper.prototype.getObjCharacterCore = function (player_id) {
118
- return this.getParsed(8 /* SnapshotItemIDs.OBJ_CHARACTER_CORE */, player_id);
119
- };
120
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjCharacterCore", {
121
- /** 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 */
122
- get: function () {
123
- return this.getAll(8 /* SnapshotItemIDs.OBJ_CHARACTER_CORE */);
124
- },
125
- enumerable: false,
126
- configurable: true
127
- });
128
- /** 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 */
129
- SnapshotWrapper.prototype.getObjCharacter = function (player_id) {
130
- return this.getParsed(9 /* SnapshotItemIDs.OBJ_CHARACTER */, player_id);
131
- };
132
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjCharacter", {
133
- /** 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 */
134
- get: function () {
135
- return this.getAll(9 /* SnapshotItemIDs.OBJ_CHARACTER */);
136
- },
137
- enumerable: false,
138
- configurable: true
139
- });
140
- SnapshotWrapper.prototype.getObjPlayerInfo = function (player_id) {
141
- return this.getParsed(10 /* SnapshotItemIDs.OBJ_PLAYER_INFO */, player_id);
142
- };
143
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjPlayerInfo", {
144
- get: function () {
145
- return this.getAll(10 /* SnapshotItemIDs.OBJ_PLAYER_INFO */);
146
- },
147
- enumerable: false,
148
- configurable: true
149
- });
150
- SnapshotWrapper.prototype.getObjClientInfo = function (player_id) {
151
- return this.getParsed(11 /* SnapshotItemIDs.OBJ_CLIENT_INFO */, player_id);
152
- };
153
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjClientInfo", {
154
- get: function () {
155
- return this.getAll(11 /* SnapshotItemIDs.OBJ_CLIENT_INFO */);
156
- },
157
- enumerable: false,
158
- configurable: true
159
- });
160
- SnapshotWrapper.prototype.getObjSpectatorInfo = function (player_id) {
161
- return this.getParsed(12 /* SnapshotItemIDs.OBJ_SPECTATOR_INFO */, player_id);
162
- };
163
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjSpectatorInfo", {
164
- get: function () {
165
- return this.getAll(12 /* SnapshotItemIDs.OBJ_SPECTATOR_INFO */);
166
- },
167
- enumerable: false,
168
- configurable: true
169
- });
170
- SnapshotWrapper.prototype.getTypeId = function (name) {
171
- var _a;
172
- return ((_a = this._client.rawSnapUnpacker.uuid_manager.LookupName(name)) === null || _a === void 0 ? void 0 : _a.type_id) || -1;
173
- };
174
- SnapshotWrapper.prototype.getObjExMyOwnObject = function (id) {
175
- return this.getParsed(this.getTypeId("my-own-object@heinrich5991.de"), id);
176
- };
177
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExMyOwnObject", {
178
- get: function () {
179
- return this.getAll(this.getTypeId("my-own-object@heinrich5991.de"));
180
- },
181
- enumerable: false,
182
- configurable: true
183
- });
184
- SnapshotWrapper.prototype.getObjExDDNetCharacter = function (id) {
185
- return this.getParsed(this.getTypeId("character@netobj.ddnet.tw"), id);
186
- };
187
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExDDNetCharacter", {
188
- get: function () {
189
- return this.getAll(this.getTypeId("character@netobj.ddnet.tw"));
190
- },
191
- enumerable: false,
192
- configurable: true
193
- });
194
- SnapshotWrapper.prototype.getObjExGameInfo = function (id) {
195
- return this.getParsed(this.getTypeId("gameinfo@netobj.ddnet.tw"), id);
196
- };
197
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExGameInfo", {
198
- get: function () {
199
- return this.getAll(this.getTypeId("gameinfo@netobj.ddnet.tw"));
200
- },
201
- enumerable: false,
202
- configurable: true
203
- });
204
- SnapshotWrapper.prototype.getObjExDDNetProjectile = function (id) {
205
- return this.getParsed(this.getTypeId("projectile@netobj.ddnet.tw"), id);
206
- };
207
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExDDNetProjectile", {
208
- get: function () {
209
- return this.getAll(this.getTypeId("projectile@netobj.ddnet.tw"));
210
- },
211
- enumerable: false,
212
- configurable: true
213
- });
214
- SnapshotWrapper.prototype.getObjExLaser = function (id) {
215
- return this.getParsed(this.getTypeId("laser@netobj.ddnet.tw"), id);
216
- };
217
- Object.defineProperty(SnapshotWrapper.prototype, "AllObjExLaser", {
218
- get: function () {
219
- return this.getAll(this.getTypeId("laser@netobj.ddnet.tw"));
220
- },
221
- enumerable: false,
222
- configurable: true
223
- });
224
- Object.defineProperty(SnapshotWrapper.prototype, "OwnID", {
225
- get: function () {
226
- var _a;
227
- return (_a = this.AllObjPlayerInfo.find(function (parsed) { return parsed.local; })) === null || _a === void 0 ? void 0 : _a.client_id;
228
- },
229
- enumerable: false,
230
- configurable: true
231
- });
232
- return SnapshotWrapper;
233
- }(stream_1.EventEmitter));
234
- 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;
@@ -1,13 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.States = void 0;
4
- var States;
5
- (function (States) {
6
- States[States["STATE_OFFLINE"] = 0] = "STATE_OFFLINE";
7
- States[States["STATE_CONNECTING"] = 1] = "STATE_CONNECTING";
8
- States[States["STATE_LOADING"] = 2] = "STATE_LOADING";
9
- States[States["STATE_ONLINE"] = 3] = "STATE_ONLINE";
10
- States[States["STATE_DEMOPLAYBACK"] = 4] = "STATE_DEMOPLAYBACK";
11
- States[States["STATE_QUITTING"] = 5] = "STATE_QUITTING";
12
- States[States["STATE_RESTARTING"] = 6] = "STATE_RESTARTING";
13
- })(States = exports.States || (exports.States = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.States = void 0;
4
+ var States;
5
+ (function (States) {
6
+ States[States["STATE_OFFLINE"] = 0] = "STATE_OFFLINE";
7
+ States[States["STATE_CONNECTING"] = 1] = "STATE_CONNECTING";
8
+ States[States["STATE_LOADING"] = 2] = "STATE_LOADING";
9
+ States[States["STATE_ONLINE"] = 3] = "STATE_ONLINE";
10
+ States[States["STATE_DEMOPLAYBACK"] = 4] = "STATE_DEMOPLAYBACK";
11
+ States[States["STATE_QUITTING"] = 5] = "STATE_QUITTING";
12
+ States[States["STATE_RESTARTING"] = 6] = "STATE_RESTARTING";
13
+ })(States || (exports.States = States = {}));
@@ -105,6 +105,14 @@ export namespace NETMSG {
105
105
  NETMSG_CHECKSUM_ERROR,
106
106
 
107
107
  NETMSG_REDIRECT,
108
+
109
+ NETMSG_RCON_CMD_GROUP_START,
110
+ NETMSG_RCON_CMD_GROUP_END,
111
+ NETMSG_MAP_RELOAD,
112
+ NETMSG_RECONNECT,
113
+ NETMSG_MAPLIST_ADD,
114
+ NETMSG_MAPLIST_GROUP_START,
115
+ NETMSG_MAPLIST_GROUP_END,
108
116
 
109
117
  NETMSG_I_AM_NPM_PACKAGE
110
118