Code Revision Number
-
Hi,
I have seen a code revision number in the private server database. It would be nice if this number would be exposed to the sandbox, to make it possible to recognize a new code upload in game. (to reset caches, compare cpu usage and stuff like that)
Thanks
W4rl0ck
-
I'd love to see how high I've racked up this number.
Since we got the following things:
- Game.gcl
- Game.resources
- Game.cpu
It might be interesting to bundle the "user" side of the scripts in Game.user
- Game.user.gcl - Old Game.gcl
- Game.user.resources - Old Game.resources
- Game.user.cpu - Old Game.cpu
- Game.user.name
- Game.user.tickOfBirth ( if available )
- Game.user.power (missing in resources, if it's added there that's fine too)
- Game.user.code
- revision
- activationTick
This would consolidate the loose dangeling bits a littlebit.
-
Add Game.user.respawn (last tick the user was respawned)
It would give you how long this colony had been alive (instead of Member since length)
-
You can get the same results with grunt.
http://docs.screeps.com/contributed/advanced_grunt.html#Automatic-Versioning
-
yeah I'm currently using the webpack defines plugin ( https://webpack.js.org/plugins/define-plugin/ ) but having the information directly from the game object would also make it possible to track changes done in the ingame editor.
-
I monitor when require.timestamp changes to keep track of how long it's been since my last code commit.
I found out about it when looking through the engine code recently. You can see where it's set here:
https://github.com/screeps/engine/blob/master/src/game/game.js#L484
I haven't seen it mentioned in these forums or on the Screeps Slack, so I don't think many people know about it.
I'd love to have Dissi's suggestion implemented though, since I don't know the actual commit number I'm up to.