mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Added an option for custom timeout as requested in #1337.
This commit is contained in:
parent
e150bd569b
commit
42de4378e1
3 changed files with 14 additions and 8 deletions
|
|
@ -60,7 +60,7 @@ namespace MinecraftClient
|
|||
private float playerYaw;
|
||||
private float playerPitch;
|
||||
private double motionY;
|
||||
public enum MovementType { Sneak, Walk, Sprint}
|
||||
public enum MovementType { Sneak, Walk, Sprint }
|
||||
public int currentMovementSpeed = 4;
|
||||
private int sequenceId; // User for player block synchronization (Aka. digging, placing blocks, etc..)
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ namespace MinecraftClient
|
|||
{
|
||||
client = ProxyHandler.newTcpClient(host, port);
|
||||
client.ReceiveBufferSize = 1024 * 1024;
|
||||
client.ReceiveTimeout = 30000; // 30 seconds
|
||||
client.ReceiveTimeout = Settings.Timeout * 1000; // Default: 30 seconds
|
||||
handler = Protocol.ProtocolHandler.GetProtocolHandler(client, protocolversion, forgeInfo, this);
|
||||
Log.Info(Translations.Get("mcc.version_supported"));
|
||||
|
||||
|
|
@ -414,7 +414,7 @@ namespace MinecraftClient
|
|||
|
||||
lock (lastKeepAliveLock)
|
||||
{
|
||||
if (lastKeepAlive.AddSeconds(30) < DateTime.Now)
|
||||
if (lastKeepAlive.AddSeconds(Settings.Timeout) < DateTime.Now)
|
||||
{
|
||||
if (((CancellationToken)o!).IsCancellationRequested)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue