daboross / srv

Terminal User Interface for the Screeps programming MMO
MIT License
7 stars 2 forks source link

srv broken on official servers #1

Open lf- opened 4 years ago

lf- commented 4 years ago

To reproduce:

use srv to log in

Observed behaviour:

[00:17:15][WARN] screeps_api::websocket::parsing: unparsed data in screeps typed channel update: 1.decorations
[00:17:15][ERROR] srv::net: Error occurred: handling room update for shard2:E56N7: creating 5f014d486dee62141ea49979 with data {"_id":"5f014d486dee62141ea49979","hits":215000,"hitsMax":250000,"nextDecayTime":25859020,"notifyWhenAttacked":true,"room":"E56N7","store":{"energy":430},"storeCapacity":2000,"type":"container","x":26,"y":16}: missing field `energyCapacity` (Context { context: "handling room update for shard2:E56N7", source: Context { context: "creating 5f014d486dee62141ea49979 with data {\"_id\":\"5f014d486dee62141ea49979\",\"hits\":215000,\"hitsMax\":250000,\"nextDecayTime\":25859020,\"notifyWhenAttacked\":true,\"room\":\"E56N7\",\"store\":{\"energy\":430},\"storeCapacity\":2000,\"type\":\"container\",\"x\":26,\"y\":16}", source: Error("missing field `energyCapacity`", line: 0, column: 0) } })
[00:17:15][ERROR] panic: thread 'unnamed' panicked at 'Error occurred: handling room update for shard2:E56N7: creating 5f014d486dee62141ea49979 with data {"_id":"5f014d486dee62141ea49979","hits":215000,"hitsMax":250000,"nextDecayTime":25859020,"notifyWhenAttacked":true,"room":"E56N7","store":{"energy":430},"storeCapacity":2000,"type":"container","x":26,"y":16}: missing field `energyCapacity` (Context { context: "handling room update for shard2:E56N7", source: Context { context: "creating 5f014d486dee62141ea49979 with data {\"_id\":\"5f014d486dee62141ea49979\",\"hits\":215000,\"hitsMax\":250000,\"nextDecayTime\":25859020,\"notifyWhenAttacked\":true,\"room\":\"E56N7\",\"store\":{\"energy\":430},\"storeCapacity\":2000,\"type\":\"container\",\"x\":26,\"y\":16}", source: Error("missing field `energyCapacity`", line: 0, column: 0) } })': src/net.rs:112
[00:17:23][ERROR] panic: thread 'main' panicked at 'already borrowed: BorrowMutError': /rustc/94d346360da50f159e0dc777dc9bc3c5b6b51a00/src/libcore/cell.rs:878

Also, there are some build issues, which I will file a PR to partially fix.

daboross commented 4 years ago

This looks like something that will need to be fixed in rust-screeps-api.

I think I have an old in-progress update on my hard disk which I started a while ago but never finished. I've got some free time, so I'd be down to either see if I can finish that today/tomorrow, or otherwise I'd upload the code if you want to see what you can do with it.

Would you be interested in fixing/updating screeps-game-api?

lf- commented 4 years ago

I had a lot of trouble trying to understand why some of the very strange compiler errors were happening given an intersection of wrong dependency versions and use of old preview functionality on a new compiler. I can poke at it I guess- depends on how much time I have in the near future.

daboross commented 4 years ago

Alright

I've got some experience upgrading/dealing with the weird future versions, and I know how annoying it can be to work with the old versions when all the docs point to the newer ones, so I can at least try to resolve those errors today. We'll see how it goes from there, I guess?

If you find time and end up inspired, fixing the login errors in rust-screeps-api shouldn't be too complicated. The logging is set up to complain about exactly what it finds wrong, and the solution usually ends up being either adding new fields to a few structs in rust-screeps-api, or making existing fields optional, and then just copying the JSON data from the logged warning/error in to make a new parsing test.

daboross commented 4 years ago

Alright - I've updated screeps-game-api and srv to the latest futures, as well as associated crates (tokio, hyper, etc.), and I've pushed all of the in-progress protocol updates to screeps-game-api.

There are still outdated protocol structs in screeps-game-api, so it isn't fully working. I probably won't be fixing those anytime soon. However, all the dependency issues should be resolved.

I've also written up some notes on doing the protocol updates at https://github.com/daboross/rust-screeps-api/blob/master/CONTRIBUTING.md, if you're interested in getting it running with the latest official server.