示例#1
0
 public void FillNull(uint mId)
 {
     this.OwnerId          = 1;
     this.Id               = mId;
     this.Name             = "Unknown Room";
     this.Description      = "-";
     this.Type             = "private";
     this.Owner            = "-";
     this.Category         = 0;
     this.UsersNow         = 0;
     this.UsersMax         = 0;
     this.ModelName        = "NO_MODEL";
     this.CCTs             = "";
     this.Score            = 0;
     this.Tags             = new List <string>();
     this.AllowPet         = true;
     this.AllowPetsEating  = false;
     this.AllowWalkthrough = true;
     this.Hidewall         = false;
     this.HideOwner        = false;
     this.Wallthick        = 0;
     this.Floorthick       = 0;
     this.Password         = "";
     this.Wallpaper        = "0.0";
     this.Floor            = "0.0";
     this.Landscape        = "0.0";
     this.Event            = null;
     this.Achievement      = 0;
     this.bool_3           = false;
     this.myIcon           = new RoomIcon(1, 1, new Dictionary <int, int>());
     this.class28_0        = Essential.GetGame().GetRoomManager().GetModel(ModelName, mId);
     this.ModelData        = "";
     this.WalkUnder        = false;
 }
示例#2
0
 public void Fill(Room Room)
 {
     this.Id               = Room.Id;
     this.Name             = Room.Name;
     this.Description      = Room.Description;
     this.Type             = Room.Type;
     this.Owner            = Room.Owner;
     this.Category         = Room.Category;
     this.State            = Room.State;
     this.UsersNow         = Room.UsersNow;
     this.UsersMax         = Room.UsersMax;
     this.ModelName        = Room.ModelName;
     this.CCTs             = Room.CCTs;
     this.Score            = Room.Score;
     this.Tags             = Room.Tags;
     this.AllowPet         = Room.AllowPet;
     this.AllowPetsEating  = Room.AllowPetsEating;
     this.AllowWalkthrough = Room.AllowWalkthrough;
     this.Hidewall         = Room.Hidewall;
     this.Wallthick        = Room.Wallthick;
     this.Floorthick       = Room.Floorthick;
     this.myIcon           = Room.RoomIcon;
     this.Password         = Room.Password;
     this.Event            = Room.Event;
     this.OwnerId          = Room.OwnerId;
     this.Wallpaper        = Room.Wallpaper;
     this.Floor            = Room.Floor;
     this.Landscape        = Room.Landscape;
     this.Achievement      = Room.Achievement;
     this.class28_0        = Essential.GetGame().GetRoomManager().GetModel(ModelName, Id);
 }
示例#3
0
        public void method_1(DataRow Row)
        {
            this.Id          = (uint)Row["Id"];
            this.Name        = (string)Row["caption"];
            this.Description = (string)Row["description"];
            this.Type        = (string)Row["roomtype"];
            this.Owner       = (string)Row["owner"];
            this.Achievement = Convert.ToUInt32(Row["achievement"]);
            string text = Row["state"].ToString().ToLower();

            if (text != null)
            {
                if (text == "open")
                {
                    this.State = 0;
                    goto IL_DF;
                }
                if (text == "password")
                {
                    this.State = 2;
                    goto IL_DF;
                }
                if (!(text == "locked"))
                {
                }
            }
            this.State = 1;
IL_DF:
            this.Category  = (int)Row["category"];
            this.UsersNow  = (int)Row["users_now"];
            this.UsersMax  = (int)Row["users_max"];
            this.ModelName = (string)Row["model_name"];
            this.CCTs      = (string)Row["public_ccts"];
            this.Score     = (int)Row["score"];
            this.OwnerId   = 0;
            this.ModelData = (string)Row["modeldata"];
            try
            {
                if (Type == "private")
                {
                    using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                    {
                        dbClient.AddParamWithValue("username", (string)Row["owner"]);
                        int result = dbClient.ReadInt32("SELECT id FROM users WHERE username = @username");
                        if (result > 0)
                        {
                            this.OwnerId = result;
                        }
                    }
                }
            }
            catch
            {
                this.OwnerId = 0;
            }



            this.Tags             = new List <string>();
            this.AllowPet         = Essential.StringToBoolean(Row["allow_pets"].ToString());
            this.AllowPetsEating  = Essential.StringToBoolean(Row["allow_pets_eat"].ToString());
            this.AllowWalkthrough = Essential.StringToBoolean(Row["allow_walkthrough"].ToString());
            this.bool_3           = false;
            this.Hidewall         = Essential.StringToBoolean(Row["allow_hidewall"].ToString());
            this.HideOwner        = Essential.StringToBoolean(Row["hide_owner"].ToString());
            this.Wallthick        = (int)Row["wallthick"];
            this.Floorthick       = (int)Row["floorthick"];
            this.Password         = (string)Row["password"];
            this.Wallpaper        = (string)Row["wallpaper"];
            this.Floor            = (string)Row["floor"];
            this.Landscape        = (string)Row["landscape"];
            this.WalkUnder        = Essential.StringToBoolean(Row["can_walkunder"].ToString());
            this.Event            = null;
            Dictionary <int, int> IconItems = new Dictionary <int, int>();

            string[] array;
            if (Row["icon_items"].ToString() != "")
            {
                array = Row["icon_items"].ToString().Split(new char[]
                {
                    '|'
                });
                for (int i = 0; i < array.Length; i++)
                {
                    string text2 = array[i];
                    if (!string.IsNullOrEmpty(text2))
                    {
                        string[] array2 = text2.Replace('.', ',').Split(new char[]
                        {
                            ','
                        });
                        int key   = 0;
                        int value = 0;
                        int.TryParse(array2[0], out key);
                        if (array2.Length > 1)
                        {
                            int.TryParse(array2[1], out value);
                        }
                        try
                        {
                            if (!IconItems.ContainsKey(key))
                            {
                                IconItems.Add(key, value);
                            }
                        }
                        catch (Exception ex)
                        {
                            Logging.LogException(string.Concat(new string[]
                            {
                                "Exception: ",
                                ex.ToString(),
                                "[",
                                text2,
                                "]"
                            }));
                        }
                    }
                }
            }
            this.myIcon = new RoomIcon((int)Row["icon_bg"], (int)Row["icon_fg"], IconItems);
            array       = Row["tags"].ToString().Split(new char[]
            {
                ','
            });
            for (int i = 0; i < array.Length; i++)
            {
                string Tag = array[i];
                this.Tags.Add(Tag);
            }
            if (ModelData.Length == 0)
            {
                this.class28_0 = Essential.GetGame().GetRoomManager().GetModel(this.ModelName, this.Id);
            }
            else
            {
                RoomModel OrgModel = Essential.GetGame().GetRoomManager().GetModel(this.ModelName, this.Id);
                this.class28_0 = new RoomModel("custom_model_" + this.Id, OrgModel.DoorX, OrgModel.DoorY, OrgModel.double_0, OrgModel.int_2, ModelData, "", false);
            }
        }
示例#4
0
        private void method_66(bool bool_13)
        {
            if (!this.bool_12)
            {
                this.bool_12 = true;
                if (bool_13)
                {
                    this.bool_11 = false;
                    if (this.timer_0 != null)
                    {
                        this.bool_6 = true;
                        this.timer_0.Change(-1, -1);
                    }
                    this.bool_6 = true;
                    this.method_64();
                    using (DatabaseClient @class = Essential.GetDatabase().GetClient())
                    {
                        @class.ExecuteQuery(string.Concat(new object[]
						{
							"UPDATE user_pets SET room_id = 0 WHERE room_id = ",
							this.Id,
							" AND NOT user_id = ",
							Essential.GetGame().GetClientManager().GetIdByName(this.Owner)
						}));
                    }
                    //this.timer_0.Dispose();
                    this.timer_0 = null;
                    this.bool_9 = false;
                    if (this.Tags != null)
                    {
                        this.Tags.Clear();
                    }
                    this.Tags = null;
                    if (this.RoomUsers != null)
                    {
                        Array.Clear(this.RoomUsers, 0, this.RoomUsers.Length);
                    }
                    this.RoomUsers = null;
                    this.RoomIcon = null;
                    if (this.UsersWithRights != null)
                    {
                        this.UsersWithRights.Clear();
                    }
                    this.RoomIcon = null;
                    if (this.dictionary_0 != null)
                    {
                        this.dictionary_0.Clear();
                    }
                    this.dictionary_0 = null;
                    this.Wallpaper = null;
                    this.Floor = null;
                    this.Landscape = null;
                    if (this.hashtable_0 != null)
                    {
                        this.hashtable_0.Clear();
                    }
                    this.hashtable_0 = null;
                    if (this.hashtable_4 != null)
                    {
                        this.hashtable_4.Clear();
                    }
                    this.hashtable_4 = null;
                    this.MoodlightData = null;
                    if (this.list_2 != null)
                    {
                        this.list_2.Clear();
                    }
                    this.list_2 = null;
                    if (this.MusicController != null)
                    {
                        this.MusicController.UnLinkRoomOutputItem();
                    }
                    this.MusicController = null;
                    if (this.InfobusAnswers != null)
                    {
                        this.InfobusAnswers.Clear();
                    }
                    this.InfobusAnswers = null;
                }
            }
        }
示例#5
0
        public Room(uint uint_2, string name, string description, string type, string string_13, int int_17, int int_18, int int_19, string string_14, string string_15, int int_20, List<string> list_18, bool bool_13, bool bool_14, bool bool_15, bool bool_16, RoomIcon class29_1, string string_16, string string_17, string string_18, string string_19, RoomData class27_1, bool bool_17, int int_21, int int_22, uint uint_3, string ModelData, bool HideOwner, bool CanWalkUnder)
        {
            this.bool_12 = false;
            this.Id = uint_2;
            this.Name = name;
            this.Description = description;
            this.Owner = string_13;
            this.Category = int_17;
            this.Type = type;
            this.State = int_18;
            this.UsersNow = 0;
            this.OwnerId = 0;
            this.CanWalkUnder = CanWalkUnder;
            if (string_15 == "")
            {
                try
                {
                    using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                    {

                        dbClient.AddParamWithValue("username", string_13);
                        int result = dbClient.ReadInt32("SELECT id FROM users WHERE username = @username");
                        if (result > 0)
                            this.OwnerId = result;
                    }
                }
                catch
                {

                }
            }

            this.UsersMax = int_19;
            this.ModelName = string_14;
            this.CCTs = string_15;
            this.Score = int_20;
            this.Tags = list_18;
            this.AllowPet = bool_13;
            this.AllowPetsEating = bool_14;
            this.AllowWalkthrough = bool_15;
            this.HideOwner = HideOwner;
            this.Hidewall = bool_16;
            this.Wallthick = int_21;
            this.Floorthick = int_22;
            this.int_7 = 0;
            this.RoomUsers = new RoomUser[500];
            this.RoomIcon = class29_1;
            this.Password = string_16;
            this.dictionary_0 = new Dictionary<uint, double>();
            this.Event = null;
            this.Wallpaper = string_17;
            this.Floor = string_18;
            this.Landscape = string_19;
            this.hashtable_4 = new Hashtable();
            this.hashtable_0 = new Hashtable();
            this.list_2 = new List<Trade>();
            if (ModelData.Length == 0)
            {
                this.class28_0 = Essential.GetGame().GetRoomManager().GetModel(this.ModelName, this.Id);
            }
            else
            {
                this.ModelData = ModelData;
                RoomModel OrgModel = Essential.GetGame().GetRoomManager().GetModel(this.ModelName, this.Id);
                this.class28_0 = new RoomModel("custom_model_" + this.Id, OrgModel.DoorX, OrgModel.DoorY, OrgModel.double_0, OrgModel.int_2, ModelData, "", false);
            }

            this.bool_6 = false;
            this.bool_7 = false;
            this.bool_5 = true;
            this.class27_0 = class27_1;
            this.bool_8 = bool_17;
            this.list_17 = new List<GroupsManager>();
            this.list_4 = new List<uint>();
            this.list_5 = new List<RoomItem>();
            this.list_9 = new List<RoomItem>();
            this.list_7 = new List<RoomItem>();
            this.list_6 = new List<RoomItem>();
            this.list_8 = new List<RoomItem>();
            this.list_10 = new List<RoomItem>();
            this.list_11 = new List<RoomItem>();
            this.list_12 = new List<RoomItem>();
            this.list_13 = new List<RoomItem>();
            this.int_10 = 0;
            this.int_11 = 0;
            this.int_9 = 0;
            this.int_12 = 0;
            this.list_3 = new List<RoomItem>();
            this.list_14 = new List<RoomItem>();
            this.list_15 = new List<RoomItem>();
            this.list_16 = new List<RoomItem>();
            this.byte_0 = new byte[this.RoomModel.int_4, this.RoomModel.int_5];
            this.double_1 = new double[this.RoomModel.int_4, this.RoomModel.int_5];
            this.double_2 = new double[this.RoomModel.int_4, this.RoomModel.int_5];
            //this.timer_0 = new Timer(new TimerCallback(this.method_32), null, 480, 480);
            this.int_8 = 0;
            this.bool_4 = false;
            this.bool_9 = true;
            this.bool_11 = false;
            this.int_16 = 0;
            this.int_15 = 4;
            this.Achievement = uint_3;
            this.bool_10 = false;
            this.hashtable_1 = new Hashtable();
            this.hashtable_2 = new Hashtable();
            this.hashtable_3 = new Hashtable();
            this.method_23();
            this.method_25();
            this.method_22();
            this.LoadMusic();
            this.InfobusAnswers = new List<int>();
            this.pollManager = new PollManager(this);
        }
示例#6
0
        public void FillNull(uint mId)
        {
            this.OwnerId = 1;
            this.Id = mId;
            this.Name = "Unknown Room";
            this.Description = "-";
            this.Type = "private";
            this.Owner = "-";
            this.Category = 0;
            this.UsersNow = 0;
            this.UsersMax = 0;
            this.ModelName = "NO_MODEL";
            this.CCTs = "";
            this.Score = 0;
            this.Tags = new List<string>();
            this.AllowPet = true;
            this.AllowPetsEating = false;
            this.AllowWalkthrough = true;
            this.Hidewall = false;
            this.HideOwner = false;
            this.Wallthick = 0;
            this.Floorthick = 0;
            this.Password = "";
            this.Wallpaper = "0.0";
            this.Floor = "0.0";
            this.Landscape = "0.0";
            this.Event = null;
            this.Achievement = 0;
            this.bool_3 = false;
            this.myIcon = new RoomIcon(1, 1, new Dictionary<int, int>());
            this.class28_0 = Essential.GetGame().GetRoomManager().GetModel(ModelName, mId);
            this.ModelData = "";
            this.WalkUnder = false;

        }
示例#7
0
 public void Fill(Room Room)
 {
     this.Id = Room.Id;
     this.Name = Room.Name;
     this.Description = Room.Description;
     this.Type = Room.Type;
     this.Owner = Room.Owner;
     this.Category = Room.Category;
     this.State = Room.State;
     this.UsersNow = Room.UsersNow;
     this.UsersMax = Room.UsersMax;
     this.ModelName = Room.ModelName;
     this.CCTs = Room.CCTs;
     this.Score = Room.Score;
     this.Tags = Room.Tags;
     this.AllowPet = Room.AllowPet;
     this.AllowPetsEating = Room.AllowPetsEating;
     this.AllowWalkthrough = Room.AllowWalkthrough;
     this.Hidewall = Room.Hidewall;
     this.Wallthick = Room.Wallthick;
     this.Floorthick = Room.Floorthick;
     this.myIcon = Room.RoomIcon;
     this.Password = Room.Password;
     this.Event = Room.Event;
     this.OwnerId = Room.OwnerId;
     this.Wallpaper = Room.Wallpaper;
     this.Floor = Room.Floor;
     this.Landscape = Room.Landscape;
     this.Achievement = Room.Achievement;
     this.class28_0 = Essential.GetGame().GetRoomManager().GetModel(ModelName, Id);
 }
示例#8
0
        public void method_1(DataRow Row)
        {
            this.Id = (uint)Row["Id"];
            this.Name = (string)Row["caption"];
            this.Description = (string)Row["description"];
            this.Type = (string)Row["roomtype"];
            this.Owner = (string)Row["owner"];
            this.Achievement = Convert.ToUInt32(Row["achievement"]);
            string text = Row["state"].ToString().ToLower();
            if (text != null)
            {
                if (text == "open")
                {
                    this.State = 0;
                    goto IL_DF;
                }
                if (text == "password")
                {
                    this.State = 2;
                    goto IL_DF;
                }
                if (!(text == "locked"))
                {
                }
            }
            this.State = 1;
        IL_DF:
            this.Category = (int)Row["category"];
            this.UsersNow = (int)Row["users_now"];
            this.UsersMax = (int)Row["users_max"];
            this.ModelName = (string)Row["model_name"];
            this.CCTs = (string)Row["public_ccts"];
            this.Score = (int)Row["score"];
            this.OwnerId = 0;
            this.ModelData = (string)Row["modeldata"];
            try
            {
                if (Type == "private")
                {
                    using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                    {

                        dbClient.AddParamWithValue("username", (string)Row["owner"]);
                        int result = dbClient.ReadInt32("SELECT id FROM users WHERE username = @username");
                        if (result > 0)
                            this.OwnerId = result;
                    }
                }
            }
            catch
            {
                this.OwnerId = 0;
            }



            this.Tags = new List<string>();
            this.AllowPet = Essential.StringToBoolean(Row["allow_pets"].ToString());
            this.AllowPetsEating = Essential.StringToBoolean(Row["allow_pets_eat"].ToString());
            this.AllowWalkthrough = Essential.StringToBoolean(Row["allow_walkthrough"].ToString());
            this.bool_3 = false;
            this.Hidewall = Essential.StringToBoolean(Row["allow_hidewall"].ToString());
            this.HideOwner = Essential.StringToBoolean(Row["hide_owner"].ToString());
            this.Wallthick = (int)Row["wallthick"];
            this.Floorthick = (int)Row["floorthick"];
            this.Password = (string)Row["password"];
            this.Wallpaper = (string)Row["wallpaper"];
            this.Floor = (string)Row["floor"];
            this.Landscape = (string)Row["landscape"];
            this.WalkUnder = Essential.StringToBoolean(Row["can_walkunder"].ToString());
            this.Event = null;
            Dictionary<int, int> IconItems = new Dictionary<int, int>();
            string[] array;
            if (Row["icon_items"].ToString() != "")
            {
                array = Row["icon_items"].ToString().Split(new char[]
				{
					'|'
				});
                for (int i = 0; i < array.Length; i++)
                {
                    string text2 = array[i];
                    if (!string.IsNullOrEmpty(text2))
                    {
                        string[] array2 = text2.Replace('.', ',').Split(new char[]
						{
							','
						});
                        int key = 0;
                        int value = 0;
                        int.TryParse(array2[0], out key);
                        if (array2.Length > 1)
                        {
                            int.TryParse(array2[1], out value);
                        }
                        try
                        {
                            if (!IconItems.ContainsKey(key))
                            {
                                IconItems.Add(key, value);
                            }
                        }
                        catch (Exception ex)
                        {
                            Logging.LogException(string.Concat(new string[]
							{
								"Exception: ",
								ex.ToString(),
								"[",
								text2,
								"]"
							}));
                        }
                    }
                }
            }
            this.myIcon = new RoomIcon((int)Row["icon_bg"], (int)Row["icon_fg"], IconItems);
            array = Row["tags"].ToString().Split(new char[]
			{
				','
			});
            for (int i = 0; i < array.Length; i++)
            {
                string Tag = array[i];
                this.Tags.Add(Tag);
            }
            if (ModelData.Length == 0)
            {
                this.class28_0 = Essential.GetGame().GetRoomManager().GetModel(this.ModelName, this.Id);
            }
            else
            {

                RoomModel OrgModel = Essential.GetGame().GetRoomManager().GetModel(this.ModelName, this.Id);
                this.class28_0 = new RoomModel("custom_model_" + this.Id, OrgModel.DoorX, OrgModel.DoorY, OrgModel.double_0, OrgModel.int_2, ModelData, "", false);
            }
        }