yolkbot 1.0.12 → 1.0.13
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 +1 -1
- package/dist/bot.js +1 -1
- package/dist/constants/changelog.js +1 -1
- package/dist/constants/housePromo.js +1 -1
- package/dist/constants/shellYoutube.js +1 -1
- package/dist/dispatches/BootPlayerDispatch.js +1 -1
- package/dist/dispatches/ChatDispatch.js +1 -1
- package/dist/dispatches/ReportPlayerDispatch.js +1 -1
- package/dist/dispatches/SaveLoadoutDispatch.js +1 -1
- package/dist/dispatches/SwitchTeamDispatch.js +1 -1
- package/dist/matchmaker.js +1 -1
- package/dist/types/api.d.ts +1 -0
- package/dist/types/bot.d.ts +4 -1
- package/dist/types/matchmaker.d.ts +1 -1
- package/dist/types/wasm/wrapper.d.ts +3 -1
- package/dist/wasm/bytes.js +1 -1
- package/dist/wasm/imports.js +1 -1
- package/dist/wasm/wasm_loader.wasm +0 -0
- package/dist/wasm/wrapper.js +1 -1
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import a from"./globals.js";import d from"./socket.js";import{FirebaseKey as c,UserAgent as u}from"./constants/index.js";const h={origin:"https://shellshock.io","user-agent":u,"x-client-version":"Chrome/JsCore/9.17.2/FirebaseCore-web","x-firebase-locale":"en"};class
|
|
3
|
+
import a from"./globals.js";import d from"./socket.js";import{FirebaseKey as c,UserAgent as u}from"./constants/index.js";const h={origin:"https://shellshock.io","user-agent":u,"x-client-version":"Chrome/JsCore/9.17.2/FirebaseCore-web","x-firebase-locale":"en"};class p{constructor(e={}){this.instance=e.instance||"shellshock.io",this.protocol=e.protocol||"wss",this.httpProxy=e.httpProxy||e.proxy?.replace(/socks([4|5|4a|5h]+):\/\//g,"https://")||"",this.socksProxy=e.proxy,this.maxRetries=e.maxRetries||5,this.suppressErrors=e.suppressErrors||!1}queryServices=async e=>{let r,t=0;const s=async()=>{try{r=new d(`${this.protocol}://${this.instance}/services/`,this.socksProxy),r.onerror=async o=>(t++,console.error(o),await new Promise(i=>setTimeout(i,100)),await s())}catch{if(t>this.maxRetries)return"max_retries_exceeded";await new Promise(o=>setTimeout(o,100)),await s()}};return await s(),new Promise(o=>{r.onopen=()=>{r.onerror=null,r.send(JSON.stringify(e))};let i=!1;r.onmessage=n=>{i=!0;try{const l=JSON.parse(n.data);o(l)}catch{this.suppressErrors||(console.error("queryServices: Bad API JSON response with call: "+e.cmd+" and data:",JSON.stringify(e)),console.error("queryServices: Full data sent: ",JSON.stringify(e))),o("bad_json")}r.close()},r.onerror=()=>!i&&o("unknown_socket_error"),r.onclose=()=>!i&&o("services_closed_early")})};#e=async(e,r,t)=>{if(!e||!r)return"firebase_no_credentials";let s,o;try{s=await(await a.fetch(`https://identitytoolkit.googleapis.com/v1/accounts:${t}?key=${c}`,{method:"POST",body:JSON.stringify({email:e,password:r,returnSecureToken:!0}),headers:{...h,"content-type":"application/json"},dispatcher:this.httpProxy?new a.ProxyAgent(this.httpProxy):void 0})).json(),o=s.idToken}catch(n){return n.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithCredentials: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):n.code==="auth/missing-email"?"firebase_no_credentials":n.code==="ERR_BAD_REQUEST"?(this.suppressErrors||console.error("loginWithCredentials: Error:",e,r),this.suppressErrors||console.error("loginWithCredentials: Error:",n.response?.data||n),"firebase_bad_request"):(this.suppressErrors||console.error("loginWithCredentials: Error:",e,r,n),"firebase_unknown_error")}if(!o)return this.suppressErrors||console.error("loginWithCredentials: the game sent no idToken",s),"firebase_no_token";this.idToken=o;const i=await this.queryServices({cmd:"auth",firebaseToken:o});return{firebase:s,...i}};createAccount=async(e,r)=>await this.#e(e,r,"signUp");loginWithCredentials=async(e,r)=>await this.#e(e,r,"signInWithPassword");loginWithRefreshToken=async e=>{if(!e)return"firebase_no_credentials";const r=new URLSearchParams;r.append("grant_type","refresh_token"),r.append("refresh_token",e);let t,s;try{t=await(await a.fetch(`https://securetoken.googleapis.com/v1/token?key=${c}`,{method:"POST",body:r,headers:{...h,"content-type":"application/x-www-form-urlencoded"},dispatcher:this.httpProxy?new a.ProxyAgent(this.httpProxy):void 0})).json(),s=t.id_token}catch(i){return i.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithRefreshToken: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):i.code==="auth/missing-email"?"firebase_no_credentials":(this.suppressErrors||console.error("loginWithRefreshToken: Error:",i,e),"firebase_unknown_error")}if(!s)return this.suppressErrors||console.error("loginWithRefreshToken: the game sent no idToken",t),"firebase_no_token";this.idToken=s;const o=await this.queryServices({cmd:"auth",firebaseToken:s});return{firebase:t,...o}};loginAnonymously=async()=>{const r=await(await a.fetch("https://identitytoolkit.googleapis.com/v1/accounts:signUp?key="+c,{method:"POST",body:JSON.stringify({returnSecureToken:!0}),headers:{...h,"content-type":"application/json"},dispatcher:this.httpProxy?new a.ProxyAgent(this.httpProxy):void 0})).json(),t=r.idToken;if(!t)return this.suppressErrors||console.error("loginAnonymously: the game sent no idToken",r),"firebase_no_token";this.idToken=t;const s=await this.queryServices({cmd:"auth",firebaseToken:t});return{firebase:r,...s}};sendEmailVerification=async(e=this.idToken)=>{const t=await(await a.fetch("https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key="+c,{method:"POST",body:JSON.stringify({requestType:"VERIFY_EMAIL",idToken:e}),headers:{...h,"content-type":"application/json"},dispatcher:this.httpProxy?new a.ProxyAgent(this.httpProxy):void 0})).json();return t.kind!=="identitytoolkit#GetOobConfirmationCodeResponse"?(this.suppressErrors||console.error("sendEmailVerification: the game sent an invalid response",t),"firebase_invalid_response"):t.email}}var w=p;export{p as API,w as default};
|
package/dist/bot.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import H from"./api.js";import s from"./comm/CommIn.js";import f from"./comm/CommOut.js";import{CloseCode as z}from"./comm/Codes.js";import{CommCode as c}from"./constants/codes.js";import U from"./bot/GamePlayer.js";import W from"./matchmaker.js";import q from"./socket.js";import{ChiknWinnerDailyLimit as j,CollectTypes as x,CoopStates as y,findItemById as u,FramesBetweenSyncs as w,GameActions as T,GameModes as d,GameOptionFlags as E,GunList as K,ItemTypes as $,Movements as G,PlayTypes as Y,ProxiesEnabled as Z,ShellStreaks as m,StateBufferSize as b}from"./constants/index.js";import R from"./dispatches/LookAtPosDispatch.js";import F from"./dispatches/MovementDispatch.js";import{NodeList as X}from"./pathing/mapnode.js";import{fetchMap as V,initKotcZones as J}from"./util.js";import{Challenges as Q}from"./constants/challenges.js";import{Maps as P}from"./constants/maps.js";const M=Object.fromEntries(Object.entries(y).map(([I,t])=>[t,I])),A=Object.fromEntries(Object.entries(d).map(([I,t])=>[t,I])),B={CHALLENGES:1,STATS:2,PATHFINDING:3,PING:5,COSMETIC_DATA:6,PLAYER_HEALTH:7,PACKET_HOOK:8,LOG_PACKETS:10,NO_LOGIN:11,DEBUG_BUFFER:12,DEBUG_BEST_TARGET:14},S=(I,t)=>(I%t+t)%t;class tt{static Intents=B;Intents=B;#e=[];#t={};#i=[];#n;#o;constructor(t={}){t.proxy&&!Z&&this.processError("proxies do not work and hence are not supported in the browser"),this.intents=t.intents||[],this.intents.includes(this.Intents.COSMETIC_DATA)&&(u(1001)||this.processError("you cannot use the COSMETIC_DATA intent inside of the singlefile browser bundles")),this.instance=t.instance||"shellshock.io",this.protocol=t.protocol||"wss",this.proxy=t.proxy||"",this.httpProxy=t.httpProxy||"",this.state={name:"yolkbot",weaponIdx:0,reloading:!1,swappingGun:!1,usingMelee:!1,stateIdx:0,serverStateIdx:0,shotsFired:0,buffer:[],left:!1,quit:!1},this.players={},this.me=new U({}),this.game={raw:{},code:"",socket:null,gameModeId:0,gameMode:A[0],mapIdx:0,map:{filename:"",hash:"",name:"",modes:{FFA:!1,Teams:!1,Spatula:!1,King:!1},availability:"both",numPlayers:"18",raw:{},nodes:{},zones:[]},playerLimit:0,isGameOwner:!1,isPrivate:!0,options:{gravity:1,damage:1,healthRegen:1,locked:!1,noTeamChange:!1,noTeamShuffle:!1,weaponsDisabled:Array(7).fill(!1),mustUseSecondary:!1},collectables:[[],[]],teamScore:[0,0,0],spatula:{coords:{x:0,y:0,z:0},controlledBy:0,controlledByTeam:0},stage:y.capturing,zoneNumber:0,activeZone:[],capturing:0,captureProgress:0,numCapturing:0,stageName:"",capturePercent:0},this.#o=this.game,this.account={id:0,firebaseId:"",sessionId:"",session:"",email:"",password:"",cw:{atLimit:!1,limit:0,secondsUntilPlay:0,canPlayAgain:Date.now()},loadout:{hatId:null,meleeId:0,stampId:null,classIdx:0,colorIdx:0,grenadeId:0,primaryId:[3100,3600,3400,3800,4e3,4200,4500],secondaryId:new Array(7).fill(3e3),stampPositionX:0,stampPositionY:0},ownedItemIds:[],vip:!1,accountAge:0,emailVerified:!1,eggBalance:0,rawLoginData:{}},this.#n=this.account,this.matchmaker=null,this.api=new H({instance:this.instance,protocol:this.protocol,proxy:this.proxy,httpProxy:this.httpProxy,maxRetries:t?.apiMaxRetries}),this.ping=0,this.lastPingTime=-1,this.lastDeathTime=-1,this.lastChatTime=-1,this.lastUpdateTick=0,this.controlKeys=0,this.pathing={nodeList:null,followingPath:!1,activePath:null,activeNode:null,activeNodeIdx:0}}dispatch(t){t.check(this)?t.execute(this):this.#e.push(t)}async createAccount(t,e){this.account.email=t,this.account.password=e;const a=await this.api.createAccount(t,e);return this.#s(a)}async login(t,e){this.account.email=t,this.account.password=e;const a=await this.api.loginWithCredentials(t,e);return this.#s(a)}async loginWithRefreshToken(t){const e=await this.api.loginWithRefreshToken(t);return this.#s(e)}async loginAnonymously(){delete this.account.email,delete this.account.password;const t=await this.api.loginAnonymously();return this.#s(t)}#s(t){return typeof t!="object"?(this.emit("authFail",t),!1):t.banRemaining?(this.emit("banned",t.banRemaining),!1):t.playerOutput?(t=t.playerOutput,this.account.rawLoginData=t,this.account.accountAge=t.accountAge,this.account.eggBalance=t.currentBalance,this.account.emailVerified=t.emailVerified,this.account.firebaseId=t.firebaseId,this.account.id=t.id,this.account.loadout=t.loadout,this.account.ownedItemIds=t.ownedItemIds,this.account.session=t.session,this.account.sessionId=t.sessionId,this.account.vip=t.upgradeProductId&&!t.upgradeIsExpired,this.intents.includes(this.Intents.STATS)&&(this.account.stats={lifetime:t.statsLifetime,monthly:t.statsCurrent}),this.intents.includes(this.Intents.CHALLENGES)&&this.#a(t.challenges),this.emit("authSuccess",this.account),this.account):(this.emit("authFail",t),!1)}#a(t){this.account.challenges=[];for(const e of t){const a=Q.find(i=>i.id===e.challengeId);a&&(delete e.playerId,this.account.challenges.push({raw:{challengeInfo:a,challengeData:e},id:e.challengeId,name:a.loc.title,desc:a.loc.desc,rewardEggs:a.reward,isRerolled:!!e.reset,isClaimed:!!e.claimed,isCompleted:!!e.completed,progressNum:e.progress,goalNum:a.goal}))}}async initMatchmaker(){return!this.account.sessionId&&!this.intents.includes(this.Intents.NO_LOGIN)&&!await this.loginAnonymously()?!1:(this.matchmaker||(this.matchmaker=new W({sessionId:this.account.sessionId,proxy:this.proxy,instance:this.instance,protocol:this.protocol,noLogin:this.intents.includes(this.Intents.NO_LOGIN),api:this.api}),this.matchmaker.on("authFail",t=>this.emit("authFail",t)),this.matchmaker.on("error",t=>this.processError(t)),await this.matchmaker.getRegions()),!0)}async#c(t){return await this.initMatchmaker()?(await this.matchmaker.waitForConnect(),await new Promise(e=>{const a=i=>{i.command==="gameFound"&&(this.matchmaker.off("msg",a),this.game.raw=i,this.game.code=i.id,e()),i.error&&i.error==="gameNotFound"&&(this.processError(`Game ${t} not found (likely expired).`),this.leave())};this.matchmaker.on("msg",a),this.matchmaker.send({command:"joinGame",id:t,observe:!1,sessionId:this.account.sessionId})})):!1}async findPublicGame(t){return this.matchmaker||this.initMatchmaker(),this.matchmaker?await this.matchmaker.findPublicGame(t):!1}async createPrivateGame(t={}){if(!await this.initMatchmaker())return!1;if(!t.region&&!this.matchmaker.regionList)return this.processError("pass a region to createPrivateGame or call getRegions() for a random one");if(t.region||(t.region=this.matchmaker.getRandomRegion()),!t.mode)return this.processError("pass a mode to createPrivateGame");if(typeof d[t.mode]!="number")return this.processError("invalid mode passed to createPrivateGame, see GameModes for a list");t.map||(t.map=P[P.length*Math.random()|0].name);const e=P.find(n=>n.name.toLowerCase()===t.map.toLowerCase()),a=P.indexOf(e);return a===-1?this.processError("invalid map, see the Maps constant for a list"):(await this.matchmaker.waitForConnect(),await new Promise(n=>{const o=r=>{r.command==="gameFound"&&(this.matchmaker.off("msg",o),n(r))};this.matchmaker.on("msg",o),this.matchmaker.send({command:"findGame",region:t.region,playType:Y.createPrivate,gameType:d[t.mode],sessionId:this.account.sessionId,noobLobby:!1,map:a})}))}async join(t,e){if(this.state.name=t||"yolkbot",typeof e=="string"?(e.includes("#")&&(e=e.split("#")[1]),await this.#c(e)):typeof e=="object"&&(this.account.id===0&&await this.loginAnonymously(),this.game.raw=e,this.game.code=this.game.raw.id),!this.game.raw.id)return this.processError("invalid game data passed to <bot>.join");const a=async()=>{try{const i=this.instance.startsWith("localhost:")?this.instance:`${this.game.raw.subdomain}.${this.instance}`;this.game.socket=new q(`${this.protocol}://${i}/game/${this.game.raw.id}`,this.proxy),this.game.socket.onerror=async n=>(this.processError(n),await new Promise(o=>setTimeout(o,100)),await a())}catch{await new Promise(i=>setTimeout(i,100)),await a()}};await a(),this.game.socket.binaryType="arraybuffer",this.game.socket.onopen=()=>this.game.socket.onerror=null,this.game.socket.onmessage=i=>this.processPacket(i.data),this.game.socket.onclose=i=>{this.state.left?this.state.left=!1:(this.emit("close",i.code),this.leave(-1))}}#r(){if(Object.entries(this.me.position).map(e=>Math.floor(e[1])).join(",")===this.pathing.activePath[this.pathing.activePath.length-1].positionStr)this.pathing.followingPath=!1,this.pathing.activePath=null,this.pathing.activeNode=null,this.pathing.activeNodeIdx=0,this.dispatch(new F(0));else{let e;this.pathing.activeNodeIdx<this.pathing.activePath.length-1?(e=this.pathing.activePath[this.pathing.activeNodeIdx+1].flatCenter(),this.dispatch(new R(e))):(e=this.pathing.activePath[this.pathing.activeNodeIdx].flatCenter(),this.dispatch(new R(e)));for(const a of this.pathing.activePath)if(a.flatRadialDistance(this.me.position)<.1&&a.position.y===Math.floor(this.me.position.y)&&this.pathing.activePath.indexOf(a)>=this.pathing.activeNodeIdx){this.pathing.activeNodeIdx=this.pathing.activePath.indexOf(a)+1,this.pathing.activeNode=this.pathing.activePath[this.pathing.activeNodeIdx];break}this.controlKeys&G.FORWARD||this.dispatch(new F(G.FORWARD))}}update(){if(!this.state.quit){if(this.pathing.followingPath&&this.intents.includes(this.Intents.PATHFINDING)&&this.#r(),this.#e.length>0)for(let t=0;t<this.#e.length;t++){const e=this.#e[t];e.check(this)&&(e.execute(this),this.#e.splice(t,1))}if(this.me.playing){const t=this.state.stateIdx;if(this.intents.includes(this.Intents.DEBUG_BUFFER)&&(console.log("setting buffer for idx",t),console.log("checking...shotsFired",this.state.shotsFired)),this.state.buffer[t]={controlKeys:this.controlKeys,yaw:this.me.view.yaw,pitch:this.me.view.pitch,shotsFired:this.state.shotsFired},this.state.shotsFired=0,this.lastUpdateTick>=2){this.emit("tick");const e=f.getBuffer();e.packInt8(c.syncMe),e.packInt8(this.state.stateIdx),e.packInt8(this.state.serverStateIdx);const a=S(this.state.stateIdx-w+1,b);for(let i=0;i<w;i++){const n=S(a+i,b);this.intents.includes(this.Intents.DEBUG_BUFFER)&&console.log("going with",this.state.stateIdx,a,n,this.state.buffer[n]),e.packInt8(this.state.buffer[n]?.controlKeys||0),e.packInt8(this.state.buffer[n]?.shotsFired||0),e.packRadU(this.state.buffer[n]?.yaw||this.me.view.yaw),e.packRad(this.state.buffer[n]?.pitch||this.me.view.pitch),e.packInt8(100)}e.send(this.game.socket),this.state.buffer=[],this.lastUpdateTick=0}else this.lastUpdateTick++;this.state.stateIdx=S(this.state.stateIdx+1,b)}if(this.intents.includes(this.Intents.PLAYER_HEALTH))for(const t of Object.values(this.players)){if(t.playing&&t.hp>0){const e=.1*(this.game.isPrivate?this.game.options.healthRegen:1);t.streakRewards.includes(m.OverHeal)?t.hp=Math.max(100,t.hp-e):t.hp=Math.min(100,t.hp+e)}t.spawnShield>0&&(t.spawnShield-=6)}}}on(t,e){Object.keys(this.#t).includes(t)?this.#t[t].push(e):this.#t[t]=[e]}onAny(t){this.#i.push(t)}off(t,e){this.#t[t]=this.#t[t].filter(a=>a!==e)}emit(t,...e){if(!this.state.quit){if(this.#t[t])for(const a of this.#t[t])a(...e);for(const a of this.#i)a(t,...e)}}#h(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackString().valueOf(),i=this.players[t];this.emit("chat",i,a,e)}#l(){const t=s.unPackInt8U(),e=this.intents.includes(this.Intents.COSMETIC_DATA),a={id:t,uniqueId:s.unPackString(),name:s.unPackString(),safename:s.unPackString(),charClass:s.unPackInt8U(),team:s.unPackInt8U(),primaryWeaponItem:e?u(s.unPackInt16U()):s.unPackInt16U(),secondaryWeaponItem:e?u(s.unPackInt16U()):s.unPackInt16U(),shellColor:s.unPackInt8U(),hatItem:e?u(s.unPackInt16U()):s.unPackInt16U(),stampItem:e?u(s.unPackInt16U()):s.unPackInt16U(),stampPosX:s.unPackInt8(),stampPosY:s.unPackInt8(),grenadeItem:e?u(s.unPackInt16U()):s.unPackInt16U(),meleeItem:e?u(s.unPackInt16U()):s.unPackInt16U(),x:s.unPackFloat(),y:s.unPackFloat(),z:s.unPackFloat(),$dx:s.unPackFloat(),$dy:s.unPackFloat(),$dz:s.unPackFloat(),yaw:s.unPackRadU(),pitch:s.unPackRad(),score:s.unPackInt32U(),kills:s.unPackInt16U(),deaths:s.unPackInt16U(),streak:s.unPackInt16U(),totalKills:s.unPackInt32U(),totalDeaths:s.unPackInt32U(),bestGameStreak:s.unPackInt16U(),bestOverallStreak:s.unPackInt16U(),shield:s.unPackInt8U(),hp:s.unPackInt8U(),playing:s.unPackInt8U(),weaponIdx:s.unPackInt8U(),$controlKeys:s.unPackInt8U(),upgradeProductId:s.unPackInt8U(),activeShellStreaks:s.unPackInt8U(),social:s.unPackLongString(),hideBadge:s.unPackInt8U()};s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U(),this.players[a.id]||(this.players[a.id]=new U(a)),this.me.id===a.id&&(this.me=this.players[a.id]),this.emit("playerJoin",this.players[a.id])}#m(){const t=s.unPackInt8U(),e=s.unPackInt16U(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackInt8U(),r=s.unPackInt8U(),p=s.unPackInt8U(),k=s.unPackInt8U(),g=s.unPackInt8U(),h=this.players[t];h&&(h.playing=!0,h.randomSeed=e,h.weapons[0]&&h.weapons[0].ammo&&(h.weapons[0].ammo.rounds=o),h.weapons[0]&&h.weapons[0].ammo&&(h.weapons[0].ammo.store=r),h.weapons[1]&&h.weapons[1].ammo&&(h.weapons[1].ammo.rounds=p),h.weapons[1]&&h.weapons[1].ammo&&(h.weapons[1].ammo.store=k),h.grenades=g,h.position={x:a,y:i,z:n},h.spawnShield=120,this.emit("playerRespawn",h))}#u(){const t=s.unPackInt8U(),e=s.unPackFloat(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackInt8U(),o=this.players[t];if(!o||o.id===this.me.id){for(let r=0;r<w;r++)s.unPackInt8U(),s.unPackRadU(),s.unPackRad(),s.unPackInt8U();return}o.position.x!==e&&(o.position.x=e),o.position.z!==i&&(o.position.z=i),(!o.jumping||Math.abs(o.position.y-a)>.5&&o.position.y!==a)&&(o.position.y=a),o.climbing!==n&&(o.climbing=n);for(let r=0;r<w;r++)s.unPackInt8U(),s.unPackRadU(),s.unPackRad(),s.unPackInt8U()}#d(){const t=s.unPackInt8U(),e=this.players[t];e&&(e.playing=!1,this.emit("playerPause",e))}#p(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];a&&(a.activeGun=e,this.emit("playerSwapWeapon",a,e))}#g(){const t=s.unPackInt8U(),e=s.unPackInt8U();s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U();const a=this.players[t],i=this.players[e];a&&(a.playing=!1,a.streak=0,a.lastDeathTime=Date.now(),a.hp=100,a.spawnShield=0),i&&i.streak++,this.emit("playerDeath",a,i)}#k(){const t=s.unPackInt8U();for(let i=0;i<6;i++)s.unPackFloat();const e=this.players[t];if(!e)return;const a=e.weapons[e.activeGun];a&&a.ammo&&(a.ammo.rounds--,this.emit("playerFire",e,a))}#f(){const t=s.unPackInt16U(),e=s.unPackInt8U(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat();this.game.collectables[e].push({id:t,x:a,y:i,z:n}),this.emit("spawnItem",e,t,{x:a,y:i,z:n})}#I(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackInt8U(),i=s.unPackInt16U(),n=this.players[t];if(this.game.collectables[e]=this.game.collectables[e].filter(o=>o.id!==i),e===x.AMMO){const o=n.weapons[a];o&&o.ammo&&(o.ammo.store=Math.min(o.ammo.storeMax,o.ammo.store+o.ammo.pickup),this.emit("collectAmmo",n,o))}e===x.GRENADE&&(n.grenades++,n.grenades>3&&(n.grenades=3),this.emit("collectGrenade",n))}#P(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;const i=a.hp;a.hp=e,this.emit("playerDamaged",a,i,a.hp)}#y(){const t=s.unPackInt8U();s.unPackFloat(),s.unPackFloat();const e=this.me.hp;this.me.hp=t,this.emit("selfDamaged",e,this.me.hp)}#w(){const t=s.unPackInt8U(),e=this.players[t];s.unPackInt8U();const a=s.unPackInt8U(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackFloat();if(s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U(),!e)return;this.state.serverStateIdx=a;const r=e.position.x,p=e.position.y,k=e.position.z;e.position.x=i,e.position.y=n,e.position.z=o,(r!==i||p!==n||k!==o)&&this.emit("selfMoved",e,{x:r,y:p,z:k},{x:i,y:n,z:o})}#U(){const t=f.getBuffer();t.packInt8(c.eventModifier),t.send(this.game.socket)}#b(){const t=s.unPackInt8U(),e={...this.players[t]};delete this.players[t.toString()],this.emit("playerLeave",e)}#S(){if(this.game.gameModeId===d.spatula){this.game.teamScore[1]=s.unPackInt16U(),this.game.teamScore[2]=s.unPackInt16U();const t={x:s.unPackFloat(),y:s.unPackFloat(),z:s.unPackFloat()},e=s.unPackInt8U(),a=s.unPackInt8U();this.game.spatula={coords:t,controlledBy:e,controlledByTeam:a},this.emit("gameStateChange",this.game)}else this.game.gameModeId===d.kotc?(this.game.stage=s.unPackInt8U(),this.game.zoneNumber=s.unPackInt8U(),this.game.capturing=s.unPackInt8U(),this.game.captureProgress=s.unPackInt16U(),this.game.numCapturing=s.unPackInt8U(),this.game.teamScore[1]=s.unPackInt8U(),this.game.teamScore[2]=s.unPackInt8U(),this.game.stageName=M[this.game.stage],this.game.capturePercent=this.game.captureProgress/1e3,this.game.activeZone=this.game.map.zones?this.game.map.zones[this.game.zoneNumber-1]:null,this.emit("gameStateChange",this.game)):this.game.gameModeId===d.team&&(this.game.teamScore[1]=s.unPackInt16U(),this.game.teamScore[2]=s.unPackInt16U());this.game.gameModeId!==d.spatula&&delete this.game.spatula,this.game.gameModeId!==d.kotc&&(delete this.game.stage,delete this.game.zoneNumber,delete this.game.capturing,delete this.game.captureProgress,delete this.game.numCapturing,delete this.game.stageName,delete this.game.numCapturing,delete this.game.activeZone),this.game.gameModeId===d.ffa&&delete this.game.teamScore}#v(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];switch(e){case m.HardBoiled:t===this.me.id&&(this.me.shieldHp=100),a.streakRewards.push(m.HardBoiled);break;case m.EggBreaker:a.streakRewards.push(m.EggBreaker);break;case m.Restock:{a.grenades=3,a.weapons[0]&&a.weapons[0].ammo&&(a.weapons[0].ammo.rounds=a.weapons[0].ammo.capacity,a.weapons[0].ammo.store=a.weapons[0].ammo.storeMax),a.weapons[1]&&a.weapons[1].ammo&&(a.weapons[1].ammo.rounds=a.weapons[1].ammo.capacity,a.weapons[1].ammo.store=a.weapons[1].ammo.storeMax);break}case m.OverHeal:a.hp=Math.min(200,a.hp+100),a.streakRewards.push(m.OverHeal);break;case m.DoubleEggs:a.streakRewards.push(m.DoubleEggs);break;case m.MiniEgg:a.streakRewards.push(m.MiniEgg);break}this.emit("playerBeginStreak",a,e)}#C(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];[m.EggBreaker,m.OverHeal,m.DoubleEggs,m.MiniEgg].includes(e)&&a.streakRewards.includes(e)&&(a.streakRewards=a.streakRewards.filter(n=>n!==e)),this.emit("playerEndStreak",e,a)}#x(){const t=s.unPackInt8U(),e=s.unPackInt8U();s.unPackFloat(),s.unPackFloat(),this.me.shieldHp=t,this.me.hp=e,this.me.shieldHp<=0?(this.me.streakRewards=this.me.streakRewards.filter(a=>a!==m.HardBoiled),this.emit("selfShieldLost")):this.emit("selfShieldHit",this.me.shieldHp)}#T(){const t={...this.game.options};let e=s.unPackInt8U(),a=s.unPackInt8U(),i=s.unPackInt8U();(e<1||e>4)&&(e=4),(a<0||a>8)&&(a=4),i>16&&(i=4),this.game.options.gravity=e/4,this.game.options.damage=a/4,this.game.options.healthRegen=i/4;const n=s.unPackInt8U();return Object.keys(E).forEach(o=>{const r=n&E[o]?1:0;this.game.options[o]=r}),this.game.options.weaponsDisabled=Array.from({length:7},()=>s.unPackInt8U()===1),this.game.options.mustUseSecondary=this.game.options.weaponsDisabled.every(o=>o),this.emit("gameOptionsChange",t,this.game.options),!1}#E(){const t=s.unPackInt8U();t===T.pause&&(this.emit("gameForcePause"),setTimeout(()=>this.me.playing=!1,3e3)),t===T.reset&&(Object.values(this.players).forEach(e=>e.streak=0),this.game.gameModeId!==d.ffa&&(this.game.teamScore=[0,0,0]),this.game.gameModeId===d.spatula&&(this.game.spatula.controlledBy=0,this.game.spatula.controlledByTeam=0,this.game.spatula.coords={x:0,y:0,z:0}),this.game.gameModeId===d.kotc&&(this.game.stage=y.capturing,this.game.zoneNumber=0,this.game.activeZone=null,this.game.capturing=0,this.game.captureProgress=0,this.game.numCapturing=0,this.game.stageName=M[y.capturing],this.game.capturePercent=0),this.emit("gameReset"))}#G(){if(!this.intents.includes(this.Intents.PING))return;const t=this.ping;this.ping=Date.now()-this.lastPingTime,this.emit("pingUpdate",t,this.ping),setTimeout(()=>{const e=f.getBuffer();e.packInt8(c.ping),e.send(this.game.socket),this.lastPingTime=Date.now()},1e3)}#R(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;const i=a.team;a.team=e,a.streak=0,this.emit("playerSwitchTeam",a,i,e)}#F(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackInt16U(),i=s.unPackInt16U(),n=s.unPackInt8U(),o=s.unPackInt16U(),r=s.unPackInt16U(),p=s.unPackInt16U(),k=s.unPackInt16U();s.unPackInt8(),s.unPackInt8();const g=this.intents.includes(this.Intents.COSMETIC_DATA),h=g?u(a):a,O=g?u(i):i,L=g?u(o):o,N=g?u(r):r,D=g?u(p):p,_=g?u(k):k,l=this.players[t];if(l){const v={...l.character},C=l.selectedGun;l.character.eggColor=n,l.character.primaryGun=h,l.character.secondaryGun=O,l.character.stamp=N,l.character.hat=L,l.character.grenade=D,l.character.melee=_,l.selectedGun=e,l.weapons[0]=new K[e],C!==l.selectedGun&&this.emit("playerChangeGun",l,C,l.selectedGun),v!==l.character&&this.emit("playerChangeCharacter",l,v,l.character)}}#M(){const t=s.unPackInt32U(),e=this.account.eggBalance;this.account.eggBalance=t,this.emit("balanceUpdate",t-e,t)}#A(){this.me.playing=!1,this.emit("selfRespawnFail")}#B(){const t=s.unPackInt8U(),e=this.players[t];e&&this.emit("playerMelee",e)}#O(){const t=s.unPackInt8U(),e=this.players[t];if(!e)return;const a=e.weapons[e.activeGun];if(a.ammo){const i=Math.min(Math.min(a.ammo.capacity,a.ammo.reload)-a.ammo.rounds,a.ammo.store);a.ammo.rounds+=i,a.ammo.store-=i}this.emit("playerReload",e,a)}#L(){const t=f.getBuffer();t.packInt8(c.gameOptions),t.packInt8(this.game.options.gravity*4),t.packInt8(this.game.options.damage*4),t.packInt8(this.game.options.healthRegen*4);const e=(this.game.options.locked?1:0)|(this.game.options.noTeamChange?2:0)|(this.game.options.noTeamShuffle?4:0);t.packInt8(e),this.game.options.weaponsDisabled.forEach(a=>{t.packInt8(a?1:0)}),t.send(this.game.socket)}#N(){const t=s.unPackInt8U();let e=s.unPackInt16U();const a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackInt8U(),r=s.unPackFloat();this.intents.includes(this.Intents.COSMETIC_DATA)&&(e=u(e)),t===$.Grenade?this.emit("grenadeExploded",e,{x:a,y:i,z:n},o,r):this.emit("rocketHit",{x:a,y:i,z:n},o,r)}#D(){const t=s.unPackInt8U(),e=s.unPackFloat(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackFloat(),r=s.unPackFloat(),p=this.players[t];p&&(p.grenades--,this.emit("playerThrowGrenade",p,{x:e,y:a,z:i},{x:n,y:o,z:r}))}#_(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;if(!this.intents.includes(this.Intents.CHALLENGES))return this.emit("challengeComplete",a,e);const i=this.account.challenges.find(n=>n.id===e);this.emit("challengeComplete",a,i),a.id===this.me.id&&this.refreshChallenges()}#H(){const t=f.getBuffer();t.packInt8(c.joinGame),t.packString(this.state.name),t.packString(this.game.raw.uuid),t.packInt8(0),t.packInt8(this.state.weaponIdx||this.account?.loadout?.classIdx||0),t.packInt32(this.account.session),t.packString(this.account.firebaseId),t.packString(this.account.sessionId),t.send(this.game.socket)}async#z(){if(this.me.id=s.unPackInt8U(),this.me.team=s.unPackInt8U(),this.game.gameModeId=s.unPackInt8U(),this.game.gameMode=A[this.game.gameModeId],this.game.mapIdx=s.unPackInt8U(),this.game.map=P[this.game.mapIdx],this.intents.includes(this.Intents.PATHFINDING)&&(this.game.map.raw=await V(this.game.map.filename,this.game.map.hash),this.pathing.nodeList=new X(this.game.map.raw),this.game.gameModeId===d.kotc)){const e=this.game.map.raw.data["DYNAMIC.capture-zone.none"];e?this.game.map.zones=J(e):delete this.game.map.zones}this.game.playerLimit=s.unPackInt8U(),this.game.isGameOwner=s.unPackInt8U()===1,this.game.isPrivate=s.unPackInt8U()===1,s.unPackInt8U(),this.state.joinedGame=!0,this.lastDeathTime=Date.now();const t=f.getBuffer();if(t.packInt8(c.clientReady),t.send(this.game.socket),this.updateIntervalId=setInterval(()=>this.update(),100/3),this.intents.includes(this.Intents.PING)){this.lastPingTime=Date.now();const e=f.getBuffer();e.packInt8(c.ping),e.send(this.game.socket)}this.emit("gameReady")}processPacket(t){s.init(t),this.intents.includes(this.Intents.PACKET_HOOK)&&this.emit("packet",t);let e=0,a=0,i=!1;for(;s.isMoreDataAvailable()&&!i;){const n=s.unPackInt8U();switch(n){case c.syncThem:this.#u();break;case c.fire:this.#k();break;case c.hitThem:this.#P();break;case c.syncMe:this.#w();break;case c.hitMe:this.#y();break;case c.swapWeapon:this.#p();break;case c.collectItem:this.#I();break;case c.respawn:this.#m();break;case c.die:this.#g();break;case c.pause:this.#d();break;case c.chat:this.#h();break;case c.addPlayer:this.#l();break;case c.removePlayer:this.#b();break;case c.eventModifier:this.#U();break;case c.metaGameState:this.#S();break;case c.beginShellStreak:this.#v();break;case c.endShellStreak:this.#C();break;case c.hitMeHardBoiled:this.#x();break;case c.gameOptions:this.#T();break;case c.ping:this.#G();break;case c.switchTeam:this.#R();break;case c.changeCharacter:this.#F();break;case c.reload:this.#O();break;case c.explode:this.#N();break;case c.throwGrenade:this.#D();break;case c.spawnItem:this.#f();break;case c.melee:this.#B();break;case c.updateBalance:this.#M();break;case c.challengeCompleted:this.#_();break;case c.socketReady:this.#H();break;case c.gameJoined:this.#z();break;case c.gameAction:this.#E();break;case c.requestGameOptions:this.#L();break;case c.respawnDenied:this.#A();break;case c.expireUpgrade:case c.clientReady:break;case c.musicInfo:s.unPackLongString();break;default:console.error(`processPacket: I got but couldn't identify a: ${Object.keys(c).find(o=>c[o]===n)} ${n}`),e&&console.error(`processPacket: It may be a result of the ${e} command (${a}).`),i=!0;break}e=Object.keys(c).find(o=>c[o]===n),a=n,this.intents.includes(this.Intents.LOG_PACKETS)&&console.log(`[LOG_PACKETS] Packet ${e}: ${a}`)}}async checkChiknWinner(){const t=await this.api.queryServices({cmd:"chicknWinnerReady",id:this.account.id,sessionId:this.account.sessionId});return typeof t=="string"?t:(this.account.cw.limit=t.limit,this.account.cw.atLimit=t.limit>=4,this.account.cw.secondsUntilPlay=(this.account.cw.atLimit?t.period:t.span)||0,this.account.cw.canPlayAgain=Date.now()+this.account.cw.secondsUntilPlay*1e3,this.account.cw)}async playChiknWinner(t=!0){if(this.account.cw.atLimit||this.account.cw.limit>j)return"hit_daily_limit";if(this.account.cw.canPlayAgain>Date.now()&&t)return"on_cooldown";const e=await this.api.queryServices({cmd:"incentivizedVideoReward",firebaseId:this.account.firebaseId,id:this.account.id,sessionId:this.account.sessionId,token:null});return typeof e=="string"?e:e.error?e.error==="RATELIMITED"||e.error==="RATELMITED"?(await this.checkChiknWinner(),"on_cooldown"):e.error==="SESSION_EXPIRED"?"session_expired":(console.error("Unknown Chikn Winner response, report this on Github:",e),"unknown_error"):e.reward?(this.account.eggBalance+=e.reward.eggsGiven,e.reward.itemIds.forEach(a=>this.account.ownedItemIds.push(a)),await this.checkChiknWinner(),e.reward):(console.error("Unknown Chikn Winner response, report this on Github:",e),"unknown_error")}async resetChiknWinner(){if(this.account.eggBalance<200)return"not_enough_eggs";if(!this.account.cw.atLimit)return"not_at_limit";const t=await this.api.queryServices({cmd:"chwReset",sessionId:this.account.sessionId});return typeof t=="string"?t:t.result!=="SUCCESS"?(console.error("Unknown Chikn Winner reset response, report this on Github:",t),"unknown_error"):(this.account.eggBalance-=200,await this.checkChiknWinner(),this.account.cw)}canSee(t){return this.intents.includes(this.Intents.PATHFINDING)?this.pathing.nodeList.hasLineOfSight(this.me.position,t.position):this.processError("You must have the PATHFINDING intent to use this method.")}getBestTarget(t=()=>!0){const a=Object.values(this.players).filter(n=>n?.playing).filter(n=>n.hp>0).filter(n=>n.id!==this.me.id).filter(n=>this.me.team===0||n.team!==this.me.team).filter(n=>!!t(n)).map(n=>({player:n,distance:Math.sqrt(Math.pow(n.position.x-this.me.position.x,2)+Math.pow(n.position.y-this.me.position.y,2)+Math.pow(n.position.z-this.me.position.z,2))})).sort((n,o)=>n.distance-o.distance);if(!a.length)return this.intents.includes(this.Intents.DEBUG_BEST_TARGET)&&console.log("no targets found"),null;const i=a.find(n=>this.canSee(n.player));return this.intents.includes(this.Intents.DEBUG_BEST_TARGET)&&(console.log("detected ",a.length,"targets"),console.log("closest target: ",a[0].player.name),console.log("all targets (ordered): ",a.map(n=>n.player.name)),console.log("found LoS player?",!!i),i&&console.log("closest LoS player: ",i.player.name)),i?{player:i.player,inLoS:!0}:{player:a[0].player,inLoS:!1}}async refreshChallenges(){const t=await this.api.queryServices({cmd:"challengeGetDaily",sessionId:this.account.sessionId,playerId:this.account.id});return this.#a(t),this.account.challenges}async rerollChallenge(t){const e=await this.api.queryServices({cmd:"challengeRerollSlot",sessionId:this.account.sessionId,slotId:t});return this.#a(e),this.account.challenges}async claimChallenge(t){const e=await this.api.queryServices({cmd:"challengeClaimReward",sessionId:this.account.sessionId,slotId:t});return this.#a(e.challenges),e.reward>0&&(this.account.eggBalance+=e.reward),{eggReward:e.reward,updatedChallenges:this.account.challenges}}async refreshBalance(){const t=await this.api.queryServices({cmd:"checkBalance",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId});return this.account.eggBalance=t.currentBalance,t.currentBalance}async redeemCode(t){const e=await this.api.queryServices({cmd:"redeem",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,id:this.account.id,code:t});return e.result==="SUCCESS"?(this.account.eggBalance=e.eggs_given,e.item_ids.forEach(a=>this.account.ownedItemIds.push(a)),{result:e,eggsGiven:e.eggs_given,itemIds:e.item_ids}):e}async claimURLReward(t){const e=await this.api.queryServices({cmd:"urlRewardParams",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,reward:t});return e.result==="SUCCESS"&&(this.account.eggBalance+=e.eggsGiven,e.itemIds.forEach(a=>this.account.ownedItemIds.push(a))),e}async claimSocialReward(t){const e=await this.api.queryServices({cmd:"reward",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,rewardTag:t});return e.result==="SUCCESS"&&(this.account.eggBalance+=e.eggsGiven,e.itemIds.forEach(a=>this.account.ownedItemIds.push(a))),e}async buyItem(t){const e=await this.api.queryServices({cmd:"buy",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,itemId:t,save:!0});return e.result==="SUCCESS"&&(this.account.eggBalance=e.currentBalance,this.account.ownedItemIds.push(e.itemId)),e}processError(t){if(this.#t.error)this.emit("error",t);else throw t}leave(t=z.mainMenu){this.state.quit||(t>-1&&(this.game?.socket?.close(t),this.state.left=!0,this.emit("leave")),clearInterval(this.updateIntervalId),this.#e=[],this.state.reloading=!1,this.state.swappingGun=!1,this.state.usingMelee=!1,this.state.stateIdx=0,this.state.serverStateIdx=0,this.state.shotsFired=0,this.state.buffer=[],this.players={},this.me=new U({}),this.game=this.#o,this.ping=0,this.lastPingTime=-1,this.lastDeathTime=-1,this.lastChatTime=-1,this.lastUpdateTick=0,this.controlKeys=0,this.pathing={nodeList:null,followingPath:!1,activePath:null,activeNode:null,activeNodeIdx:0})}logout(){this.account=this.#n}quit(t=!1){this.state.quit||(this.leave(),this.matchmaker&&(this.matchmaker.close(),this.matchmaker=null),t||(delete this.account,delete this.game,delete this.me,delete this.players),this.state.quit=!0,this.emit("quit"))}}var kt=tt;export{tt as Bot,kt as default};
|
|
3
|
+
import H from"./api.js";import s from"./comm/CommIn.js";import f from"./comm/CommOut.js";import{CloseCode as z}from"./comm/Codes.js";import{CommCode as c}from"./constants/codes.js";import U from"./bot/GamePlayer.js";import W from"./matchmaker.js";import j from"./socket.js";import{ChiknWinnerDailyLimit as q,CollectTypes as x,CoopStates as y,findItemById as d,FramesBetweenSyncs as w,GameActions as T,GameModes as g,GameOptionFlags as E,GunList as K,ItemTypes as $,Movements as G,PlayTypes as Y,ProxiesEnabled as Z,ShellStreaks as m,StateBufferSize as b}from"./constants/index.js";import R from"./dispatches/LookAtPosDispatch.js";import F from"./dispatches/MovementDispatch.js";import{NodeList as Q}from"./pathing/mapnode.js";import{coords as X}from"./wasm/wrapper.js";import{fetchMap as J,initKotcZones as V}from"./util.js";import{Challenges as tt}from"./constants/challenges.js";import{Maps as P}from"./constants/maps.js";const M=Object.fromEntries(Object.entries(y).map(([I,t])=>[t,I])),A=Object.fromEntries(Object.entries(g).map(([I,t])=>[t,I])),B={CHALLENGES:1,STATS:2,PATHFINDING:3,PING:5,COSMETIC_DATA:6,PLAYER_HEALTH:7,PACKET_HOOK:8,LOG_PACKETS:10,NO_LOGIN:11,DEBUG_BUFFER:12,DEBUG_BEST_TARGET:14},S=(I,t)=>(I%t+t)%t;class et{static Intents=B;Intents=B;#e=[];#t={};#i=[];#n;#o;constructor(t={}){t.proxy&&!Z&&this.processError("proxies do not work and hence are not supported in the browser"),this.intents=t.intents||[],this.intents.includes(this.Intents.COSMETIC_DATA)&&(d(1001)||this.processError("you cannot use the COSMETIC_DATA intent inside of the singlefile browser bundles")),this.instance=t.instance||"shellshock.io",this.protocol=t.protocol||"wss",this.proxy=t.proxy||"",this.httpProxy=t.httpProxy||"",this.state={name:"yolkbot",weaponIdx:0,inGame:!1,reloading:!1,swappingGun:!1,usingMelee:!1,stateIdx:0,serverStateIdx:0,shotsFired:0,buffer:[],left:!1,quit:!1},this.players={},this.me=new U({}),this.game={raw:{},code:"",socket:null,gameModeId:0,gameMode:A[0],mapIdx:0,map:{filename:"",hash:"",name:"",modes:{FFA:!1,Teams:!1,Spatula:!1,King:!1},availability:"both",numPlayers:"18",raw:{},nodes:{},zones:[]},playerLimit:0,isGameOwner:!1,isPrivate:!0,options:{gravity:1,damage:1,healthRegen:1,locked:!1,noTeamChange:!1,noTeamShuffle:!1,weaponsDisabled:Array(7).fill(!1),mustUseSecondary:!1},collectables:[[],[]],teamScore:[0,0,0],spatula:{coords:{x:0,y:0,z:0},controlledBy:0,controlledByTeam:0},stage:y.capturing,zoneNumber:0,activeZone:[],capturing:0,captureProgress:0,numCapturing:0,stageName:"",capturePercent:0},this.#o=this.game,this.account={id:0,firebaseId:"",sessionId:"",session:"",email:"",password:"",cw:{atLimit:!1,limit:0,secondsUntilPlay:0,canPlayAgain:Date.now()},loadout:{hatId:null,meleeId:0,stampId:null,classIdx:0,colorIdx:0,grenadeId:0,primaryId:[3100,3600,3400,3800,4e3,4200,4500],secondaryId:new Array(7).fill(3e3),stampPositionX:0,stampPositionY:0},ownedItemIds:[],vip:!1,accountAge:0,emailVerified:!1,eggBalance:0,rawLoginData:{}},this.#n=this.account,this.matchmaker=null,this.api=new H({instance:this.instance,protocol:this.protocol,proxy:this.proxy,httpProxy:this.httpProxy,maxRetries:t?.apiMaxRetries}),this.ping=0,this.lastPingTime=-1,this.lastDeathTime=-1,this.lastChatTime=-1,this.lastUpdateTick=0,this.controlKeys=0,this.pathing={nodeList:null,followingPath:!1,activePath:null,activeNode:null,activeNodeIdx:0},this.hasQuit=!1}dispatch(t){t.check(this)?t.execute(this):this.#e.push(t)}async createAccount(t,e){this.account.email=t,this.account.password=e;const a=await this.api.createAccount(t,e);return this.#s(a)}async login(t,e){this.account.email=t,this.account.password=e;const a=await this.api.loginWithCredentials(t,e);return this.#s(a)}async loginWithRefreshToken(t){const e=await this.api.loginWithRefreshToken(t);return this.#s(e)}async loginAnonymously(){delete this.account.email,delete this.account.password;const t=await this.api.loginAnonymously();return this.#s(t)}#s(t){return typeof t!="object"?(this.emit("authFail",t),!1):t.banRemaining?(this.emit("banned",t.banRemaining),!1):t.playerOutput?(t=t.playerOutput,this.account.rawLoginData=t,this.account.accountAge=t.accountAge,this.account.eggBalance=t.currentBalance,this.account.emailVerified=t.emailVerified,this.account.firebaseId=t.firebaseId,this.account.id=t.id,this.account.loadout=t.loadout,this.account.ownedItemIds=t.ownedItemIds,this.account.session=t.session,this.account.sessionId=t.sessionId,this.account.vip=t.upgradeProductId&&!t.upgradeIsExpired,this.intents.includes(this.Intents.STATS)&&(this.account.stats={lifetime:t.statsLifetime,monthly:t.statsCurrent}),this.intents.includes(this.Intents.CHALLENGES)&&this.#a(t.challenges),this.emit("authSuccess",this.account),this.account):(this.emit("authFail",t),!1)}#a(t){this.account.challenges=[];for(const e of t){const a=tt.find(i=>i.id===e.challengeId);a&&(delete e.playerId,this.account.challenges.push({raw:{challengeInfo:a,challengeData:e},id:e.challengeId,name:a.loc.title,desc:a.loc.desc,rewardEggs:a.reward,isRerolled:!!e.reset,isClaimed:!!e.claimed,isCompleted:!!e.completed,progressNum:e.progress,goalNum:a.goal}))}}async initMatchmaker(){return!this.account.sessionId&&!this.intents.includes(this.Intents.NO_LOGIN)&&!await this.loginAnonymously()?!1:(this.matchmaker||(this.matchmaker=new W({sessionId:this.account.sessionId,proxy:this.proxy,instance:this.instance,protocol:this.protocol,noLogin:this.intents.includes(this.Intents.NO_LOGIN),api:this.api}),this.matchmaker.on("authFail",t=>this.emit("authFail",t)),this.matchmaker.on("error",t=>this.processError(t)),await this.matchmaker.getRegions()),!0)}async#c(t){return await this.initMatchmaker()?(await this.matchmaker.waitForConnect(),await new Promise(e=>{const a=i=>{i.command==="gameFound"&&(this.matchmaker.off("msg",a),this.game.raw=i,this.game.code=i.id,e()),i.error&&i.error==="gameNotFound"&&(this.processError(`Game ${t} not found (likely expired).`),this.leave())};this.matchmaker.on("msg",a),this.matchmaker.send({command:"joinGame",id:t,observe:!1,sessionId:this.account.sessionId})})):!1}async findPublicGame(t){return this.matchmaker||this.initMatchmaker(),this.matchmaker?await this.matchmaker.findPublicGame(t):!1}async createPrivateGame(t={}){if(!await this.initMatchmaker())return!1;if(!t.region&&!this.matchmaker.regionList&&!this.matchmaker.regionList.length)return this.processError("pass a region to createPrivateGame or call getRegions() for a random one");if(t.region||(t.region=this.matchmaker.getRandomRegion()),!t.mode)return this.processError("pass a mode to createPrivateGame");if(typeof g[t.mode]!="number")return this.processError("invalid mode passed to createPrivateGame, see GameModes for a list");t.map||(t.map=P[P.length*Math.random()|0].name);const e=P.find(n=>n.name.toLowerCase()===t.map.toLowerCase()),a=P.indexOf(e);return a===-1?this.processError("invalid map, see the Maps constant for a list"):(await this.matchmaker.waitForConnect(),await new Promise(n=>{const o=r=>{r.command==="gameFound"&&(this.matchmaker.off("msg",o),n(r))};this.matchmaker.on("msg",o),this.matchmaker.send({command:"findGame",region:t.region,playType:Y.createPrivate,gameType:g[t.mode],sessionId:this.account.sessionId,noobLobby:!1,map:a})}))}async join(t,e){if(this.state.name=t||"yolkbot",typeof e=="string"?(e.includes("#")&&(e=e.split("#")[1]),await this.#c(e)):typeof e=="object"&&(this.account.id===0&&await this.loginAnonymously(),this.game.raw=e,this.game.code=this.game.raw.id),!this.game.raw.id)return this.processError("invalid game data passed to <bot>.join");const a=async()=>{try{const i=this.instance.startsWith("localhost:")?this.instance:`${this.game.raw.subdomain}.${this.instance}`;this.game.socket=new j(`${this.protocol}://${i}/game/${this.game.raw.id}`,this.proxy),this.game.socket.onerror=async n=>(this.processError(n),await new Promise(o=>setTimeout(o,100)),await a())}catch{await new Promise(i=>setTimeout(i,100)),await a()}};await a(),this.game.socket.binaryType="arraybuffer",this.game.socket.onopen=()=>this.game.socket.onerror=null,this.game.socket.onmessage=i=>this.processPacket(i.data),this.game.socket.onclose=i=>{this.state.left?this.state.left=!1:(this.emit("close",i.code),this.leave(-1))}}#r(){if(Object.entries(this.me.position).map(e=>Math.floor(e[1])).join(",")===this.pathing.activePath[this.pathing.activePath.length-1].positionStr)this.pathing.followingPath=!1,this.pathing.activePath=null,this.pathing.activeNode=null,this.pathing.activeNodeIdx=0,this.dispatch(new F(0));else{let e;this.pathing.activeNodeIdx<this.pathing.activePath.length-1?(e=this.pathing.activePath[this.pathing.activeNodeIdx+1].flatCenter(),this.dispatch(new R(e))):(e=this.pathing.activePath[this.pathing.activeNodeIdx].flatCenter(),this.dispatch(new R(e)));for(const a of this.pathing.activePath)if(a.flatRadialDistance(this.me.position)<.1&&a.position.y===Math.floor(this.me.position.y)&&this.pathing.activePath.indexOf(a)>=this.pathing.activeNodeIdx){this.pathing.activeNodeIdx=this.pathing.activePath.indexOf(a)+1,this.pathing.activeNode=this.pathing.activePath[this.pathing.activeNodeIdx];break}this.controlKeys&G.FORWARD||this.dispatch(new F(G.FORWARD))}}update(){if(!this.hasQuit){if(this.pathing.followingPath&&this.intents.includes(this.Intents.PATHFINDING)&&this.#r(),this.#e.length>0)for(let t=0;t<this.#e.length;t++){const e=this.#e[t];e.check(this)&&(e.execute(this),this.#e.splice(t,1))}if(this.me.playing){const t=this.state.stateIdx;if(this.intents.includes(this.Intents.DEBUG_BUFFER)&&(console.log("setting buffer for idx",t),console.log("checking...shotsFired",this.state.shotsFired)),this.state.buffer[t]={controlKeys:this.controlKeys,yaw:this.me.view.yaw,pitch:this.me.view.pitch,shotsFired:this.state.shotsFired},this.state.shotsFired=0,this.lastUpdateTick>=2){this.emit("tick");const e=f.getBuffer();e.packInt8(c.syncMe),e.packInt8(this.state.stateIdx),e.packInt8(this.state.serverStateIdx);const a=S(this.state.stateIdx-w+1,b);for(let i=0;i<w;i++){const n=S(a+i,b);this.intents.includes(this.Intents.DEBUG_BUFFER)&&console.log("going with",this.state.stateIdx,a,n,this.state.buffer[n]),e.packInt8(this.state.buffer[n]?.controlKeys||0),e.packInt8(this.state.buffer[n]?.shotsFired||0);const o=this.state.buffer[n]?.yaw||this.me.view.yaw,r=this.state.buffer[n]?.pitch||this.me.view.pitch,u=X(o,r);e.packString(u),e.packInt8(100)}e.send(this.game.socket),this.state.buffer=[],this.lastUpdateTick=0}else this.lastUpdateTick++;this.state.stateIdx=S(this.state.stateIdx+1,b)}if(this.intents.includes(this.Intents.PLAYER_HEALTH))for(const t of Object.values(this.players)){if(t.playing&&t.hp>0){const e=.1*(this.game.isPrivate?this.game.options.healthRegen:1);t.streakRewards.includes(m.OverHeal)?t.hp=Math.max(100,t.hp-e):t.hp=Math.min(100,t.hp+e)}t.spawnShield>0&&(t.spawnShield-=6)}}}on(t,e){Object.keys(this.#t).includes(t)?this.#t[t].push(e):this.#t[t]=[e]}onAny(t){this.#i.push(t)}off(t,e){e?this.#t[t]=this.#t[t].filter(a=>a!==e):this.#t[t]=[]}emit(t,...e){if(!this.hasQuit){if(this.#t[t])for(const a of this.#t[t])a(...e);for(const a of this.#i)a(t,...e)}}#h(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackString().valueOf(),i=this.players[t];this.emit("chat",i,a,e)}#l(){const t=s.unPackInt8U(),e=this.intents.includes(this.Intents.COSMETIC_DATA),a={id:t,uniqueId:s.unPackString(),name:s.unPackString(),safename:s.unPackString(),charClass:s.unPackInt8U(),team:s.unPackInt8U(),primaryWeaponItem:e?d(s.unPackInt16U()):s.unPackInt16U(),secondaryWeaponItem:e?d(s.unPackInt16U()):s.unPackInt16U(),shellColor:s.unPackInt8U(),hatItem:e?d(s.unPackInt16U()):s.unPackInt16U(),stampItem:e?d(s.unPackInt16U()):s.unPackInt16U(),stampPosX:s.unPackInt8(),stampPosY:s.unPackInt8(),grenadeItem:e?d(s.unPackInt16U()):s.unPackInt16U(),meleeItem:e?d(s.unPackInt16U()):s.unPackInt16U(),x:s.unPackFloat(),y:s.unPackFloat(),z:s.unPackFloat(),$dx:s.unPackFloat(),$dy:s.unPackFloat(),$dz:s.unPackFloat(),yaw:s.unPackRadU(),pitch:s.unPackRad(),score:s.unPackInt32U(),kills:s.unPackInt16U(),deaths:s.unPackInt16U(),streak:s.unPackInt16U(),totalKills:s.unPackInt32U(),totalDeaths:s.unPackInt32U(),bestGameStreak:s.unPackInt16U(),bestOverallStreak:s.unPackInt16U(),shield:s.unPackInt8U(),hp:s.unPackInt8U(),playing:s.unPackInt8U(),weaponIdx:s.unPackInt8U(),$controlKeys:s.unPackInt8U(),upgradeProductId:s.unPackInt8U(),activeShellStreaks:s.unPackInt8U(),social:s.unPackLongString(),hideBadge:s.unPackInt8U()};s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U(),this.players[a.id]||(this.players[a.id]=new U(a)),this.emit("playerJoin",this.players[a.id]),this.me.id===a.id&&(this.me=this.players[a.id],this.emit("botJoined",this.me))}#m(){const t=s.unPackInt8U(),e=s.unPackInt16U(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackInt8U(),r=s.unPackInt8U(),u=s.unPackInt8U(),p=s.unPackInt8U(),k=s.unPackInt8U(),h=this.players[t];h&&(h.playing=!0,h.randomSeed=e,h.weapons[0]&&h.weapons[0].ammo&&(h.weapons[0].ammo.rounds=o),h.weapons[0]&&h.weapons[0].ammo&&(h.weapons[0].ammo.store=r),h.weapons[1]&&h.weapons[1].ammo&&(h.weapons[1].ammo.rounds=u),h.weapons[1]&&h.weapons[1].ammo&&(h.weapons[1].ammo.store=p),h.grenades=k,h.position={x:a,y:i,z:n},h.spawnShield=120,this.emit("playerRespawn",h))}#u(){const t=s.unPackInt8U(),e=s.unPackFloat(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackInt8U(),o=this.players[t];if(!o||o.id===this.me.id){for(let p=0;p<w;p++)s.unPackInt8U(),s.unPackRadU(),s.unPackRad(),s.unPackInt8U();return}for(let p=0;p<w-1;p++)s.unPackInt8U(),s.unPackRadU(),s.unPackRad(),s.unPackInt8U();s.unPackInt8U();const r=s.unPackRadU();o.view.yaw=r;const u=s.unPackRad();o.view.pitch=u,s.unPackInt8U(),o.position.x!==e&&(o.position.x=e),o.position.z!==i&&(o.position.z=i),(!o.jumping||Math.abs(o.position.y-a)>.5&&o.position.y!==a)&&(o.position.y=a),o.climbing!==n&&(o.climbing=n)}#d(){const t=s.unPackInt8U(),e=this.players[t];e&&(e.playing=!1,this.emit("playerPause",e))}#p(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];a&&(a.activeGun=e,this.emit("playerSwapWeapon",a,e))}#g(){const t=s.unPackInt8U(),e=s.unPackInt8U();s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U();const a=this.players[t],i=this.players[e];a&&(a.playing=!1,a.streak=0,a.lastDeathTime=Date.now(),a.hp=100,a.spawnShield=0),i&&i.streak++,this.emit("playerDeath",a,i)}#k(){const t=s.unPackInt8U();for(let i=0;i<6;i++)s.unPackFloat();const e=this.players[t];if(!e)return;const a=e.weapons[e.activeGun];a&&a.ammo&&(a.ammo.rounds--,this.emit("playerFire",e,a))}#f(){const t=s.unPackInt16U(),e=s.unPackInt8U(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat();this.game.collectables[e].push({id:t,x:a,y:i,z:n}),this.emit("spawnItem",e,t,{x:a,y:i,z:n})}#I(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackInt8U(),i=s.unPackInt16U(),n=this.players[t];if(this.game.collectables[e]=this.game.collectables[e].filter(o=>o.id!==i),e===x.AMMO){const o=n.weapons[a];o&&o.ammo&&(o.ammo.store=Math.min(o.ammo.storeMax,o.ammo.store+o.ammo.pickup),this.emit("collectAmmo",n,o))}e===x.GRENADE&&(n.grenades++,n.grenades>3&&(n.grenades=3),this.emit("collectGrenade",n))}#P(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;const i=a.hp;a.hp=e,this.emit("playerDamaged",a,i,a.hp)}#y(){const t=s.unPackInt8U();s.unPackFloat(),s.unPackFloat();const e=this.me.hp;this.me.hp=t,this.emit("selfDamaged",e,this.me.hp)}#w(){const t=s.unPackInt8U(),e=this.players[t];s.unPackInt8U();const a=s.unPackInt8U(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackFloat();if(s.unPackInt8U(),s.unPackInt8U(),s.unPackInt8U(),!e)return;this.state.serverStateIdx=a;const r=e.position.x,u=e.position.y,p=e.position.z;e.position.x=i,e.position.y=n,e.position.z=o,(r!==i||u!==n||p!==o)&&this.emit("selfMoved",e,{x:r,y:u,z:p},{x:i,y:n,z:o})}#U(){const t=f.getBuffer();t.packInt8(c.eventModifier),t.send(this.game.socket)}#b(){const t=s.unPackInt8U(),e={...this.players[t]};delete this.players[t.toString()],this.emit("playerLeave",e)}#S(){if(this.game.gameModeId===g.spatula){this.game.teamScore[1]=s.unPackInt16U(),this.game.teamScore[2]=s.unPackInt16U();const t={x:s.unPackFloat(),y:s.unPackFloat(),z:s.unPackFloat()},e=s.unPackInt8U(),a=s.unPackInt8U();this.game.spatula={coords:t,controlledBy:e,controlledByTeam:a},this.emit("gameStateChange",this.game)}else this.game.gameModeId===g.kotc?(this.game.stage=s.unPackInt8U(),this.game.zoneNumber=s.unPackInt8U(),this.game.capturing=s.unPackInt8U(),this.game.captureProgress=s.unPackInt16U(),this.game.numCapturing=s.unPackInt8U(),this.game.teamScore[1]=s.unPackInt8U(),this.game.teamScore[2]=s.unPackInt8U(),this.game.stageName=M[this.game.stage],this.game.capturePercent=this.game.captureProgress/1e3,this.game.activeZone=this.game.map.zones?this.game.map.zones[this.game.zoneNumber-1]:null,this.emit("gameStateChange",this.game)):this.game.gameModeId===g.team&&(this.game.teamScore[1]=s.unPackInt16U(),this.game.teamScore[2]=s.unPackInt16U());this.game.gameModeId!==g.spatula&&delete this.game.spatula,this.game.gameModeId!==g.kotc&&(delete this.game.stage,delete this.game.zoneNumber,delete this.game.capturing,delete this.game.captureProgress,delete this.game.numCapturing,delete this.game.stageName,delete this.game.numCapturing,delete this.game.activeZone),this.game.gameModeId===g.ffa&&delete this.game.teamScore}#v(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];switch(e){case m.HardBoiled:t===this.me.id&&(this.me.shieldHp=100),a.streakRewards.push(m.HardBoiled);break;case m.EggBreaker:a.streakRewards.push(m.EggBreaker);break;case m.Restock:{a.grenades=3,a.weapons[0]&&a.weapons[0].ammo&&(a.weapons[0].ammo.rounds=a.weapons[0].ammo.capacity,a.weapons[0].ammo.store=a.weapons[0].ammo.storeMax),a.weapons[1]&&a.weapons[1].ammo&&(a.weapons[1].ammo.rounds=a.weapons[1].ammo.capacity,a.weapons[1].ammo.store=a.weapons[1].ammo.storeMax);break}case m.OverHeal:a.hp=Math.min(200,a.hp+100),a.streakRewards.push(m.OverHeal);break;case m.DoubleEggs:a.streakRewards.push(m.DoubleEggs);break;case m.MiniEgg:a.streakRewards.push(m.MiniEgg);break}this.emit("playerBeginStreak",a,e)}#C(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];[m.EggBreaker,m.OverHeal,m.DoubleEggs,m.MiniEgg].includes(e)&&a.streakRewards.includes(e)&&(a.streakRewards=a.streakRewards.filter(n=>n!==e)),this.emit("playerEndStreak",e,a)}#x(){const t=s.unPackInt8U(),e=s.unPackInt8U();s.unPackFloat(),s.unPackFloat(),this.me.shieldHp=t,this.me.hp=e,this.me.shieldHp<=0?(this.me.streakRewards=this.me.streakRewards.filter(a=>a!==m.HardBoiled),this.emit("selfShieldLost")):this.emit("selfShieldHit",this.me.shieldHp)}#T(){const t={...this.game.options};let e=s.unPackInt8U(),a=s.unPackInt8U(),i=s.unPackInt8U();(e<1||e>4)&&(e=4),(a<0||a>8)&&(a=4),i>16&&(i=4),this.game.options.gravity=e/4,this.game.options.damage=a/4,this.game.options.healthRegen=i/4;const n=s.unPackInt8U();return Object.keys(E).forEach(o=>{const r=n&E[o]?1:0;this.game.options[o]=r}),this.game.options.weaponsDisabled=Array.from({length:7},()=>s.unPackInt8U()===1),this.game.options.mustUseSecondary=this.game.options.weaponsDisabled.every(o=>o),this.emit("gameOptionsChange",t,this.game.options),!1}#E(){const t=s.unPackInt8U();t===T.pause&&(this.emit("gameForcePause"),setTimeout(()=>this.me.playing=!1,3e3)),t===T.reset&&(Object.values(this.players).forEach(e=>e.streak=0),this.game.gameModeId!==g.ffa&&(this.game.teamScore=[0,0,0]),this.game.gameModeId===g.spatula&&(this.game.spatula.controlledBy=0,this.game.spatula.controlledByTeam=0,this.game.spatula.coords={x:0,y:0,z:0}),this.game.gameModeId===g.kotc&&(this.game.stage=y.capturing,this.game.zoneNumber=0,this.game.activeZone=null,this.game.capturing=0,this.game.captureProgress=0,this.game.numCapturing=0,this.game.stageName=M[y.capturing],this.game.capturePercent=0),this.emit("gameReset"))}#G(){if(!this.intents.includes(this.Intents.PING))return;const t=this.ping;this.ping=Date.now()-this.lastPingTime,this.emit("pingUpdate",t,this.ping),setTimeout(()=>{const e=f.getBuffer();e.packInt8(c.ping),e.send(this.game.socket),this.lastPingTime=Date.now()},1e3)}#R(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;const i=a.team;a.team=e,a.streak=0,this.emit("playerSwitchTeam",a,i,e)}#F(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=s.unPackInt16U(),i=s.unPackInt16U(),n=s.unPackInt8U(),o=s.unPackInt16U(),r=s.unPackInt16U(),u=s.unPackInt16U(),p=s.unPackInt16U();s.unPackInt8(),s.unPackInt8();const k=this.intents.includes(this.Intents.COSMETIC_DATA),h=k?d(a):a,O=k?d(i):i,L=k?d(o):o,N=k?d(r):r,D=k?d(u):u,_=k?d(p):p,l=this.players[t];if(l){const v={...l.character},C=l.selectedGun;l.character.eggColor=n,l.character.primaryGun=h,l.character.secondaryGun=O,l.character.stamp=N,l.character.hat=L,l.character.grenade=D,l.character.melee=_,l.selectedGun=e,l.weapons[0]=new K[e],C!==l.selectedGun&&this.emit("playerChangeGun",l,C,l.selectedGun),v!==l.character&&this.emit("playerChangeCharacter",l,v,l.character)}}#M(){const t=s.unPackInt32U(),e=this.account.eggBalance;this.account.eggBalance=t,this.emit("balanceUpdate",t-e,t)}#A(){this.me.playing=!1,this.emit("selfRespawnFail")}#B(){const t=s.unPackInt8U(),e=this.players[t];e&&this.emit("playerMelee",e)}#O(){const t=s.unPackInt8U(),e=this.players[t];if(!e)return;const a=e.weapons[e.activeGun];if(a.ammo){const i=Math.min(Math.min(a.ammo.capacity,a.ammo.reload)-a.ammo.rounds,a.ammo.store);a.ammo.rounds+=i,a.ammo.store-=i}this.emit("playerReload",e,a)}#L(){const t=f.getBuffer();t.packInt8(c.gameOptions),t.packInt8(this.game.options.gravity*4),t.packInt8(this.game.options.damage*4),t.packInt8(this.game.options.healthRegen*4);const e=(this.game.options.locked?1:0)|(this.game.options.noTeamChange?2:0)|(this.game.options.noTeamShuffle?4:0);t.packInt8(e),this.game.options.weaponsDisabled.forEach(a=>{t.packInt8(a?1:0)}),t.send(this.game.socket)}#N(){const t=s.unPackInt8U();let e=s.unPackInt16U();const a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackInt8U(),r=s.unPackFloat();this.intents.includes(this.Intents.COSMETIC_DATA)&&(e=d(e)),t===$.Grenade?this.emit("grenadeExploded",e,{x:a,y:i,z:n},o,r):this.emit("rocketHit",{x:a,y:i,z:n},o,r)}#D(){const t=s.unPackInt8U(),e=s.unPackFloat(),a=s.unPackFloat(),i=s.unPackFloat(),n=s.unPackFloat(),o=s.unPackFloat(),r=s.unPackFloat(),u=this.players[t];u&&(u.grenades--,this.emit("playerThrowGrenade",u,{x:e,y:a,z:i},{x:n,y:o,z:r}))}#_(){const t=s.unPackInt8U(),e=s.unPackInt8U(),a=this.players[t];if(!a)return;if(!this.intents.includes(this.Intents.CHALLENGES))return this.emit("challengeComplete",a,e);const i=this.account.challenges.find(n=>n.id===e);this.emit("challengeComplete",a,i),a.id===this.me.id&&this.refreshChallenges()}#H(){const t=f.getBuffer();t.packInt8(c.joinGame),t.packString(this.state.name),t.packString(this.game.raw.uuid),t.packInt8(0),t.packInt8(this.state.weaponIdx||this.account?.loadout?.classIdx||0),t.packInt32(this.account.session),t.packString(this.account.firebaseId),t.packString(this.account.sessionId),t.send(this.game.socket)}async#z(){if(this.me.id=s.unPackInt8U(),this.me.team=s.unPackInt8U(),this.game.gameModeId=s.unPackInt8U(),this.game.gameMode=A[this.game.gameModeId],this.game.mapIdx=s.unPackInt8U(),this.game.map=P[this.game.mapIdx],this.intents.includes(this.Intents.PATHFINDING)&&(this.game.map.raw=await J(this.game.map.filename,this.game.map.hash),this.pathing.nodeList=new Q(this.game.map.raw),this.game.gameModeId===g.kotc)){const e=this.game.map.raw.data["DYNAMIC.capture-zone.none"];e?this.game.map.zones=V(e):delete this.game.map.zones}this.game.playerLimit=s.unPackInt8U(),this.game.isGameOwner=s.unPackInt8U()===1,this.game.isPrivate=s.unPackInt8U()===1,s.unPackInt8U(),this.state.inGame=!0,this.lastDeathTime=Date.now();const t=f.getBuffer();if(t.packInt8(c.clientReady),t.send(this.game.socket),this.updateIntervalId=setInterval(()=>this.update(),100/3),this.intents.includes(this.Intents.PING)){this.lastPingTime=Date.now();const e=f.getBuffer();e.packInt8(c.ping),e.send(this.game.socket)}this.emit("gameReady")}processPacket(t){s.init(t),this.intents.includes(this.Intents.PACKET_HOOK)&&this.emit("packet",t);let e=0,a=0,i=!1;for(;s.isMoreDataAvailable()&&!i;){const n=s.unPackInt8U();switch(n){case c.syncThem:this.#u();break;case c.fire:this.#k();break;case c.hitThem:this.#P();break;case c.syncMe:this.#w();break;case c.hitMe:this.#y();break;case c.swapWeapon:this.#p();break;case c.collectItem:this.#I();break;case c.respawn:this.#m();break;case c.die:this.#g();break;case c.pause:this.#d();break;case c.chat:this.#h();break;case c.addPlayer:this.#l();break;case c.removePlayer:this.#b();break;case c.eventModifier:this.#U();break;case c.metaGameState:this.#S();break;case c.beginShellStreak:this.#v();break;case c.endShellStreak:this.#C();break;case c.hitMeHardBoiled:this.#x();break;case c.gameOptions:this.#T();break;case c.ping:this.#G();break;case c.switchTeam:this.#R();break;case c.changeCharacter:this.#F();break;case c.reload:this.#O();break;case c.explode:this.#N();break;case c.throwGrenade:this.#D();break;case c.spawnItem:this.#f();break;case c.melee:this.#B();break;case c.updateBalance:this.#M();break;case c.challengeCompleted:this.#_();break;case c.socketReady:this.#H();break;case c.gameJoined:this.#z();break;case c.gameAction:this.#E();break;case c.requestGameOptions:this.#L();break;case c.respawnDenied:this.#A();break;case c.expireUpgrade:case c.clientReady:break;case c.musicInfo:s.unPackLongString();break;default:console.error(`processPacket: I got but couldn't identify a: ${Object.keys(c).find(o=>c[o]===n)} ${n}`),e&&console.error(`processPacket: It may be a result of the ${e} command (${a}).`),i=!0;break}e=Object.keys(c).find(o=>c[o]===n),a=n,this.intents.includes(this.Intents.LOG_PACKETS)&&console.log(`[LOG_PACKETS] Packet ${e}: ${a}`)}}async checkChiknWinner(){const t=await this.api.queryServices({cmd:"chicknWinnerReady",id:this.account.id,sessionId:this.account.sessionId});return typeof t=="string"?t:(this.account.cw.limit=t.limit,this.account.cw.atLimit=t.limit>=4,this.account.cw.secondsUntilPlay=(this.account.cw.atLimit?t.period:t.span)||0,this.account.cw.canPlayAgain=Date.now()+this.account.cw.secondsUntilPlay*1e3,this.account.cw)}async playChiknWinner(t=!0){if(this.account.cw.atLimit||this.account.cw.limit>q)return"hit_daily_limit";if(this.account.cw.canPlayAgain>Date.now()&&t)return"on_cooldown";const e=await this.api.queryServices({cmd:"incentivizedVideoReward",firebaseId:this.account.firebaseId,id:this.account.id,sessionId:this.account.sessionId,token:null});return typeof e=="string"?e:e.error?e.error==="RATELIMITED"||e.error==="RATELMITED"?(await this.checkChiknWinner(),"on_cooldown"):e.error==="SESSION_EXPIRED"?"session_expired":(console.error("Unknown Chikn Winner response, report this on Github:",e),"unknown_error"):e.reward?(this.account.eggBalance+=e.reward.eggsGiven,e.reward.itemIds.forEach(a=>this.account.ownedItemIds.push(a)),await this.checkChiknWinner(),e.reward):(console.error("Unknown Chikn Winner response, report this on Github:",e),"unknown_error")}async resetChiknWinner(){if(this.account.eggBalance<200)return"not_enough_eggs";if(!this.account.cw.atLimit)return"not_at_limit";const t=await this.api.queryServices({cmd:"chwReset",sessionId:this.account.sessionId});return typeof t=="string"?t:t.result!=="SUCCESS"?(console.error("Unknown Chikn Winner reset response, report this on Github:",t),"unknown_error"):(this.account.eggBalance-=200,await this.checkChiknWinner(),this.account.cw)}canSee(t){return this.intents.includes(this.Intents.PATHFINDING)?this.pathing.nodeList.hasLineOfSight(this.me.position,t.position):this.processError("You must have the PATHFINDING intent to use this method.")}getBestTarget(t=()=>!0){const a=Object.values(this.players).filter(n=>n?.playing).filter(n=>n.hp>0).filter(n=>n.id!==this.me.id).filter(n=>this.me.team===0||n.team!==this.me.team).filter(n=>!!t(n)).map(n=>({player:n,distance:Math.sqrt(Math.pow(n.position.x-this.me.position.x,2)+Math.pow(n.position.y-this.me.position.y,2)+Math.pow(n.position.z-this.me.position.z,2))})).sort((n,o)=>n.distance-o.distance);if(!a.length)return this.intents.includes(this.Intents.DEBUG_BEST_TARGET)&&console.log("no targets found"),null;const i=a.find(n=>this.canSee(n.player));return this.intents.includes(this.Intents.DEBUG_BEST_TARGET)&&(console.log("detected ",a.length,"targets"),console.log("closest target: ",a[0].player.name),console.log("all targets (ordered): ",a.map(n=>n.player.name)),console.log("found LoS player?",!!i),i&&console.log("closest LoS player: ",i.player.name)),i?{player:i.player,inLoS:!0}:{player:a[0].player,inLoS:!1}}async refreshChallenges(){const t=await this.api.queryServices({cmd:"challengeGetDaily",sessionId:this.account.sessionId,playerId:this.account.id});return this.#a(t),this.account.challenges}async rerollChallenge(t){const e=await this.api.queryServices({cmd:"challengeRerollSlot",sessionId:this.account.sessionId,slotId:t});return this.#a(e),this.account.challenges}async claimChallenge(t){const e=await this.api.queryServices({cmd:"challengeClaimReward",sessionId:this.account.sessionId,slotId:t});return this.#a(e.challenges),e.reward>0&&(this.account.eggBalance+=e.reward),{eggReward:e.reward,updatedChallenges:this.account.challenges}}async refreshBalance(){const t=await this.api.queryServices({cmd:"checkBalance",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId});return this.account.eggBalance=t.currentBalance,t.currentBalance}async redeemCode(t){const e=await this.api.queryServices({cmd:"redeem",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,id:this.account.id,code:t});return e.result==="SUCCESS"?(this.account.eggBalance=e.eggs_given,e.item_ids.forEach(a=>this.account.ownedItemIds.push(a)),{result:e,eggsGiven:e.eggs_given,itemIds:e.item_ids}):e}async claimURLReward(t){const e=await this.api.queryServices({cmd:"urlRewardParams",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,reward:t});return e.result==="SUCCESS"&&(this.account.eggBalance+=e.eggsGiven,e.itemIds.forEach(a=>this.account.ownedItemIds.push(a))),e}async claimSocialReward(t){const e=await this.api.queryServices({cmd:"reward",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,rewardTag:t});return e.result==="SUCCESS"&&(this.account.eggBalance+=e.eggsGiven,e.itemIds.forEach(a=>this.account.ownedItemIds.push(a))),e}async buyItem(t){const e=await this.api.queryServices({cmd:"buy",firebaseId:this.account.firebaseId,sessionId:this.account.sessionId,itemId:t,save:!0});return e.result==="SUCCESS"&&(this.account.eggBalance=e.currentBalance,this.account.ownedItemIds.push(e.itemId)),e}processError(t){if(this.#t.error&&this.#t.error.length)this.emit("error",t);else throw t}leave(t=z.mainMenu){this.hasQuit||(t>-1&&(this.game?.socket?.close(t),this.state.left=!0,this.emit("leave",t)),clearInterval(this.updateIntervalId),this.#e=[],this.state.reloading=!1,this.state.swappingGun=!1,this.state.usingMelee=!1,this.state.stateIdx=0,this.state.serverStateIdx=0,this.state.shotsFired=0,this.state.buffer=[],this.players={},this.me=new U({}),this.game=this.#o,this.ping=0,this.lastPingTime=-1,this.lastDeathTime=-1,this.lastChatTime=-1,this.lastUpdateTick=0,this.controlKeys=0,this.pathing={nodeList:null,followingPath:!1,activePath:null,activeNode:null,activeNodeIdx:0})}logout(){this.account=this.#n}quit(t=!1){this.hasQuit||(this.leave(),this.matchmaker&&(this.matchmaker.close(),t||(this.matchmaker=null)),t||(delete this.account,delete this.api,delete this.game,delete this.me,delete this.players,delete this.state),this.hasQuit=!0)}}var It=et;export{et as Bot,It as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
const e=[{version:"1.0.
|
|
3
|
+
const e=[{version:"1.0.6",date:"May 1 2025",content:["Lock in & look out eggventurers, it's time for the Leggacy of the Sun update!","Congrats to the winners of the EGG ORG takeover - all players have been awarded an Eggsassin Stamp!","We liked random killstreak bonuses so much we decided to keep them!","Eggiana Jones has arrived - the newest item bundle featuring a cracking new melee!","Throw Throw Apocalypto! Try the latest Premium Mayan Grenade - in-store & free for VIPs ","We got a hot one! Try the latest map Greenhouse in public & private lobbies","The Public Map pool has been overhauled! The Egg Org Maps are gone, replaced by a range of Mayan maps & old favorites!"]}];export{e as Changelog};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
const e={big:[{imageExt:".jpg",link:["https://basketballtips.info?utm_source=ssbigsplash&utm_medium=referral"],label:"BasketBros",active:!1,id:"kt4wqo5fb",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"castles",link:["https://castles.cc?utm=sssplash"],imageExt:".png",id:"kmv2r4wvq",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://www.surveymonkey.com/r/eggjune22?utm_source=sssplash"],label:"Survey",imageExt:".png",id:"l47ejll3r",active:!1,weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",active:!1,label:"VIP Club",linksToVipStore:"1",id:"ki5mdikz13",weighted:!1,hideOnCG:!1,linksTo:"linksToVipStore"},{active:!1,label:"Creators",link:["http://shellcreators.bluewizard.com/"],imageExt:".png",id:"kiutzlr317",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",label:"MonthlyUpdate",active:!1,id:"kperqror1b",linksToTaggedItems:"Merc",weighted:!1,hideOnCG:!1,linksTo:"linksToTaggedItems"},{link:["https://bluewizard.threadless.com/collections/shell-shockers"],label:"BW merch",active:!1,imageExt:".png",id:"kkxdntoi1f",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",linksToTaggedItems:"JulyM23",active:!1,label:"Monthy Update",id:"lk7f4zzi1r",weighted:!1,hideOnCG:!1,linksTo:"linksToTaggedItems"},{active:!1,label:"Twitch Drops",link:["https://shellshock.io/twitch?utm_source=ss-splash-ad&utm_medium=referral"],imageExt:".png",id:"lerd8ope1s",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Nate Nook",link:["https://bluewizard.com/nate/?utm_source=sssplash"],imageExt:".jpg",id:"kzhfdvso1t",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Basketball Grenade",link:["https://basketbros.io/?utm_source=ssbigsplash&utm_medium=referral"],active:!1,imageExt:".png",id:"l0srdxke1v",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Bad Egg",imageExt:".png",link:["https://freegames.io/game/bad-egg?utm_source=shellshockers&utm_medium=referral&utm_campaign=splashad"],id:"lchuivey1x",active:!1,weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://dragonjoust.io?utm_source=shellshockers&utm_medium=referral&utm_campaign=splashad"],label:"Dragon Joust",imageExt:".png",active:!1,id:"lcsafw1j1y",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://freegames.io/game/zuck-vs-musk---techbro-beatdown?utm_source=shellshockers&utm_medium=referral&utm_campaign=splashad"],label:"Zuck v Musk",active:!1,imageExt:".jpg",id:"lj8r5m7o20",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://freegames.io?utm_source=shellshockers&utm_medium=referral&utm_campaign=splashad"],active:!1,label:"Freegames",imageExt:".png",id:"ljyrwybt21",weighted:!1,hideOnCG:!1,linksTo:"link"}],small:[{link:["https://freegames.io/game/football-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Football Bros",active:!0,weighted:!0,hideOnCG:!0,imageExt:".png",id:"lz8tuwxpg",linksTo:"link"},{active:!0,imageExt:".jpg",link:["https://freegames.io/game/basket-bros?utm_source=shell_shockers_houseads&utm_medium=referral","https://www.crazygames.com/game/basketbros"],label:"Basket Bros",id:"kokajqjqu",weighted:!1,hideOnCG:!0,linksTo:"link"},{active:!0,linksToVipStore:"1",imageExt:".png",label:"VIP",id:"kuzrh1cwt",weighted:!1,hideOnCG:!1,linksTo:"linksToVipStore"},{label:"Twitch Drops 7",imageExt:".png",id:"m7b5681oc",weighted:!1,hideOnCG:!1,linksTo:"linkToTwitch",linkToTwitch:"1",active:!1},{link:["https://freegames.io/game/mech-bros/?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,label:"Mech Bros",weighted:!1,hideOnCG:!1,imageExt:".jpg",id:"lwk851end",linksTo:"link"},{link:["https://freegames.io/game/soccer-bros?utm_source=shell_shockers&utm_medium=referral","https://www.crazygames.com/game/soccer-bros"],label:"Soccer Bros",imageExt:".jpg",id:"lphl58wab",weighted:!1,hideOnCG:!1,linksTo:"link",active:!1},{imageExt:".png",label:"Private Games",id:"ls3tphkc6",active:!1,weighted:!1,hideOnCG:!1,linksTo:"linksToCreateGame",linksToCreateGame:"1"},{imageExt:".jpg",active:!1,label:"Shell Survey",link:["https://www.surveymonkey.com/r/septshell23"],id:"lofzjd42w",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://freegames.io/game/wrestle-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,label:"Wrestle Bros",imageExt:".png",id:"lhkqsfa911",weighted:!1,hideOnCG:!1,linksTo:"link"}],bigBanner:[{active:!0,label:"VIP",linksToVipStore:"1",imageExt:".png",id:"kuzrh1cwg",weighted:!1,hideOnCG:!1,linksTo:"linksToVipStore"},{active:!0,label:"VIP",linksToVipStore:"1",imageExt:".png",id:"kuzrh1cwh",weighted:!1,hideOnCG:!1,linksTo:"linksToVipStore"},{imageExt:".jpg",link:["https://freegames.io/game/basket-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Basket Bros",active:!0,id:"kokal7c9i",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://freegames.io/game/basket-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Basket Bros",active:!0,id:"kokamphkj",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Dragon Joust",link:["https://freegames.io/game/dragon-joust?utm_source=shell_shockers&utm_medium=referral"],imageExt:".png",active:!0,id:"laskwdxfs",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!0,label:"Dragon Joust",link:["https://freegames.io/game/dragon-joust?utm_source=shell_shockers&utm_medium=referral"],imageExt:".png",id:"laskwvhat",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!0,label:"Bad Egg",link:["https://freegames.io/game/bad-egg?utm_source=shell_shockers&utm_medium=referral"],imageExt:".png",id:"laskxj0mu",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!0,label:"Bad Egg",link:["https://freegames.io/game/bad-egg?utm_source=shell_shockers&utm_medium=referral"],imageExt:".png",id:"laskxwdnv",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://freegames.io/game/wrestle-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!0,label:"Wrestle Bros",imageExt:".png",id:"lhkqwo2pw",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!0,label:"Wrestle Bros",link:["https://freegames.io/game/wrestle-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],imageExt:".png",id:"lhkqx9ohx",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,imageExt:".jpg",link:["https://www.curiouscorrespondence.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Curious Correspondence",id:"kmy3p8p80",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://www.curiouscorrespondence.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Curious Correspondence",active:!1,id:"kmy3s9571",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Curious Correspondence",link:["https://www.curiouscorrespondence.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,imageExt:".jpg",id:"kmy3tjgj2",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",active:!1,label:"Friday the 13th Killer Puzzle",link:["https://f13killerpuzzle.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],id:"kmz1018u3",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://f13killerpuzzle.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Friday the 13th Killer Puzzle",id:"kmz1140y4",active:!1,weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",link:["https://store.steampowered.com/app/1233690/Hypergalactic_Psychic_Table_Tennis_3000/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Hypergalactic Psychic Table Tennis 3000",id:"kmz12sag5",active:!1,weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",active:!1,label:"Nuke Zone",link:["https://nuke.zone/?utm_source=shell_shockers_houseads&utm_medium=referral"],id:"kmz16o7h6",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",link:["https://raid.land/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Raid Land",active:!1,id:"kmz18sjd7",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://slashycamp.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,label:"Slashy Camp",id:"kmz19yp68",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://slashycamp.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Slashy Camp",active:!1,id:"kmz1ap9b9",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://bluewizard.com/slayawaycamp-free-to-slay/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Slayaway Camp",active:!1,id:"kmz1bycra",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://bluewizard.com/slayawaycamp-free-to-slay/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Slayaway Camp",active:!1,id:"kmz1cyblb",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",active:!1,link:["https://shop.stormcrow.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Shop Storm Crow",id:"kmz1evxgc",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://shop.stormcrow.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Shop Storm Crow",active:!1,imageExt:".jpg",id:"kmz1fpoxd",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://shop.stormcrow.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Shop Storm Crow",active:!1,id:"kmz1gms0e",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://shop.stormcrow.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,label:"Shop Storm Crow",id:"kmz1h7u4f",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Headless",active:!1,link:["https://headless.gg/?utm_source=shell_shockers_houseads&utm_medium=referral"],imageExt:".jpg",id:"kp7h0zu8k",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Headless",link:["https://headless.gg/?utm_source=shell_shockers_houseads&utm_medium=referral"],imageExt:".jpg",id:"kp7h1ekxl",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,link:["https://store.steampowered.com/app/1255530/Nuke_Zone/?utm_source=ss-house-ads&utm_medium=referral&utm_campaign=next-fest-launch"],label:"Nuke Zone Next Fest",imageExt:".jpg",id:"kpzrnq8fm",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Nuke Zone Next Fest",link:["https://store.steampowered.com/app/1255530/Nuke_Zone/?utm_source=ss-house-ads&utm_medium=referral&utm_campaign=next-fest-launch"],imageExt:".jpg",id:"kpzro6wzn",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",label:"Nuke Zone Demo",link:["https://store.steampowered.com/app/1255530/Nuke_Zone/?utm_source=ss-house-ads&utm_medium=referral&utm_campaign=demo-june22"],active:!1,id:"kq88mifpo",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Nuke Zone Demo",link:["https://store.steampowered.com/app/1255530/Nuke_Zone/?utm_source=ss-house-ads&utm_medium=referral&utm_campaign=demo-june22"],imageExt:".jpg",id:"kq88n006p",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",link:["https://apps.apple.com/app/apple-store/id1515978119?pt=118229234&ct=ss-house-ad&mt=8"],active:!1,label:"SS Mobile iOS",id:"krdzwhajq",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Cubic Castles",imageExt:".png",link:["https://castles.cc/?utm_source=shell_shockers_houseads&utm_medium=referral"],id:"ktn7rc9jr",weighted:!1,hideOnCG:!1,linksTo:"link"}],houseAdPercentChance:100,specialItemsTag:"May25",featuredSocialMedia:"Twitter",premFeatured:"premFeatOne",smHouseAds:[{ad:"badEgg",weighted:0}],shellLogo:[{active:!1,label:"Christmas",imageExt:".svg",id:"lpn8kxv40",weighted:!1,hideOnCG:!1},{imageExt:".svg",label:"Egg Org 2",active:!1,id:"luhi1wp12",weighted:!1,hideOnCG:!1},{imageExt:".svg",label:"Halloween",id:"m1qxbsyk2",weighted:!1,hideOnCG:!1,active:!1}]};export{e as HousePromo};
|
|
3
|
+
const e={big:[{imageExt:".jpg",link:["https://basketballtips.info?utm_source=ssbigsplash&utm_medium=referral"],label:"BasketBros",active:!1,id:"kt4wqo5fb",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"castles",link:["https://castles.cc?utm=sssplash"],imageExt:".png",id:"kmv2r4wvq",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://www.surveymonkey.com/r/eggjune22?utm_source=sssplash"],label:"Survey",imageExt:".png",id:"l47ejll3r",active:!1,weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",active:!1,label:"VIP Club",linksToVipStore:"1",id:"ki5mdikz13",weighted:!1,hideOnCG:!1,linksTo:"linksToVipStore"},{active:!1,label:"Creators",link:["http://shellcreators.bluewizard.com/"],imageExt:".png",id:"kiutzlr317",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",label:"MonthlyUpdate",active:!1,id:"kperqror1b",linksToTaggedItems:"Merc",weighted:!1,hideOnCG:!1,linksTo:"linksToTaggedItems"},{link:["https://bluewizard.threadless.com/collections/shell-shockers"],label:"BW merch",active:!1,imageExt:".png",id:"kkxdntoi1f",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",linksToTaggedItems:"JulyM23",active:!1,label:"Monthy Update",id:"lk7f4zzi1r",weighted:!1,hideOnCG:!1,linksTo:"linksToTaggedItems"},{active:!1,label:"Twitch Drops",link:["https://shellshock.io/twitch?utm_source=ss-splash-ad&utm_medium=referral"],imageExt:".png",id:"lerd8ope1s",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Nate Nook",link:["https://bluewizard.com/nate/?utm_source=sssplash"],imageExt:".jpg",id:"kzhfdvso1t",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Basketball Grenade",link:["https://basketbros.io/?utm_source=ssbigsplash&utm_medium=referral"],active:!1,imageExt:".png",id:"l0srdxke1v",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Bad Egg",imageExt:".png",link:["https://freegames.io/game/bad-egg?utm_source=shellshockers&utm_medium=referral&utm_campaign=splashad"],id:"lchuivey1x",active:!1,weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://dragonjoust.io?utm_source=shellshockers&utm_medium=referral&utm_campaign=splashad"],label:"Dragon Joust",imageExt:".png",active:!1,id:"lcsafw1j1y",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://freegames.io/game/zuck-vs-musk---techbro-beatdown?utm_source=shellshockers&utm_medium=referral&utm_campaign=splashad"],label:"Zuck v Musk",active:!1,imageExt:".jpg",id:"lj8r5m7o20",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://freegames.io?utm_source=shellshockers&utm_medium=referral&utm_campaign=splashad"],active:!1,label:"Freegames",imageExt:".png",id:"ljyrwybt21",weighted:!1,hideOnCG:!1,linksTo:"link"}],small:[{link:["https://freegames.io/game/football-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Football Bros",active:!0,weighted:!0,hideOnCG:!0,imageExt:".png",id:"lz8tuwxpg",linksTo:"link"},{active:!0,imageExt:".jpg",link:["https://freegames.io/game/basket-bros?utm_source=shell_shockers_houseads&utm_medium=referral","https://www.crazygames.com/game/basketbros"],label:"Basket Bros",id:"kokajqjqu",weighted:!1,hideOnCG:!0,linksTo:"link"},{active:!0,linksToVipStore:"1",imageExt:".png",label:"VIP",id:"kuzrh1cwt",weighted:!1,hideOnCG:!1,linksTo:"linksToVipStore"},{label:"Twitch Drops 7",imageExt:".png",id:"m7b5681oc",weighted:!1,hideOnCG:!1,linksTo:"linkToTwitch",linkToTwitch:"1",active:!1},{link:["https://freegames.io/game/mech-bros/?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,label:"Mech Bros",weighted:!1,hideOnCG:!1,imageExt:".jpg",id:"lwk851end",linksTo:"link"},{link:["https://freegames.io/game/soccer-bros?utm_source=shell_shockers&utm_medium=referral","https://www.crazygames.com/game/soccer-bros"],label:"Soccer Bros",imageExt:".jpg",id:"lphl58wab",weighted:!1,hideOnCG:!1,linksTo:"link",active:!1},{imageExt:".png",label:"Private Games",id:"ls3tphkc6",active:!1,weighted:!1,hideOnCG:!1,linksTo:"linksToCreateGame",linksToCreateGame:"1"},{imageExt:".jpg",active:!1,label:"Shell Survey",link:["https://www.surveymonkey.com/r/septshell23"],id:"lofzjd42w",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://freegames.io/game/wrestle-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,label:"Wrestle Bros",imageExt:".png",id:"lhkqsfa911",weighted:!1,hideOnCG:!1,linksTo:"link"}],bigBanner:[{active:!0,label:"VIP",linksToVipStore:"1",imageExt:".png",id:"kuzrh1cwg",weighted:!1,hideOnCG:!1,linksTo:"linksToVipStore"},{active:!0,label:"VIP",linksToVipStore:"1",imageExt:".png",id:"kuzrh1cwh",weighted:!1,hideOnCG:!1,linksTo:"linksToVipStore"},{imageExt:".jpg",link:["https://freegames.io/game/basket-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Basket Bros",active:!0,id:"kokal7c9i",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://freegames.io/game/basket-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Basket Bros",active:!0,id:"kokamphkj",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Dragon Joust",link:["https://freegames.io/game/dragon-joust?utm_source=shell_shockers&utm_medium=referral"],imageExt:".png",active:!0,id:"laskwdxfs",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!0,label:"Dragon Joust",link:["https://freegames.io/game/dragon-joust?utm_source=shell_shockers&utm_medium=referral"],imageExt:".png",id:"laskwvhat",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!0,label:"Bad Egg",link:["https://freegames.io/game/bad-egg?utm_source=shell_shockers&utm_medium=referral"],imageExt:".png",id:"laskxj0mu",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!0,label:"Bad Egg",link:["https://freegames.io/game/bad-egg?utm_source=shell_shockers&utm_medium=referral"],imageExt:".png",id:"laskxwdnv",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://freegames.io/game/wrestle-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!0,label:"Wrestle Bros",imageExt:".png",id:"lhkqwo2pw",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!0,label:"Wrestle Bros",link:["https://freegames.io/game/wrestle-bros?utm_source=shell_shockers_houseads&utm_medium=referral"],imageExt:".png",id:"lhkqx9ohx",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,imageExt:".jpg",link:["https://www.curiouscorrespondence.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Curious Correspondence",id:"kmy3p8p80",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://www.curiouscorrespondence.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Curious Correspondence",active:!1,id:"kmy3s9571",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Curious Correspondence",link:["https://www.curiouscorrespondence.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,imageExt:".jpg",id:"kmy3tjgj2",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",active:!1,label:"Friday the 13th Killer Puzzle",link:["https://f13killerpuzzle.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],id:"kmz1018u3",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://f13killerpuzzle.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Friday the 13th Killer Puzzle",id:"kmz1140y4",active:!1,weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",link:["https://store.steampowered.com/app/1233690/Hypergalactic_Psychic_Table_Tennis_3000/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Hypergalactic Psychic Table Tennis 3000",id:"kmz12sag5",active:!1,weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",active:!1,label:"Nuke Zone",link:["https://nuke.zone/?utm_source=shell_shockers_houseads&utm_medium=referral"],id:"kmz16o7h6",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",link:["https://raid.land/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Raid Land",active:!1,id:"kmz18sjd7",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://slashycamp.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,label:"Slashy Camp",id:"kmz19yp68",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://slashycamp.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Slashy Camp",active:!1,id:"kmz1ap9b9",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://bluewizard.com/slayawaycamp-free-to-slay/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Slayaway Camp",active:!1,id:"kmz1bycra",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://bluewizard.com/slayawaycamp-free-to-slay/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Slayaway Camp",active:!1,id:"kmz1cyblb",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",active:!1,link:["https://shop.stormcrow.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Shop Storm Crow",id:"kmz1evxgc",weighted:!1,hideOnCG:!1,linksTo:"link"},{link:["https://shop.stormcrow.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Shop Storm Crow",active:!1,imageExt:".jpg",id:"kmz1fpoxd",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://shop.stormcrow.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],label:"Shop Storm Crow",active:!1,id:"kmz1gms0e",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",link:["https://shop.stormcrow.com/?utm_source=shell_shockers_houseads&utm_medium=referral"],active:!1,label:"Shop Storm Crow",id:"kmz1h7u4f",weighted:!1,hideOnCG:!1,linksTo:"link"},{label:"Headless",active:!1,link:["https://headless.gg/?utm_source=shell_shockers_houseads&utm_medium=referral"],imageExt:".jpg",id:"kp7h0zu8k",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Headless",link:["https://headless.gg/?utm_source=shell_shockers_houseads&utm_medium=referral"],imageExt:".jpg",id:"kp7h1ekxl",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,link:["https://store.steampowered.com/app/1255530/Nuke_Zone/?utm_source=ss-house-ads&utm_medium=referral&utm_campaign=next-fest-launch"],label:"Nuke Zone Next Fest",imageExt:".jpg",id:"kpzrnq8fm",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Nuke Zone Next Fest",link:["https://store.steampowered.com/app/1255530/Nuke_Zone/?utm_source=ss-house-ads&utm_medium=referral&utm_campaign=next-fest-launch"],imageExt:".jpg",id:"kpzro6wzn",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".jpg",label:"Nuke Zone Demo",link:["https://store.steampowered.com/app/1255530/Nuke_Zone/?utm_source=ss-house-ads&utm_medium=referral&utm_campaign=demo-june22"],active:!1,id:"kq88mifpo",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Nuke Zone Demo",link:["https://store.steampowered.com/app/1255530/Nuke_Zone/?utm_source=ss-house-ads&utm_medium=referral&utm_campaign=demo-june22"],imageExt:".jpg",id:"kq88n006p",weighted:!1,hideOnCG:!1,linksTo:"link"},{imageExt:".png",link:["https://apps.apple.com/app/apple-store/id1515978119?pt=118229234&ct=ss-house-ad&mt=8"],active:!1,label:"SS Mobile iOS",id:"krdzwhajq",weighted:!1,hideOnCG:!1,linksTo:"link"},{active:!1,label:"Cubic Castles",imageExt:".png",link:["https://castles.cc/?utm_source=shell_shockers_houseads&utm_medium=referral"],id:"ktn7rc9jr",weighted:!1,hideOnCG:!1,linksTo:"link"}],houseAdPercentChance:100,specialItemsTag:"May25",featuredSocialMedia:"Instagram",premFeatured:"premFeatOne",smHouseAds:[{ad:"badEgg",weighted:0}],shellLogo:[{active:!1,label:"Christmas",imageExt:".svg",id:"lpn8kxv40",weighted:!1,hideOnCG:!1},{imageExt:".svg",label:"Egg Org 2",active:!1,id:"luhi1wp12",weighted:!1,hideOnCG:!1},{imageExt:".svg",label:"Halloween",id:"m1qxbsyk2",weighted:!1,hideOnCG:!1,active:!1}]};export{e as HousePromo};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
const t=[{active:!0,link:"https://www.youtube.com/watch?v=6z9KKTk4kdw",desc:"",imageExt:"",id:"6z9KKTk4kdw",author:"TheKingmanYT",title:"1v1ing THE GOAT KT_VEI",externalImg:"https://i.ytimg.com/vi/6z9KKTk4kdw/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=Jn1cT1PEi0s",desc:"",imageExt:"",id:"Jn1cT1PEi0s",author:"Meep ",title:"10 Kill Streak /w Ancient Guns! | New Update",externalImg:"https://i.ytimg.com/vi/Jn1cT1PEi0s/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=iKx-xz5T_T8",desc:"",imageExt:"",id:"iKx-xz5T_T8",author:"Bubbleaxe",title:"WALKIN | Montage",externalImg:"https://i.ytimg.com/vi/iKx-xz5T_T8/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=7afD9QxU_vA",desc:"",imageExt:"",id:"7afD9QxU_vA",author:"Godric Gryffindor",title:"I Play a Game of BINGO!",externalImg:"https://i.ytimg.com/vi/7afD9QxU_vA/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=I7MEVsuYVkY",desc:"",imageExt:"",id:"I7MEVsuYVkY",author:"Galactic",title:"Smooth Lofi gameplay w/Phoenix Yt",externalImg:"https://i.ytimg.com/vi/I7MEVsuYVkY/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=LrfhRAK-nDs",desc:"",imageExt:"",id:"LrfhRAK-nDs",author:"Meep ",title:"10 KS w/ Golden Dragon Guns!",externalImg:"https://i.ytimg.com/vi/LrfhRAK-nDs/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=S3pbYxiDl2E",desc:"",imageExt:"",id:"S3pbYxiDl2E",author:"The Rogue Contractor ",title:" \u{1F3AF}Snipes & Clutch Plays & 200 IQ Shots\u{1F525}",externalImg:"https://i.ytimg.com/vi/S3pbYxiDl2E/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=Xs5OLOpfHcc",desc:"",imageExt:"",id:"Xs5OLOpfHcc",author:"Clingzter ",title:"The Eggstra Value Pack is LOADED!!",externalImg:"https://i.ytimg.com/vi/Xs5OLOpfHcc/hqdefault.jpg"}];export{t as ShellYoutube};
|
|
3
|
+
const t=[{active:!0,link:"https://www.youtube.com/watch?v=-Pj2j-PC020",desc:"",imageExt:"",id:"-Pj2j-PC020",author:"Shell League",title:"CRAZY KotC match Highlights",externalImg:"https://i.ytimg.com/vi/-Pj2j-PC020/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=6z9KKTk4kdw",desc:"",imageExt:"",id:"6z9KKTk4kdw",author:"TheKingmanYT",title:"1v1ing THE GOAT KT_VEI",externalImg:"https://i.ytimg.com/vi/6z9KKTk4kdw/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=Jn1cT1PEi0s",desc:"",imageExt:"",id:"Jn1cT1PEi0s",author:"Meep ",title:"10 Kill Streak /w Ancient Guns! | New Update",externalImg:"https://i.ytimg.com/vi/Jn1cT1PEi0s/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=iKx-xz5T_T8",desc:"",imageExt:"",id:"iKx-xz5T_T8",author:"Bubbleaxe",title:"WALKIN | Montage",externalImg:"https://i.ytimg.com/vi/iKx-xz5T_T8/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=7afD9QxU_vA",desc:"",imageExt:"",id:"7afD9QxU_vA",author:"Godric Gryffindor",title:"I Play a Game of BINGO!",externalImg:"https://i.ytimg.com/vi/7afD9QxU_vA/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=I7MEVsuYVkY",desc:"",imageExt:"",id:"I7MEVsuYVkY",author:"Galactic",title:"Smooth Lofi gameplay w/Phoenix Yt",externalImg:"https://i.ytimg.com/vi/I7MEVsuYVkY/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=LrfhRAK-nDs",desc:"",imageExt:"",id:"LrfhRAK-nDs",author:"Meep ",title:"10 KS w/ Golden Dragon Guns!",externalImg:"https://i.ytimg.com/vi/LrfhRAK-nDs/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=S3pbYxiDl2E",desc:"",imageExt:"",id:"S3pbYxiDl2E",author:"The Rogue Contractor ",title:" \u{1F3AF}Snipes & Clutch Plays & 200 IQ Shots\u{1F525}",externalImg:"https://i.ytimg.com/vi/S3pbYxiDl2E/hqdefault.jpg"},{active:!0,link:"https://www.youtube.com/watch?v=Xs5OLOpfHcc",desc:"",imageExt:"",id:"Xs5OLOpfHcc",author:"Clingzter ",title:"The Eggstra Value Pack is LOADED!!",externalImg:"https://i.ytimg.com/vi/Xs5OLOpfHcc/hqdefault.jpg"}];export{t as ShellYoutube};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import o from"../comm/CommOut.js";import{CommCode as
|
|
3
|
+
import o from"../comm/CommOut.js";import{CommCode as u}from"../constants/codes.js";class r{constructor(e){this.uniqueId=e}check(e){return typeof this.uniqueId=="string"&&e.game.isGameOwner&&Object.values(e.players).find(t=>t.uniqueId===this.uniqueId)}execute(e){const t=o.getBuffer();t.packInt8(u.bootPlayer),t.packString(this.uniqueId),t.send(e.game.socket)}}var a=r;export{r as BootPlayerDispatch,a as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import s from"../comm/CommOut.js";import{CommCode as i}from"../constants/codes.js";class a{constructor(t,e=!1){this.msg=t,this.noLimit=e}check(t){return!(typeof this.msg!="string"||this.msg.length<1||this.msg.length>64||!t.state.
|
|
3
|
+
import s from"../comm/CommOut.js";import{CommCode as i}from"../constants/codes.js";class a{constructor(t,e=!1){this.msg=t,this.noLimit=e}check(t){return!(typeof this.msg!="string"||this.msg.length<1||this.msg.length>64||!t.state.inGame||t.lastChatTime+3e3>Date.now()&&!this.noLimit||!t.game.isPrivate&&!t.account.emailVerified&&t.account.accountAge<1e3*60*60*12)}execute(t){const e=s.getBuffer();e.packInt8(i.chat),e.packString(this.msg),e.send(t.game.socket),t.lastChatTime=Date.now()}}var c=a;export{a as ChatDispatch,c as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import r from"../comm/CommOut.js";import{CommCode as n}from"../constants/codes.js";class a{constructor(e,t={}){typeof e=="number"?this.id=e:typeof e=="string"&&(this.name=e),this.reasons=[!!t.cheating,!!t.harassment,!!t.offensive,!!t.other],this.reasons.includes(!0)||(this.reasons[3]=!0);for(let s=0;s<this.reasons.length;s++)this.reasons[s]===!0&&(this.reasonInt|=1<<s)}check(e){if(!e.state.
|
|
3
|
+
import r from"../comm/CommOut.js";import{CommCode as n}from"../constants/codes.js";class a{constructor(e,t={}){typeof e=="number"?this.id=e:typeof e=="string"&&(this.name=e),this.reasons=[!!t.cheating,!!t.harassment,!!t.offensive,!!t.other],this.reasons.includes(!0)||(this.reasons[3]=!0);for(let s=0;s<this.reasons.length;s++)this.reasons[s]===!0&&(this.reasonInt|=1<<s)}check(e){if(!e.state.inGame)return!1;let t;return this.id?t=e.players[this.id.toString()]:this.name&&(t=e.players.find(s=>s.name===this.name)),!!t}execute(e){let t;this.id?t=e.players[this.id.toString()]:this.name&&(t=e.players.find(i=>i.name===this.name));const s=r.getBuffer();s.packInt8(n.reportPlayer),s.packString(t.uniqueId),s.packInt8(this.reasonInt),s.send(e.game.socket)}}var l=a;export{a as ReportPlayerDispatch,l as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import{findItemById as t,GunList as l,ItemTypes as i}from"../constants/index.js";import f from"../comm/CommOut.js";import{CommCode as o}from"../constants/codes.js";const I=n=>t(n)&&t(n).unlock==="default",m=(n,e)=>t(n)&&t(n).item_type_id===e;class u{constructor(e){this.changes={classIdx:e.gunId,hatId:e.hatId,stampId:e.stampId,grenadeId:e.grenadeId,meleeId:e.meleeId,colorIdx:e.eggColor,primaryId:e.primaryIds,secondaryId:e.secondaryIds},this.changes=Object.fromEntries(Object.entries(this.changes).filter(([,s])=>!!s))}check(e){if(e.me.playing)return!1;const s=this.changes;if(s.colorIdx&&s.colorIdx>=7&&!e.account.vip||s.colorIdx&&s.colorIdx>=14||m(s.hatId,i.Hat)&&!I(s.hatId)&&!e.account.ownedItemIds.includes(s.hatId)||m(s.stampId,i.Stamp)&&!I(s.stampId)&&!e.account.ownedItemIds.includes(s.stampId)||m(s.grenadeId,i.Grenade)&&!I(s.grenadeId)&&!e.account.ownedItemIds.includes(s.grenadeId)||m(s.meleeId,i.Melee)&&!I(s.meleeId)&&!e.account.ownedItemIds.includes(s.meleeId)||typeof s.classIdx=="number"&&s.classIdx>6||s.classIdx<0)return!1;if(this.changes.primaryId)for(let c=0;c<7;c++){const d=this.changes.primaryId[c];if(!m(d,i.Primary)||!I(d)&&!e.account.ownedItemIds.includes(d))return!1}if(this.changes.secondaryId)for(let c=0;c<7;c++){const d=this.changes.secondaryId[c];if(!m(d,i.Secondary)||!I(d)&&!e.account.ownedItemIds.includes(d))return!1}return!0}execute(e){e.me&&this.changes.classIdx&&this.changes.classIdx!==e.me.selectedGun&&(e.me.weapons[0]=new l[this.changes.classIdx]),e.state.weaponIdx=this.changes.classIdx||e.state.weaponIdx;const s={...e.account.loadout,...this.changes},c=e.api.queryServices({cmd:"saveLoadout",save:!0,firebaseId:e.account.firebaseId,sessionId:e.account.sessionId,loadout:s});e.account.loadout=s,e.me&&c.then(()=>{if(e.state.
|
|
3
|
+
import{findItemById as t,GunList as l,ItemTypes as i}from"../constants/index.js";import f from"../comm/CommOut.js";import{CommCode as o}from"../constants/codes.js";const I=n=>t(n)&&t(n).unlock==="default",m=(n,e)=>t(n)&&t(n).item_type_id===e;class u{constructor(e){this.changes={classIdx:e.gunId,hatId:e.hatId,stampId:e.stampId,grenadeId:e.grenadeId,meleeId:e.meleeId,colorIdx:e.eggColor,primaryId:e.primaryIds,secondaryId:e.secondaryIds},this.changes=Object.fromEntries(Object.entries(this.changes).filter(([,s])=>!!s))}check(e){if(e.me.playing)return!1;const s=this.changes;if(s.colorIdx&&s.colorIdx>=7&&!e.account.vip||s.colorIdx&&s.colorIdx>=14||m(s.hatId,i.Hat)&&!I(s.hatId)&&!e.account.ownedItemIds.includes(s.hatId)||m(s.stampId,i.Stamp)&&!I(s.stampId)&&!e.account.ownedItemIds.includes(s.stampId)||m(s.grenadeId,i.Grenade)&&!I(s.grenadeId)&&!e.account.ownedItemIds.includes(s.grenadeId)||m(s.meleeId,i.Melee)&&!I(s.meleeId)&&!e.account.ownedItemIds.includes(s.meleeId)||typeof s.classIdx=="number"&&s.classIdx>6||s.classIdx<0)return!1;if(this.changes.primaryId)for(let c=0;c<7;c++){const d=this.changes.primaryId[c];if(!m(d,i.Primary)||!I(d)&&!e.account.ownedItemIds.includes(d))return!1}if(this.changes.secondaryId)for(let c=0;c<7;c++){const d=this.changes.secondaryId[c];if(!m(d,i.Secondary)||!I(d)&&!e.account.ownedItemIds.includes(d))return!1}return!0}execute(e){e.me&&this.changes.classIdx&&this.changes.classIdx!==e.me.selectedGun&&(e.me.weapons[0]=new l[this.changes.classIdx]),e.state.weaponIdx=this.changes.classIdx||e.state.weaponIdx;const s={...e.account.loadout,...this.changes},c=e.api.queryServices({cmd:"saveLoadout",save:!0,firebaseId:e.account.firebaseId,sessionId:e.account.sessionId,loadout:s});e.account.loadout=s,e.me&&c.then(()=>{if(e.state.inGame){const a=f.getBuffer();a.packInt8(o.changeCharacter),a.packInt8(this.changes?.classIdx||e.me.selectedGun),a.send(e.game.socket)}const d=e.intents.includes(e.Intents.COSMETIC_DATA);Object.entries(this.changes).forEach(([a,r])=>{a==="classIdx"?e.me.selectedGun=r:a==="hatId"?e.me.character.hat=d?t(r):r:a==="stampId"?e.me.character.stamp=d?t(r):r:a==="grenadeId"?e.me.character.grenade=d?t(r):r:a==="meleeId"?e.me.character.melee=d?t(r):r:a==="colorIdx"?e.me.character.eggColor=r:a==="primaryId"?e.me.character.primaryGun=d?t(r[e.me.selectedGun]):r:a==="secondaryId"&&(e.me.character.secondaryGun=d?t(r[e.me.selectedGun]):r)})})}}var y=u;export{u as SaveLoadoutDispatch,y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import n from"../comm/CommOut.js";import{CommCode as i}from"../constants/codes.js";class f{check(e){if(!e.state.
|
|
3
|
+
import n from"../comm/CommOut.js";import{CommCode as i}from"../constants/codes.js";class f{check(e){if(!e.state.inGame||e.me.playing||e.game.gameModeId===0)return!1;if(e.game.isPrivate)return!e.game.options.noTeamChange;const t=e.players,r=e.me.team,m=t.filter(a=>a.team===r).length,s=t.filter(a=>a.team!==r).length;return!(s>m||m===s)}execute(e){const t=n.getBuffer();t.packInt8(i.switchTeam),t.send(e.game.socket)}}var u=f;export{f as SwitchTeamDispatch,u as default};
|
package/dist/matchmaker.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
import h from"./api.js";import{GameModes as r,PlayTypes as c,ProxiesEnabled as a}from"./constants/index.js";import{validate as d}from"./wasm/wrapper.js";import f from"./socket.js";class g{connected=!1;onceConnected=[];proxy=null;sessionId="";onListeners=new Map;onceListeners=new Map;#e=!1;constructor(
|
|
3
|
+
import h from"./api.js";import{GameModes as r,PlayTypes as c,ProxiesEnabled as a}from"./constants/index.js";import{validate as d}from"./wasm/wrapper.js";import f from"./socket.js";class g{connected=!1;onceConnected=[];regionList=[];proxy=null;sessionId="";onListeners=new Map;onceListeners=new Map;#e=!1;constructor(i={}){i.instance||(i.instance="shellshock.io"),i.protocol||(i.protocol="wss"),i.api?this.api=i.api:this.api=new h({instance:i.instance,protocol:i.protocol,proxy:i.proxy}),i.sessionId||i.noLogin?this.sessionId=i.sessionId:this.#o(),i.proxy&&!a?this.#i("proxies do not work and hence are not supported in the browser"):i.proxy&&(this.proxy=i.proxy),this.#t(i.instance,i.protocol,i.noLogin)}async#t(i,s,e){const t=async()=>{try{this.ws=new f(`${s}://${i}/matchmaker/`,this.proxy),this.ws.onerror=async o=>(this.#i(o),await new Promise(n=>setTimeout(n,100)),await t())}catch{await new Promise(o=>setTimeout(o,100)),await t()}};await t(),this.ws.onopen=()=>{this.connected=!0,this.ws.onerror=null,(this.sessionId||e)&&this.onceConnected.forEach(o=>o())},this.ws.onmessage=o=>{const n=JSON.parse(o.data);n.command==="validateUUID"&&this.ws.send(JSON.stringify({command:"validateUUID",hash:d(n.uuid)})),this.#s("msg",n)},this.ws.onclose=()=>{this.connected=!1,this.#e||this.#t(i)}}async#o(){const i=await this.api.loginAnonymously();(!i||typeof i=="string")&&this.#s("authFail",i),this.sessionId=i.sessionId,this.connected&&this.onceConnected.forEach(s=>s())}send(i){this.ws.send(JSON.stringify(i))}async waitForConnect(){return new Promise(i=>{this.connected?i():this.onceConnected.push(i)})}async getRegions(){await this.waitForConnect();const i=this;return new Promise(s=>{const e=t=>{t.command==="regionList"&&(this.regionList=t.regionList,this.off("msg",e),s(t.regionList))};this.on("msg",e),this.ws.onerror=t=>i.#i("failed to get regions",t),this.ws.send(JSON.stringify({command:"regionList"}))})}async findPublicGame(i={}){return await this.waitForConnect(),!i.region&&!this.regionList&&!this.regionList.length?this.#i("pass a region to createPrivateGame or call getRegions() for a random one"):(i.region||(opts.region=this.getRandomRegion()),this.regionList.length&&!this.regionList.find(s=>s.id===i.region)?this.#i("did not find region in regionList"):i.mode?typeof r[i.mode]!="number"?this.#i("invalid mode passed to findPublicGame, see GameModes for a list"):new Promise(s=>{const e={command:"findGame",region:i.region,playType:c.joinPublic,gameType:r[i.mode],sessionId:this.sessionId},t=o=>{o.command==="gameFound"&&(this.off("msg",t),s(o))};this.on("msg",t),this.ws.send(JSON.stringify(e))}):this.#i("pass a mode to findPublicGame"))}getRandomRegion(){if(!this.regionList&&!this.regionList.length)this.#i("use <Matchmaker>.getRegions() before getRandomRegion()");else return this.regionList[Math.floor(Math.random()*this.regionList.length)].id}getRandomGameMode(){const i=Object.keys(r);return i[Math.floor(Math.random()*i.length)]}close(){this.#e=!0,this.connected=!1,this.ws.close()}on(i,s){this.onListeners.has(i)||this.onListeners.set(i,[]),this.onListeners.get(i).push(s)}once(i,s){this.onceListeners.has(i)||this.onceListeners.set(i,[]),this.onceListeners.get(i).push(s)}off(i,s){this.onListeners.has(i)&&this.onListeners.set(i,this.onListeners.get(i).filter(e=>e!==s)),this.onceListeners.has(i)&&this.onceListeners.set(i,this.onceListeners.get(i).filter(e=>e!==s))}#s(i,...s){this.onListeners.has(i)&&this.onListeners.get(i).forEach(e=>e(...s)),this.onceListeners.has(i)&&(this.onceListeners.get(i).forEach(e=>e(...s)),this.onceListeners.delete(i))}#i(i){if(this.onListeners.has("error"))this.#s("error",i);else throw i}}var y=g;export{g as Matchmaker,y as default};
|
package/dist/types/api.d.ts
CHANGED
package/dist/types/bot.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { Character, GamePlayer, Position } from './bot/GamePlayer';
|
|
|
16
16
|
import { Challenge } from './constants/challenges';
|
|
17
17
|
import { AnyGun } from './constants/guns';
|
|
18
18
|
import { Map } from './constants/maps';
|
|
19
|
+
import { Item } from './constants/items';
|
|
19
20
|
import { ADispatch } from './dispatches/index';
|
|
20
21
|
import { NodeList } from './pathing/mapnode';
|
|
21
22
|
import { API } from './api';
|
|
@@ -228,6 +229,7 @@ export interface BufferFrame {
|
|
|
228
229
|
export interface BotState {
|
|
229
230
|
name: string;
|
|
230
231
|
weaponIdx: number;
|
|
232
|
+
inGame: boolean;
|
|
231
233
|
reloading: boolean;
|
|
232
234
|
swappingGun: boolean;
|
|
233
235
|
usingMelee: boolean;
|
|
@@ -295,6 +297,7 @@ export class Bot {
|
|
|
295
297
|
on(event: 'authSuccess', cb: (account: Account) => void): void;
|
|
296
298
|
on(event: 'balanceUpdate', cb: (oldBalance: number, newBalance: number) => void): void;
|
|
297
299
|
on(event: 'banned', cb: (banRemaining: string) => void): void;
|
|
300
|
+
on(event: 'botJoined', cb: (botPlayer: GamePlayer) => void): void;
|
|
298
301
|
on(event: 'chat', cb: (player: GamePlayer | undefined, message: string, flags: number) => void): void;
|
|
299
302
|
on(event: 'close', cb: (code: number) => void): void;
|
|
300
303
|
on(event: 'collectAmmo', cb: (player: GamePlayer, weapon: AnyGun) => void): void;
|
|
@@ -305,7 +308,7 @@ export class Bot {
|
|
|
305
308
|
on(event: 'gameReset', cb: () => void): void;
|
|
306
309
|
on(event: 'gameStateChange', cb: (oldState: Game, newState: Game) => void): void;
|
|
307
310
|
on(event: 'grenadeExploded', cb: (item: Item | number, pos: Position, damage: number, radius: number) => void): void;
|
|
308
|
-
on(event: 'leave', cb: () => void): void;
|
|
311
|
+
on(event: 'leave', cb: (closeCode: number) => void): void;
|
|
309
312
|
on(event: 'packet', cb: (packet: ArrayBuffer) => void): void;
|
|
310
313
|
on(event: 'pingUpdate', cb: (oldPing: number, newPing: number) => void): void;
|
|
311
314
|
on(event: 'playerBeginStreak', cb: (player: GamePlayer, streak: number) => void): void;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function coords(yaw: number, pitch: number): string;
|
|
2
|
+
export declare function process(shellshockJS: string, dateToUse?: number): Promise<string>;
|
|
3
|
+
export declare function validate(uuid: string): string;
|