yolkbot 1.4.5 → 1.4.6
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.
- package/browser/build/global.js +1 -1
- package/browser/build/module.js +1 -1
- package/dist/api.js +200 -1
- package/dist/bot/GamePlayer.js +74 -1
- package/dist/bot.js +1679 -1
- package/dist/comm/CommIn.js +79 -1
- package/dist/comm/CommOut.js +60 -1
- package/dist/comm/index.js +11 -1
- package/dist/constants/CloseCode.js +27 -1
- package/dist/constants/CommCode.js +53 -1
- package/dist/constants/challenges.js +1821 -1
- package/dist/constants/findItemById.js +2 -3
- package/dist/constants/guns.js +277 -1
- package/dist/constants/index.js +139 -1
- package/dist/constants/items.js +45042 -1
- package/dist/constants/maps.js +1263 -1
- package/dist/constants/regions.js +30 -1
- package/dist/dispatches/BanPlayerDispatch.js +32 -1
- package/dist/dispatches/BootPlayerDispatch.js +21 -1
- package/dist/dispatches/ChatDispatch.js +32 -1
- package/dist/dispatches/FireDispatch.js +15 -1
- package/dist/dispatches/GameOptionsDispatch.js +66 -1
- package/dist/dispatches/GoToAmmoDispatch.js +38 -1
- package/dist/dispatches/GoToCoopDispatch.js +38 -1
- package/dist/dispatches/GoToGrenadeDispatch.js +38 -1
- package/dist/dispatches/GoToPlayerDispatch.js +39 -1
- package/dist/dispatches/GoToSpatulaDispatch.js +26 -1
- package/dist/dispatches/LookAtDispatch.js +35 -1
- package/dist/dispatches/LookAtPosDispatch.js +29 -1
- package/dist/dispatches/MeleeDispatch.js +26 -1
- package/dist/dispatches/MovementDispatch.js +26 -1
- package/dist/dispatches/PauseDispatch.js +18 -1
- package/dist/dispatches/ReloadDispatch.js +28 -1
- package/dist/dispatches/ReportPlayerDispatch.js +42 -1
- package/dist/dispatches/ResetGameDispatch.js +19 -1
- package/dist/dispatches/SaveLoadoutDispatch.js +105 -1
- package/dist/dispatches/SpawnDispatch.js +22 -1
- package/dist/dispatches/SwapWeaponDispatch.js +25 -1
- package/dist/dispatches/SwitchTeamDispatch.js +33 -1
- package/dist/dispatches/ThrowGrenadeDispatch.js +21 -1
- package/dist/dispatches/index.js +74 -1
- package/dist/env/fetch.js +97 -10
- package/dist/env/globals.js +15 -1
- package/dist/index.js +14 -2
- package/dist/matchmaker.js +141 -1
- package/dist/pathing/astar.js +55 -1
- package/dist/pathing/binaryheap.js +79 -1
- package/dist/pathing/mapnode.js +179 -1
- package/dist/socket.js +97 -1
- package/dist/util.js +68 -1
- package/dist/wasm/bytes.js +8 -1
- package/dist/wasm/direct.js +84 -1
- package/dist/wasm/legacy.js +170 -1
- package/dist/wasm/util.js +19 -1
- package/package.json +38 -39
- /package/dist/{types/api.d.ts → api.d.ts} +0 -0
- /package/dist/{types/bot → bot}/GamePlayer.d.ts +0 -0
- /package/dist/{types/bot.d.ts → bot.d.ts} +0 -0
- /package/dist/{types/comm → comm}/CommIn.d.ts +0 -0
- /package/dist/{types/comm → comm}/CommOut.d.ts +0 -0
- /package/dist/{types/comm → comm}/index.d.ts +0 -0
- /package/dist/{types/constants → constants}/CloseCode.d.ts +0 -0
- /package/dist/{types/constants → constants}/CommCode.d.ts +0 -0
- /package/dist/{types/constants → constants}/challenges.d.ts +0 -0
- /package/dist/{types/constants → constants}/changelog.d.ts +0 -0
- /package/dist/{types/constants → constants}/findItemById.d.ts +0 -0
- /package/dist/{types/constants → constants}/guns.d.ts +0 -0
- /package/dist/{types/constants → constants}/housePromo.d.ts +0 -0
- /package/dist/{types/constants → constants}/index.d.ts +0 -0
- /package/dist/{types/constants → constants}/items.d.ts +0 -0
- /package/dist/{types/constants → constants}/language.d.ts +0 -0
- /package/dist/{types/constants → constants}/maps.d.ts +0 -0
- /package/dist/{types/constants → constants}/notices.d.ts +0 -0
- /package/dist/{types/constants → constants}/regions.d.ts +0 -0
- /package/dist/{types/constants → constants}/shellNews.d.ts +0 -0
- /package/dist/{types/constants → constants}/shellYoutube.d.ts +0 -0
- /package/dist/{types/constants → constants}/shopItems.d.ts +0 -0
- /package/dist/{types/constants → constants}/sounds.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/BanPlayerDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/BootPlayerDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/ChatDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/FireDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/GameOptionsDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/GoToAmmoDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/GoToCoopDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/GoToGrenadeDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/GoToPlayerDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/GoToSpatulaDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/LookAtDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/LookAtPosDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/MeleeDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/MovementDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/PauseDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/ReloadDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/ReportPlayerDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/ResetGameDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/SaveLoadoutDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/SpawnDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/SwapWeaponDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/SwitchTeamDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/ThrowGrenadeDispatch.d.ts +0 -0
- /package/dist/{types/dispatches → dispatches}/index.d.ts +0 -0
- /package/dist/{types/matchmaker.d.ts → matchmaker.d.ts} +0 -0
- /package/dist/{types/pathing → pathing}/astar.d.ts +0 -0
- /package/dist/{types/pathing → pathing}/binaryheap.d.ts +0 -0
- /package/dist/{types/pathing → pathing}/mapnode.d.ts +0 -0
- /package/dist/{types/socket.d.ts → socket.d.ts} +0 -0
- /package/dist/{types/util.d.ts → util.d.ts} +0 -0
- /package/dist/{types/wasm → wasm}/bytes.d.ts +0 -0
- /package/dist/{types/wasm → wasm}/direct.d.ts +0 -0
- /package/dist/{types/wasm → wasm}/legacy.d.ts +0 -0
- /package/dist/{types/wasm → wasm}/util.d.ts +0 -0
package/dist/comm/CommIn.js
CHANGED
|
@@ -1 +1,79 @@
|
|
|
1
|
-
export class CommIn
|
|
1
|
+
export class CommIn {
|
|
2
|
+
static buffer;
|
|
3
|
+
static idx;
|
|
4
|
+
static init(buf) {
|
|
5
|
+
this.buffer = new Uint8Array(buf);
|
|
6
|
+
this.idx = 0;
|
|
7
|
+
}
|
|
8
|
+
static isMoreDataAvailable() {
|
|
9
|
+
return Math.max(0, this.buffer.length - this.idx);
|
|
10
|
+
}
|
|
11
|
+
static unPackInt8U() {
|
|
12
|
+
const i2 = this.idx;
|
|
13
|
+
this.idx++;
|
|
14
|
+
return this.buffer[i2];
|
|
15
|
+
}
|
|
16
|
+
static unPackInt8() {
|
|
17
|
+
const v = this.unPackInt8U();
|
|
18
|
+
return (v + 128) % 256 - 128;
|
|
19
|
+
}
|
|
20
|
+
static unPackInt16U() {
|
|
21
|
+
const i2 = this.idx;
|
|
22
|
+
this.idx += 2;
|
|
23
|
+
return this.buffer[i2] + this.buffer[i2 + 1] * 256;
|
|
24
|
+
}
|
|
25
|
+
static unPackInt24U() {
|
|
26
|
+
const i2 = this.idx;
|
|
27
|
+
this.idx += 3;
|
|
28
|
+
return this.buffer[i2] + this.buffer[i2 + 1] * 256 + this.buffer[i2 + 2] * 65536;
|
|
29
|
+
}
|
|
30
|
+
static unPackInt32U() {
|
|
31
|
+
const i2 = this.idx;
|
|
32
|
+
this.idx += 4;
|
|
33
|
+
return this.buffer[i2] + this.buffer[i2 + 1] * 256 + this.buffer[i2 + 2] * 65536 + this.buffer[i2 + 3] * 16777216;
|
|
34
|
+
}
|
|
35
|
+
static unPackInt16() {
|
|
36
|
+
const v = this.unPackInt16U();
|
|
37
|
+
return (v + 32768) % 65536 - 32768;
|
|
38
|
+
}
|
|
39
|
+
static unPackInt32() {
|
|
40
|
+
const v = this.unPackInt32U();
|
|
41
|
+
return (v + 2147483648) % 4294967296 - 2147483648;
|
|
42
|
+
}
|
|
43
|
+
static unPackRadU() {
|
|
44
|
+
return this.unPackInt24U() / 2097152;
|
|
45
|
+
}
|
|
46
|
+
static unPackRad() {
|
|
47
|
+
const v = this.unPackInt16U() / 8192;
|
|
48
|
+
return v - Math.PI;
|
|
49
|
+
}
|
|
50
|
+
static unPackFloat() {
|
|
51
|
+
return this.unPackInt16() / 256;
|
|
52
|
+
}
|
|
53
|
+
static unPackDouble() {
|
|
54
|
+
return this.unPackInt32() / 1048576;
|
|
55
|
+
}
|
|
56
|
+
static unPackString(maxLen) {
|
|
57
|
+
maxLen = maxLen || 255;
|
|
58
|
+
const len = Math.min(this.unPackInt8U(), maxLen);
|
|
59
|
+
return this.unPackStringHelper(len);
|
|
60
|
+
}
|
|
61
|
+
static unPackLongString(maxLen) {
|
|
62
|
+
maxLen = maxLen || 16383;
|
|
63
|
+
const len = Math.min(this.unPackInt16U(), maxLen);
|
|
64
|
+
return this.unPackStringHelper(len);
|
|
65
|
+
}
|
|
66
|
+
static unPackStringHelper(len) {
|
|
67
|
+
const remainder = this.isMoreDataAvailable();
|
|
68
|
+
if (remainder < len)
|
|
69
|
+
return 0;
|
|
70
|
+
let str = "";
|
|
71
|
+
for (let i2 = 0;i2 < len; i2++) {
|
|
72
|
+
const c = this.unPackInt16U();
|
|
73
|
+
if (c > 0)
|
|
74
|
+
str += String.fromCodePoint(c);
|
|
75
|
+
}
|
|
76
|
+
return str;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export default CommIn;
|
package/dist/comm/CommOut.js
CHANGED
|
@@ -1 +1,60 @@
|
|
|
1
|
-
export class CommOut
|
|
1
|
+
export class CommOut {
|
|
2
|
+
constructor(size = 16384) {
|
|
3
|
+
this.idx = 0;
|
|
4
|
+
this.arrayBuffer = new ArrayBuffer(size);
|
|
5
|
+
this.buffer = new Uint8Array(this.arrayBuffer, 0, size);
|
|
6
|
+
}
|
|
7
|
+
send(ws2) {
|
|
8
|
+
const b2 = new Uint8Array(this.arrayBuffer, 0, this.idx);
|
|
9
|
+
ws2.send(b2);
|
|
10
|
+
}
|
|
11
|
+
packInt8(val) {
|
|
12
|
+
this.buffer[this.idx] = val & 255;
|
|
13
|
+
this.idx++;
|
|
14
|
+
}
|
|
15
|
+
packInt16(val) {
|
|
16
|
+
this.buffer[this.idx] = val & 255;
|
|
17
|
+
this.buffer[this.idx + 1] = val >> 8 & 255;
|
|
18
|
+
this.idx += 2;
|
|
19
|
+
}
|
|
20
|
+
packInt24(val) {
|
|
21
|
+
this.buffer[this.idx] = val & 255;
|
|
22
|
+
this.buffer[this.idx + 1] = val >> 8 & 255;
|
|
23
|
+
this.buffer[this.idx + 2] = val >> 16 & 255;
|
|
24
|
+
this.idx += 3;
|
|
25
|
+
}
|
|
26
|
+
packInt32(val) {
|
|
27
|
+
this.buffer[this.idx] = val & 255;
|
|
28
|
+
this.buffer[this.idx + 1] = val >> 8 & 255;
|
|
29
|
+
this.buffer[this.idx + 2] = val >> 16 & 255;
|
|
30
|
+
this.buffer[this.idx + 3] = val >> 24 & 255;
|
|
31
|
+
this.idx += 4;
|
|
32
|
+
}
|
|
33
|
+
packRadU(val) {
|
|
34
|
+
this.packInt24(val * 2097152);
|
|
35
|
+
}
|
|
36
|
+
packRad(val) {
|
|
37
|
+
this.packInt16((val + Math.PI) * 8192);
|
|
38
|
+
}
|
|
39
|
+
packFloat(val) {
|
|
40
|
+
this.packInt16(val * 256);
|
|
41
|
+
}
|
|
42
|
+
packDouble(val) {
|
|
43
|
+
this.packInt32(val * 1048576);
|
|
44
|
+
}
|
|
45
|
+
packString(str) {
|
|
46
|
+
if (typeof str !== "string")
|
|
47
|
+
str = "";
|
|
48
|
+
this.packInt8(str.length);
|
|
49
|
+
for (let i2 = 0;i2 < str.length; i2++)
|
|
50
|
+
this.packInt16(str.charCodeAt(i2));
|
|
51
|
+
}
|
|
52
|
+
packLongString(str) {
|
|
53
|
+
if (typeof str !== "string")
|
|
54
|
+
str = "";
|
|
55
|
+
this.packInt16(str.length);
|
|
56
|
+
for (let i2 = 0;i2 < str.length; i2++)
|
|
57
|
+
this.packInt16(str.charCodeAt(i2));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export default CommOut;
|
package/dist/comm/index.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
import CommIn from"./CommIn.js";
|
|
1
|
+
import CommIn from "./CommIn.js";
|
|
2
|
+
import CommOut from "./CommOut.js";
|
|
3
|
+
import CommCode from "../constants/CommCode.js";
|
|
4
|
+
import CloseCode from "../constants/CloseCode.js";
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
CommIn,
|
|
8
|
+
CommOut,
|
|
9
|
+
CommCode,
|
|
10
|
+
CloseCode
|
|
11
|
+
};
|
|
@@ -1 +1,27 @@
|
|
|
1
|
-
export const CloseCode={
|
|
1
|
+
export const CloseCode = {
|
|
2
|
+
gameNotFound: 4000,
|
|
3
|
+
gameFull: 4001,
|
|
4
|
+
badName: 4002,
|
|
5
|
+
mainMenu: 4003,
|
|
6
|
+
gameIdleExceeded: 4004,
|
|
7
|
+
corruptedLoginData0: 4005,
|
|
8
|
+
corruptedLoginData1: 4006,
|
|
9
|
+
corruptedLoginData2: 4007,
|
|
10
|
+
corruptedLoginData3: 4008,
|
|
11
|
+
corruptedLoginData4: 4009,
|
|
12
|
+
corruptedLoginData5: 4010,
|
|
13
|
+
gameMaxPlayersExceeded: 4011,
|
|
14
|
+
gameDestroyUser: 4012,
|
|
15
|
+
joinGameOutOfOrder: 4013,
|
|
16
|
+
gameShuttingDown: 4014,
|
|
17
|
+
readyBeforeReady: 4015,
|
|
18
|
+
booted: 4016,
|
|
19
|
+
gameErrorOnUserSocket: 4017,
|
|
20
|
+
uuidNotFound: 4018,
|
|
21
|
+
sessionNotFound: 4019,
|
|
22
|
+
clusterFullCpu: 4020,
|
|
23
|
+
clusterFullMem: 4021,
|
|
24
|
+
noClustersAvailable: 4022,
|
|
25
|
+
locked: 4023
|
|
26
|
+
};
|
|
27
|
+
export default CloseCode;
|
|
@@ -1 +1,53 @@
|
|
|
1
|
-
const
|
|
1
|
+
const CommCode = {
|
|
2
|
+
swapWeapon: 0,
|
|
3
|
+
joinGame: 1,
|
|
4
|
+
refreshGameState: 2,
|
|
5
|
+
spawnItem: 3,
|
|
6
|
+
observeGame: 4,
|
|
7
|
+
ping: 5,
|
|
8
|
+
bootPlayer: 6,
|
|
9
|
+
banPlayer: 7,
|
|
10
|
+
loginRequired: 8,
|
|
11
|
+
gameLocked: 9,
|
|
12
|
+
reportPlayer: 10,
|
|
13
|
+
switchTeam: 13,
|
|
14
|
+
changeCharacter: 14,
|
|
15
|
+
pause: 15,
|
|
16
|
+
gameOptions: 16,
|
|
17
|
+
gameAction: 17,
|
|
18
|
+
requestGameOptions: 18,
|
|
19
|
+
gameJoined: 19,
|
|
20
|
+
socketReady: 20,
|
|
21
|
+
addPlayer: 21,
|
|
22
|
+
removePlayer: 22,
|
|
23
|
+
fire: 23,
|
|
24
|
+
melee: 24,
|
|
25
|
+
throwGrenade: 25,
|
|
26
|
+
eventModifier: 27,
|
|
27
|
+
hitThem: 28,
|
|
28
|
+
hitMe: 29,
|
|
29
|
+
collectItem: 30,
|
|
30
|
+
challengeResetInGame: 31,
|
|
31
|
+
chat: 34,
|
|
32
|
+
syncThem: 35,
|
|
33
|
+
die: 37,
|
|
34
|
+
beginShellStreak: 38,
|
|
35
|
+
endShellStreak: 39,
|
|
36
|
+
updateBalance: 42,
|
|
37
|
+
reload: 43,
|
|
38
|
+
respawn: 44,
|
|
39
|
+
respawnDenied: 45,
|
|
40
|
+
clientReady: 47,
|
|
41
|
+
requestRespawn: 48,
|
|
42
|
+
switchTeamFail: 51,
|
|
43
|
+
expireUpgrade: 52,
|
|
44
|
+
metaGameState: 53,
|
|
45
|
+
syncMe: 54,
|
|
46
|
+
explode: 55,
|
|
47
|
+
keepAlive: 56,
|
|
48
|
+
musicInfo: 57,
|
|
49
|
+
hitMeHardBoiled: 58,
|
|
50
|
+
playerInfo: 59,
|
|
51
|
+
challengeCompleted: 60
|
|
52
|
+
};
|
|
53
|
+
export default CommCode;
|