You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 13, 2020. It is now read-only.
Hi, I saw in the code, that it looks like it should be possible to call setTickRate from the client console:
config.engine.on('playerSandbox',function(sandbox,userID){sandbox.setTickRate=function(value){if(!value)returnsandbox.console.log('Value required')if(!config.auth){returnsandbox.console.log(`screepsmod-auth is required to set tick rate from player console.`)}if(!config.auth.getUser){returnsandbox.console.log(`screepsmod-auth is outdated, please update screepsmod-auth`)}config.auth.getUser({_id: userID}).then(user=>{if(user.hasGroup('admin')){pubsub.publish('setTickRate',value)sandbox.console.log(`Tick rate set to ${value}ms`)}else{sandbox.console.log(`Unauthorized. Only Admins can set tick rate.`)}})}sandbox.getTickRate=function(){env.get('tickRate').then(value=>{sandbox.console.log(`Tick rate is ${value}ms`)})}})
However when I try to call setTickRate, the console says setTickRate is not defined.
How do I use this feature?
Would be awesome to set the tickRate from code for testing
The text was updated successfully, but these errors were encountered:
That is broken due to changes when IVM was introduced, it also relies on the undocumented group feature of screepsmod-auth, which I never finished developing and documenting :(
Currently not, IVM changes the sandbox in a way that makes this much harder to do. This kinda cheats and calls the DB directly from user code, which isn't allowed in IVM. It would need to set an intent then listen for it, adding a lot of extra complexity. You can still call it from CLI though.
Hi, I saw in the code, that it looks like it should be possible to call setTickRate from the client console:
However when I try to call
setTickRate
, the console sayssetTickRate is not defined
.How do I use this feature?
Would be awesome to set the tickRate from code for testing
The text was updated successfully, but these errors were encountered: