Пример #1
0
 public void EditSpace(string Name, string Description, SpaceAccessType AccessType, string Password, bool AllowUppercuts, bool AllowCoconuts, List <string> WhiteList, List <string> BlackList)
 {
     lock (this.object_0)
     {
         this.string_0          = Name;
         this.string_1          = Description;
         this.spaceAccessType_0 = AccessType;
         this.string_3          = Password;
         this.bool_1            = AllowUppercuts;
         this.bool_0            = AllowCoconuts;
         this.list_0            = WhiteList;
         this.list_1            = BlackList;
         using (SqlDatabaseClient client = SqlDatabaseManager.GetClient())
         {
             StringBuilder builder  = new StringBuilder();
             StringBuilder builder2 = new StringBuilder();
             foreach (string str in WhiteList)
             {
                 if (builder.Length > 0)
                 {
                     builder.Append(",");
                 }
                 builder.Append(str);
             }
             foreach (string str2 in BlackList)
             {
                 if (builder2.Length > 0)
                 {
                     builder2.Append(",");
                 }
                 builder.Append(str2);
             }
             string str3 = "open";
             if (this.spaceAccessType_0 == SpaceAccessType.PasswordProtected)
             {
                 str3 = "password";
             }
             else if (this.spaceAccessType_0 == SpaceAccessType.Locked)
             {
                 str3 = "lock";
             }
             client.SetParameter("id", this.uint_0);
             client.SetParameter("name", this.string_0);
             client.SetParameter("description", this.string_1);
             client.SetParameter("accesstype", str3);
             client.SetParameter("password", this.string_3);
             client.SetParameter("whitelist", builder);
             client.SetParameter("blacklist", builder2);
             client.SetParameter("allowuppercuts", this.bool_1 ? "1" : "0");
             client.SetParameter("allowcoconuts", this.bool_0 ? "1" : "0");
             client.ExecuteNonQuery("UPDATE escenarios SET nombre = @name, descripcion = @description, acceso = @accesstype, password = @password, lista_verde = @whitelist, lista_negra = @blacklist, permitir_upper = @allowuppercuts, permitir_coco = @allowcoconuts WHERE id = @id LIMIT 1");
         }
     }
 }
Пример #2
0
 public SpaceInfo(uint uint_5, List <uint> SubIds, uint ParentId, string Name, string Description, uint OwnerId, uint SpaceId, BoomBang.Game.Spaces.SpaceType SpaceType, SpaceAccessType AccessType, string Password, bool AllowUppercuts, bool AllowCoconuts, List <string> WhiteList, List <string> BlackList, uint MaxUsers, string ModelName)
 {
     this.uint_0            = uint_5;
     this.list_2            = SubIds;
     this.uint_1            = ParentId;
     this.string_0          = Name;
     this.string_1          = Description;
     this.uint_4            = OwnerId;
     this.uint_2            = SpaceId;
     this.spaceType_0       = SpaceType;
     this.spaceAccessType_0 = AccessType;
     this.string_3          = Password;
     this.bool_0            = AllowCoconuts;
     this.bool_1            = AllowUppercuts;
     this.list_0            = WhiteList;
     this.list_1            = BlackList;
     this.double_0          = UnixTimestamp.GetCurrent();
     this.uint_3            = MaxUsers;
     this.string_2          = ModelName;
     this.object_0          = new object();
 }
Пример #3
0
        public static SpaceInfo GenerateSpaceInfoFromRow(DataRow Row)
        {
            SpaceAccessType open = SpaceAccessType.Open;
            string          str  = Row["acceso"].ToString();

            if (str != null)
            {
                if (!(str == "lock"))
                {
                    if (str == "password")
                    {
                        open = SpaceAccessType.PasswordProtected;
                    }
                }
                else
                {
                    open = SpaceAccessType.Locked;
                }
            }
            SpaceType area = SpaceType.Area;
            string    str2 = Row["tipo_area"].ToString();

            if (str2 != null)
            {
                if (str2 == "area")
                {
                    area = SpaceType.Area;
                }
                else if (str2 == "island")
                {
                    area = SpaceType.Island;
                }
                else if (!(str2 == "game"))
                {
                    if (str2 == "home")
                    {
                        area = SpaceType.Home;
                    }
                }
                else
                {
                    area = SpaceType.Game;
                }
            }
            List <uint>   subIds    = new List <uint>();
            List <string> whiteList = new List <string>();
            List <string> blackList = new List <string>();

            string[] strArray  = Row["ids_secundarias"].ToString().Split(new char[] { ',' });
            string[] strArray2 = Row["lista_verde"].ToString().Split(new char[] { ',' });
            string[] strArray3 = Row["lista_negra"].ToString().Split(new char[] { ',' });
            for (int i = 0; i < strArray.Length; i++)
            {
                uint result = 0;
                uint.TryParse(strArray[i], out result);
                if (result > 0)
                {
                    subIds.Add(result);
                }
            }
            for (int j = 0; j < strArray2.Length; j++)
            {
                whiteList.Add(strArray2[j]);
            }
            for (int k = 0; k < strArray3.Length; k++)
            {
                blackList.Add(strArray3[k]);
            }
            return(new SpaceInfo((uint)Row["id"], subIds, (uint)Row["id_principal"], (string)Row["nombre"], (string)Row["descripcion"], (uint)Row["id_usuario"], (uint)Row["tipo_decoracion"], area, open, (string)Row["password"], Row["permitir_uppercut"].ToString() == "1", Row["permitir_coco"].ToString() == "1", whiteList, blackList, (uint)Row["max_visitantes"], (string)Row["modelo"]));
        }
Пример #4
0
 public static SpaceInfo GenerateRawSpaceInfo(uint uint_0, List <uint> SubIds, uint ParentId, string Name, string Description, uint OwnerId, uint SpaceId, SpaceType Type, SpaceAccessType AccessType, string Password, bool AllowCoconuts, bool AllowUppercuts, List <string> WhiteList, List <string> BlackList, uint MaxUsers, string Model)
 {
     return(new SpaceInfo(uint_0, SubIds, ParentId, Name, Description, OwnerId, SpaceId, Type, AccessType, Password, AllowUppercuts, AllowCoconuts, WhiteList, BlackList, MaxUsers, Model));
 }