room.energyAvailable returns null on private server and spawn energy returns 0/0



  • Re: room.energyAvailable returns null on private server

    This issue still appears when I am running Server version 4.2.15 on Windows 11. Every time the server stops this issue appears - I have to reset the private server with system.resetAllData()

    Issue as logged on the github --> https://github.com/screeps/screeps/issues/116

    In the meantime, is there a command to gracefully shut down the server or something else I should be doing to avoid this problem in the first place?



  • Without resetting all data - a workout appears to be

    storage.db['rooms.objects'].update({ type: "spawn" }, { $set: { storeCapacityResource: { energy: 300 } } });
    storage.db['rooms.objects'].update({ type: "extension" }, { $set: { storeCapacityResource: { energy: 200 } } }); // or 50/100 depending on RCL
    storage.db['rooms.objects'].update({ type: "link" }, { $set: { storeCapacityResource: { energy: 800 } } });
    storage.db['rooms.objects'].update({ type: "tower" }, { $set: { storeCapacityResource: { energy: 1000 } } });