mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
https://github.com/ORelio/Minecraft-Console-Client/issues/625: add GetOnlinePlayersWithUUID() which allows to retrive a UUID <-> playerName relation
This commit is contained in:
parent
992003da8d
commit
33edd15c9b
4 changed files with 45 additions and 0 deletions
|
|
@ -274,6 +274,18 @@ namespace MinecraftClient
|
||||||
return base.GetOnlinePlayers();
|
return base.GetOnlinePlayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a dictionary of online player names and their corresponding UUID
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// dictionary of online player whereby
|
||||||
|
/// UUID represents the key
|
||||||
|
/// playername represents the value</returns>
|
||||||
|
new public Dictionary<string, string> GetOnlinePlayersWithUUID()
|
||||||
|
{
|
||||||
|
return base.GetOnlinePlayersWithUUID();
|
||||||
|
}
|
||||||
|
|
||||||
/* == Additional Methods useful for Script API == */
|
/* == Additional Methods useful for Script API == */
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -657,6 +657,18 @@ namespace MinecraftClient
|
||||||
return Handler.GetOnlinePlayers();
|
return Handler.GetOnlinePlayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a dictionary of online player names and their corresponding UUID
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// dictionary of online player whereby
|
||||||
|
/// UUID represents the key
|
||||||
|
/// playername represents the value</returns>
|
||||||
|
protected Dictionary<string, string> GetOnlinePlayersWithUUID()
|
||||||
|
{
|
||||||
|
return Handler.GetOnlinePlayersWithUUID();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers the given plugin channel for use by this chatbot.
|
/// Registers the given plugin channel for use by this chatbot.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -703,6 +703,26 @@ namespace MinecraftClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a dictionary of online player names and their corresponding UUID
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// dictionary of online player whereby
|
||||||
|
/// UUID represents the key
|
||||||
|
/// playername represents the value</returns>
|
||||||
|
public Dictionary<string, string> GetOnlinePlayersWithUUID()
|
||||||
|
{
|
||||||
|
Dictionary<string, string> uuid2Player = new Dictionary<string, string>();
|
||||||
|
lock (onlinePlayers)
|
||||||
|
{
|
||||||
|
foreach (Guid key in onlinePlayers.Keys)
|
||||||
|
{
|
||||||
|
uuid2Player.Add(key.ToString(), onlinePlayers[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return uuid2Player;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers the given plugin channel for the given bot.
|
/// Registers the given plugin channel for the given bot.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ namespace MinecraftClient.Protocol
|
||||||
string GetUserUUID();
|
string GetUserUUID();
|
||||||
string GetSessionID();
|
string GetSessionID();
|
||||||
string[] GetOnlinePlayers();
|
string[] GetOnlinePlayers();
|
||||||
|
Dictionary<string, string> GetOnlinePlayersWithUUID();
|
||||||
Location GetCurrentLocation();
|
Location GetCurrentLocation();
|
||||||
World GetWorld();
|
World GetWorld();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue