Пример #1
0
        public void AddPermissionArea(int x1, int y1, int z1, int x2, int y2, int z2, int permissionLevel)
        {
            AreaConfig area = new AreaConfig();

            area.Level  = permissionLevel;
            area.Coords = string.Format("{0},{1},{2},{3},{4},{5}", x1, y1, z1, x2, y2, z2);
            server.config.Areas.Add(area);
            server.configNeedsSaving = true;
        }
Пример #2
0
        public static List <AreaConfig> getDefaultAreas()
        {
            List <AreaConfig> defaultAreas = new List <AreaConfig>();

            AreaConfig publicArea = new AreaConfig();

            publicArea.Id     = 1;
            publicArea.Coords = "0,0,1,9984,5000,128";
            publicArea.PermittedGroups.Add("Guest");
            defaultAreas.Add(publicArea);
            AreaConfig protectedArea = new AreaConfig();

            protectedArea.Id     = 2;
            protectedArea.Coords = "0,0,1,9984,9984,128";
            protectedArea.PermittedGroups.Add("Builder");
            protectedArea.PermittedGroups.Add("Moderator");
            protectedArea.PermittedGroups.Add("Admin");
            defaultAreas.Add(protectedArea);

            return(defaultAreas);
        }