TheGrandmother / MUD

The worlds lames mud :/
1 stars 1 forks source link

Re-add heartbeats! #26

Closed Chilinot closed 8 years ago

Chilinot commented 8 years ago

We need to re add hearbeats to the game to detect all disconnects. Currently the game wont detect when a player refreshes the webpage or simply closes the browser/tab. This can be fixed by re-introducing heartbeats to the MUD.

TheGrandmother commented 8 years ago

I'll look into the possibility of having the interface maintain the connection when a refresh happens.

Chilinot commented 8 years ago

Heartbeats seem to be working in the server and the old client again. The commits can be found in the heartbeat branch :)

TheGrandmother commented 8 years ago

How does the heartbeat exchange look ?

Chilinot commented 8 years ago

Client sends heartbeats every 5 seconds. The server immediately responds to these messages.

If the server detects that a client has not sent any messages within at least 5*heartbeat-frequency (25 seconds) it assumes the connection is dead and kills it.

TheGrandmother commented 8 years ago

How does the heartbeat messages look ?

I propose we add a new rule that we must specify every new message thingy on the wiki as soon as we push them.

Chilinot commented 8 years ago

The heartbeats are the exact same messages that was used earlier. I just made the server and client send them again.

Structure: receiver;sender;HEARTBEAT;null;timestamp;

receiver;sender;HEARTBEAT_REPLY;null;timestamp;

TheGrandmother commented 8 years ago

Fixed! 7fca376eba7646337b1b5d633ea3614f85b312e3