static void SaveGroups(List <Group> givenList) { if (cfg == null) { cfg = ConfigElement.GetAll(typeof(Group)); } using (StreamWriter w = new StreamWriter(Paths.RankPropsFile)) { w.WriteLine("#Version 3"); w.WriteLine("#RankName = string"); w.WriteLine("#\tThe name of the rank (e.g. Guest)"); w.WriteLine("#Permission = number"); w.WriteLine("#\tThe \"permission\" level number of the rank."); w.WriteLine("#\tPermission level numbers must be between -20 and 120"); w.WriteLine("#\tThe higher the number, the more commands and blocks are available"); w.WriteLine("#"); w.WriteLine("#\tFor example, the default ranks use the following permission levels:"); w.WriteLine("#\t\tBanned = -20, Guest = 0, Builder = 30, AdvBuilder = 50"); w.WriteLine("#\t\tOperator = 80, Admin = 100, Owner = 120"); w.WriteLine("#Limit = number"); w.WriteLine("#\tThe draw command limit for the rank (can be changed in-game with /limit)"); w.WriteLine("#\tMust be greater than 0"); w.WriteLine("#MaxUndo = number of seconds"); w.WriteLine("#\tThe undo limit for players of the rank when undoing others. (/undoplayer)"); w.WriteLine("#Color = color"); w.WriteLine("#\tThe default color shown in tab and chat for players of the rank (e.g. &f)"); w.WriteLine("#MOTD = string"); w.WriteLine("#\tThe default MOTD players of the rank will see when joining levels."); w.WriteLine("#\tLeave blank to use the server MOTD."); w.WriteLine("#OSMaps = number"); w.WriteLine("#\tThe maximum number of maps players of the rank can have in /os"); w.WriteLine("#Prefix = string"); w.WriteLine("#\tCharacters that always appear before names of players of the rank in chat."); w.WriteLine("#\tLeave blank to have no characters before the names of players."); w.WriteLine("#GenVolume = number"); w.WriteLine("#\tThe maximum volume of a map that can be generated by players of the rank."); w.WriteLine("#\t(e.g. 512 x 256 x 512 map = 67108864 volume)"); w.WriteLine("#AfkKickMinutes = number of minutes"); w.WriteLine("#\tNumber of minutes a player of the rank can be AFK for before they are automatically AFK kicked."); w.WriteLine(); w.WriteLine(); foreach (Group group in givenList) { w.WriteLine("RankName = " + group.Name); ConfigElement.SerialiseElements(cfg, w, group); w.WriteLine(); } } }
public static void SaveGroups(List <Group> givenList) { if (cfg == null) { cfg = ConfigElement.GetAll(typeof(Group)); } using (StreamWriter w = new StreamWriter(Paths.RankPropsFile)) { w.WriteLine("#Version 3"); w.WriteLine("#RankName = string"); w.WriteLine("#\tThe name of the rank (e.g. Guest)"); w.WriteLine("#Permission = num"); w.WriteLine("#\tThe \"permission\" of the rank. It's a number."); w.WriteLine("#\tThere are pre-defined permissions already set. (for the old ranks)"); w.WriteLine("#\t\tBanned = -20, Guest = 0, Builder = 30, AdvBuilder = 50, Operator = 80"); w.WriteLine("#\t\tSuperOP = 100, Nobody = 120"); w.WriteLine("#\tMust be greater than -50 and less than 120"); w.WriteLine("#\tThe higher the number, the more commands do (such as undo allowing more seconds)"); w.WriteLine("#Limit = num"); w.WriteLine("#\tThe draw command limit for the rank (can be changed in-game with /limit)"); w.WriteLine("#\tMust be greater than 0"); w.WriteLine("#MaxUndo = num"); w.WriteLine("#\tThe undo limit for the rank, only applies when undoing others."); w.WriteLine("#\tMust be greater than 0"); w.WriteLine("#Color = color"); w.WriteLine("#\tThe default color shown in tab and chat for players of the rank (e.g. &f)"); w.WriteLine("#MOTD = string"); w.WriteLine("#\tAlternate MOTD players of the rank will see when joining the server."); w.WriteLine("#\tLeave blank to use the server MOTD."); w.WriteLine("#OSMaps = num"); w.WriteLine("#\tThe number of maps the players will have in /os"); w.WriteLine("#Prefix = string"); w.WriteLine("#\tCharacters that always appear before names of players of the rank in chat."); w.WriteLine("#\tLeave blank to have no characters before the names of players."); w.WriteLine("#GenVolume = num"); w.WriteLine("#\tThe maximum volume of a map that can be generated by players of the rank."); w.WriteLine("#AfkKickMinutes = num"); w.WriteLine("#\tNumber of minutes a player of the rank can be AFK for before they are automatically AFK kicked."); w.WriteLine(); w.WriteLine(); foreach (Group group in givenList) { w.WriteLine("RankName = " + group.Name); ConfigElement.SerialiseElements(cfg, w, group); w.WriteLine(); } } }