Add connection timeout using server keepalives

Vanilla client will consider that connection has been lost
when no server keepalive was received during the last 30 seconds.
This commit implements a similar mechanism in MCC. See #802
This commit is contained in:
ORelio 2019-09-15 17:01:53 +02:00
parent 1406c00abd
commit 877e50579d
4 changed files with 61 additions and 6 deletions

View file

@ -43,15 +43,20 @@ namespace MinecraftClient.Protocol
/// <param name="isJson">TRUE if the text is JSON-Encoded</param>
void OnTextReceived(string text, bool isJson);
/// <summary>
/// Called when receiving a connection keep-alive from the server
/// </summary>
void OnServerKeepAlive();
/// <summary>
/// Called when an inventory is opened
/// </summary>
void onInventoryOpen(Inventory inventory);
void OnInventoryOpen(Inventory inventory);
/// <summary>
/// Called when an inventory is closed
/// </summary>
void onInventoryClose(byte inventoryID);
void OnInventoryClose(byte inventoryID);
/// <summary>
/// Called when the player respawns, which happens on login, respawn and world change.