mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
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:
parent
1406c00abd
commit
877e50579d
4 changed files with 61 additions and 6 deletions
|
|
@ -185,6 +185,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
{
|
||||
case PacketIncomingType.KeepAlive:
|
||||
SendPacket(PacketOutgoingType.KeepAlive, packetData);
|
||||
handler.OnServerKeepAlive();
|
||||
break;
|
||||
case PacketIncomingType.JoinGame:
|
||||
handler.OnGameJoined();
|
||||
|
|
@ -481,7 +482,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
byte slots = dataTypes.ReadNextByte(packetData);
|
||||
Inventory inventory = new Inventory(windowID, inventoryType, title, slots);
|
||||
|
||||
handler.onInventoryOpen(inventory);
|
||||
handler.OnInventoryOpen(inventory);
|
||||
}
|
||||
break;
|
||||
case PacketIncomingType.CloseWindow:
|
||||
|
|
@ -489,7 +490,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
{
|
||||
byte windowID = dataTypes.ReadNextByte(packetData);
|
||||
|
||||
handler.onInventoryClose(windowID);
|
||||
handler.OnInventoryClose(windowID);
|
||||
}
|
||||
break;
|
||||
case PacketIncomingType.WindowItems:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue