mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +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>
|
||||
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>
|
||||
/// Called when a map was updated
|
||||
/// </summary>
|
||||
|
|
@ -876,7 +885,7 @@ namespace MinecraftClient
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all Entityes
|
||||
/// Get all Entities
|
||||
/// </summary>
|
||||
/// <returns>All Entities</returns>
|
||||
protected Dictionary<int, Entity> GetEntities()
|
||||
|
|
@ -884,6 +893,15 @@ namespace MinecraftClient
|
|||
return Handler.GetEntities();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all players Latency
|
||||
/// </summary>
|
||||
/// <returns>All players latency</returns>
|
||||
protected Dictionary<string, int> GetPlayersLatency()
|
||||
{
|
||||
return Handler.GetPlayersLatency();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the current location of the player (Feets location)
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -780,7 +780,7 @@ namespace MinecraftClient
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all Entityes
|
||||
/// Get all Entities
|
||||
/// </summary>
|
||||
/// <returns>All Entities</returns>
|
||||
public Dictionary<int, Entity> GetEntities()
|
||||
|
|
@ -788,6 +788,15 @@ namespace MinecraftClient
|
|||
return entities;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all players latency
|
||||
/// </summary>
|
||||
/// <returns>All players latency</returns>
|
||||
public Dictionary<string, int> GetPlayersLatency()
|
||||
{
|
||||
return playersLatency;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get client player's inventory items
|
||||
/// </summary>
|
||||
|
|
@ -2082,6 +2091,7 @@ namespace MinecraftClient
|
|||
if (ent.Value.UUID == uuid && ent.Value.Name == playerName)
|
||||
{
|
||||
ent.Value.Latency = latency;
|
||||
DispatchBotEvent(bot => bot.OnLatencyUpdate(ent.Value, playerName, uuid, latency));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue