public PlayerGroup(string Name, bool Public) { name = Name; fileName = name; players = PlayerGroupList.Load(fileName, this); pub = Public; allPlayerGroups.Add(new PlayerGroup(name, pub)); }
public static PlayerGroupList Load(string path, PlayerGroup groupName) { if (!Directory.Exists("groups")) { Directory.CreateDirectory("groups"); } path = "groups/" + path; PlayerGroupList list = new PlayerGroupList(); list.group = groupName; if (File.Exists(path)) { foreach (string line in File.ReadAllLines(path)) { list.Add(line); } } else { File.Create(path).Close(); Server.s.Log("CREATED NEW: " + path); } return(list); }
public static PlayerGroupList Load(string path, PlayerGroup groupName) { if (!Directory.Exists("groups")) { Directory.CreateDirectory("groups"); } path = "groups/" + path; PlayerGroupList list = new PlayerGroupList(); list.group = groupName; if (File.Exists(path)) { foreach (string line in File.ReadAllLines(path)) { list.Add(line); } } else { File.Create(path).Close(); Server.s.Log("CREATED NEW: " + path); } return list; }