laverdet / screepsmod-inspector

isolated-vm inspector support for screeps
6 stars 2 forks source link

Setting unlimited cpu limit #2

Open Ramblurr opened 6 years ago

Ramblurr commented 6 years ago

If I let a breakpoint sit for more than a couple seconds, the ivm is killed..

"Script execution timed out ungracefully, restarting virtual machine"

For this mod to work effectively it should set the user's cpu to Infinity.

Here are some things I tried to make this work:

  1. I edited the cpu value of my user (using the db cli) to be Infinity in the database, this ended up being saved in db.json as null, and my user code was never run.

    storage.db['users'].update({ username: 'my-user' },{ $set: { cpu: Infinity }})

  2. I tried setting it to Number.MAX_SAFE_INTEGER, but this resulted in this error: screenshot from 2018-05-03 18-36-26

  3. Finally I set a large number like 9999999999, and this persisted to the db, however the script was still killed after sitting on a breakpoint for a few seconds: screenshot from 2018-05-03 18-32-19

laverdet commented 6 years ago

I don't think you are running my modifications to screeps/driver. Be sure to do cd node_modules/\@screeps/driver; ../../webpack/bin/webpack.js after applying the changes of the PR.

Ramblurr commented 6 years ago

You're right. I hadn't run the webpack build after applying the patch.

Now, it is working.. I can let a brkpoint sit for more than a few seconds. However when I resume execution, the console spits out the followine..but it doesn't seem to affect anything.

By the way I manually applied the changes of the patch because the PR is out of date (specifically user-vm.js has changed).

Thanks!