namespace  { using ; using ; using ; using ; using ; using ; using †; using ‹; using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Runtime.CompilerServices; using System.Text; using System.Threading; internal class  { internal int ; internal string ; internal bool ; internal  ; internal  ; internal Š ; private string ; private string ; internal bool ; private [,] ; private byte[,] ; public byte[,] ; private double[,] ; public bool[,] ; private [,] ; private [,] ; private Hashtable ; private Hashtable ; private HashSet ; private Thread ; private StringBuilder ; internal int ; internal int ; private byte ; private int ; private Thread ; internal void (string Data) { try { foreach (™ ™ in this..Values) { if ((™..† || ™..„) || .(™.., "fuse_pick_up_any_furni", ™.)) { ™..(Data); } } } catch { } } internal void (™ sourceUser, string Message) { string[] strArray = new string[] { "sml", "agr", "sad", "srp" }; string[] strArray2 = new string[] { ":)", ":D" }; string[] strArray3 = new string[] { ">:(", ":@", ":/" }; string[] strArray4 = new string[] { ":(", ":'(" }; string[] strArray5 = new string[] { ":o", ":O", ":0" }; string[][] strArray6 = new string[][] { strArray2, strArray3, strArray4, strArray5 }; for (int i = 0; i < strArray6.Length; i++) { string[] separator = strArray6[i]; if (Message.Split(separator, StringSplitOptions.None).Length > 1) { string str = strArray[i]; sourceUser..“("gest", str, 0x1388); break; } } } private void (string Data, int msSleep) { Thread.Sleep(msSleep); foreach (™ ™ in ((Hashtable) this..Clone()).Values) { ™..(Data); } } internal void (string Data) { try { foreach (™ ™ in ((Hashtable) this..Clone()).Values) { ™..(Data); } } catch { } } internal void (int userID, string Data) { foreach (™ ™ in ((Hashtable) this..Clone()).Values) { if (™. == userID) { ™..(Data); break; } } } internal void (string Data, int msSleep) { new ..(this.).BeginInvoke(Data, msSleep, null, null); } internal void (string Username, string Data) { foreach (™ ™ in ((Hashtable) this..Clone()).Values) { if (™.. == Username) { ™..(Data); break; } } } private int () { int key = 0; while (true) { if (!(this..ContainsKey(key) || this..ContainsKey(key))) { return key; } key++; } } internal ™ (int roomUID) { return (™) this.[roomUID]; } private int () { if (this..Count <= 0) { return -1; } while (true) { int key = new Random(DateTime.Now.Millisecond).Next(0, this..Count); if (this..ContainsKey(key) || this..ContainsKey(key)) { return key; } } } internal void () { try { try { foreach (™ ™ in this..Values) { ™..("@R"); ™...Clear(); ™.. = null; ™..€ = 0; ™.. = false; ™..‚ = false; ™..ƒ = false; ™..„ = false; ™..† = false; ™.. = null; ™.. = null; if (™.. != -1) { ™..(); } if (!((™.. == null) || ™...)) { ™..(); } } } catch { } foreach (  in this..Values) { .(); } this..Clear(); this..Clear(); this. = null; if (!this.) { this..Clear(); this..Clear(); } else { try { this..Abort(); } catch { } if (this. != null) { this..Clear(); } this. = null; } .(this.); this..Abort(); } catch { } } internal void ( roomBot) { try { if (roomBot. == -1) { this..Append(roomBot.() + Convert.ToChar(13)); } } catch { } } internal void (™ roomUser) { if (roomUser. == -1) { this..Append(roomUser.() + Convert.ToChar(13)); } } internal void (string Emitter, string Cast) { this.("AG" + Emitter + " " + Cast); } internal void (int voteAmount) { string data = "EY" + œ.€(voteAmount); lock (this.) { foreach (™ ™ in this..Values) { if (™.) { ™..(data); } } } } private void () { List list = new List(); while (true) { .[,] Array; int[] numArray; int num; int num2; double num3; try { foreach (™ ™ in this..Values) { if (™. == -1) { continue; } Array = (.[,]) this..Clone(); try { if ((Array[™., ™.] == ..) || (Array[™., ™.] == ..)) { Array[™., ™.] = ..; } if (this.[™., ™.]) { Array[™., ™.] = ..; } } catch { } numArray = new Œ(Array, this., this.).(™., ™., ™., ™.); ™..’("mv"); if (numArray == null) { ™. = -1; if (this.[™., ™.] != null) { .  = this.[™., ™.]; if (this.) { if ((. == "curtains1") || (. == "curtains2")) { ™. = true; ™..("A`"); this.(., "close"); } else if ((™. != "") && ..Contains("Splash")) { this.("AG" + .); if (..Substring(8) == "enter") { ™..(); ™..‘("swim", ""); } else { ™..’("swim"); } this.(™, ., ., false); ™. = .; ™. = .; } } } else if (™.) { if (this..Count <= 1) { this.(™., true, ""); return; } this.(™., true, ""); continue; } this..Append(™.() + Convert.ToChar(13)); } else { num = numArray[0]; num2 = numArray[1]; .  = this.[num, num2]; this.[™., ™.] = false; this.[num, num2] = true; ™. = .(™., ™., num, num2); ™. = ™.; ™..’("sit"); ™..’("lay"); num3 = 0.0; if ( == ..) { num3 = this.[num, num2]; } else { num3 = this.[num, num2]; } ™..‘("mv", string.Concat(new object[] { num, ",", num2, ",", num3.ToString().Replace(',', '.') })); this..Append(™.() + Convert.ToChar(13)); ™. = num; ™. = num2; ™. = num3; switch () { case ..: ™..’("dance"); ™. = this.[num, num2]; ™. = ™.; ™..‘("sit", this.[num, num2].ToString().Replace(',', '.')); break; case ..: ™..’("dance"); ™. = this.[num, num2]; ™. = ™.; ™..‘("lay", this.[num, num2].ToString().Replace(',', '.')); break; } } } foreach (int num4 in list) { this.(num4, true, ""); } list.Clear(); } catch (Exception exception) { Ž.(exception.Message); } foreach (  in this..Values) { if (. == -1) { continue; } Array = (.[,]) this..Clone(); try { if (Array[., .] == ..) { Array[., .] = ..; } if (this.[., .]) { Array[., .] = ..; } } catch { } numArray = new Œ(Array, this., this.).(., ., ., .); .’("mv"); if (numArray == null) { if ((. == .) && (. == .)) { .Ž(); } . = -1; this..Append(.() + Convert.ToChar(13)); } else { num = numArray[0]; num2 = numArray[1]; this.[., .] = false; this.[num, num2] = true; . = .(., ., num, num2); . = .; .’("sit"); num3 = this.[num, num2]; if (this.[num, num2] == ..) { num3 = this.[num, num2]; } else { num3 = this.[num, num2]; } .‘("mv", string.Concat(new object[] { num, ",", num2, ",", num3.ToString().Replace(',', '.') })); this..Append(.() + Convert.ToChar(13)); . = num; . = num2; . = num3; if (this.[num, num2] == ..) { .’("dance"); . = this.[num, num2]; . = .; .‘("sit", this.[num, num2].ToString().Replace(',', '.')); } } } try { if (this..Length > 0) { this.("@b" + this..ToString()); this. = new StringBuilder(); } } catch { } Thread.Sleep(410); } } internal void (int X, int Y) { foreach (™ ™ in ((Hashtable) this..Clone()).Values) { if ((™. == X) && (™. == Y)) { if (this.[X, Y] == .) { if (!™..("sit")) { ™. = this.[X, Y]; ™. = ™.; ™..‘("sit", this.[X, Y].ToString().Replace(',', '.')); this.(™); } } else if (this.[X, Y] == .) { if (!™..("bed")) { ™. = this.[X, Y]; ™. = ™.; ™..‘("lay", this.[X, Y].ToString().Replace(',', '.')); this.(™); } } else { ™..’("sit"); ™..’("lay"); ™. = this.[X, Y]; this.(™); } break; } } } internal void (™ roomUser, int toX, int toY, bool secondRefresh) { new (this.).BeginInvoke(roomUser, toX, toY, secondRefresh, null, null); } internal void (™ roomUser, int toX, int toY, bool secondRefresh) { new (this.).BeginInvoke(roomUser, toX, toY, secondRefresh, null, null); } internal void ( sourceBot, string Message) { string data = string.Concat(new object[] { "@X", œ.€(sourceBot.), Message, Convert.ToChar(2) }); foreach (™ ™ in ((Hashtable) this..Clone()).Values) { if ((Math.Abs((int) (™. - sourceBot.)) < 6) && (Math.Abs((int) (™. - sourceBot.)) < 6)) { ™..(data); } } } internal void (™ sourceUser, string Message) { this.(sourceUser, Message); if (sourceUser.) { this.("Ei" + œ.€(sourceUser.) + "H"); sourceUser. = false; } string data = string.Concat(new object[] { "@X", œ.€(sourceUser.), Message, Convert.ToChar(2) }); foreach (™ ™ in ((Hashtable) this..Clone()).Values) { if ((Math.Abs((int) (™. - sourceUser.)) < 6) && (Math.Abs((int) (™. - sourceUser.)) < 6)) { ™..(data); } } foreach (  in this..Values) { if ((Math.Abs((int) (. - sourceUser.)) < 6) && (Math.Abs((int) (. - sourceUser.)) < 6)) { .(sourceUser, Message); } } } internal void ( sourceBot, string Message) { string data = string.Concat(new object[] { "@Z", œ.€(sourceBot.), Message, Convert.ToChar(2) }); lock (this.) { foreach (™ ™ in this..Values) { ™..(data); } } } internal void (™ sourceUser, string Message) { this.(sourceUser, Message); if (sourceUser.) { this.("Ei" + œ.€(sourceUser.) + "H"); sourceUser. = false; } sourceUser..“("talk", "", Message.Length * 190); string data = string.Concat(new object[] { "@Z", œ.€(sourceUser.), Message, Convert.ToChar(2) }); Hashtable hashtable = new Hashtable(); hashtable = (Hashtable) this..Clone(); foreach (™ ™ in hashtable.Values) { this..Append(™.() + Convert.ToChar(13)); ™..(data); } lock (this.) { foreach (  in this..Values) { if (((Math.Abs((int) (. - sourceUser.)) < 6) && (Math.Abs((int) (. - sourceUser.)) < 6)) && (new Random(DateTime.Now.Millisecond).Next(0, 11) == 0)) { this.(, .); } } } } internal void (™ sourceUser, string Receiver, string Message) { this.(sourceUser, Message); if (sourceUser.) { this.("Ei" + œ.€(sourceUser.) + "H"); sourceUser. = false; } string data = string.Concat(new object[] { "@Y", œ.€(sourceUser.), Message, Convert.ToChar(2) }); Hashtable hashtable = new Hashtable(); hashtable = (Hashtable) this..Clone(); foreach (™ ™ in this..Values) { if (™.. == Receiver) { sourceUser..(data); ™..(data); break; } } } internal void €(byte casterRank, string Message) { List<™> list = new List<™>(); lock (this.) { foreach (™ ™ in this..Values) { if (™.. < casterRank) { list.Add(™); } } foreach (™ ™ in list) { this.(™., true, Message); } } } internal void (byte casterRank, string Message) { Message = "BK" + –.Œ("scommand_muted") + "\r" + Message; foreach (™ ™ in ((Hashtable) this..Clone()).Values) { if (!(™..‡ || (™.. >= casterRank))) { ™..‡ = true; ™..(Message); } } } internal void ‚(byte casterRank) { string data = "BK" + –.Œ("scommand_unmuted"); Hashtable hashtable = new Hashtable(); hashtable = (Hashtable) this..Clone(); try { foreach (™ ™ in hashtable.Values) { if (™..‡ && (™.. < casterRank)) { ™..‡ = false; ™..(data); } } } catch { } } internal void ƒ() { DataColumn column; using (“ “ = „..ž()) { column = “.‹("SELECT id FROM roombots WHERE roomid = '" + this. + "'"); } int[] numArray = ’.Š(column, null); for (int i = 0; i < numArray.Length; i++) {   = new (numArray[i], this.(), this); . = this.[., .]; this.[., .] = true; this..Add(., ); this.(@"@\" + .()); this.("@b" + .()); } } internal bool „(int X, int Y, int Length, int Width) { for (int i = X; i < (X + Width); i++) { for (int j = Y; j < (X + Length); j++) { if (this.[i, j]) { return true; } } } return false; } internal void †(int X, int Y, int Length, int Width,  State) { for (int i = X; i < (X + Width); i++) { for (int j = Y; j < (Y + Length); j++) { this.[i, j] = State; } } } internal  ‡(int X, int Y) { try { return this.[X, Y]; } catch { return null; } } internal int[] ˆ() { return new int[] { this..GetUpperBound(0), this..GetUpperBound(1) }; } public bool ‰(string emiterValue) { return ((this. != null) && (this. == emiterValue)); } private void Š(object o) { try { DataRow row; string str2; bool flag; using (“ “ = „..ž()) { row = “.Š("SELECT specialcast_emitter,specialcast_interval,specialcast_rnd_min, specialcast_rnd_max FROM room_modeldata WHERE model = '" + ((string) o) + "'"); } this. = Convert.ToString(row["specialcast_emitter"]); int millisecondsTimeout = Convert.ToInt32(row["specialcast_interval"]); int minValue = Convert.ToInt32(row["specialcast_rnd_min"]); int num3 = Convert.ToInt32(row["specialcast_rnd_max"]); row = null; string str = ""; goto Label_01E4; Label_0098: str2 = ""; int num4 = new Random().Next(minValue, num3 + 1); if (this. == "cam1") { int num5; switch (num4) { case 1: num5 = this.(); if (num5 != -1) { str2 = "targetcamera " + num5; } goto Label_019E; case 2: str2 = "setcamera 1"; goto Label_019E; case 3: str2 = "setcamera 2"; goto Label_019E; } num5 = this.(); if (num5 != -1) { str2 = "targetcamera " + num5; } } else if (this. == "sf") { str2 = num4.ToString(); } else if (this. == "lamp") { str2 = "setlamp " + num4; } Label_019E: if (str2 == "") { return; } if (str2 != str) { this.(this., str2); str = str2; } Thread.Sleep(millisecondsTimeout); Label_01E4: flag = true; } catch { } goto Label_0098; } internal void ( User) { if ((User. != 0) || (User.‚ && User.ƒ)) { “ “; User. = new (User., this.); User. = new ™(User., this., this.(), User, User.); if (User. == 0) { User.. = this.; User.. = this.; User.. = this.; User.. = this.; User.. = this.; } else {   = this..’(User.); User.. = .; User.. = .; User.. = .; User.. = .; User.. = .; User. = 0; this.(string.Concat(new object[] { @"A\", ., "/", User., "/", .ž() })); } User.. = -1; this..Add(User.., User.); if (!this.) { if (User.† && !User.„) { User..‘("flatctrl", "onlyfurniture"); } if (User.„) { User..‘("flatctrl", "useradmin"); } using (“ = „..ž()) { User.. = “.Ž(string.Concat(new object[] { "SELECT userid FROM room_votes WHERE userid = '", User., "' AND roomid = '", this., "'" })); } } else { if (this.) { using (“ = „..ž()) { User.. = “.Œ("SELECT figure_swim FROM users WHERE id = '" + User. + "'"); } } if (this. != null) { using (“ = „..ž()) { User.. = “.(string.Concat(new object[] { "SELECT ", this..Type, "_totalpoints FROM users WHERE id = '", User., "'" })); } this.(string.Concat(new object[] { "CzI", œ.€(User..), User.., Convert.ToChar(2), .(this.., User..), Convert.ToChar(2) })); } } this.(@"@\" + User..()); if ((User.‰ > 0) && !this..Contains(User.‰)) { string str; using (“ = „..ž()) { str = “.Œ("SELECT badge FROM groups_details WHERE id = '" + User.‰ + "'"); } this.(string.Concat(new object[] { "DuI", œ.€(User.‰), str, Convert.ToChar(2) })); this..Add(User.‰); } .(this., this..Count); } } internal void (int roomUID, bool sendKick, string moderatorMessage) { if (!this..Contains(roomUID)) { return; } ™ ™ = (™) this.[roomUID]; if (sendKick) { ™..("@R"); if (moderatorMessage != "") { ™..(string.Concat(new object[] { "@a", moderatorMessage, Convert.ToChar(2), "holo.cast.modkick" })); } } this.[™., ™.] = false; ™...Clear(); ™.. = null; ™..€ = 0; ™.. = false; ™..‚ = false; ™..ƒ = false; ™..„ = false; ™..† = false; ™.. = null; ™.. = null; if (™.. != -1) { ™..(); } if (!((™.. == null) || ™...)) { ™..(); } this..Remove(roomUID); if (this..Count <= 0) { this..Clear(); this..Clear(); this. = null; if (!this.) { this..Clear(); this..Clear(); } else { try { this..Abort(); } catch { } if (this. != null) { this..Clear(); } this. = null; } .(this.); this..Abort(); return; } if (™..‰ <= 0) { goto Label_0275; } bool flag = true; try { foreach (™ ™2 in this..Values) { if ((™2. != ™.) && (™2..‰ == ™..‰)) { flag = false; goto Label_0254; } } } catch { } Label_0254: if (flag) { this..Remove(™..‰); } Label_0275: this.("@]" + roomUID); .(this., this..Count); } internal bool ‘(int roomUID) { return this..ContainsKey(roomUID); } internal  —(int roomUID) { return ((™) this.[roomUID]).; } public (int roomID, bool isPublicroom) { string str; DataRow row; “ “; DataTable table; this. = roomID; this. = isPublicroom; using (“ = „..ž()) { str = “.Œ("SELECT model FROM rooms WHERE id = '" + roomID + "'"); row = “.Š("SELECT door_x,door_y,door_h,door_z,heightmap,publicroom_items, swimmingpool FROM room_modeldata WHERE model = '" + str + "'"); } this. = Convert.ToInt32(row["door_x"]); this. = Convert.ToInt32(row["door_y"]); this. = Convert.ToInt32(row["door_h"]); this. = Convert.ToByte(row["door_z"]); this. = Convert.ToString(row["heightmap"]); string[] strArray = this..Split(new char[] { Convert.ToChar(13) }); int length = strArray[0].Length; int num2 = strArray.Length - 1; this. = new .[length, num2]; this. = new byte[length, num2]; this. = new byte[length, num2]; this. = new double[length, num2]; this. = new bool[length, num2]; this. = new [length, num2]; this. = new [length, num2]; for (int i = 0; i < num2; i++) { for (int j = 0; j < length; j++) { string s = strArray[i].Substring(j, 1).Trim().ToLower(); if (s == "x") { this.[j, i] = ..; } else { this.[j, i] = ..; try { this.[j, i] = byte.Parse(s); } catch { } } } } if (isPublicroom) { string[] strArray2 = Convert.ToString(row["publicroom_items"]).Split("\n".ToCharArray()); for (int k = 0; k < strArray2.Length; k++) { string[] strArray3 = strArray2[k].Split(new char[] { ' ' }); int num6 = int.Parse(strArray3[2]); int num7 = int.Parse(strArray3[3]); .  = (.) int.Parse(strArray3[6]); this.[num6, num7] = ; if ( == ..) { this.[num6, num7] = byte.Parse(strArray3[5]); this.[num6, num7] = 1.0; } object obj2 = this.; this. = string.Concat(new object[] { obj2, strArray3[0], " ", strArray3[1], " ", strArray3[2], " ", strArray3[3], " ", strArray3[4], " ", strArray3[5], Convert.ToChar(13) }); } using (“ = „..ž()) { table = “.("SELECT object,x,y,goalx,goaly,stepx,stepy,roomid,state FROM room_modeldata_triggers WHERE model = '" + str + "'"); } foreach (DataRow row2 in table.Rows) { this.[Convert.ToInt32(row2["x"]), Convert.ToInt32(row2["y"])] = new (Convert.ToString(row2["object"]), Convert.ToInt32(row2["goalx"]), Convert.ToInt32(row2["goaly"]), Convert.ToInt32(row2["stepx"]), Convert.ToInt32(row2["stepy"]), Convert.ToInt32(row2["state"]) == 1, Convert.ToInt32(row2["roomid"])); } bool flag = false; using (“ = „..ž()) { flag = “.Ž("SELECT specialcast_interval FROM room_modeldata WHERE model = '" + str + "' AND specialcast_interval > 0"); } if (flag) { this. = new Thread(new ParameterizedThreadStart(this.Š)); this..Priority = ThreadPriority.Lowest; this..Start(str); } using (“ = „..ž()) { int num8; this. = int.TryParse(Convert.ToString(row["swimmingpool"]), out num8); flag = “.Ž("SELECT id FROM games_lobbies WHERE id = '" + roomID + "'"); } if (flag) { using (“ = „..ž()) { row = “.Š("SELECT type,rank FROM games_lobbies WHERE id = '" + roomID + "'"); } this. = new Š(this, Convert.ToString(row["type"]) == "bb", Convert.ToString(row["rank"])); } } else { this. = new (this); this. = new (this); using (“ = „..ž()) { table = “.("SELECT furniture.id, furniture.tid, furniture.x, furniture.y, furniture.z, furniture.h, furniture.var, furniture.wallpos FROM rooms, furniture WHERE furniture.roomid = rooms.id AND rooms.id = '" + roomID + "' ORDER BY rooms.id ASC"); } foreach (DataRow row2 in table.Rows) { if (Convert.ToString(row2["wallpos"]) == "") { this..‹(Convert.ToInt32(row2["id"]), Convert.ToInt32(row2["tid"]), Convert.ToInt32(row2["x"]), Convert.ToInt32(row2["y"]), Convert.ToInt32(row2["z"]), Convert.ToDouble(row2["h"]), Convert.ToString(row2["var"])); } else { this..‹(Convert.ToInt32(row2["id"]), Convert.ToInt32(row2["tid"]), Convert.ToString(row2["wallpos"]), Convert.ToString(row2["var"]), false); } } } this. = new Hashtable(); this. = new Hashtable(); this.ƒ(); this. = new HashSet(); this. = new StringBuilder(); this. = new Thread(new ThreadStart(this.)); this..Start(); this.[this., this.] = ..; } ~() { Ž.WriteLine(".", Ž.., ConsoleColor.Cyan, ConsoleColor.DarkCyan); } internal string dynamicStatuses { get { StringBuilder builder = new StringBuilder(); foreach (  in this..Values) { builder.Append(.() + Convert.ToChar(13)); } foreach (™ ™ in ((Hashtable) this..Clone()).Values) { builder.Append(™.() + Convert.ToChar(13)); } return builder.ToString(); } } internal string dynamicUnits { get { StringBuilder builder = new StringBuilder(); foreach (  in this..Values) { builder.Append(.()); } foreach (™ ™ in ((Hashtable) this..Clone()).Values) { builder.Append(™.()); } return builder.ToString(); } } internal string Flooritems { get { if (this.) { return "H"; } return this..(); } } internal string Groups { get { DataTable table; StringBuilder builder = new StringBuilder(œ.€(this..Count)); StringBuilder builder2 = new StringBuilder(); foreach (int num in this.) { builder2.Append(" OR id = '" + num + "'"); } builder2.Append(" OR"); using (“ “ = „..ž()) { “.ˆ("tablename", builder2.ToString().Substring(3)); table = “.("SELECT id,badge FROM groups_details WHERE @tablename 'a' = 'b'"); } foreach (DataRow row in table.Rows) { builder.Append(œ.€(Convert.ToInt32(row["id"])) + Convert.ToString(row["badge"]) + Convert.ToChar(2)); } return builder.ToString(); } } internal string Heightmap { get { return this.; } } internal string PublicroomItems { get { return this.; } } internal string Userlist { get { StringBuilder builder = new StringBuilder(œ.€(this.) + œ.€(this..Count)); foreach (™ ™ in ((Hashtable) this..Clone()).Values) { builder.Append(™.. + Convert.ToChar(2)); } return builder.ToString(); } } internal ICollection Users { get { return this..Values; } } internal string Wallitems { get { if (this.) { return ""; } return this..(); } } internal enum  { , , , ,  } private delegate void (string Data, int msSleep); private delegate void (™ roomUser, int toX, int toY, bool secondRefresh); internal class  { internal readonly string ; internal readonly int ; internal readonly int ; internal readonly int ; internal readonly int ; internal readonly int ; internal bool ; internal (string Object, int goalX, int goalY, int stepX, int stepY, bool State, int roomID) { this. = Object; this. = goalX; this. = goalY; this. = stepX; this. = stepY; this. = roomID; this. = State; } } internal class  { private  ; private Hashtable  = new Hashtable(); internal int ; internal void (int itemID, byte Z) {   = () this.[itemID]; .  = .(.); int num = 1; int num2 = 1; if ((. > 1) && (. > 1)) { if ((Z == 2) || (Z == 6)) { num = .; num2 = .; } else { num = .; num2 = .; } } for (int i = .; i < (. + num2); i++) { for (int j = .; j < (. + num); j++) { .  = this..[i, j]; if (( != null) && (.“() != itemID)) { } } } } internal void ‹(int itemID, int templateID, int X, int Y, int Z, double H, string Var) { try { .  = .(templateID); if (–.(., 0, 13) == "sound_machine") { this. = itemID; } int length = 0; int width = 0; if ((Z == 2) || (Z == 6)) { length = .; width = .; } else { length = .; width = .; } for (int i = X; i < (X + width); i++) { for (int j = Y; j < (Y + length); j++) { .  = this..[i, j]; if ( == null) { if ((. != 2) && (. != 3)) {  = new .(); .Add(itemID); } } else { .Add(itemID); } this..[i, j] = (.) .; if ((. == 2) || (. == 3)) { this..[i, j] = H + .; this..[i, j] = Convert.ToByte(Z); } else if (. == 4) { this..[i, j] = H; } this..[i, j] = ; } } if (.) { if (this..„(X, Y, length, width)) { return; } if (Var.ToLower() == "c") { this..†(X, Y, length, width, ..); } else if (Var.ToLower() == "o") { this..†(X, Y, length, width, ..); } else { this..†(X, Y, length, width, ..); } }   = new (itemID, templateID, X, Y, Z, H, Var); this..Add(itemID, ); } catch (Exception exception) { Ž.("[" + exception.Source + "] Exception Error - " + exception.Message); } } internal void Œ(int itemID, int ownerID) { if (this..ContainsKey(itemID)) {   = () this.[itemID]; .  = .(.); int num = 0; int num2 = 0; if ((. == 2) || (. == 6)) { num = .; num2 = .; } else { num = .; num2 = .; } for (int i = .; i < (. + num2); i++) { for (int j = .; j < (. + num); j++) { .  = this..[i, j]; if (( != null) && (.Count > 1)) { if (itemID == .”()) { int num5 = .“();  2 = () this.[num5]; if (.(2.). == 2) { this..[i, j] = ..; } else { this..[i, j] = ..; } } else if (itemID == .“()) { int num6 = .•(itemID);  3 = () this.[num6]; byte num7 = .(3.).; this..[i, j] = (.) num7; switch (num7) { case 2: case 3: this..[i, j] = 3.; this..[i, j] = 3. + .(3.).; break; case 4: this..[i, j] = 3.; break; } } .Remove(itemID); this..[i, j] = ; } else { this..[i, j] = ..; this..[i, j] = 0.0; this..[i, j] = 0; this..[i, j] = null; } if ((. == 2) || (. == 3)) { this..(i, j); } } } if ((this. == 0) && (–.(., 0, 13) == "sound_machine")) { this. = 0; } this..("A^" + itemID); this..Remove(itemID); using (“ “ = „..ž()) { if (ownerID > 0) { “.‰(string.Concat(new object[] { "UPDATE furniture SET x = '0',y = '0',z = '0', h = '0', ownerid = '", ownerID, "',roomid = '0' WHERE id = '", itemID, "' LIMIT 1" })); } else { “.‰("DELETE FROM furniture WHERE id = '" + itemID + "' LIMIT 1"); } } } } internal void (int itemID, int templateID, int X, int Y, byte typeID, byte Z) { if (!this..ContainsKey(itemID)) { try { .  = .(templateID); bool flag = –.(., 0, 13) == "sound_machine"; if (!flag || (this. <= 0)) {  ; int num5; int num6; string str; int num = 0; int num2 = 0; if ((Z == 2) || (Z == 6)) { num = .; num2 = .; } else { num = .; num2 = .; } double num3 = this..[X, Y]; double h = num3; if (this..[X, Y] != null) {  = () this.[this..[X, Y].“()]; h = . + .(.).; } for (num5 = X; num5 < (X + num2); num5++) { num6 = Y; while (num6 < (Y + num)) { if (this..[num5, num6]) { return; } .  = this..[num5, num6]; switch () { case ..: break; case ..: { if (this..[num5, num6] == null) { return; }  = () this.[this..[num5, num6].“()]; . 2 = .(.); if (((2. == 0.0) || (2. == 2)) || (2. == 3)) { return; } if ((. + 2.) > h) { h = . + 2.; } break; } default: { if (( != ..) || (this..[num5, num6] == null)) { return; } double num7 = (() this.[this..[num5, num6].“()]). + 0.1; if (num7 > h) { h = num7; } break; } } num6++; } } if (h > Œ.) { h = Œ.; } for (num5 = X; num5 < (X + num2); num5++) { for (num6 = Y; num6 < (Y + num); num6++) { .  = null; if (this..[num5, num6] == null) { if (((. == 1) && (. > 0.0)) || (. == 4)) {  = new .(); .Add(itemID); } } else {  = this..[num5, num6]; .Add(itemID); } this..[num5, num6] = (.) .; this..[num5, num6] = ; if ((. == 2) || (. == 3)) { this..[num5, num6] = h + .; this..[num5, num6] = Z; this..[num5, num6] = Z; if ((. == 3) && ((num5 != X) || (num6 != Y))) { if (num2 == 1) { this..[num5, num6] = ..; } else if (((Z == 2) && (num5 != X)) || ((Z == 0) && (num6 != Y))) { this..[num5, num6] = ..; } } } else if (. == 4) { this..[num5, num6] = h; } } } using (“ “ = „..ž()) { str = “.Œ("SELECT var FROM furniture WHERE id = '" + itemID + "'"); “.‰(string.Concat(new object[] { "UPDATE furniture SET roomid = '", this.., "',x = '", X, "',y = '", Y, "',z = '", Z, "',h = '", h.ToString().Replace(',', '.'), "' WHERE id = '", itemID, "' LIMIT 1" })); }  2 = new (itemID, templateID, X, Y, Z, h, str); this..Add(itemID, 2); this..("A]" + 2.ToString()); if (flag) { this. = itemID; } } } catch { } } } internal void Ž(int itemID, int X, int Y, byte Z) { try {  2; int num6; . ;   = () this.[itemID]; .  = .(.); int num = 0; int num2 = 0; if ((Z == 2) || (Z == 6)) { num = .; num2 = .; } else { num = .; num2 = .; } double num3 = this..[X, Y]; double num4 = num3; if (this..[X, Y] != null) { 2 = () this.[this..[X, Y].“()]; if (2 != ) { . 2 = .(2.); if (2. == 1) { num4 = 2. + 2.; } } else if (this..[X, Y].Count > 1) { num4 = 2.; } } int x = X; while (x < (X + num2)) { num6 = Y; while (num6 < (Y + num)) { if ((. != 2) && this..[x, num6]) { return; } .  = this..[x, num6];  = this..[x, num6]; if ( != ..) { if ( == null) { if ((x != .) || (num6 != .)) { return; } } else { 2 = () this.[.“()]; if (2 != ) { . 3 = .(2.); if ((3. == 1) && (3. > 0.0)) { if ((2. + 3.) > num4) { num4 = 2. + 3.; } } else if (3. == 2) { return; } } } } num6++; } x++; } int num7 = 1; int num8 = 1; if ((. > 1) || (. > 1)) { if ((. == 2) || (. == 6)) { num7 = .; num8 = .; } else { num7 = .; num8 = .; } } if (num4 > Œ.) { num4 = Œ.; } for (x = .; x < (. + num8); x++) { num6 = .; while (num6 < (. + num7)) {  = this..[x, num6]; if (( == null) || (.Count <= 1)) { goto Label_05AC; } if (itemID == .”()) { if (.((() this.[.“()]).). == 2) { this..[x, num6] = ..; } else { this..[x, num6] = ..; } } else if (itemID == .“()) {  3 = () this.[.•(itemID)]; byte num9 = .(3.).; this..[x, num6] = (.) num9; switch (num9) { case 2: case 3: this..[x, num6] = 3.; this..[x, num6] = 3. + .(3.).; if ((. == 3) && ((x != X) || (num6 != Y))) { if (num2 == 1) { this..[x, num6] = ..; } else if (((Z == 2) && (x != X)) || ((Z == 0) && (num6 != Y))) { this..[x, num6] = ..; } } goto Label_058A; } if (num9 == 4) { this..[x, num6] = 3.; } } Label_058A: .Remove(itemID); this..[x, num6] = ; goto Label_060A; Label_05AC: this..[x, num6] = ..; this..[x, num6] = 0.0; this..[x, num6] = 0; this..[x, num6] = null; Label_060A: if ((. == 2) || (. == 3)) { this..(x, num6); } num6++; } } . = X; . = Y; . = Z; . = num4; this..("A_" + .ToString()); using (“ “ = „..ž()) { “.‰(string.Concat(new object[] { "UPDATE furniture SET x = '", X, "',y = '", Y, "',z = '", Z, "',h = '", num4.ToString().Replace(',', '.'), "' WHERE id = '", itemID, "' LIMIT 1" })); } for (x = X; x < (X + num2); x++) { for (num6 = Y; num6 < (Y + num); num6++) {  = null; if (this..[x, num6] == null) { if ((((. > 0.0) && (. != 2)) && (. != 3)) && (. != 4)) {  = new .(); .Add(itemID); } } else {  = this..[x, num6]; .Add(itemID); } this..[x, num6] = (.) .; this..[x, num6] = ; if ((. == 2) || (. == 3)) { this..[x, num6] = num4 + .; this..[x, num6] = Z; this..(x, num6); } else if (. == 4) { this..[x, num6] = num4; } } } } catch { } } internal void (int itemID, string toStatus, bool hasRights) { if (this..ContainsKey(itemID)) {   = () this.[itemID]; string input = .ž(); if ((((input != "edice") && (input != "edicehc")) && (–.(input, 0, 11) != "prizetrophy")) && !(–.(input, 0, 7) == "present")) { using (“ “ = „..ž()) { “.ˆ("var", toStatus); if ((toStatus.ToLower() == "c") || (toStatus.ToLower() == "o")) { if (hasRights) { .  = .(.); if (.) { int length = 1; int width = 1; if ((. > 1) || (. > 1)) { if ((. == 2) || (. == 6)) { length = .; width = .; } else { length = .; width = .; } } if (toStatus.ToLower() == "c") { if (this..„(., ., length, width)) { return; } this..†(., ., length, width, ..); } else { this..†(., ., length, width, ..); } . = toStatus; this..(string.Concat(new object[] { "AX", itemID, Convert.ToChar(2), toStatus, Convert.ToChar(2) })); “.‰("UPDATE furniture SET var = @var WHERE id = " + itemID + " LIMIT 1"); } } } else if (toStatus.Replace(Convert.ToChar(2), Convert.ToChar(0x20)) == toStatus) { . = toStatus; this..(string.Concat(new object[] { "AX", itemID, Convert.ToChar(2), toStatus, Convert.ToChar(2) })); “.‰("UPDATE furniture SET var = @var WHERE id = " + itemID + " LIMIT 1"); } } } } } internal bool ‘(int itemID) { return this..ContainsKey(itemID); } internal  ’(int itemID) { return () this.[itemID]; } public ( Room) { this. = Room; } internal void Clear() { try { this..Clear(); } catch { } this. = null; this. = null; } internal string Items { get { StringBuilder builder = new StringBuilder(œ.€(this..Count)); foreach (  in this..Values) { builder.Append(.ToString()); } return builder.ToString(); } } } internal class  { private  ; private Hashtable  = new Hashtable(); internal string (int roomID) { try { string[] itemArray; using (“ “ = „..ž()) { itemArray = (string[]) “.Š("SELECT preset_cur,preset_1,preset_2,preset_3 FROM furniture_moodlight WHERE roomid ='" + roomID + "'").ItemArray; } string str = œ.€(3) + œ.€(Convert.ToInt32(itemArray[0])); for (int i = 1; i <= 3; i++) { string[] strArray2 = itemArray[i].Split(new char[] { ',' }); str = string.Concat(new object[] { str, œ.€(i), œ.€(Convert.ToInt32(strArray2[0])), strArray2[1], Convert.ToChar(2), œ.€(Convert.ToInt32(strArray2[2])) }); } return str; } catch { return ""; } } internal void (bool isEnabled, int presetID, int bgState, string presetColour, int alphaDarkF, int roomID) { int num; “ “; string str; DataRow row; using (“ = „..ž()) { num = “.("SELECT id FROM furniture_moodlight WHERE roomid ='" + roomID + "'"); } if (!isEnabled) { string str2; using (“ = „..ž()) { str2 = “.Œ("SELECT var FROM furniture WHERE id ='" + num + "'"); } if (str2.Substring(0, 1) == "2") { str = "1" + str2.Substring(1); } else { str = "2" + str2.Substring(1); } using (“ = „..ž()) { “.‰(string.Concat(new object[] { "UPDATE furniture SET var = '", str, "' WHERE id ='", num, "' LIMIT 1" })); } } else { str = string.Concat(new object[] { "2,", presetID, ",", bgState, ",", presetColour, ",", alphaDarkF }); using (“ = „..ž()) { “.‰(string.Concat(new object[] { "UPDATE furniture SET var ='", str, "' WHERE id ='", num, "' LIMIT 1" })); “.‰(string.Concat(new object[] { "UPDATE furniture_moodlight SET preset_cur ='", presetID, "',preset_", presetID, " ='", bgState, ",", presetColour, ",", alphaDarkF, "' WHERE id = '", num, "' LIMIT 1" })); } } using (“ = „..ž()) { row = “.Š("SELECT wallpos,var FROM furniture WHERE id = '" + num + "'"); } string wallPosition = Convert.ToString(row["wallpos"]); this.(num, "roomdimmer", wallPosition, Convert.ToString(row["var"])); } internal void (int itemID, string cctName, string wallPosition, string itemVariable) { this..(string.Concat(new object[] { "AU", itemID, Convert.ToChar(9), cctName, Convert.ToChar(9), " ", wallPosition, Convert.ToChar(9), itemVariable })); } internal void ‹(int itemID, int templateID, string wallPosition, string Var, bool Place) { if (!this..Contains(itemID)) {   = new (itemID, templateID, wallPosition, Var); this..Add(itemID, ); if (Place) { this..("AS" + .ToString()); using (“ “ = „..ž()) { “.‰(string.Concat(new object[] { "UPDATE furniture SET roomid = '", this.., "',wallpos = '", wallPosition, "' WHERE id = '", itemID, "' LIMIT 1" })); if (templateID == 0x3ea) { if (!“.Ž("SELECT roomid FROM furniture_moodlight WHERE id='" + itemID + "'")) { “.‰(string.Concat(new object[] { "INSERT INTO furniture_moodlight VALUES ('", itemID, "','", this.., "','1','1,#000000,225','1,#000000,200','1,#000000,175')" })); } else { “.‰(string.Concat(new object[] { "UPDATE furniture_moodlight SET roomid = '", this.., "' WHERE id= '", itemID, "'" })); } } } } } } internal void Œ(int itemID, int ownerID) { if (this..ContainsKey(itemID)) { this..("AT" + itemID); this..Remove(itemID); using (“ “ = „..ž()) { if (ownerID > 0) { “.‰(string.Concat(new object[] { "UPDATE furniture SET ownerid = '", ownerID, "',roomid = '0' WHERE id = '", itemID, "' LIMIT 1" })); } else { “.‰("DELETE FROM furniture WHERE id = '" + itemID + "' LIMIT 1"); } } } } internal void (int itemID, int toStatus) { if (this..ContainsKey(itemID)) {   = () this.[itemID]; string str = .ž(); if (((((str != "roomdimmer") && (str != "post.it")) && ((str != "post.it.vd") && (str != "poster"))) && (str != "habbowheel")) && !(str == "ads_lin_wh_c")) { . = toStatus.ToString(); this..(string.Concat(new object[] { "AU", itemID, Convert.ToChar(9), str, Convert.ToChar(9), " ", ., Convert.ToChar(9), . })); using (“ “ = „..ž()) { “.‰(string.Concat(new object[] { "UPDATE furniture SET var = '", toStatus, "' WHERE id = '", itemID, "' LIMIT 1" })); } } } } internal bool ‘(int itemID) { return this..ContainsKey(itemID); } internal  ’(int itemID) { return () this.[itemID]; } public ( Room) { this. = Room; } internal void Clear() { try { this..Clear(); } catch { } this. = null; this. = null; } internal string Items { get { StringBuilder builder = new StringBuilder(); try { foreach (  in this..Values) { builder.Append(.ToString() + Convert.ToChar(13)); } } catch { } return builder.ToString(); } } } private class  { private int[]  = new int[20]; internal int (int aboveID) { for (int i = 0; i < 20; i++) { if (this.[i] == aboveID) { return this.[i + 1]; } } return 0; } internal int “() { for (int i = 0; i < 20; i++) { if (this.[i] == 0) { return this.[i - 1]; } } return 0; } internal int ”() { return this.[0]; } internal int •(int belowID) { for (int i = 0; i < 20; i++) { if (this.[i] == belowID) { return this.[i - 1]; } } return 0; } internal () { } internal void Add(int itemID) { for (int i = 0; i < 20; i++) { if (this.[i] == 0) { this.[i] = itemID; break; } } } internal bool Contains(int itemID) { foreach (int num in this.) { if (num == itemID) { return true; } } return false; } internal void Remove(int itemID) { int num; for (num = 0; num < 20; num++) { if (this.[num] == itemID) { this.[num] = 0; break; } } int index = 0; int[] numArray = new int[20]; for (num = 0; num < 20; num++) { if (this.[num] > 0) { numArray[index] = this.[num]; index++; } } this. = numArray; } internal int Count { get { int num = 0; for (int i = 0; i < 20; i++) { if (this.[i] > 0) { num++; } else { return num; } } return num; } } } } }