Beispiel #1
0
 internal SnowStorm(Habbo warowner)
 {
     WarsData stormWars = Essential.GetGame().GetStormWars();
     stormWars.LastWarId++;
     this.WarId = Essential.GetGame().GetStormWars().LastWarId;
     this.WarLevel = 9;
     this.WarOwner = warowner;
     this.WarUsers = new List<Habbo>();
     this.WarStarted = 0;
     this.MaxUsers = 10;
     this.Model = Essential.GetGame().GetStormWars().RoomModel[this.WarLevel];
     this.Kvalue = 0;
     Essential.GetGame().GetStormWars().Wars.Add(this.WarId, this);
     this.Countdown = 3;
     RoomData class2 = new RoomData();
     class2.FillNull((uint)WarId);
     class2.Owner = "Rootkit";
     class2.Name = "SnowStorm Level " + WarLevel;
     this.SnowRoom = new Room(class2.Id, class2.Name, class2.Description, class2.Type, class2.Owner, class2.Category, class2.State, class2.UsersMax,"model_a", class2.CCTs, class2.Score, class2.Tags, class2.AllowPet, class2.AllowPetsEating, class2.AllowWalkthrough, class2.Hidewall, class2.Icon, class2.Password, class2.Wallpaper, class2.Floor, class2.Landscape, class2, class2.bool_3, class2.Wallthick, class2.Floorthick, class2.Achievement, this.Model.HeightMap, class2.HideOwner,false);
 }
Beispiel #2
0
		public RoomData method_17(uint uint_0, DataRow dataRow_0)
		{
			RoomData result;
			if (this.hashtable_0.ContainsKey(uint_0))
			{
				result = (this.hashtable_0[uint_0] as RoomData);
			}
			else
			{
				RoomData @class = new RoomData();
				if (this.method_13(uint_0))
				{
					@class = this.GetRoom(uint_0).RoomData;
				}
				else
				{
					@class.method_1(dataRow_0);
				}
                if (!this.hashtable_0.ContainsKey(uint_0))
                {
                    this.hashtable_0.Add(uint_0, @class);
                }
				result = @class;
			}
			return result;
		}
Beispiel #3
0
		public RoomData method_12(uint uint_0)
		{
			RoomData @class = new RoomData();
			RoomData result;
			lock (this.hashtable_0)
			{
				if (this.hashtable_0.ContainsKey(uint_0))
				{
					result = (this.hashtable_0[uint_0] as RoomData);
					return result;
				}
				if (this.method_13(uint_0))
				{
					result = this.GetRoom(uint_0).RoomData;
					return result;
				}
				DataRow dataRow = null;
				using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
				{
					dataRow = class2.ReadDataRow("SELECT * FROM rooms WHERE Id = '" + uint_0 + "' LIMIT 1");
				}
				if (dataRow == null)
				{
					result = null;
					return result;
				}
				@class.method_1(dataRow);
			}
			if (!this.hashtable_0.ContainsKey(uint_0))
			{
				this.hashtable_0.Add(uint_0, @class);
			}
			result = @class;
			return result;
		}
Beispiel #4
0
		public RoomData method_11(uint uint_0)
		{
			RoomData result;
			if (this.method_12(uint_0) != null)
			{
				result = this.method_12(uint_0);
			}
			else
			{
				RoomData @class = new RoomData();
				@class.FillNull(uint_0);
				result = @class;
			}
			return result;
		}
Beispiel #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);
        }
		public ServerMessage method_21(SupportTicket class111_0, RoomData class27_0, double double_0)
		{
			ServerMessage result;
			using (DatabaseClient @class = Essential.GetDatabase().GetClient())
			{
				DataTable dataTable = @class.ReadDataTable(string.Concat(new object[]
				{
					"SELECT user_id,user_name,timestamp,hour,minute,message FROM chatlogs WHERE room_id = '",
					class27_0.Id,
					"' AND timestamp >= '",
					double_0 - 300.0,
					"' AND timestamp < UNIX_TIMESTAMP() ORDER BY timestamp DESC LIMIT 100"
				}));
                ServerMessage Message = new ServerMessage(Outgoing.RoomChatlog); // Updated
				Message.AppendBoolean(class27_0.IsPublicRoom);
				Message.AppendInt32((int)class27_0.Id);
				Message.AppendString(class27_0.Name);
				if (dataTable != null)
				{
					Message.AppendInt32(dataTable.Rows.Count);
					IEnumerator enumerator = dataTable.Rows.GetEnumerator();
					try
					{
						while (enumerator.MoveNext())
						{
							DataRow dataRow = (DataRow)enumerator.Current;
                            string hour = (int)dataRow["hour"].ToString().Length > 1 ? "" + (int)dataRow["hour"] : "0" + (int)dataRow["hour"];
                            string minute = (int)dataRow["minute"].ToString().Length > 1 ? "" + (int)dataRow["minute"] : "0" + (int)dataRow["minute"];
                            Message.AppendInt32((int)(double)dataRow["timestamp"]);
                            Message.AppendUInt((uint)dataRow["user_id"]);
                            Message.AppendString((string)dataRow["user_name"]);
							Message.AppendString((string)dataRow["message"]);
                            Message.AppendString(hour + ":" + minute);
						}
						goto IL_186;
					}
					finally
					{
						IDisposable disposable = enumerator as IDisposable;
						if (disposable != null)
						{
							disposable.Dispose();
						}
					}
				}
				Message.AppendInt32(0);
            IL_186:
				result = Message;
			}
			return result;
		}
		public ServerMessage method_14(RoomData class27_0)
		{
			Room @class = Essential.GetGame().GetRoomManager().GetRoom(class27_0.Id);
			uint uint_ = 0u;
			using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
			{
				try
				{
					class2.AddParamWithValue("owner", class27_0.Owner);
					uint_ = (uint)class2.ReadDataRow("SELECT Id FROM users WHERE username = @owner LIMIT 1")[0];
				}
				catch (Exception)
				{
				}
			}
            ServerMessage Message = new ServerMessage(Outgoing.RoomTool); // PP
			Message.AppendUInt(class27_0.Id);
			Message.AppendInt32(class27_0.UsersNow);
			if (@class != null)
			{
				Message.AppendBoolean(@class.method_56(class27_0.Owner) != null);
			}
			else
			{
				Message.AppendBoolean(false);
			}
			Message.AppendUInt(uint_);
			Message.AppendStringWithBreak(class27_0.Owner);
            Message.AppendBoolean(class27_0 != null);
            //Message.AppendUInt(class27_0.Id);
			Message.AppendStringWithBreak(class27_0.Name);
			Message.AppendStringWithBreak(class27_0.Description);
			Message.AppendInt32(class27_0.TagCount);
			foreach (string current in class27_0.Tags)
			{
				Message.AppendStringWithBreak(current);
			}
			if (@class != null)
			{
				Message.AppendBoolean(@class.HasEvent);
				if (@class.Event == null)
				{
					return Message;
				}
				Message.AppendStringWithBreak(@class.Event.Name);
				Message.AppendStringWithBreak(@class.Event.Description);
				Message.AppendInt32(@class.Event.Tags.Count);
				using (TimedLock.Lock(@class.Event.Tags))
				{
					foreach (string current in @class.Event.Tags)
					{
						Message.AppendStringWithBreak(current);
					}
					return Message;
				}
			}
			Message.AppendBoolean(false);
			return Message;
		}