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