Remove deprecated GetUsers() and IDs method
Thanks @Enerdy
This commit is contained in:
parent
e5de43de36
commit
eda5ba312e
1 changed files with 1 additions and 47 deletions
|
|
@ -63,28 +63,6 @@ namespace TShockAPI
|
|||
return mess.Split(':')[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used for some places where a list of players might be used.
|
||||
/// </summary>
|
||||
/// <returns>String of players seperated by commas.</returns>
|
||||
[Obsolete("Use GetPlayers and manually create strings. This should never have been kept as far as actual functions go.")]
|
||||
public string GetPlayers()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (TSPlayer player in TShock.Players)
|
||||
{
|
||||
if (player != null && player.Active)
|
||||
{
|
||||
if (sb.Length != 0)
|
||||
{
|
||||
sb.Append(", ");
|
||||
}
|
||||
sb.Append(player.Name);
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of current players on the server
|
||||
/// </summary>
|
||||
|
|
@ -112,30 +90,6 @@ namespace TShockAPI
|
|||
return players;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used for some places where a list of players might be used.
|
||||
/// </summary>
|
||||
/// <returns>String of players and their id seperated by commas.</returns>
|
||||
[Obsolete("Use GetPlayers and manually create strings. This should never have been kept as far as actual functions go.")]
|
||||
public string GetPlayersWithIds()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (TSPlayer player in TShock.Players)
|
||||
{
|
||||
if (player != null && player.Active)
|
||||
{
|
||||
if (sb.Length != 0)
|
||||
{
|
||||
sb.Append(", ");
|
||||
}
|
||||
sb.Append(player.Name);
|
||||
string id = "(ID: " + Convert.ToString(TShock.Users.GetUserID(player.UserAccountName)) + ", IX:" + player.Index + ")";
|
||||
sb.Append(id);
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds a player and gets IP as string
|
||||
/// </summary>
|
||||
|
|
@ -697,7 +651,7 @@ namespace TShockAPI
|
|||
}
|
||||
|
||||
foo = foo.Replace("%map%", Main.worldName);
|
||||
foo = foo.Replace("%players%", GetPlayers());
|
||||
foo = foo.Replace("%players%", String.Join(",", GetPlayers(false)));
|
||||
Regex reg = new Regex("%\\s*(?<r>\\d{1,3})\\s*,\\s*(?<g>\\d{1,3})\\s*,\\s*(?<b>\\d{1,3})\\s*%");
|
||||
var matches = reg.Matches(foo);
|
||||
Color c = Color.White;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue