Added code to convey idea before I write all of it out, also added default config files, everything is subject to change
This commit is contained in:
parent
d0fe76090d
commit
bb2e9559f0
10 changed files with 102 additions and 2 deletions
|
|
@ -7,6 +7,8 @@ namespace TShockAPI
|
|||
{
|
||||
class Tools
|
||||
{
|
||||
private static List<Group> groups;
|
||||
|
||||
/// <summary>
|
||||
/// Provides the real IP address from a RemoteEndPoint string that contains a port and an IP
|
||||
/// </summary>
|
||||
|
|
@ -317,6 +319,39 @@ namespace TShockAPI
|
|||
tr.Close();
|
||||
}
|
||||
|
||||
private static void LoadGroups()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows a MOTD to the player
|
||||
/// </summary>
|
||||
/// <param name="ply">int player</param>
|
||||
public static Group GetGroup(string name)
|
||||
{
|
||||
//first attempt on cached groups
|
||||
for (int i = 0; i < groups.Count; i++)
|
||||
{
|
||||
if (groups[i].GetName().Equals(name))
|
||||
{
|
||||
return groups[i];
|
||||
}
|
||||
}
|
||||
//shit, it didnt work, reload and try again
|
||||
LoadGroups();
|
||||
|
||||
for (int i = 0; i < groups.Count; i++)
|
||||
{
|
||||
if (groups[i].GetName().Equals(name))
|
||||
{
|
||||
return groups[i];
|
||||
}
|
||||
}
|
||||
|
||||
//sigh :(, ok, you fucked up the config files, congrats.
|
||||
return null;
|
||||
}
|
||||
|
||||
public Tools() { }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue