Changes region allow to use IP addresses rather than names. Cancels out name spoofing.
This commit is contained in:
parent
640382d898
commit
c45696efb2
4 changed files with 49 additions and 24 deletions
|
|
@ -60,6 +60,25 @@ namespace TShockAPI
|
|||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds a player and gets IP as string
|
||||
/// </summary>
|
||||
/// <param name="msg">Player name</param>
|
||||
public static string GetPlayerIP(string playername)
|
||||
{
|
||||
foreach (TSPlayer player in TShock.Players)
|
||||
{
|
||||
if (player != null && player.Active)
|
||||
{
|
||||
if (playername.ToLower() == player.Name.ToLower())
|
||||
{
|
||||
return player.IP;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// It's a clamp function
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue