mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Latency improve (#1244)
* Update ChatBot.cs * Update McClient.cs * Update ChatBot.cs * Update ChatBot.cs * Update McClient.cs
This commit is contained in:
parent
02e294e3e8
commit
de9dcd6d77
2 changed files with 30 additions and 2 deletions
|
|
@ -230,6 +230,15 @@ namespace MinecraftClient
|
||||||
/// <param name="latency">Latency.</param>
|
/// <param name="latency">Latency.</param>
|
||||||
public virtual void OnLatencyUpdate(string playername, Guid uuid, int latency) { }
|
public virtual void OnLatencyUpdate(string playername, Guid uuid, int latency) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the Latency has been updated for a player
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity">Entity</param>
|
||||||
|
/// <param name="playername">Player Name</param>
|
||||||
|
/// <param name="uuid">Player UUID</param>
|
||||||
|
/// <param name="latency">Latency.</param>
|
||||||
|
public virtual void OnLatencyUpdate(Entity entity, string playername, Guid uuid, int latency) { }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a map was updated
|
/// Called when a map was updated
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -876,7 +885,7 @@ namespace MinecraftClient
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get all Entityes
|
/// Get all Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>All Entities</returns>
|
/// <returns>All Entities</returns>
|
||||||
protected Dictionary<int, Entity> GetEntities()
|
protected Dictionary<int, Entity> GetEntities()
|
||||||
|
|
@ -884,6 +893,15 @@ namespace MinecraftClient
|
||||||
return Handler.GetEntities();
|
return Handler.GetEntities();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get all players Latency
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>All players latency</returns>
|
||||||
|
protected Dictionary<string, int> GetPlayersLatency()
|
||||||
|
{
|
||||||
|
return Handler.GetPlayersLatency();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the current location of the player (Feets location)
|
/// Get the current location of the player (Feets location)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -780,7 +780,7 @@ namespace MinecraftClient
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get all Entityes
|
/// Get all Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>All Entities</returns>
|
/// <returns>All Entities</returns>
|
||||||
public Dictionary<int, Entity> GetEntities()
|
public Dictionary<int, Entity> GetEntities()
|
||||||
|
|
@ -788,6 +788,15 @@ namespace MinecraftClient
|
||||||
return entities;
|
return entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get all players latency
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>All players latency</returns>
|
||||||
|
public Dictionary<string, int> GetPlayersLatency()
|
||||||
|
{
|
||||||
|
return playersLatency;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get client player's inventory items
|
/// Get client player's inventory items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -2082,6 +2091,7 @@ namespace MinecraftClient
|
||||||
if (ent.Value.UUID == uuid && ent.Value.Name == playerName)
|
if (ent.Value.UUID == uuid && ent.Value.Name == playerName)
|
||||||
{
|
{
|
||||||
ent.Value.Latency = latency;
|
ent.Value.Latency = latency;
|
||||||
|
DispatchBotEvent(bot => bot.OnLatencyUpdate(ent.Value, playerName, uuid, latency));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue