mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Add timeout for SpigotMC, Fix bot update
- We need to send a MC 1.6 ping first but SpigotMC ignore them - So a timeout is necessary. Too slow old servers might suffer - Fix bots not beign updated by Protocol16 (MC 1.4 to 1.6)
This commit is contained in:
parent
c8332eb845
commit
850ff7ad0b
1 changed files with 2 additions and 0 deletions
|
|
@ -55,6 +55,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
private bool Update()
|
private bool Update()
|
||||||
{
|
{
|
||||||
|
handler.OnUpdate();
|
||||||
bool connection_ok = true;
|
bool connection_ok = true;
|
||||||
while (c.Client.Available > 0 && connection_ok)
|
while (c.Client.Available > 0 && connection_ok)
|
||||||
{
|
{
|
||||||
|
|
@ -651,6 +652,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
TcpClient tcp = ProxyHandler.newTcpClient(host, port);
|
TcpClient tcp = ProxyHandler.newTcpClient(host, port);
|
||||||
|
tcp.ReceiveTimeout = 5000; //MC 1.7.2+ SpigotMC servers won't answer, so we need a reasonable timeout.
|
||||||
byte[] ping = new byte[2] { 0xfe, 0x01 };
|
byte[] ping = new byte[2] { 0xfe, 0x01 };
|
||||||
tcp.Client.Send(ping, SocketFlags.None);
|
tcp.Client.Send(ping, SocketFlags.None);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue