server
server copied to clipboard
Issue/#786 send player update on disconnect
This should let the client more accurately determine when a player has disconnected. It could also be used to rewrite the player state determination to be more accurate (for displaying swords and blocking certain actions).
The state names could change if someone has better ideas. I just didn't want to make them too long since they will already add quite a few bytes to the network traffic. We could save the most bytes by using integer codes, but I think it's ok to sacrifice some bytes to have a more expressive protocol.
Closes #786
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
ea2b7d3
) 94.61% compared to head (66287f9
) 96.68%.
:exclamation: Current head 66287f9 differs from pull request most recent head 76d7944. Consider uploading reports for the commit 76d7944 to get more accurate results
Additional details and impacted files
Files | Coverage Δ | |
---|---|---|
server/player_service.py | 99.21% <100.00%> (+2.10%) |
:arrow_up: |
server/players.py | 100.00% <100.00%> (ø) |
Yea the state should always be there. If it happens again in future testing we'll need to look in the server logs to see what's going on as the contents of the messages is logged there.
Any updates on that? I am missing this feature =)
I can take another look at this. I think the main thing for me is I didn't like the state names and I am not quite comfortable with exposing the internal state over the protocol. But we might be able to start with just two state 'offline' and 'online', then you will at least be able to tell when people disconnect.
As an update we are soon going to turn on always-on for the irc client to facilitate offline messages. This will make state tracking using the irc server much harder so it would be nice if something like this could be added.
Tested on the test server and this works for me