Open thmsndk opened 4 years ago
ags131 deobfuscating the client in #client-dev on slack, theese are all comments from ags :)
slightly deobfuscated snippet:
o = R.roomController ? R.roomController.level : 0;
if (!u.CONTROLLER_STRUCTURES[e.type][0] && (!R.roomController || o < 1 || R.roomController.user != e.user)) {
return false
}
if (t.length > u.CONTROLLER_STRUCTURES[e.type][o] && (t.sort(W(R.roomController))) {
t = _.take(t, u.CONTROLLER_STRUCTURES[e.type][o]),
}
return !_.contains(t, e))
looks like it automatically returns false if theres no controller, level < 1, or its not the owner of the room Haven't found the W function yet, but assuming its distance since its passed the controller
W = function (e) {
return e.pos && (e = e.pos),
function (t, o) {
return t.pos && (t = t.pos),
o.pos && (o = o.pos),
Math.max(Math.abs(t.x - e.x), Math.abs(t.y - e.y)) - Math.max(Math.abs(o.x - e.x), Math.abs(o.y - e.y))
}
Yep, returns a distance compare function So looks like it sorts by distance, removes the allowed number of items, then checks if its still in the list, if it is, then it disables
When your controller downgrades a structure gets disabled.![official-disabled-structures](https://user-images.githubusercontent.com/9084377/84683890-2c086b00-af38-11ea-84c3-89596d217bde.gif)
Extensions have an "off" property in the payload when they are disabled that is true no idea about towers,nukers, labs and factories
https://screeps.com/a/#!/room/shard3/E18S39
https://screeps.com/ptr/api/game/room-objects?shard=shard3&room[$in]=E18S39&room[$in]=E18S39
Now, nuker and factory is "easy" you can only have one and can compare with RCL. but what about towers and labs? what gets disabled?
disabled factory payload