namespace Holo.Virtual.Users { using Holo; using Holo.Managers; using Holo.Source.GameConnectionSystem; using Holo.Source.Managers; using Holo.Source.Managers.User; using Holo.Source.Socket_servers.Game_Socketsystem; using Holo.Virtual.Rooms; using Holo.Virtual.Rooms.Games; using Holo.Virtual.Rooms.Items; using Holo.Virtual.Rooms.Pathfinding; using Holo.Virtual.Users.Items; using Holo.Virtual.Users.Messenger; using Ion.Storage; using Microsoft.VisualBasic; using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Globalization; using System.Net.Sockets; using System.Runtime.CompilerServices; using System.Text; using System.Threading; public class virtualUser { internal bool _activateBuy; internal List _Badges = new List(); internal List _badgeSlotIDs = new List(); internal bool _blockCFH; internal bool _clean; internal bool _clubMember; private gameConnection _ConnectionManager; internal int _Credits; internal string _Figure; internal List _fuserights; internal int _groupID; internal int _groupMemberRank; internal int _guideCount; internal int _guideFinish; internal int _guideRequest; internal int _guideRoom; internal bool _guideSearch; private int _handPage; internal bool _hasRights; internal bool _hostsEvent; internal bool _inPublicroom; internal bool _isDisconnected; internal bool _isGuide; public bool _isLoggedIn; internal bool _isMuted; internal bool _isOwner; internal int _maxFriends; internal int _Minuteperiod; internal string _Mission; internal string _mutedIDs; internal bool _noHeightLimit; internal int _Pixels; internal byte _Rank; private bool _receivedSpriteIndex; internal bool _ROOMACCESS_PRIMARY_OK; internal bool _ROOMACCESS_SECONDARY_OK; internal int _roomID; internal char _Sex; internal bool _stackRugs; internal int _teleporterID; internal int _teleporterRoomID; internal int _Tickets; internal bool _tradeAccept; internal bool _tradeConfirm; internal int _tradeItemCount; internal int[] _tradeItems = new int[0x41]; internal int _tradePartnerRoomUID = -1; internal int _tradePartnerUID = -1; internal string _Username; private Thread brbLooper; private int connectionID; private Socket connectionSocket; internal string currentPacket; internal Holo.Virtual.Rooms.Games.gamePlayer gamePlayer; internal bool generatedOwnRooms = false; private messageHandler Handler; internal string Ipaddress = ""; internal virtualMessenger Messenger; public bool nameChanged = false; private bool on = false; internal bool ownRoomsUpdated = true; internal bool pingOK; private bool RegisteredPackets = false; internal int Respect; internal virtualRoom Room; internal virtualRoomUser roomUser; private virtualSongEditor songEditor; internal Coord[] spawnLoc = new Coord[] { new Coord(-1, -1), new Coord(-1, -1) }; internal string spawnStatus = ""; internal int statusCount; internal string statusID; internal virtualRoomUserStatusManager statusManager; internal int userID; public virtualUser(gameConnection ConnectionManager) { this._ConnectionManager = ConnectionManager; } internal void abortTrade() { if (((this.Room != null) && this.Room.containsUser(this._tradePartnerRoomUID)) && (this.roomUser != null)) { virtualUser Partner = this.Room.getUser(this._tradePartnerRoomUID); this.sendData("An"); this.refreshHand("update"); Partner.sendData("An"); Partner.refreshHand("update"); this._tradePartnerRoomUID = -1; this._tradeAccept = false; this._tradeItems = new int[0x41]; this._tradeItemCount = 0; this.statusManager.removeStatus("trd"); this.roomUser.Refresh(); Partner._tradePartnerRoomUID = -1; Partner._tradeAccept = false; Partner._tradeItems = new int[0x41]; Partner._tradeItemCount = 0; Partner.statusManager.removeStatus("trd"); Partner.roomUser.Refresh(); } } private void delDisconnectTimed(int ms) { Thread.Sleep(ms); this.Disconnect(); } internal void Disconnect() { this._ConnectionManager.Close(); } internal void Disconnect(int ms) { new timedDisconnector(this.delDisconnectTimed).BeginInvoke(ms, null, null); } ~virtualUser() { if (!this._isDisconnected) { this.Disconnect(); } GC.Collect(); } private bool isSpeechCommand(string Text) { string[] args = Text.Split(new char[] { ' ' }); try { DatabaseClient dbClient; string Message; virtualUser Target; DataRow dRow; int banHours; string Reason; string lookup; virtualUser User; int Minutes; string userName; bool returnNow; Thread Refresher; ThreadStart tStarter; DataTable dTable; int i; int furniID; int randomValue; string furniSprite; floorItem fItem; Hashtable Users; string amount; string taxi; string user; long pixelstoupdate; long newpixels; int Credits; string Badge; string CS$4$0002; switch (args[0].ToLower()) { case "commands": if (this._Rank >= 5) { goto Label_0785; } this.sendData("BKAbout: \rServer Time: " + DateTime.Now.ToString() + " (EST)\r\r\rEmulator: Life R35 Emulator\r\r(Jeff's Edition EMU) Syntax Commands \r\r:poof \r:cleanhand \r:no_height_limits \r:whosonline \r:server \r:staff \r:cfh \r"); goto Label_5649; case "poof": this.refreshAppearance(false, false, true); goto Label_5649; case "cleanmyhand": if (!this._clean) { goto Label_0822; } using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("DELETE FROM furniture WHERE ownerid = '" + this.userID + "' AND roomid = '0'"); } this.refreshHand("update"); this._clean = false; goto Label_5649; case "no_height_limits": if (this._noHeightLimit) { goto Label_08D4; } this._noHeightLimit = true; this.sendData("BKThe height limit has been disabled for you! You can now walk in the height without any limits." + Convert.ToChar(2)); goto Label_5649; case "whosonline": this.sendData(userManager.generateWhosOnline(rankManager.containsRight(this, "fuse_administrator_access", this.userID))); goto Label_5649; case "server": this.sendData(string.Concat(new object[] { "BKServer Information \rServer Time: ", DateTime.Now.ToString(), " (GMT)\r\r\rEmulator: Jeff's EMU Edition\rBuild: 4.4.0.0 (04/12/2010)\rDCR Support: r35-r36", Convert.ToChar(2) })); goto Label_5649; case "spec": this.sendData(string.Concat(new object[] { "BKServer System Spec \rOSVersion:", Environment.OSVersion, "\rProcessorCount:", Environment.ProcessorCount, "\rMachineName:", Environment.MachineName, "\r", Convert.ToChar(2) })); goto Label_5649; case "staff": this.sendData("BKIf you need to contact the Hotel Staff Please use the Call for help" + Convert.ToChar(2)); goto Label_5649; case "cfh": Message = Text.Substring(3); this.Room.sendShout(this.roomUser, "A Mod is on there way!" + Convert.ToChar(2)); userManager.sendToRank(6, false, string.Concat(new object[] { "BK", stringManager.getString("scommand_911"), "\r Help call from ", this._Username, " \r Message: ", Message, " \r Room ID: ", this._roomID, Convert.ToChar(2) })); userManager.sendToRank(7, false, string.Concat(new object[] { "BK", stringManager.getString("scommand_911"), "\r Help call from ", this._Username, " \r Message: ", Message, " \r Room ID: ", this._roomID, Convert.ToChar(2) })); goto Label_5649; case "alert": if (this._Rank > 5) { goto Label_0B41; } return false; case "roomalert": if (rankManager.containsRight(this, "fuse_room_alert", this.userID)) { goto Label_0BE5; } return false; case "kick": if (rankManager.containsRight(this, "fuse_kick", this.userID)) { goto Label_0C59; } return false; case "roomkick": if (rankManager.containsRight(this, "fuse_room_kick", this.userID)) { goto Label_0D52; } return false; case "shutup": if (rankManager.containsRight(this, "fuse_mute", this.userID)) { goto Label_0DDC; } return false; case "unmute": if (rankManager.containsRight(this, "fuse_mute", this.userID)) { goto Label_0EFF; } return false; case "roomshutup": if (rankManager.containsRight(this, "fuse_room_mute", this.userID)) { goto Label_0FFA; } return false; case "roomunmute": if (rankManager.containsRight(this, "fuse_room_mute", this.userID)) { goto Label_1084; } return false; case "ban": if (rankManager.containsRight(this, "fuse_ban", this.userID)) { goto Label_1109; } return false; case "superban": if (rankManager.containsRight(this, "fuse_superban", this.userID)) { goto Label_132E; } return false; case "habbo": if (rankManager.containsRight(this, "fuse_alert", this.userID)) { goto Label_1557; } return false; case "wheres": if (this._Rank > 5) { goto Label_15F1; } return false; case "kiss": if (this._Rank > 5) { goto Label_1795; } return false; case "bj": if (this._Rank > 5) { goto Label_19DA; } return false; case "rape": if (this._Rank > 5) { goto Label_1B14; } return false; case "clone": if (this._Rank > 5) { goto Label_1C39; } return false; case "sendme": goto Label_1CF6; case "pixels": if (this._Rank > 5) { goto Label_1D4F; } return false; case "ra": if (rankManager.containsRight(this, "fuse_alert", this.userID)) { goto Label_1E18; } return false; case "ha": case "hw": if (this._Rank > 5) { goto Label_1EAC; } return false; case "admin": if (this._Rank >= 5) { goto Label_1F5E; } this.sendData("BKAbout: \rServer Time: " + DateTime.Now.ToString() + " (EST)\r\r\r(Jeff's Edition EMU) Syntax Commands \r\rThis command is just for Jeff;\rSorry, But you do not have access to this command."); goto Label_5649; case "offline": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_1FA1; } return false; case "cleanroom": if (this._Rank > 6) { goto Label_2009; } return false; case "teleport": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_20D7; } return false; case "userinfo": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2121; } return false; case "cords": if (this._Rank > 5) { goto Label_216D; } return false; case "stun": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_220E; } return false; case "unstun": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2250; } return false; case "refresh": returnNow = false; if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2295; } return false; case "infobus": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { string Title; SortedList Questions = new SortedList(); using (dbClient = Eucalypt.dbManager.GetClient()) { Title = dbClient.getString("SELECT question from infobus WHERE id = 0"); dTable = dbClient.getTable("SELECT id, question FROM infobus"); } StringBuilder Packet = new StringBuilder("AO" + Title + Convert.ToChar(13)); foreach (DataRow dRow in dTable.Rows) { Questions.Add(int.Parse(dRow["id"].ToString()), dRow["question"].ToString()); } Questions.Remove(0); i = 0; int Char = 13; foreach (string Question in Questions.Values) { i++; if (i == Questions.Count) { Char = 2; } Packet.Append(string.Concat(new object[] { i, ":", Question, Convert.ToChar(Char) })); } this.Room.InfobusPoll_answers = new int[Questions.Count]; this.Room.sendData(Packet.ToString()); Thread InfobusStopper = new Thread(new ThreadStart(this.Room.InfobusStop)); InfobusStopper.Priority = ThreadPriority.Lowest; InfobusStopper.Start(); } goto Label_5649; case "rig": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2703; } return false; case "zombie": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_293D; } return false; case "ghost": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2A52; } return false; case "happyhour": tStarter = null; if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2B69; } return false; case "globalfurni": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2C38; } return false; case "allowtaxi": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2D50; } return false; case "flag": if (this._Rank > 6) { goto Label_2E34; } return false; case "massdance": if (this._Rank > 6) { foreach (virtualRoomUser User in this.Room.Users) { User.statusManager.addStatus("dance", ""); User.statusManager.Refresh(); } } goto Label_5649; case "masstalk": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2F62; } return false; case "masswave": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_2FFB; } return false; case "stopwave": if (rankManager.containsRight(this, "fuse_moderator_access", this.userID)) { goto Label_30A0; } return false; case "stopdance": if (rankManager.containsRight(this, "fuse_moderator_access", this.userID)) { goto Label_3129; } return false; case "bite": User = userManager.getUser(args[1]); if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_31C9; } return false; case "inject": if (this._Rank > 6) { goto Label_3231; } return false; case "red": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_32AD; } return false; case "summon": if (this._Rank > 6) { goto Label_3335; } return false; case "send": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_33C7; } return false; case "admininject": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_341B; } return false; case "foreverwave": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_3496; } return false; case "walk": if (rankManager.containsRight(this, "fuse_moderator_access", this.userID)) { goto Label_34EE; } return false; case "dontwalk": if ((this._isOwner && !this._inPublicroom) && (this.Room != null)) { goto Label_35D1; } return false; case "kill": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_3679; } return false; case "naked": if (rankManager.containsRight(this, "fuse_alert", this.userID)) { goto Label_36FE; } return false; case "unnaked": goto Label_5649; case "givepixels": { if (!rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { this.sendData("BKYou Don't Have the Right to Access This Command!"); return false; } User = userManager.getUser(args[1]); Target = userManager.getUser(args[1]); pixelstoupdate = int.Parse(args[2]); long oldpixels = 0L; using (dbClient = Eucalypt.dbManager.GetClient()) { oldpixels = dbClient.getInt("SELECT pixels FROM users WHERE name = '" + args[1] + "'"); } newpixels = oldpixels + pixelstoupdate; using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET pixels = ", newpixels, " WHERE name = '", args[1], "'" })); } User.refreshValueables(true, false); Target.sendData("BKYou Have Recieved " + pixelstoupdate + " pixel(s) from a Jeff!"); this.sendData(string.Concat(new object[] { "BKThe User ", args[1], " has Received ", pixelstoupdate, " pixel(s)!" })); goto Label_5649; } case "pickall": if (this._Rank > 6) { goto Label_3910; } return false; case "kickroom": if (this._Rank > 5) { goto Label_3A45; } return false; case "nude": { using (dbClient = Eucalypt.dbManager.GetClient()) { if (this._Rank <= 6) { return false; } dbClient.runQuery("UPDATE users SET figure = 'hd-180-4.hr-831-61' WHERE id = '" + this.userID + "'"); this.refreshAppearance(true, true, true); goto Label_5649; } } case "invisible": { using (dbClient = Eucalypt.dbManager.GetClient()) { if (this._Rank <= 6) { return false; } dbClient.runQuery("UPDATE users SET figure = 'hd-0-0.sh-0-.lg-0-.ch-0-.hr-0-0' WHERE id = '" + this.userID + "'"); this.refreshAppearance(true, true, true); goto Label_5649; } } case "masscredits": if (this._Rank <= 6) { return false; } Credits = int.Parse(args[1]); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE users SET credits = credits + '" + Credits + "'"); } foreach (virtualUser User in userManager._Users.Values) { this.refreshValueables(true, false); } goto Label_5649; case "roomcredits": if (this._Rank > 6) { goto Label_3C40; } return false; case "massbadge": if (this._Rank > 6) { goto Label_3D49; } return false; case "credits": { using (dbClient = Eucalypt.dbManager.GetClient()) { if (this._Rank <= 5) { return false; } Target = userManager.getUser(userManager.getUserID(args[1])); Credits = int.Parse(args[2]); dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET credits = credits + ", Credits, " WHERE id = ", Target.userID })); this.sendData("Credits Given !"); this.refreshValueables(true, false); goto Label_5649; } } case "masspixels": if (this._Rank <= 6) { return false; } pixelstoupdate = int.Parse(args[1]); foreach (virtualUser User in userManager._Users.Values) { newpixels = User._Pixels + pixelstoupdate; using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET pixels = ", newpixels, " WHERE name = '", User._Username, "'" })); } User.refreshValueables(true, false); } goto Label_5649; case "roompixels": if (this._Rank > 6) { goto Label_403B; } return false; case "cure": if (this._Rank > 6) { goto Label_413A; } return false; case "color": if (this._Rank > 6) { goto Label_418A; } return false; case "renameroom": if (this._Rank > 6) { goto Label_424C; } return false; case "colour red": if (this._Rank > 6) { goto Label_42F9; } return false; case "colour blue": if (this._Rank > 6) { goto Label_432B; } return false; case "colour yellow": if (this._Rank > 6) { goto Label_435D; } return false; case "colour pink": if (this._Rank > 6) { goto Label_438F; } return false; case "colour black": if (this._Rank > 6) { goto Label_43C1; } return false; case "colour purple": if (this._Rank > 6) { goto Label_43F3; } return false; case "colour green": if (this._Rank > 6) { goto Label_4425; } return false; case "colour off": if (this._Rank > 6) { goto Label_4456; } return false; case "la": if (this._Rank > 6) { goto Label_4484; } return false; case "tui": if (this._Rank > 6) { goto Label_4670; } return false; case "logout": if (this._Rank > 6) { goto Label_485C; } return false; case "fuckyou": User = userManager.getUser(args[1]); this.Room.sendShout(this.roomUser, "Fuck You" + User._Username); User.sendData("BKFuck you " + User._Username + " Hahahah By: " + this._Username); this.Room.sendShout(this.roomUser, "Fuck You" + User._Username); User.sendData("BKFuck you " + User._Username + " Hahahah By: " + this._Username); this.Room.sendShout(this.roomUser, "I Just Owned " + User._Username); goto Label_5649; case "clean": if (this._Rank > 6) { goto Label_497F; } goto Label_5649; case "lockroom": if (this._Rank > 6) { goto Label_49F9; } return false; case "invis": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_4A7F; } return false; case "pull": if (this._Rank > 6) { goto Label_4B07; } return false; case "push2": if (this._Rank > 6) { goto Label_4CF3; } return false; case "push3": if (this._Rank > 6) { goto Label_4EDF; } return false; case "push4": if (this._Rank > 6) { goto Label_50CB; } return false; case "nc": if (rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { goto Label_52C0; } return false; case "warp": if (this._Rank > 6) { goto Label_5348; } return false; case "sendroom": if (this._Rank > 6) { goto Label_538E; } return false; case "summonall": if (this._Rank > 6) { goto Label_5421; } return false; case "openroom": if (this._Rank > 6) { goto Label_54AE; } return false; case "lockroom2": if (this._Rank > 6) { goto Label_5518; } return false; case "staffroom": if (this._Rank > 6) { goto Label_55B3; } return false; default: return false; } Label_0785: this.sendData("BKModerator Commands \rFull list of MOD commands,\rPlease go to http://gardenshotel.no-ip.org:8080/mod.txt \r Note: Jeff Added commands for MODs. \rAnother Note: Please rmb to put http:// for the link\rDCR Support: R35-R36" + Convert.ToChar(2)); goto Label_5649; Label_0822:; this.sendData(string.Concat(new object[] { "BKIf you want to clear your whole hand please type the command again,", Convert.ToChar(13), "this command will remove every item from your inventory.", Convert.ToChar(13), Convert.ToChar(13), "WARNING: You are unable to restore or cancel the process!", Convert.ToChar(2) })); this._clean = true; goto Label_5649; Label_08D4: this._noHeightLimit = false; this.sendData("BKThe height limit has been enabled for you! You can not walk in the height without any limits anymore." + Convert.ToChar(2)); goto Label_5649; Label_0B41: Target = userManager.getUser(userManager.getUserID(args[1])); Target.sendData("B!" + stringManager.wrapParameters(args, 2) + Convert.ToChar(2)); this.sendData("BK" + stringManager.getString("scommand_success") + Convert.ToChar(2)); staffManager.addStaffMessage("alert", this.userID, Target.userID, args[2], ""); goto Label_5649; Label_0BE5: Message = Text.Substring(10); this.Room.sendData("B!" + Message + Convert.ToChar(2)); staffManager.addStaffMessage("ralert", this.userID, this.Room.roomID, Message, ""); goto Label_5649; Label_0C59: Target = userManager.getUser(userManager.getUserID(args[1])); if (Target._Rank < this._Rank) { Message = ""; if (args.Length > 2) { Message = stringManager.wrapParameters(args, 2); } Target.Room.removeUser(Target.roomUser.roomUID, true, Message); this.sendData("BK" + stringManager.getString("scommand_success") + Convert.ToChar(2)); staffManager.addStaffMessage("kick", this.userID, Target.userID, Message, ""); } else { this.sendData("BK" + stringManager.getString("scommand_failed") + Convert.ToChar(2)); } goto Label_5649; Label_0D52: Message = stringManager.wrapParameters(args, 1); this.Room.kickUsers(this._Rank, Message); this.sendData("BK" + stringManager.getString("scommand_success") + Convert.ToChar(2)); staffManager.addStaffMessage("rkick", this.userID, this.Room.roomID, Message, ""); goto Label_5649; Label_0DDC: Target = userManager.getUser(userManager.getUserID(args[1])); if (!((Target._Rank >= this._Rank) || Target._isMuted)) { Message = stringManager.wrapParameters(args, 2); Target._isMuted = true; Target.sendData(string.Concat(new object[] { "BK", stringManager.getString("scommand_muted"), "\r", Message, Convert.ToChar(2) })); this.sendData("BK" + stringManager.getString("scommand_success") + Convert.ToChar(2)); staffManager.addStaffMessage("mute", this.userID, Target.userID, Message, ""); } else { this.sendData("BK" + stringManager.getString("scommand_failed") + Convert.ToChar(2)); } goto Label_5649; Label_0EFF: Target = userManager.getUser(userManager.getUserID(args[1])); if ((Target._Rank < this._Rank) && Target._isMuted) { Target._isMuted = false; Target.sendData("BK" + stringManager.getString("scommand_unmuted") + Convert.ToChar(2)); this.sendData("BK" + stringManager.getString("scommand_success") + Convert.ToChar(2)); staffManager.addStaffMessage("unmute", this.userID, Target.userID, "", ""); } else { this.sendData("BK" + stringManager.getString("scommand_failed") + Convert.ToChar(2)); } goto Label_5649; Label_0FFA: Message = stringManager.wrapParameters(args, 1); this.Room.muteUsers(this._Rank, Message); this.sendData("BK" + stringManager.getString("scommand_success") + Convert.ToChar(2)); staffManager.addStaffMessage("rmute", this.userID, this.Room.roomID, Message, ""); goto Label_5649; Label_1084: this.Room.unmuteUsers(this._Rank); this.sendData("BK" + stringManager.getString("scommand_success") + Convert.ToChar(2)); staffManager.addStaffMessage("runmute", this.userID, this.Room.roomID, "", ""); goto Label_5649; Label_1109: using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("name", args[1]); dRow = dbClient.getRow("SELECT id,rank FROM users WHERE name = @name"); } if (dRow.Table.Rows.Count == 0) { this.sendData(string.Concat(new object[] { "BK", stringManager.getString("modtool_actionfailed"), "\r", stringManager.getString("modtool_usernotfound"), Convert.ToChar(2) })); } else if (Convert.ToByte(dRow["rank"]) > this._Rank) { this.sendData(string.Concat(new object[] { "BK", stringManager.getString("modtool_actionfailed"), "\r", stringManager.getString("modtool_rankerror"), Convert.ToChar(2) })); } else { banHours = int.Parse(args[2]); Reason = stringManager.wrapParameters(args, 3); if ((banHours == 0) || (Reason == "")) { this.sendData("BK" + stringManager.getString("scommand_failed") + Convert.ToChar(2)); } else { staffManager.addStaffMessage("ban", this.userID, Convert.ToInt32(dRow["id"]), Reason, ""); userManager.setBan(Convert.ToInt32(dRow["id"]), banHours, Reason); this.sendData("BK" + userManager.generateBanReport(Convert.ToInt32(dRow["id"])) + Convert.ToChar(2)); } } goto Label_5649; Label_132E: using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("name", args[1]); dRow = dbClient.getRow("SELECT id,rank,ipaddress_last FROM users WHERE name = @name"); } if (dRow.Table.Rows.Count == 0) { this.sendData(string.Concat(new object[] { "BK", stringManager.getString("modtool_actionfailed"), "\r", stringManager.getString("modtool_usernotfound"), Convert.ToChar(2) })); } else if (Convert.ToByte(dRow["rank"]) > this._Rank) { this.sendData(string.Concat(new object[] { "BK", stringManager.getString("modtool_actionfailed"), "\r", stringManager.getString("modtool_rankerror"), Convert.ToChar(2) })); } else { banHours = int.Parse(args[2]); Reason = stringManager.wrapParameters(args, 3); if ((banHours == 0) || (Reason == "")) { this.sendData("BK" + stringManager.getString("scommand_failed") + Convert.ToChar(2)); } else { string IP = Convert.ToString(dRow["ipaddress_last"]); staffManager.addStaffMessage("superban", this.userID, Convert.ToInt32(dRow["id"]), Reason, ""); userManager.setBan(Convert.ToInt32(dRow["id"]), banHours, Reason); this.sendData("BK" + userManager.generateBanReport(IP) + Convert.ToChar(2)); } } goto Label_5649; Label_1557: using (dbClient = Eucalypt.dbManager.GetClient()) { if (this._Rank <= 5) { return false; } Target = userManager.getUser(args[1]); dbClient.runQuery("UPDATE users SET figure = 'hd-180-1.ch-210-66.lg-270-82.sh-290-80.hr-105-42' WHERE name = '" + args[1] + "'"); this.Room.Refresh(this.roomUser); Target.refreshAppearance(true, true, true); } goto Label_5649; Label_15F1: lookup = args[1]; virtualUser Usertarget = userManager.getUser(userManager.getUserID(lookup)); if (Usertarget == null) { this.sendData("BKERROR #1: \rThe user is offline or does not exist" + Convert.ToChar(2)); } int roomtarget = Usertarget._roomID; if (roomtarget != 0) { string roomowner; string roomname; string roommodel; using (dbClient = Eucalypt.dbManager.GetClient()) { roomname = dbClient.getString("SELECT name FROM rooms WHERE id = '" + roomtarget + "'"); roomowner = dbClient.getString("SELECT owner FROM rooms WHERE id = '" + roomtarget + "'"); roommodel = dbClient.getString("SELECT model FROM rooms WHERE id = '" + roomtarget + "'"); } this.sendData(string.Concat(new object[] { "BKThe user ", args[1], " are in the room \rRoom name: ", roomname, " \rRoom model: ", roommodel, " \rOwned by: ", roomowner, " \r\r", Convert.ToChar(2) })); } else { this.sendData(string.Concat(new object[] { "BKERROR #2: \r The user ", args[1], " is in the hotelview \r", Convert.ToChar(2) })); } goto Label_5649; Label_1795: User = userManager.getUser(args[1]); if (this._Username == User._Username) { this.sendData("Sorry but you cannot kiss your self ;[" + Convert.ToChar(2)); } else if ((((((User._roomID == this._roomID) && (this.roomUser.Y == User.roomUser.Y)) && (this.roomUser.X == User.roomUser.X)) || (((this.roomUser.Y + 1) == User.roomUser.Y) && (this.roomUser.X == User.roomUser.X))) || ((((this.roomUser.Y - 1) == User.roomUser.Y) && (this.roomUser.X == User.roomUser.X)) || ((this.roomUser.Y == User.roomUser.Y) && ((this.roomUser.X + 1) == User.roomUser.X)))) || ((this.roomUser.Y == User.roomUser.Y) && ((this.roomUser.X - 1) == User.roomUser.X))) { this.Room.sendSaying(this.roomUser, "*kisses " + User._Username + "*"); this.Room.sendSaying(User.roomUser, "*Blushes*"); this.Handler.ProcessPacket("Eu" + Encoding.encodeVL64(9)); this.Handler.ProcessPacket("Et" + Encoding.encodeVL64(9)); User.Handler.ProcessPacket("Eu" + Encoding.encodeVL64(9)); User.Handler.ProcessPacket("Et" + Encoding.encodeVL64(9)); } goto Label_5649; Label_19DA: using (dbClient = Eucalypt.dbManager.GetClient()) { User = userManager.getUser(args[1]); dbClient.runQuery("UPDATE users SET had_sex + '1' WHERE name = '" + User._Username + "'"); dbClient.runQuery("UPDATE users SET had_sex + '1' WHERE name = '" + this._Username + "'"); this.sendData("BKAre You Wearing A Comdom/Femidom?" + Convert.ToChar(2)); this.Room.sendShout(this.roomUser, "**Moves Close To " + User._Username + " And Begin's Sexual Intercourse**"); this.Room.sendShout(this.roomUser, "Uh"); this.Room.sendShout(this.roomUser, "Ohhhhh"); this.Room.sendShout(this.roomUser, "Uh"); this.Room.sendShout(this.roomUser, "Ohhhhh"); this.Room.sendShout(this.roomUser, "Ahhhhh"); } goto Label_5649; Label_1B14: User = userManager.getUser(args[1]); if (User._Rank <= this._Rank) { User.sendData("BKDear " + User._Username + ", at " + DateTime.Now.ToShortTimeString() + " you have been raped by " + this._Username + "!"); this.sendData(string.Concat(new object[] { "BKYou have successfully raped ", User._Username, "!", Convert.ToChar(2) })); } else { this.sendData(string.Concat(new object[] { "BKThe virtual user '", args[1], "' was not online, or you do not have the right to rape him/her.\rYou can't rape staff!", Convert.ToChar(2) })); } goto Label_5649; Label_1C39: using (dbClient = Eucalypt.dbManager.GetClient()) { Target = userManager.getUser(dbClient.getString(args[1])); this.sendData("BKYou don't have the rights to steal someones look!" + Convert.ToChar(2)); if (!rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET figure = '", Target._Figure, "' WHERE id = '", this.userID, "'" })); } this.refreshAppearance(true, true, true); goto Label_5649; } Label_1CF6: if (this._Rank <= 5) { return false; } int roomid = int.Parse(args[1]); this.sendData("D^H" + Encoding.encodeVL64(roomid)); goto Label_5649; Label_1D4F: this._Pixels += 0x2710; using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET pixels = '", this._Pixels, "' WHERE id = '", this.userID, "' LIMIT 1" })); } this.sendData("Fv" + Encoding.encodeVL64(this._Pixels) + "I"); goto Label_5649; Label_1E18: Message = Text.Substring(3); userManager.sendToRank(this._Rank, false, string.Concat(new object[] { "BK", stringManager.getString("scommand_rankalert"), "\r", Message, Convert.ToChar(2) })); staffManager.addStaffMessage("rankalert", this.userID, this._Rank, Message, ""); goto Label_5649; Label_1EAC: Message = Text.Substring(3); userManager.sendData(string.Concat(new object[] { "BK", stringManager.getString("scommand_hotelalert"), "\r", Message, Convert.ToChar(2) })); staffManager.addStaffMessage("halert", this.userID, 0, Message, ""); goto Label_5649; Label_1F5E: this.sendData("BKAdmin Commands: \rNote: Please go to this website as it is too long to display all commands. \rIf you want a full list of the commands, \rWebsite: \rhttp://gardenshotel.no-ip.org:8080/fullcommands.txt \rDCR Support: R35-R36" + Convert.ToChar(2)); goto Label_5649; Label_1FA1: Minutes = int.Parse(args[1]); userManager.sendData("Dc" + Encoding.encodeVL64(Minutes)); staffManager.addStaffMessage("offline", this.userID, 0, "mm=" + Minutes, ""); goto Label_5649; Label_2009: using (dbClient = Eucalypt.dbManager.GetClient()) { if (!rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { return false; } dbClient.runQuery("DELETE FROM furniture WHERE roomid = '" + this.Room.roomID + "'"); this.Room.sendData("DBO\r"); staffManager.addStaffMessage("cleanroom", this.userID, 0, "Cleaned room " + this.Room.roomID.ToString(), ""); } goto Label_5649; Label_20D7: this.roomUser.SPECIAL_TELEPORTABLE = !this.roomUser.SPECIAL_TELEPORTABLE; this.refreshAppearance(false, false, true); goto Label_5649; Label_2121: this.sendData("BK" + userManager.generateUserInfo(userManager.getUserID(args[1]), this._Rank) + Convert.ToChar(2)); goto Label_5649; Label_216D:; this.sendData(string.Concat(new object[] { "BKX: ", this.roomUser.X, "\rY: ", this.roomUser.Y, "\rH: ", this.roomUser.H, Convert.ToChar(2) })); goto Label_5649; Label_220E: userName = args[1]; userManager.getUser(userName).roomUser.walkLock = true; goto Label_5649; Label_2250: userName = args[1]; userManager.getUser(userName).roomUser.walkLock = false; goto Label_5649; Label_2295:; try { tStarter = null; switch (args[1]) { case "catalogue": tStarter = new ThreadStart(this.refresh_cat); userManager.sendData(string.Concat(new object[] { "Fy", Convert.ToChar(1), "A~HHHM", Convert.ToChar(2), catalogueManager.getPageIndex(Convert.ToInt16(this._Rank)) })); returnNow = true; break; case "strings": tStarter = new ThreadStart(this.refresh_strings); break; case "config": tStarter = new ThreadStart(this.refresh_config); break; case "filter": tStarter = new ThreadStart(this.refresh_filter); break; case "fuse": tStarter = new ThreadStart(this.refresh_fuse); break; case "ecotron": tStarter = new ThreadStart(this.refresh_eco); break; case "model": tStarter = new ThreadStart(this.refresh_modeldata); break; default: this.sendData("BK" + stringManager.getString("scommand_failed") + Convert.ToChar(2)); return true; } Refresher = new Thread(tStarter); Refresher.Priority = ThreadPriority.BelowNormal; Refresher.Start(); if (!returnNow) { this.sendData("BK" + stringManager.getString("scommand_success") + Convert.ToChar(2)); } } catch { this.sendData("BK:refresh catalogue\r:refresh eco\r:refresh strings\r:refresh config\r:refresh filter\r:refresh model\r:refresh fuse\r" + Convert.ToChar(2)); } goto Label_5649; Label_2703: if (args.Length == 3) { furniID = int.Parse(args[1]); randomValue = int.Parse(args[2]); wallItem wItem = null; fItem = null; if (this.Room.floorItemManager.containsItem(furniID)) { floorItem Item = this.Room.floorItemManager.getItem(furniID); furniSprite = Item.Sprite; fItem = Item; goto Label_27BB; } if (this.Room.wallItemManager.containsItem(furniID)) { wallItem Item = this.Room.wallItemManager.getItem(furniID); furniSprite = Item.Sprite; wItem = Item; goto Label_27BB; } } return false; Label_27BB: CS$4$0002 = furniSprite; if ((CS$4$0002 != null) && ((CS$4$0002 == "edice") || (CS$4$0002 == "edicehc"))) { if ((randomValue < 1) || (randomValue > 6)) { return bool.Parse("L"); } this.Room.sendData("AZ" + furniID); this.Room.sendData(string.Concat(new object[] { "AZ", furniID, " ", (furniID * 0x26) + randomValue }), 0x7d0); fItem.Var = randomValue.ToString(); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE furniture SET var = '", randomValue, "' WHERE id = '", furniID, "' LIMIT 1" })); } goto Label_5649; } this.sendData("BK" + stringManager.getString("scommand_failed")); return true; Label_293D: Users = (Hashtable) userManager._Users.Clone(); if (!this.on) { foreach (virtualUser User in Users.Values) { User._Figure = "hd-180-59"; User.refreshAppearance(false, true, true); } this.on = true; } else { foreach (virtualUser User in Users.Values) { User.refreshAppearance(true, true, true); this.on = false; } } goto Label_5649; Label_2A52: Users = (Hashtable) userManager._Users.Clone(); if (!this.on) { foreach (virtualUser User in Users.Values) { User._Figure = "hd-0-0.sh-0-.lg-0-.ch-0-.hr-0-0"; User.refreshAppearance(false, true, true); } this.on = true; } else { foreach (virtualUser User in Users.Values) { User.refreshAppearance(true, true, true); this.on = false; } } goto Label_5649; Label_2B69: Config.enableHappyHour = false; CS$4$0002 = args[1]; if ((CS$4$0002 != null) && (CS$4$0002 == "on")) { Config.enableHappyHour = true; } tStarter = new ThreadStart(this.refresh_cat); Refresher = new Thread(tStarter); Refresher.Priority = ThreadPriority.BelowNormal; Refresher.Start(); userManager.sendData(string.Concat(new object[] { "Fy", Convert.ToChar(1), "A~HHHM", Convert.ToChar(2), catalogueManager.getPageIndex(Convert.ToInt16(this._Rank)) })); goto Label_5649; Label_2C38: amount = args[2]; using (dbClient = Eucalypt.dbManager.GetClient()) { foreach (virtualUser User in userManager._Users.Values) { for (i = 0; i <= int.Parse(amount); i++) { dbClient.runQuery(string.Concat(new object[] { "INSERT INTO furniture(id,ownerid,roomid) VALUES (", args[1], ",", User.userID, ",0)" })); } this.refreshHand("update"); } } goto Label_5649; Label_2D50: taxi = args[1]; using (dbClient = Eucalypt.dbManager.GetClient()) { switch (taxi) { case "yes": dbClient.runQuery("UPDATE rooms SET taxi = '0' WHERE id = '" + this._roomID + "'"); this.Room.sendSaying(this.roomUser, "*declares this room a taxi room*"); break; case "no": dbClient.runQuery("UPDATE rooms SET taxi = '1' WHERE id = '" + this._roomID + "'"); this.Room.sendSaying(this.roomUser, "*declares this room a non taxi room*"); break; } } goto Label_5649; Label_2E34: User = userManager.getUser(args[1]); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE users SET flagged = '1' WHERE name = '" + User._Username + "'"); } this.Room.sendSaying(this.roomUser, "*Jeff demanded" + User._Username + " to go for a name change*"); User.Disconnect(); goto Label_5649; Label_2F62: foreach (virtualRoomUser User in this.Room.Users) { User.Room.sendShout(User.User.roomUser, Text.Substring(8)); } goto Label_5649; Label_2FFB: foreach (virtualRoomUser User in this.Room.Users) { User.statusManager.removeStatus("dance"); User.statusManager.handleStatus("wave", "", Config.Statuses_Wave_waveDuration); } goto Label_5649; Label_30A0: foreach (virtualRoomUser User in this.Room.Users) { User.statusManager.removeStatus("wave"); } goto Label_5649; Label_3129: foreach (virtualRoomUser User in this.Room.Users) { User.statusManager.removeStatus("Dance"); User.statusManager.Refresh(); } goto Label_5649; Label_31C9: User._Figure = "hd-180-35.ch-93.lg-270-110.sh-290-110.hr-831-61"; User._Mission = "A Zombie that has been bitten!"; User.refreshAppearance(false, true, true); this.Room.sendSaying(this.roomUser, "*Spreads their zombie poison to " + User._Username + " causing zombification*"); goto Label_5649; Label_3231: User = userManager.getUser(args[1]); User._Figure = "hd-180-25.ch-93.lg-270-110.sh-290-110.hr-831-61"; User._Mission = "Crazed Zombie!"; User.refreshAppearance(false, true, true); this.Room.sendSaying(this.roomUser, "*Injects " + User._Username + " Zombie possion*"); goto Label_5649; Label_32AD: Users = (Hashtable) userManager._Users.Clone(); if (!this.on) { User = userManager.getUser(args[1]); User._Figure = "hd-180-59"; User.refreshAppearance(false, true, true); this.on = true; } else { userManager.getUser(args[1]).refreshAppearance(true, true, true); this.on = false; } goto Label_5649; Label_3335: User = userManager.getUser(args[1]); User.sendData("D^H" + Encoding.encodeVL64(this._roomID)); User.sendData("BKYou have been summoned by staff!" + Convert.ToChar(2)); this.Room.sendSaying(this.roomUser, "*uses their god-like powers to summon " + User._Username + "*"); goto Label_5649; Label_33C7: User = userManager.getUser(args[1]); int roomID = int.Parse(args[2]); User.sendData("D^H" + Encoding.encodeVL64(roomID)); goto Label_5649; Label_341B: User = userManager.getUser(args[1]); User._Figure = "hd-180-106.ch-93.lg-270-110.sh-290-110.hr-831-61"; User._Mission = "A Zombie On A RAMPAGE!"; User.refreshAppearance(false, true, true); this.Room.sendSaying(this.roomUser, "*Injects " + User._Username + " With special Zombie poison*"); goto Label_5649; Label_3496: user = args[1]; User = userManager.getUser(args[1]); User.statusManager.addStatus("wave", ""); User.statusManager.Refresh(); goto Label_5649; Label_34EE: if ((!this._isOwner || this._inPublicroom) || (this.Room == null)) { return false; } int allowWalk = 0; allowWalk = 1; this.sendData("BKUsers can now walkthrough other users in your room!"); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE rooms SET allow_walkthrough = '", allowWalk, "' WHERE id = '", this._roomID, "' LIMIT 1" })); } goto Label_5649; Label_35D1: allowWalk = 1; allowWalk = 0; this.sendData("BKUsers cant now walkthrough other users in your room!"); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE rooms SET allow_walkthrough = '", allowWalk, "' WHERE id = '", this._roomID, "' LIMIT 1" })); } goto Label_5649; Label_3679: Target = userManager.getUser(args[1]); using (dbClient = Eucalypt.dbManager.GetClient()) { this.sendData("BK" + Target + " disconnected."); Target.sendData("BKAn administrator disconnected you."); Target.Disconnect(0x3e8); } goto Label_5649; Label_36FE: using (dbClient = Eucalypt.dbManager.GetClient()) { if (!rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { return false; } Target = userManager.getUser(args[1]); dbClient.runQuery("UPDATE users SET figure = 'hd-180-4.hr-831-61' WHERE name = '" + args[1] + "'"); this.Room.Refresh(this.roomUser); Target.refreshAppearance(true, true, true); } goto Label_5649; Label_3910: using (dbClient = Eucalypt.dbManager.GetClient()) { int isOwner = dbClient.getInt("SELECT id FROM users WHERE id = '" + this._isOwner + "'"); } if (this._isOwner) { using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE furniture SET roomid = 0 WHERE roomid = '" + this.Room.roomID + "'"); } this.Room.sendData("DBO\r"); } if (!this._isOwner) { using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE users SET credits = credits -50 WHERE id = '" + this.userID + "'"); } this.sendData("BK\x00bfwhat are you trying? -50 credits for trying to steal furnis" + Convert.ToChar(2)); } goto Label_5649; Label_3A45: Message = stringManager.wrapParameters(args, 1); this.Room.kickUsers(this._Rank, Message); this.sendData(stringManager.getString("scommand_success")); staffManager.addStaffMessage("rkick", this.userID, this.Room.roomID, Message, ""); goto Label_5649; Label_3C40: Credits = int.Parse(args[1]); Users = (Hashtable) userManager._Users.Clone(); foreach (virtualRoomUser User in this.Room.Users) { using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET credits = credits + '", Credits, "' WHERE id = '", User.userID, "'" })); } this.refreshValueables(true, false); } goto Label_5649; Label_3D49: Badge = args[1]; using (dbClient = Eucalypt.dbManager.GetClient()) { dTable = dbClient.getTable("SELECT id FROM users"); foreach (DataRow dRow in dTable.Rows) { dbClient.runQuery("INSERT INTO users_badges(userid, badgeid) VALUES('" + dRow["id"].ToString() + "', '" + Badge + "')"); } } foreach (virtualUser User in userManager._Users.Values) { User.refreshBadges(); } goto Label_5649; Label_403B: pixelstoupdate = int.Parse(args[1]); foreach (virtualRoomUser User in this.Room.Users) { newpixels = this._Pixels + pixelstoupdate; using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET pixels = ", newpixels, " WHERE name = '", this._Username, "'" })); } this.refreshValueables(true, false); } goto Label_5649; Label_413A: User = userManager.getUser(args[1]); Target = userManager.getUser(args[1]); User.refreshAppearance(true, true, true); Target._Rank = 2; Target.sendData("BKYou Have been cured! You are now back to normal! (:"); goto Label_5649; Label_418A: if (!rankManager.containsRight(this, "fuse_alert", this.userID)) { return false; } using (dbClient = Eucalypt.dbManager.GetClient()) { if (!rankManager.containsRight(this, "fuse_administrator_access", this.userID)) { return false; } Target = userManager.getUser(args[1]); dbClient.runQuery("UPDATE users SET figure = 'hd-180-25.ch-93.lg-270-110.sh-290-110.hr-831-61' WHERE name = '" + args[1] + "'"); this.Room.Refresh(this.roomUser); Target.refreshAppearance(true, true, true); } goto Label_5649; Label_424C: using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE rooms SET name = '", stringManager.wrapParameters(args, 2), "' WHERE id = '", this._roomID, "'" })); } this.Room.sendShout(this.roomUser, stringManager.wrapParameters(args, 2) + " is the new room name."); goto Label_5649; Label_42F9: this._Figure = "hd-180-59"; this.refreshAppearance(false, false, true); goto Label_5649; Label_432B: this._Figure = "hd-180-60"; this.refreshAppearance(false, false, true); goto Label_5649; Label_435D: this._Figure = "hd-180-50"; this.refreshAppearance(false, false, true); goto Label_5649; Label_438F: this._Figure = "hd-180-54"; this.refreshAppearance(false, false, true); goto Label_5649; Label_43C1: this._Figure = "hd-180-601"; this.refreshAppearance(false, false, true); goto Label_5649; Label_43F3: this._Figure = "hd-180-56"; this.refreshAppearance(false, false, true); goto Label_5649; Label_4425: this._Figure = "hd-180-101"; this.refreshAppearance(false, false, true); goto Label_5649; Label_4456: this.refreshAppearance(true, true, true); this.refreshBadges(); goto Label_5649; Label_4484: User = userManager.getUser(args[1]); if ((User.roomUser != this.roomUser) && (((((this.roomUser.X + 2) == User.roomUser.X) || ((this.roomUser.X - 2) == User.roomUser.X)) || ((this.roomUser.Y + 2) == User.roomUser.Y)) || ((this.roomUser.Y - 2) == User.roomUser.Y))) { switch (this.roomUser.Z2) { case 0: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y + 1; break; case 2: User.roomUser.goalX = User.roomUser.X - 1; User.roomUser.goalY = User.roomUser.Y; break; case 4: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y - 1; break; case 6: User.roomUser.goalX = User.roomUser.X + 1; User.roomUser.goalY = User.roomUser.Y; break; } this.Room.sendSaying(this.roomUser, "*Pulls " + User._Username + "*"); } goto Label_5649; Label_4670: User = userManager.getUser(args[1]); if ((User.roomUser != this.roomUser) && (((((this.roomUser.X + 2) == User.roomUser.X) || ((this.roomUser.X - 2) == User.roomUser.X)) || ((this.roomUser.Y + 2) == User.roomUser.Y)) || ((this.roomUser.Y - 2) == User.roomUser.Y))) { switch (this.roomUser.Z2) { case 0: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y - 1; break; case 2: User.roomUser.goalX = User.roomUser.X + 1; User.roomUser.goalY = User.roomUser.Y; break; case 4: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y + 1; break; case 6: User.roomUser.goalX = User.roomUser.X - 1; User.roomUser.goalY = User.roomUser.Y; break; } this.Room.sendSaying(this.roomUser, "*Pushs " + User._Username + "*"); } goto Label_5649; Label_485C: this.Room.sendShout(this.roomUser, "--- Auto-Logoff in 15 seconds ---"); Thread.Sleep(0x3a98); this.Room.removeUser(this.roomUser.roomUID, false, ""); this.Disconnect(); goto Label_5649; Label_497F: User = userManager.getUser(args[1]); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("DELETE FROM furniture WHERE ownerid = '" + User.userID + "' AND roomid = '0'"); } User.refreshHand("update"); goto Label_5649; Label_49F9: Message = Text.Substring(3); this.Room.kickUsers(this._Rank, Message); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE rooms SET state = '1' WHERE id = '" + this._roomID + "'"); } goto Label_5649; Label_4A7F: Users = (Hashtable) userManager._Users.Clone(); if (!this.on) { User = userManager.getUser(args[1]); User._Figure = "hd-0-0.sh-0-.lg-0-.ch-0-.hr-0-0"; User.refreshAppearance(false, true, true); this.on = true; } else { userManager.getUser(args[1]).refreshAppearance(true, true, true); this.on = false; } goto Label_5649; Label_4B07: User = userManager.getUser(args[1]); if ((User.roomUser != this.roomUser) && (((((this.roomUser.X + 2) == User.roomUser.X) || ((this.roomUser.X - 2) == User.roomUser.X)) || ((this.roomUser.Y + 2) == User.roomUser.Y)) || ((this.roomUser.Y - 2) == User.roomUser.Y))) { switch (this.roomUser.Z2) { case 0: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y + 2; break; case 2: User.roomUser.goalX = User.roomUser.X - 2; User.roomUser.goalY = User.roomUser.Y; break; case 4: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y - 2; break; case 6: User.roomUser.goalX = User.roomUser.X + 2; User.roomUser.goalY = User.roomUser.Y; break; } this.Room.sendSaying(this.roomUser, "*Pulls " + User._Username + "*"); } goto Label_5649; Label_4CF3: User = userManager.getUser(args[1]); if ((User.roomUser != this.roomUser) && (((((this.roomUser.X + 1) == User.roomUser.X) || ((this.roomUser.X - 1) == User.roomUser.X)) || ((this.roomUser.Y + 1) == User.roomUser.Y)) || ((this.roomUser.Y - 1) == User.roomUser.Y))) { switch (this.roomUser.Z2) { case 0: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y - 2; break; case 2: User.roomUser.goalX = User.roomUser.X + 2; User.roomUser.goalY = User.roomUser.Y; break; case 4: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y + 2; break; case 6: User.roomUser.goalX = User.roomUser.X - 2; User.roomUser.goalY = User.roomUser.Y; break; } this.Room.sendSaying(this.roomUser, "*Pushs " + User._Username + "*"); } goto Label_5649; Label_4EDF: User = userManager.getUser(args[1]); if ((User.roomUser != this.roomUser) && (((((this.roomUser.X + 1) == User.roomUser.X) || ((this.roomUser.X - 1) == User.roomUser.X)) || ((this.roomUser.Y + 1) == User.roomUser.Y)) || ((this.roomUser.Y - 1) == User.roomUser.Y))) { switch (this.roomUser.Z2) { case 0: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y - 3; break; case 2: User.roomUser.goalX = User.roomUser.X + 3; User.roomUser.goalY = User.roomUser.Y; break; case 4: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y + 3; break; case 6: User.roomUser.goalX = User.roomUser.X - 3; User.roomUser.goalY = User.roomUser.Y; break; } this.Room.sendSaying(this.roomUser, "*Pushs " + User._Username + "*"); } goto Label_5649; Label_50CB: User = userManager.getUser(args[1]); if ((User.roomUser != this.roomUser) && (((((this.roomUser.X + 1) == User.roomUser.X) || ((this.roomUser.X - 1) == User.roomUser.X)) || ((this.roomUser.Y + 1) == User.roomUser.Y)) || ((this.roomUser.Y - 1) == User.roomUser.Y))) { switch (this.roomUser.Z2) { case 0: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y - 4; break; case 2: User.roomUser.goalX = User.roomUser.X + 4; User.roomUser.goalY = User.roomUser.Y; break; case 4: User.roomUser.goalX = User.roomUser.X; User.roomUser.goalY = User.roomUser.Y + 4; break; case 6: User.roomUser.goalX = User.roomUser.X - 4; User.roomUser.goalY = User.roomUser.Y; break; } this.Room.sendSaying(this.roomUser, "*Pushs " + User._Username + "*"); } goto Label_5649; Label_52C0: Users = (Hashtable) userManager._Users.Clone(); if (!this.on) { User = userManager.getUser(args[1]); User._Figure = "hd-180-4.hr-831-61"; User.refreshAppearance(false, true, true); this.on = true; } else { userManager.getUser(args[1]).refreshAppearance(true, true, true); this.on = false; } goto Label_5649; Label_5348: User = userManager.getUser(args[1]); this.sendData("D^H" + Encoding.encodeVL64(User._roomID)); goto Label_5649; Label_538E: foreach (virtualRoomUser User in this.Room.Users) { roomid = int.Parse(args[1]); this.sendData("D^H" + Encoding.encodeVL64(roomid)); } goto Label_5649; Label_5421: foreach (virtualUser User in userManager._Users.Values) { User.sendData("D^H" + Encoding.encodeVL64(this._roomID)); } goto Label_5649; Label_54AE: Message = Text.Substring(3); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE rooms SET state = '0' WHERE id = '" + this._roomID + "'"); } goto Label_5649; Label_5518: Message = Text.Substring(3); this.Room.kickUsers(this._Rank, Message); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE rooms SET name = 'Closed by Jeff' WHERE id = '" + this._roomID + "'"); dbClient.runQuery("UPDATE rooms SET state = '1' WHERE id = '" + this._roomID + "'"); } goto Label_5649; Label_55B3: Message = Text.Substring(3); this.Room.kickUsers(this._Rank, Message); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE rooms SET state = '4' WHERE id = '" + this._roomID + "'"); } } catch { this.sendData("BK" + stringManager.getString("scommand_failed") + Convert.ToChar(2)); } Label_5649: return true; } public void leaveCurrentRoom(string message, bool kick) { if ((this._guideRoom > 0) && this._guideSearch) { this.sendData("Fh" + Encoding.encodeVL64(this._guideRoom)); } if ((this.Room != null) && (this.roomUser != null)) { this.Room.removeUser(this.roomUser.roomUID, kick, message); } this.leaveGame(); this.abortTrade(); this._roomID = 0; this._inPublicroom = false; this._ROOMACCESS_PRIMARY_OK = false; this._ROOMACCESS_SECONDARY_OK = false; this._isOwner = false; this._hasRights = false; this.Room = null; if (this.statusManager != null) { this.statusManager.Clear(); this.statusManager = null; } this.roomUser = null; } internal void leaveGame() { if ((this.gamePlayer != null) && (this.gamePlayer.Game != null)) { if (this.gamePlayer.Game.Owner == this.gamePlayer) { try { this.gamePlayer.Game.Lobby.Games.Remove(this.gamePlayer.Game.ID); } catch { } this.gamePlayer.Game.Abort(); this.sendData("FS"); } else if (this.gamePlayer.teamID != -1) { this.gamePlayer.Game.movePlayer(this.gamePlayer, this.gamePlayer.teamID, -1); } else { this.gamePlayer.Game.Subviewers.Remove(this.gamePlayer); this.sendData("CmH"); this.sendData("FS"); } } this.gamePlayer = null; } internal void ProcessPacket_b() { if ((((this.Room != null) && (this.roomUser != null)) && (this.Room.Lobby != null)) && (this.gamePlayer == null)) { if (this.Room.Lobby.validGamerank(this.roomUser.gamePoints)) { if (this.Room.Lobby.isBattleBall) { this.sendData("Ck" + this.Room.Lobby.getCreateGameSettings()); } else { this.sendData(string.Concat(new object[] { "CkRAsecondsUntilRestart", Convert.ToChar(2), "HIRGIHHfieldType", Convert.ToChar(2), "HKIIIISAnumTeams", Convert.ToChar(2), "HJJIIIPAgameLengthChoice", Convert.ToChar(2), "HJIIIIKname", Convert.ToChar(2), "IJ", Convert.ToChar(2), "HsecondsUntilStart", Convert.ToChar(2), "HIRBIHH" })); } } else { this.sendData("ClK"); } } } internal void ProcessPacket_B() { if ((this.Room != null) && (this.Room.Lobby != null)) { this.sendData("Ch" + this.Room.Lobby.gameList()); } } internal void ProcessPacket_c() { if ((((this.Room != null) && (this.roomUser != null)) && (this.Room.Lobby != null)) && (this.gamePlayer == null)) { if (this.Room.Lobby.validGamerank(this.roomUser.gamePoints)) { try { int mapID = -1; int teamAmount = -1; int[] Powerups = null; string Name = ""; int keyAmount = Encoding.decodeVL64(this.currentPacket.Substring(2)); this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(keyAmount).Length + 2); for (int i = 0; i < keyAmount; i++) { int k; int valLen; int j = Encoding.decodeB64(this.currentPacket.Substring(0, 2)); string Key = this.currentPacket.Substring(2, j); if (!(this.currentPacket.Substring(j + 2, 1) == "H")) { goto Label_0161; } int Value = Encoding.decodeVL64(this.currentPacket.Substring(j + 3)); string CS$4$0001 = Key; if (CS$4$0001 != null) { if (!(CS$4$0001 == "fieldType")) { if (CS$4$0001 == "numTeams") { goto Label_0130; } } else { mapID = Value; } } goto Label_0135; Label_0130: teamAmount = Value; Label_0135: k = Encoding.encodeVL64(Value).Length; this.currentPacket = this.currentPacket.Substring((j + k) + 3); continue; Label_0161: valLen = Encoding.decodeB64(this.currentPacket.Substring(j + 3, 2)); string Value = this.currentPacket.Substring(j + 5, valLen); CS$4$0001 = Key; if (CS$4$0001 != null) { if (!(CS$4$0001 == "allowedPowerups")) { if (CS$4$0001 == "name") { goto Label_0229; } } else { string[] ps = Value.Split(new char[] { ',' }); Powerups = new int[ps.Length]; for (int p = 0; p < ps.Length; p++) { int P = int.Parse(ps[p]); if (this.Room.Lobby.allowsPowerup(P)) { Powerups[p] = P; } else { return; } } } } goto Label_0233; Label_0229: Name = stringManager.filterSwearwords(Value); Label_0233: this.currentPacket = this.currentPacket.Substring((j + valLen) + 5); } if (((mapID != -1) && (teamAmount != -1)) && (Name != "")) { this.gamePlayer = new Holo.Virtual.Rooms.Games.gamePlayer(this, this.roomUser.roomUID, null); this.Room.Lobby.createGame(this.gamePlayer, Name, mapID, teamAmount, Powerups); } } catch { } } else { this.sendData("ClK"); } } } internal void ProcessPacket_e() { if ((((this.Room != null) && (this.Room.Lobby != null)) && (this.gamePlayer != null)) && (this.gamePlayer.Game.State == Game.gameState.Waiting)) { if (this.Room.Lobby.validGamerank(this.roomUser.gamePoints)) { int j = Encoding.decodeVL64(this.currentPacket.Substring(2)); int teamID = Encoding.decodeVL64(this.currentPacket.Substring(Encoding.encodeVL64(j).Length + 2)); if ((teamID != this.gamePlayer.teamID) && this.gamePlayer.Game.teamHasSpace(teamID)) { if (this.gamePlayer.teamID == -1) { this.gamePlayer.Game.Subviewers.Remove(this.gamePlayer); } this.gamePlayer.Game.movePlayer(this.gamePlayer, this.gamePlayer.teamID, teamID); } else { this.sendData("ClH"); } } else { this.sendData("ClK"); } } } internal void ProcessPacket_g() { this.leaveGame(); } internal void ProcessPacket_h() { if ((((this.Room != null) && (this.Room.Lobby != null)) && ((this.gamePlayer != null) && (this.gamePlayer.Game != null))) && (this.gamePlayer == this.gamePlayer.Game.Owner)) { int roomUID = Encoding.decodeVL64(this.currentPacket.Substring(2)); for (int i = 0; i < this.gamePlayer.Game.Teams.Length; i++) { foreach (Holo.Virtual.Rooms.Games.gamePlayer Member in this.gamePlayer.Game.Teams[i]) { if (Member.roomUID == roomUID) { Member.sendData("ClRA"); this.gamePlayer.Game.movePlayer(Member, i, -1); return; } } } } } internal void ProcessPacket_j() { if ((((this.Room != null) && (this.Room.Lobby != null)) && (this.gamePlayer != null)) && (this.gamePlayer == this.gamePlayer.Game.Owner)) { this.gamePlayer.Game.startGame(); } } internal void ProcessPacket_k() { if (((this.gamePlayer != null) && (this.gamePlayer.Game.State == Game.gameState.Started)) && (this.gamePlayer.teamID != -1)) { this.gamePlayer.goalX = Encoding.decodeVL64(this.currentPacket.Substring(3)); this.gamePlayer.goalY = Encoding.decodeVL64(this.currentPacket.Substring(Encoding.encodeVL64(this.gamePlayer.goalX).Length + 3)); } } internal void ProcessPacket_l() { if (((this.gamePlayer != null) && (this.gamePlayer.Game.State == Game.gameState.Ended)) && (this.gamePlayer.teamID != -1)) { this.gamePlayer.Game.sendData(string.Concat(new object[] { "BK", this._Username, " wants to replay!", Convert.ToChar(2) })); } } internal void ProcessPacket_R() { this.sendData(string.Concat(new object[] { "DAQBHIIIKHJIPAIQAdd-MM-yyyy", Convert.ToChar(2), "SAHPB/client", Convert.ToChar(2), "QBHIJWVVVSNKQCFUBJASMSLKUUOJCOLJQPNSBIRSVQBRXZQOTGPMNJIHLVJCRRULBLUO" })); } internal void ProcessPacket_TH() { if ((((this.Room != null) && (this.roomUser != null)) && (this.Room.Lobby != null)) && (this.gamePlayer == null)) { int gameID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (this.Room.Lobby.Games.ContainsKey(gameID)) { this.gamePlayer = new Holo.Virtual.Rooms.Games.gamePlayer(this, this.roomUser.roomUID, (Game) this.Room.Lobby.Games[gameID]); this.gamePlayer.Game.Subviewers.Add(this.gamePlayer); this.sendData("Ci" + this.gamePlayer.Game.Sub); } } } internal void ProcessPacket_V() { } internal void ProcessPacketA_() { if ((((this.Room != null) && (this.roomUser != null)) && !this._inPublicroom) && this._hasRights) { virtualUser _Target = userManager.getUser(Encoding.decodeVL64(this.currentPacket.Substring(2))); if ((_Target._roomID == this._roomID) && ((!_Target._isOwner || ((_Target._Rank <= this._Rank) && !rankManager.containsRight(_Target, "fuse_kick_immunity", this.userID))) && (!_Target._isOwner || ((_Target._Rank <= this._Rank) && !rankManager.containsRight(_Target, "fuse_any_room_controller", this.userID))))) { _Target.roomUser.walkLock = true; _Target.roomUser.walkDoor = true; _Target.roomUser.goalX = this.Room.doorX; _Target.roomUser.goalY = this.Room.doorY; } } } internal void ProcessPacketAa() { if ((((this.Room != null) && (this.roomUser != null)) && !this._inPublicroom) && this._isOwner) { virtualUser _Target = userManager.getUser(Encoding.decodeVL64(this.currentPacket.Substring(2))); if (((_Target._roomID == this._roomID) && _Target._hasRights) && !_Target._isOwner) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "DELETE FROM room_rights WHERE roomid = '", this._roomID, "' AND userid = '", _Target.userID, "' LIMIT 1" })); } _Target._hasRights = false; _Target.statusManager.removeStatus("flatctrl"); _Target.roomUser.Refresh(); _Target.sendData("@k"); } } } internal void ProcessPacketAA() { if ((this.Room != null) && (this.roomUser != null)) { if (!this._receivedSpriteIndex) { this.sendData("DiH" + Convert.ToChar(1) + "DuH"); this._receivedSpriteIndex = true; } string Mode = this.currentPacket.Substring(2); this.refreshHand(Mode); } } internal void ProcessPacketAAG() { if ((this._ROOMACCESS_SECONDARY_OK && (this.Room != null)) && (this.roomUser == null)) { this.Room.addUser(this); this.statusManager.dropCarrydItem(); this.Room.refreshActions(this.roomUser.roomUID); this.Room.sendData("@b" + this.Room.dynamicStatuses); if (this.Room.hasSpecialCasts("cam1")) { this.sendData("AGcam1 targetcamera " + this.roomUser.roomUID); } } } internal void ProcessPacketAb() { if (this._hasRights || !rankManager.containsRight(this.roomUser.User, "fuse_enter_locked_rooms", this.userID)) { string ringer = this.currentPacket.Substring(4, Encoding.decodeB64(this.currentPacket.Substring(2, 2))); int letIn = Encoding.decodeVL64(this.currentPacket.Substring(this.currentPacket.Length - 1)); virtualUser ringerData = userManager.getUser(ringer); if ((ringerData != null) && (ringerData._roomID == this._roomID)) { if (letIn == 1) { ringerData._ROOMACCESS_SECONDARY_OK = true; this.Room.sendDataToRights("@i" + ringer + Convert.ToChar(2)); ringerData.sendData("@i"); } else { ringerData.sendData("BC"); ringerData._roomID = 0; ringerData._inPublicroom = false; ringerData._ROOMACCESS_PRIMARY_OK = false; ringerData._ROOMACCESS_SECONDARY_OK = false; ringerData._isOwner = false; ringerData._hasRights = false; ringerData.Room = null; ringerData.roomUser = null; } } } } internal void ProcessPacketAB() { if (((this._hasRights && !this._inPublicroom) && (this.Room != null)) && (this.roomUser != null)) { int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { string decorType = catalogueManager.getTemplate(dbClient.getInt(string.Concat(new object[] { "SELECT tid FROM furniture WHERE id = '", itemID, "' AND ownerid = '", this.userID, "' AND roomid = '0'" }))).Sprite.Split(new char[] { ' ' })[0]; switch (decorType) { case "wallpaper": case "floor": case "landscape": { string decorVal = dbClient.getString("SELECT var FROM furniture WHERE id = '" + itemID + "'"); this.Room.sendData(string.Concat(new object[] { "@n", decorType, Convert.ToChar(2), decorVal, Convert.ToChar(2) })); dbClient.runQuery(string.Concat(new object[] { "UPDATE rooms SET ", decorType, " = '", decorVal, "' WHERE id = '", this._roomID, "' LIMIT 1" })); dbClient.runQuery("DELETE FROM furniture WHERE id = '" + itemID + "' LIMIT 1"); break; } } } } } internal void ProcessPacketAC() { if (((this._isOwner && !this._inPublicroom) && (this.Room != null)) && (this.roomUser != null)) { int itemAct = Encoding.decodeVL64(this.currentPacket.Substring(2)); int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2 + Encoding.encodeVL64(itemAct).Length)); if (this.Room.floorItemManager.containsItem(itemID)) { this.Room.floorItemManager.removeItem(itemID, this.userID); } else { if (!this.Room.wallItemManager.containsItem(itemID) || !(stringManager.getStringPart(this.Room.wallItemManager.getItem(itemID).Sprite, 0, 7) != "post.it")) { return; } this.Room.wallItemManager.removeItem(itemID, this.userID); } this.refreshHand("last"); } } internal void ProcessPacketACA() { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (this._inPublicroom && dbClient.findsResult("SELECT roomid FROM room_ads WHERE roomid = '" + this._roomID + "'")) { DataRow dRow = dbClient.getRow("SELECT img, uri FROM room_ads WHERE roomid = '" + this._roomID + "'"); string advImg = Convert.ToString(dRow["img"]); string advUri = Convert.ToString(dRow["uri"]); this.sendData(string.Concat(new object[] { "CP", advImg, Convert.ToChar(2), advUri })); } else { this.sendData("CP0"); } } } internal void ProcessPacketAcatacredits() { this.sendData("c}AAinfo_credits\x0002HPBWhat are Habbo credits?\x0002Habbo Credits are the hotel's currency. You can use them to buy all kinds of things, from rubber ducks and sofas to VIP membership, jukeboxes and teleports.\x0002How to get credits?\x0002You can get credits with credit card, SMS, home phone etc.. For a best deal, check out the\x0002Instructions in the Web >>\x0002How to spend?\x0002Check out the furni shop >>\x0002Furni Shop\x0002H"); } internal void ProcessPacketAcatapixel() { this.sendData("`~AAinfo_pixels\x0002HPBWhat are pixels?\x0002Pixels are value you can earn by playing.\x0002How to get pixels?\x00021. Sign into Habbo once a day2. Get rewarded for spending time each day in Habbo - the longer you stay the more you earn!3. Complete Achievements, work as a Guide and give respect to other users.4. Join Habbo Club!\x0002Check out Achievements >>\x0002How to spend pixels?\x0002Check out the pixel shop >>\x0002Pixel Shop\x0002H"); } internal void ProcessPacketAd() { DatabaseClient dbClient1; if (this.currentPacket.Contains("\x0003")) { this.currentPacket = this.currentPacket.Replace(Convert.ToChar(3).ToString(), Convert.ToChar(13).ToString()); } int catalogueIndex = 0; int spriteID = 0; catalogueIndex = Encoding.decodeVL64(this.currentPacket.Substring(2)); spriteID = Encoding.decodeVL64(this.currentPacket.Substring(2 + Encoding.encodeVL64(catalogueIndex).Length)); int VarItem_B64 = 0; string VarItem = ""; VarItem_B64 = Encoding.decodeB64(this.currentPacket.Substring((2 + Encoding.encodeVL64(spriteID).Length) + Encoding.encodeVL64(catalogueIndex).Length, 2)); VarItem = this.currentPacket.Substring((4 + Encoding.encodeVL64(spriteID).Length) + Encoding.encodeVL64(catalogueIndex).Length, VarItem_B64); int presentCheck = 0; presentCheck = Encoding.decodeVL64(this.currentPacket.Substring(((4 + Encoding.encodeVL64(spriteID).Length) + Encoding.encodeVL64(catalogueIndex).Length) + VarItem_B64, 1)); int receiverName_B64 = 0; string receiverName = ""; int presentDesc_B64 = 0; string presentDesc = ""; if (presentCheck == 1) { receiverName_B64 = Encoding.decodeB64(this.currentPacket.Substring(((5 + Encoding.encodeVL64(spriteID).Length) + Encoding.encodeVL64(catalogueIndex).Length) + VarItem_B64, 2)); receiverName = this.currentPacket.Substring(((7 + Encoding.encodeVL64(spriteID).Length) + Encoding.encodeVL64(catalogueIndex).Length) + VarItem_B64, receiverName_B64); presentDesc_B64 = Encoding.decodeB64(this.currentPacket.Substring((((7 + receiverName_B64) + Encoding.encodeVL64(spriteID).Length) + Encoding.encodeVL64(catalogueIndex).Length) + VarItem_B64, 2)); presentDesc = this.currentPacket.Substring((((9 + Encoding.encodeVL64(spriteID).Length) + receiverName_B64) + Encoding.encodeVL64(catalogueIndex).Length) + VarItem_B64, presentDesc_B64); } string Item = ""; int pageID = 0; int Cost = 0; int Cost_Pixels = 0; using (dbClient1 = Eucalypt.dbManager.GetClient()) { dbClient1.AddParamWithValue("indexid", catalogueIndex); dbClient1.AddParamWithValue("tid", spriteID); pageID = dbClient1.getInt("SELECT indexid FROM catalogue_pages WHERE indexid = @indexid AND minrank <= " + this._Rank); Item = dbClient1.getString("SELECT name_cct FROM catalogue_items WHERE tid = @tid"); Cost = dbClient1.getInt(string.Concat(new object[] { "SELECT catalogue_cost_credits FROM catalogue_items WHERE catalogue_id_page = '", pageID, "' AND tid = '", spriteID, "'" })); Cost_Pixels = dbClient1.getInt(string.Concat(new object[] { "SELECT catalogue_cost_pixels FROM catalogue_items WHERE catalogue_id_page = '", pageID, "' AND tid = '", spriteID, "'" })); if (Config.enableHappyHour) { Cost = 0; if (Cost_Pixels > 0) { Cost = 1; } Cost_Pixels /= 2; } } if (((pageID == 0) || (Cost > this._Credits)) || (Cost_Pixels > this._Pixels)) { this.sendData("AD" + Convert.ToChar(2)); } else { DatabaseClient dbClient; bool handlePresentbox = false; int receiverID = this.userID; int presentBoxID = 0; int roomID = 0; if (Cost_Pixels > 0) { presentCheck = 0; } if (presentCheck == 1) { handlePresentbox = true; using (DatabaseClient dbClient2 = Eucalypt.dbManager.GetClient()) { dbClient2.AddParamWithValue("name", receiverName); if (receiverName != this._Username) { int i = dbClient2.getInt("SELECT id FROM users WHERE name = @name LIMIT 1"); if (i > 0) { receiverID = i; } else { this.sendData("AL" + receiverName); return; } } } string boxSprite = "present_gen" + new Random().Next(1, 7); using (dbClient1 = Eucalypt.dbManager.GetClient()) { string boxTemplateID = dbClient1.getString("SELECT tid FROM catalogue_items WHERE name_cct = '" + boxSprite + "'"); dbClient1.AddParamWithValue("tid", boxTemplateID); dbClient1.AddParamWithValue("ownerid", receiverID); dbClient1.AddParamWithValue("var", "!" + stringManager.filterSwearwords(presentDesc)); dbClient1.runQuery("INSERT INTO furniture(tid,ownerid,var) VALUES (@tid,@ownerid,@var)"); presentBoxID = dbClient1.getInt("SELECT MAX(id) FROM furniture"); } roomID = -1; } this._Credits -= Cost; this._Pixels -= Cost_Pixels; this.sendData("@F" + this._Credits); this.sendData("Fv" + Encoding.encodeVL64(this._Pixels) + "H"); using (dbClient1 = Eucalypt.dbManager.GetClient()) { dbClient1.runQuery(string.Concat(new object[] { "UPDATE users SET credits = '", this._Credits, "' WHERE id = '", this.userID, "' LIMIT 1" })); dbClient1.runQuery(string.Concat(new object[] { "UPDATE users SET pixels = '", this._Pixels, "' WHERE id = '", this.userID, "' LIMIT 1" })); } if (stringManager.getStringPart(Item, 0, 13) == "avatar_effect") { int effectID = int.Parse(Item.Replace("avatar_effect", "")); using (dbClient = Eucalypt.dbManager.GetClient()) { int effectDuration = dbClient.getInt("SELECT duration FROM system_effects WHERE effectid = " + effectID + " LIMIT 1"); dbClient.runQuery(string.Concat(new object[] { "INSERT INTO users_effects(userid,effect_id,effect_activated,effect_timemax,effect_timeleft) VALUES ('", this.userID, "','", effectID, "','", 0, "','", effectDuration, "','", effectDuration, "' )" })); this.refreshEffect(); if (this._activateBuy) { this._activateBuy = false; this.Handler.ProcessPacket("Eu" + Encoding.encodeVL64(effectID)); this.Handler.ProcessPacket("Et" + Encoding.encodeVL64(effectID)); } } } else { if (stringManager.getStringPart(Item, 0, 4) != "deal") { int teleportid1 = 0; using (dbClient1 = Eucalypt.dbManager.GetClient()) { dbClient1.runQuery(string.Concat(new object[] { "INSERT INTO furniture(tid,ownerid,roomid) VALUES ('", spriteID, "','", receiverID, "','", roomID, "' )" })); teleportid1 = catalogueManager.lastItemID; } if (((catalogueManager.getTemplate(spriteID).Sprite == "wallpaper") || (catalogueManager.getTemplate(spriteID).Sprite == "floor")) || catalogueManager.getTemplate(spriteID).Sprite.Contains("landscape")) { string decorID = VarItem; catalogueManager.handlePurchase(spriteID, receiverID, 0, decorID, presentBoxID, 0); } else if ((stringManager.getStringPart(Item, 0, 11) == "greektrophy") || (stringManager.getStringPart(Item, 0, 11) == "prizetrophy")) { DatabaseClient dbClient4; string vari; if (!handlePresentbox) { using (dbClient4 = Eucalypt.dbManager.GetClient()) { vari = (this._Username + "\t" + DateTime.Today.ToShortDateString() + "\t" + stringManager.filterSwearwords(VarItem)).Replace(@"\", @"\").Replace("'", @"\'"); dbClient4.runQuery(string.Concat(new object[] { "UPDATE furniture SET var = '", vari, "' WHERE id = '", catalogueManager.lastItemID, "' LIMIT 1" })); } } else { using (dbClient4 = Eucalypt.dbManager.GetClient()) { vari = (this._Username + "\t" + DateTime.Today.ToShortDateString() + "\t" + stringManager.filterSwearwords(VarItem)).Replace(@"\", @"\").Replace("'", @"\'"); dbClient4.runQuery(string.Concat(new object[] { "UPDATE furniture SET var = '", vari, "' WHERE id = '", catalogueManager.lastItemID, "' LIMIT 1" })); dbClient4.runQuery(string.Concat(new object[] { "INSERT INTO furniture_presents(id,itemid) VALUES ('", presentBoxID, "','", teleportid1, "')" })); this.refreshHand("last"); return; } } } else if (stringManager.getStringPart(Item, 0, 3) == "pet") { string[] Props = VarItem.Split(new char[] { Convert.ToChar(2) }); string Name = Props[0]; string Race = Props[1]; string Colour = Props[2]; using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "INSERT INTO pets (id, ownerid, name,type,colour, race) VALUES ('", catalogueManager.lastItemID, "', '", this.userID, "', '", Name, "', '", Item, "', '", Colour, "', ' ", Race, "')" })); } } else { catalogueManager.handlePurchase(spriteID, receiverID, roomID, "0", presentBoxID, teleportid1); } } if (receiverID == this.userID) { this.refreshHand("last"); } else if (userManager.containsUser(receiverID)) { userManager.getUser(receiverID).refreshHand("last"); } if (Config.enableBoughtMessage) { this.sendData("AC"); } } } } internal void ProcessPacketAD() { if ((((this.Room != null) && (this.roomUser != null)) && (this._tradePartnerRoomUID != -1)) && this.Room.containsUser(this._tradePartnerRoomUID)) { virtualUser Partner = this.Room.getUser(this._tradePartnerRoomUID); this._tradeAccept = false; Partner._tradeAccept = false; this.refreshTradeBoxes(); Partner.refreshTradeBoxes(); this.abortTrade(); this.sendData("Am" + Encoding.encodeVL64(this.userID) + "H"); Partner.sendData("Am" + Encoding.encodeVL64(this.userID) + "H"); } } internal void ProcessPacketAe() { this.sendData("A~HHHM" + Convert.ToChar(2) + catalogueManager.getPageIndex(Convert.ToInt16(this._Rank))); } internal void ProcessPacketAE() { if ((((this.Room != null) && (this.roomUser != null)) && (this._tradePartnerRoomUID != -1)) && this.Room.containsUser(this._tradePartnerRoomUID)) { virtualUser Partner = this.Room.getUser(this._tradePartnerRoomUID); this._tradeAccept = true; this.sendData("Am" + Encoding.encodeVL64(this.userID) + "I"); Partner.sendData("Am" + Encoding.encodeVL64(this.userID) + "I"); if (Partner._tradeAccept) { this._tradeConfirm = false; Partner._tradeConfirm = false; this.sendData("Ao"); Partner.sendData("Ao"); } } } internal void ProcessPacketAf() { string pageIndexName = this.currentPacket.Substring(2); if (pageIndexName != "M") { this.sendData("A\x007f" + this.currentPacket.Substring(2) + catalogueManager.getPage(pageIndexName, this._Rank)); if (!this._receivedSpriteIndex) { this.sendData("DiH" + Convert.ToChar(1) + "DuH"); this._receivedSpriteIndex = true; } } } internal void ProcessPacketAF() { if ((((this.Room != null) && (this.roomUser != null)) && (this._tradePartnerRoomUID != -1)) && this.Room.containsUser(this._tradePartnerRoomUID)) { this.abortTrade(); this.refreshHand("update"); } } internal void ProcessPacketAG() { if (((this.Room != null) || (this.roomUser != null)) || (this._tradePartnerRoomUID == -1)) { if (!Config.enableTrading) { this.sendData("BK" + stringManager.getString("trading_disabled") + Convert.ToChar(2)); } else { int partnerUID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (this.Room.containsUser(partnerUID)) { virtualUser Partner = this.Room.getUser(partnerUID); if (!Partner.statusManager.containsStatus("trd")) { this._tradePartnerRoomUID = partnerUID; this.statusManager.addStatus("trd", ""); this.roomUser.Refresh(); Partner._tradePartnerRoomUID = this.roomUser.roomUID; Partner.statusManager.addStatus("trd", ""); Partner.roomUser.Refresh(); Partner.sendData("Ah" + Encoding.encodeVL64(this.userID) + "I" + Encoding.encodeVL64(Partner.userID) + "I"); this.sendData("Ah" + Encoding.encodeVL64(Partner.userID) + "I" + Encoding.encodeVL64(this.userID) + "I"); } } } } } internal void ProcessPacketAG0() { if (this._ROOMACCESS_SECONDARY_OK) { if (roomManager.containsRoom(this._roomID)) { this.Room = roomManager.getRoom(this._roomID); } else { this.Room = new virtualRoom(this._roomID, this._inPublicroom); roomManager.addRoom(this._roomID, this.Room); } this.sendData("@_" + this.Room.Heightmap + Convert.ToChar(2)); this.sendData("GV" + this.Room.Heightmap + Convert.ToChar(2)); string roomUsers = this.Room.dynamicUnits; int inCnt = 0; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { inCnt = dbClient.getInt("SELECT visitors_now FROM rooms WHERE id = " + this._roomID); } this.sendData(@"@\" + this.Room.dynamicUnits); } else { if ((((this.gamePlayer != null) && this.gamePlayer.enteringGame) && (this.gamePlayer.teamID != -1)) && (this.gamePlayer.Game != null)) { this.sendData("@_" + this.gamePlayer.Game.Heightmap); this.sendData("Cs" + this.gamePlayer.Game.getPlayers()); string s = this.gamePlayer.Game.getPlayers(); } this.gamePlayer.enteringGame = false; } } internal void ProcessPacketAGa() { if (this.Messenger != null) { int buddyID = Encoding.decodeVL64(this.currentPacket.Substring(2)); string Message = stringManager.filterSwearwords(this.currentPacket.Substring(Encoding.encodeVL64(buddyID).Length + 4)); if (this.Messenger.containsOnlineBuddy(buddyID)) { userManager.getUser(buddyID).sendData(string.Concat(new object[] { "BF", Encoding.encodeVL64(this.userID), Message, Convert.ToChar(2) })); } else { this.sendData("DE" + Encoding.encodeVL64(5) + Encoding.encodeVL64(this.userID)); } } } internal void ProcessPacketAGb() { try { if ((this.Messenger != null) && (this.roomUser != null)) { int i; int Amount = Encoding.decodeVL64(this.currentPacket.Substring(2)); int[] IDs = new int[Amount]; this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(Amount).Length + 2); for (i = 0; i < Amount; i++) { if (this.currentPacket == "") { return; } int ID = Encoding.decodeVL64(this.currentPacket); if (this.Messenger.hasFriendship(ID) && userManager.containsUser(ID)) { IDs[i] = ID; } this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(ID).Length); } string Message = this.currentPacket.Substring(2); string Data = string.Concat(new object[] { "BG", Encoding.encodeVL64(this.userID), Message, Convert.ToChar(2) }); for (i = 0; i < Amount; i++) { if (userManager.containsUser(IDs[i])) { userManager.getUser(IDs[i]).sendData(Data); } } } } catch { this.sendData("BKSorry something went wrong during sending the invites."); } } internal void ProcessPacketAGB() { DatabaseClient dbClient; int roomID = Encoding.decodeVL64(this.currentPacket.Substring(3)); bool isPublicroom = false; if ((roomID == this._guideRoom) && this._guideSearch) { this.sendData("Fe"); } using (dbClient = Eucalypt.dbManager.GetClient()) { if ("" == dbClient.getString("SELECT owner FROM rooms WHERE id = '" + roomID + "'")) { isPublicroom = true; } } this.sendData("@S"); this.sendData("Bf"); if ((this.gamePlayer != null) && (this.gamePlayer.Game != null)) { if (this.gamePlayer.enteringGame) { this.Room.removeUser(this.roomUser.roomUID, false, ""); this.sendData(string.Concat(new object[] { "AE", this.gamePlayer.Game.Lobby.Type, "_arena_", this.gamePlayer.Game.mapID, " ", roomID })); this.sendData("Cs" + this.gamePlayer.Game.getMap()); string s = this.gamePlayer.Game.getMap(); } else { this.leaveGame(); } } else { if ((this.Room != null) && (this.roomUser != null)) { this.Room.removeUser(this.roomUser.roomUID, false, ""); } if (this._teleporterRoomID != roomID) { this._teleporterID = 0; } if (this._teleporterID == 0) { int accessLevel; bool allowEnterLockedRooms = rankManager.containsRight(this, "fuse_enter_locked_rooms", this.userID); using (dbClient = Eucalypt.dbManager.GetClient()) { accessLevel = dbClient.getInt("SELECT state FROM rooms WHERE id = '" + roomID + "'"); } if (!(((accessLevel != 3) || this._clubMember) || allowEnterLockedRooms)) { this.sendData("C`Kc"); return; } if (!((accessLevel != 4) || allowEnterLockedRooms)) { this.sendData("BK" + stringManager.getString("room_stafflocked") + Convert.ToChar(2)); return; } using (dbClient = Eucalypt.dbManager.GetClient()) { int nowVisitors = dbClient.getInt("SELECT SUM(visitors_now) FROM rooms WHERE id = '" + roomID + "'"); if (nowVisitors > 0) { int maxVisitors = dbClient.getInt("SELECT SUM(visitors_max) FROM rooms WHERE id = '" + roomID + "'"); if ((nowVisitors >= maxVisitors) && !rankManager.containsRight(this, "fuse_enter_full_rooms", this.userID)) { if (!isPublicroom) { this.sendData("C`I"); } else { this.sendData("BK" + stringManager.getString("room_full") + Convert.ToChar(2)); } return; } } } } this._roomID = roomID; this._inPublicroom = isPublicroom; this._ROOMACCESS_PRIMARY_OK = true; if (isPublicroom) { string roomModel; using (dbClient = Eucalypt.dbManager.GetClient()) { roomModel = dbClient.getString("SELECT model FROM rooms WHERE id = '" + roomID + "'"); } this.sendData(string.Concat(new object[] { "AE", roomModel, Convert.ToChar(2), Encoding.encodeVL64(roomID) })); this._ROOMACCESS_SECONDARY_OK = true; } } } internal void ProcessPacketAGBL() { if (this._ROOMACCESS_SECONDARY_OK && !this._inPublicroom) { DataRow dRow; string Landscape; DatabaseClient dbClient; using (dbClient = Eucalypt.dbManager.GetClient()) { dRow = dbClient.getRow("SELECT model, wallpaper, floor FROM rooms WHERE id = '" + this._roomID + "'"); Landscape = dbClient.getString("SELECT landscape FROM rooms WHERE id = '" + this._roomID + "'"); } string Model = "model_" + Convert.ToString(dRow["model"]); this.sendData(string.Concat(new object[] { "AE", Model, Convert.ToChar(2), Encoding.encodeVL64(this._roomID) })); int Wallpaper = Convert.ToInt32(dRow["wallpaper"]); int Floor = Convert.ToInt32(dRow["floor"]); this.sendData(string.Concat(new object[] { "@nlandscape", Convert.ToChar(2), Landscape.Replace(",", "."), Convert.ToChar(2) })); if (Wallpaper > 0) { this.sendData(string.Concat(new object[] { "@nwallpaper", Convert.ToChar(2), Wallpaper, Convert.ToChar(2) })); } if (Floor > 0) { this.sendData(string.Concat(new object[] { "@nfloor", Convert.ToChar(2), Floor, Convert.ToChar(2) })); } if (!this._isOwner) { this._isOwner = rankManager.containsRight(this, "fuse_any_room_controller", this.userID); } if (this._isOwner) { this._hasRights = true; this.sendData("@o"); } if (this._hasRights) { this.sendData("@j"); } int voteAmount = -1; using (dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.findsResult(string.Concat(new object[] { "SELECT userid FROM room_votes WHERE userid = '", this.userID, "' AND roomid = '", this._roomID, "'" })) | this._isOwner) { voteAmount = dbClient.getInt("SELECT SUM(vote) FROM room_votes WHERE roomid = '" + this._roomID + "'"); if (voteAmount < 0) { voteAmount = 0; } } } this.sendData("EY" + Encoding.encodeVL64(voteAmount)); this.sendData("Er" + eventManager.getEvent(this._roomID)); } } internal void ProcessPacketAGBL2() { if (this._ROOMACCESS_SECONDARY_OK && (this.Room != null)) { this.sendData("@^" + this.Room.PublicroomItems); this.sendData("@`" + this.Room.Flooritems); } } internal void ProcessPacketAGCA() { if (this._ROOMACCESS_SECONDARY_OK && (this.Room != null)) { this.sendData("Du" + this.Room.Groups); if (this.Room.Lobby != null) { this.sendData(string.Concat(new object[] { "CgH", this.Room.Lobby.Rank.Title, Convert.ToChar(2), Encoding.encodeVL64(this.Room.Lobby.Rank.minPoints), Encoding.encodeVL64(this.Room.Lobby.Rank.maxPoints) })); this.sendData("Cz" + this.Room.Lobby.playerRanks); } if (!this._receivedSpriteIndex) { this.sendData("DiH" + Convert.ToChar(1) + "DuH"); this._receivedSpriteIndex = true; } } } internal void ProcessPacketAGe() { if (this.Messenger != null) { int Amount = Encoding.decodeVL64(this.currentPacket.Substring(2)); this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(Amount).Length + 2); StringBuilder Updates = new StringBuilder(); virtualBuddy Me = new virtualBuddy(this.userID); for (int i = 0; i < Amount; i++) { DatabaseClient dbClient; if (this.currentPacket == "") { break; } int requestID = Encoding.decodeVL64(this.currentPacket); int fromUserID = 0; using (dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.getInt("SELECT COUNT(friendid) FROM messenger_friendrequests WHERE userid = '" + this.userID + "'") > this._maxFriends) { break; } if ((this.userID > 0) && (requestID > 0)) { fromUserID = dbClient.getInt(string.Concat(new object[] { "SELECT userid_from FROM messenger_friendrequests WHERE userid_to = '", this.userID, "' AND requestid = '", requestID, "'" })); } } if (fromUserID > 0) { virtualBuddy Buddy = new virtualBuddy(fromUserID); this.Messenger.addBuddy(Buddy, false); if (userManager.containsUser(fromUserID) && (userManager.getUser(fromUserID).Messenger != null)) { userManager.getUser(fromUserID).Messenger.addBuddy(Me, true); } using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "INSERT INTO messenger_friendships(userid,friendid) VALUES ('", fromUserID, "','", this.userID, "')" })); dbClient.runQuery(string.Concat(new object[] { "DELETE FROM messenger_friendrequests WHERE userid_to = '", this.userID, "' AND requestid = '", requestID, "' LIMIT 1" })); } this.sendData("@MHI" + Encoding.encodeVL64(1) + Buddy.ToString(true, false)); this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(requestID).Length); } } } } internal void ProcessPacketAGf() { if (this.Messenger != null) { int Amount = Encoding.decodeVL64(this.currentPacket.Substring(3)); this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(Amount).Length + 3); for (int i = 0; i < Amount; i++) { if (this.currentPacket == "") { break; } int requestID = Encoding.decodeVL64(this.currentPacket); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "DELETE FROM messenger_friendrequests WHERE userid_to = '", this.userID, "' AND requestid = '", requestID, "' LIMIT 1" })); } this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(requestID).Length); } } } internal void ProcessPacketAGg() { if (this.Messenger != null) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("username", this.currentPacket.Substring(4)); int toID = dbClient.getInt("SELECT id FROM users WHERE name = @username"); int requestID = dbClient.getInt("SELECT MAX(requestid) FROM messenger_friendrequests WHERE userid_to = '" + toID + "'") + 1; dbClient.runQuery(string.Concat(new object[] { "INSERT INTO messenger_friendrequests(userid_to,userid_from,requestid) VALUES ('", toID, "','", this.userID, "','", requestID, "')" })); if (userManager.getUser(toID) != null) { userManager.getUser(toID).sendData(string.Concat(new object[] { "BDI", this._Username, Convert.ToChar(2), this.userID, Convert.ToChar(2) })); } } } } internal void ProcessPacketAGG() { this.refreshAppearance(false, true, false); } internal void ProcessPacketAGh() { if (this.Messenger != null) { int buddyID = Encoding.decodeVL64(this.currentPacket.Substring(3)); this.Messenger.removeBuddy(buddyID); if (userManager.containsUser(buddyID) && (userManager.getUser(buddyID).Messenger != null)) { userManager.getUser(buddyID).Messenger.removeBuddy(this.userID); } using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "DELETE FROM messenger_friendships WHERE (userid = '", this.userID, "' AND friendid = '", buddyID, "') OR (userid = '", buddyID, "' AND friendid = '", this.userID, "') LIMIT 1" })); } } } internal void ProcessPacketAGH() { this.refreshValueables(true, true); } internal void ProcessPacketAGi() { string[] IDs; DatabaseClient dbClient; string Packet = "Fs"; string PacketFriends = ""; string PacketOthers = ""; string PacketAdd = ""; int CountFriends = 0; int CountOthers = 0; using (dbClient = Eucalypt.dbManager.GetClient()) { string Search = this.currentPacket.Substring(4).Replace(@"\", @"\").Replace("'", @"\'"); dbClient.AddParamWithValue("search", Search); IDs = dataHandling.dColToArray(dbClient.getColumn("SELECT id FROM users WHERE name LIKE '" + Search + "%' LIMIT 20 ")); } for (int i = 0; i < IDs.Length; i++) { DataRow row; int thisID = Convert.ToInt32(IDs[i]); bool online = userManager.containsUser(thisID); string onlineStr = online ? "I" : "H"; using (dbClient = Eucalypt.dbManager.GetClient()) { row = dbClient.getRow("SELECT name, mission, lastvisit, figure FROM users WHERE id = " + thisID.ToString()); } PacketAdd = string.Concat(new object[] { Encoding.encodeVL64(thisID), row[0], "\x0002", row[1], "\x0002", onlineStr, onlineStr, "\x0002", onlineStr, online ? row[3] : "", "\x0002", online ? "" : row[2], "\x0002" }); if (this.Messenger.hasFriendship(thisID)) { CountFriends++; PacketFriends = PacketFriends + PacketAdd; } else { CountOthers++; PacketOthers = PacketOthers + PacketAdd; } } PacketFriends = Encoding.encodeVL64(CountFriends) + PacketFriends; PacketOthers = Encoding.encodeVL64(CountOthers) + PacketOthers; Packet = Packet + PacketFriends + PacketOthers; this.sendData(Packet); } internal void ProcessPacketAGj() { if ((this.currentPacket.Contains("\x00ac") || this.currentPacket.Contains(Convert.ToChar(1).ToString())) || this.currentPacket.Contains(Convert.ToChar(2).ToString())) { this.sendData("@dI"); } else { this.sendData("@dH"); } } internal void ProcessPacketAGL() { this.Messenger = new virtualMessenger(this.userID); this.sendData("@L" + this.Messenger.friendList(this._maxFriends)); this.sendData("Dz" + this.Messenger.friendRequests()); } internal void ProcessPacketAGO() { if (this.Messenger != null) { this.sendData("@M" + this.Messenger.getUpdates()); } } internal void ProcessPacketAGp() { bool result; DatabaseClient dbClient; int cfhID = Encoding.decodeVL64(this.currentPacket.Substring(4)); int cfhAction = Encoding.decodeVL64(this.currentPacket.Substring(Encoding.encodeVL64(cfhID).Length + 4)); string userName = ""; using (dbClient = Eucalypt.dbManager.GetClient()) { userName = dbClient.getString("SELECT username FROM cms_help WHERE id = '" + cfhID + "'"); result = dbClient.findsResult("SELECT id FROM cms_help WHERE id = '" + cfhID + "'"); } if (!result) { using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("DELETE FROM cms_help WHERE id = '" + cfhID + "' LIMIT 1"); } userManager.sendToRank(Config.Minimum_CFH_Rank, true, "DQ" + Encoding.encodeVL64(cfhID) + Convert.ToChar(2)); } else if (cfhAction == 1) { virtualUser toVirtualUser = userManager.getUser(userManager.getUserID(userName)); if (toVirtualUser._isLoggedIn) { toVirtualUser._blockCFH = true; } using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("DELETE FROM cms_help WHERE id = '" + cfhID + "' LIMIT 1"); } userManager.sendToRank(Config.Minimum_CFH_Rank, true, "DQ" + Encoding.encodeVL64(cfhID) + Convert.ToChar(2)); } else { DataRow dRow; string roomName; using (dbClient = Eucalypt.dbManager.GetClient()) { dRow = dbClient.getRow("SELECT picked_up,username,message,roomid FROM cms_help WHERE id = '" + cfhID + "'"); roomName = dbClient.getString("SELECT name FROM rooms WHERE id = '" + Convert.ToString(dRow[3]) + "'"); } userManager.sendToRank(Config.Minimum_CFH_Rank, true, string.Concat(new object[] { "BT", Encoding.encodeVL64(cfhID), Convert.ToChar(2), "IPicked up by ", this._Username, " at ", DateTime.Now.ToLongTimeString(), "!", Convert.ToChar(2), Convert.ToString(dRow[1]), Convert.ToChar(2), Convert.ToString(dRow[2]), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow[3])), Convert.ToChar(2), roomName, Convert.ToChar(2), "I", Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow[3])) })); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE cms_help SET picked_up = '1' WHERE id = '" + cfhID + "' LIMIT 1"); } } } internal void ProcessPacketAGP() { DataTable dTable; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dTable = dbClient.getTable("SELECT id,name,description,state,showname,visitors_now,visitors_max FROM rooms WHERE owner = '" + this._Username + "' ORDER BY id ASC"); } if (dTable.Rows.Count > 0) { StringBuilder Rooms = new StringBuilder(); foreach (DataRow dRow in dTable.Rows) { Rooms.Append(string.Concat(new object[] { Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), Convert.ToString(dRow["name"]), Convert.ToChar(2), this._Username, Convert.ToChar(2), roomManager.getRoomState(Convert.ToInt32(dRow["state"])), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_now"])), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_max"])), Convert.ToString(dRow["description"]), Convert.ToChar(2) })); } this.sendData("@P" + Encoding.encodeVL64(dTable.Rows.Count) + Rooms.ToString()); } else { this.sendData("@y" + this._Username); } } internal void ProcessPacketAGPAR() { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.getInt("SELECT COUNT(id) FROM rooms WHERE owner = '" + this._Username + "'") < Config.Navigator_createRoom_maxRooms) { string roomName_B64 = ""; string roomName = ""; string roomModel_B64 = ""; string roomModel = ""; string roomOpentype_B64 = ""; string roomOpentype = ""; int roomShowname = 0; roomName_B64 = this.currentPacket.Substring(2, 2); roomName = this.currentPacket.Substring(4, Encoding.decodeB64(roomName_B64)); roomModel_B64 = this.currentPacket.Substring(Encoding.decodeB64(roomName_B64) + 4, 2); roomModel = this.currentPacket.Substring(Encoding.decodeB64(roomName_B64) + 6, Encoding.decodeB64(roomModel_B64)); roomOpentype_B64 = this.currentPacket.Substring((Encoding.decodeB64(roomName_B64) + Encoding.decodeB64(roomModel_B64)) + 6, 2); roomOpentype = this.currentPacket.Substring((Encoding.decodeB64(roomName_B64) + 8) + Encoding.decodeB64(roomModel_B64), Encoding.decodeB64(roomOpentype_B64)); roomShowname = Encoding.decodeVL64(this.currentPacket.Substring(((Encoding.decodeB64(roomName_B64) + 8) + Encoding.decodeB64(roomModel_B64)) + Encoding.decodeB64(roomOpentype_B64), 1)); if ((roomShowname != 0) && (roomShowname != 1)) { roomShowname = 1; } roomModel = roomModel.Substring(6, 1); dbClient.AddParamWithValue("rs2", stringManager.filterSwearwords(roomName)); dbClient.AddParamWithValue("user", this._Username); dbClient.AddParamWithValue("rs3", roomModel); dbClient.AddParamWithValue("rs4", roomManager.getRoomState(roomOpentype).ToString()); dbClient.AddParamWithValue("rs5", roomShowname); dbClient.runQuery("INSERT INTO rooms (name, owner, model, state, showname) VALUES (@rs2,@user,@rs3,@rs4,@rs5)"); string roomID = dbClient.getString("SELECT MAX(id) FROM rooms WHERE owner = @user"); this.sendData(string.Concat(new object[] { "@{", Encoding.encodeVL64(int.Parse(roomID)), stringManager.filterSwearwords(roomName), Convert.ToChar(2) })); } else { this.sendData("@aError creating a private room"); } } } internal void ProcessPacketAGq() { this.sendData("Bc" + DateTime.Today.ToShortDateString()); } internal void ProcessPacketAGQ() { DataTable dTable; string nameString; DatabaseClient dbClient; int countRooms = 0; bool seeAllRoomOwners = rankManager.containsRight(this, "fuse_see_all_roomowners", this.userID); StringBuilder Rooms = new StringBuilder(); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("search", this.currentPacket.Substring(4)); dbClient.AddParamWithValue("max", Config.Navigator_roomSearch_maxResults); dTable = dbClient.getTable("SELECT id,name,owner,description,state,showname,visitors_now,visitors_max FROM rooms WHERE (owner = @search) ORDER BY id ASC LIMIT @max"); } if (dTable.Rows.Count > 0) { foreach (DataRow dRow in dTable.Rows) { nameString = Convert.ToString(dRow["owner"]); if ((!(Convert.ToString(dRow["showname"]) == "0") || !(Convert.ToString(dRow["owner"]) != this._Username)) || seeAllRoomOwners) { Rooms.Append(string.Concat(new object[] { Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), Convert.ToString(dRow["name"]), Convert.ToChar(2), Convert.ToString(dRow["owner"]), Convert.ToChar(2), roomManager.getRoomState(Convert.ToInt32(dRow["state"])), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_now"])), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_max"])), Convert.ToString(dRow["description"]), Convert.ToChar(2) })); countRooms++; } } } using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("max", Config.Navigator_roomSearch_maxResults - countRooms); dTable = dbClient.getTable("SELECT id,name,owner,description,state,showname,visitors_now,visitors_max FROM rooms WHERE (owner != '' AND name LIKE '" + this.currentPacket.Substring(4).Replace("'", "''") + "%') ORDER BY id ASC LIMIT @max"); } if (dTable.Rows.Count > 0) { foreach (DataRow dRow in dTable.Rows) { nameString = Convert.ToString(dRow["owner"]); if ((!(Convert.ToString(dRow["showname"]) == "0") || !(Convert.ToString(dRow["owner"]) != this._Username)) || seeAllRoomOwners) { Rooms.Append(string.Concat(new object[] { Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), Convert.ToString(dRow["name"]), Convert.ToChar(2), Convert.ToString(dRow["owner"]), Convert.ToChar(2), roomManager.getRoomState(Convert.ToInt32(dRow["state"])), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_now"])), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_max"])), Convert.ToString(dRow["description"]), Convert.ToChar(2) })); countRooms++; } } } if (countRooms == 0) { this.sendData("@z"); } else { this.sendData("@w" + Encoding.encodeVL64(countRooms) + Rooms.ToString()); } } internal void ProcessPacketAGR() { DataColumn dCol; DatabaseClient dbClient; using (dbClient = Eucalypt.dbManager.GetClient()) { dCol = dbClient.getColumn(string.Concat(new object[] { "SELECT roomid FROM users_favourites WHERE userid = '", this.userID, "' ORDER BY roomid DESC LIMIT ", Config.Navigator_Favourites_maxRooms })); } Hashtable deletedIDs = new Hashtable(dCol.Table.Rows.Count); string roomIDs = " "; foreach (DataRow dRow in dCol.Table.Rows) { deletedIDs.Add(Convert.ToInt32(dRow["roomid"]), Convert.ToInt32(dRow["roomid"])); roomIDs = roomIDs + "id = '" + Convert.ToString(dRow["roomid"]) + "' OR "; } roomIDs = roomIDs.Substring(0, roomIDs.Length - 4); if (roomIDs.Length > 0) { DataTable dTable; int guestRoomAmount = 0; bool seeHiddenRoomOwners = rankManager.containsRight(this, "fuse_enter_locked_rooms", this.userID); StringBuilder Rooms = new StringBuilder(); using (dbClient = Eucalypt.dbManager.GetClient()) { dTable = dbClient.getTable("SELECT name,owner,state,showname,visitors_now,visitors_max,description,category,ccts,id FROM rooms WHERE " + roomIDs); } foreach (DataRow dRow in dTable.Rows) { deletedIDs.Remove(Convert.ToInt32(dRow["id"])); if (Convert.ToString(dRow[1]) == "") { Rooms.Append(string.Concat(new object[] { Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), "I", Convert.ToString(dRow[0]), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow[4])), Encoding.encodeVL64(Convert.ToInt32(dRow[5])), Encoding.encodeVL64(Convert.ToInt32(dRow[7])), Convert.ToString(dRow[6]), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), "H", Convert.ToString(dRow[8]), Convert.ToChar(2), "HI" })); } else { string nameString = Convert.ToString(dRow[0]); if (!((!(Convert.ToString(dRow[3]) == "0") || !(this._Username != Convert.ToString(dRow[1]))) || seeHiddenRoomOwners)) { nameString = "-"; } Rooms.Append(string.Concat(new object[] { Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), nameString, Convert.ToChar(2), Convert.ToString(dRow[1]), Convert.ToChar(2), roomManager.getRoomState(Convert.ToInt32(dRow[2])), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow[4])), Encoding.encodeVL64(Convert.ToInt32(dRow[5])), Convert.ToString(dRow[6]), Convert.ToChar(2) })); guestRoomAmount++; } } using (dbClient = Eucalypt.dbManager.GetClient()) { foreach (int rID in deletedIDs.Values) { dbClient.runQuery("DELETE FROM users_favourites WHERE roomid = '" + rID + "' LIMIT 1"); } } this.sendData(string.Concat(new object[] { "@}HHJ", Convert.ToChar(2), "HHH", Encoding.encodeVL64(guestRoomAmount - deletedIDs.Count), Rooms.ToString() })); } } internal void ProcessPacketAGS() { int roomID = Encoding.decodeVL64(this.currentPacket.Substring(3)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.findsResult("SELECT id FROM rooms WHERE id = '" + roomID + "'") && !dbClient.findsResult(string.Concat(new object[] { "SELECT userid FROM users_favourites WHERE userid = '", this.userID, "' AND roomid = '", roomID, "'" }))) { if (dbClient.getInt("SELECT COUNT(userid) FROM users_favourites WHERE userid = '" + this.userID + "'") < Config.Navigator_Favourites_maxRooms) { this.sendData("GK" + Encoding.encodeVL64(roomID) + "I"); dbClient.runQuery(string.Concat(new object[] { "INSERT INTO users_favourites (userid,roomid) VALUES ('", this.userID, "','", roomID, "')" })); } else { this.sendData("@anav_error_toomanyfavrooms"); } } } } internal void ProcessPacketAGT() { int roomID = Encoding.decodeVL64(this.currentPacket.Substring(3)); this.sendData("GK" + Encoding.encodeVL64(roomID) + "H"); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "DELETE FROM users_favourites WHERE userid = '", this.userID, "' AND roomid = '", roomID, "' LIMIT 1" })); } } internal void ProcessPacketAGu() { this.leaveCurrentRoom("", false); } internal void ProcessPacketAGU() { DataRow dRow; DatabaseClient dbClient; int roomID = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (dbClient = Eucalypt.dbManager.GetClient()) { dRow = dbClient.getRow("SELECT name,owner,description,model,state,superusers,showname,category,visitors_now,visitors_max FROM rooms WHERE id = '" + roomID + "' AND NOT(owner IS NULL)"); } if (dRow.Table.Rows.Count > 0) { StringBuilder Details = new StringBuilder(Encoding.encodeVL64(Convert.ToInt32(dRow[5])) + Encoding.encodeVL64(Convert.ToInt32(dRow[4])) + Encoding.encodeVL64(roomID)); if (((Convert.ToString(dRow[1]) != this._Username) && (Convert.ToString(dRow[6]) == "0")) && rankManager.containsRight(this, "fuse_see_all_roomowners", this.userID)) { Details.Append("-"); } else { Details.Append(Convert.ToString(dRow[1])); } Details.Append(string.Concat(new object[] { Convert.ToChar(2), "model_", Convert.ToString(dRow[3]), Convert.ToChar(2), Convert.ToString(dRow[0]), Convert.ToChar(2), Convert.ToString(dRow[2]), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow[6])) })); using (dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.findsResult("SELECT id FROM room_categories WHERE id = '" + Convert.ToString(dRow[7]) + "' AND trading = '1'")) { Details.Append("I"); } else { Details.Append("H"); } } Details.Append(Encoding.encodeVL64(Convert.ToInt32(dRow[8])) + Encoding.encodeVL64(Convert.ToInt32(dRow[9]))); this.sendData("@v" + Details.ToString()); } } internal void ProcessPacketAGv() { this.sendData("@S"); } internal void ProcessPacketAGw() { try { if (!this._isMuted && ((this.Room != null) && (this.roomUser != null))) { string Message = this.currentPacket.Substring(4); userManager.addChatMessage(this._Username, this._roomID, Message); Message = stringManager.filterSwearwords(Message); if ((Message.Substring(0, 1) == ":") && this.isSpeechCommand(Message.Substring(1))) { if (this.roomUser.isTyping) { this.Room.sendData("Ei" + Encoding.encodeVL64(this.roomUser.roomUID) + "H"); this.roomUser.isTyping = false; } } else if (this.currentPacket.Substring(1, 1) == "w") { this.Room.sendShout(this.roomUser, Message); } else { this.Room.sendSaying(this.roomUser, Message); } } } catch (Exception) { } } internal void ProcessPacketAGW() { int roomID = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.findsResult(string.Concat(new object[] { "SELECT id FROM rooms WHERE id = '", roomID, "' AND owner = '", this._Username, "'" }))) { dbClient.runQuery("DELETE FROM room_rights WHERE roomid = '" + roomID + "'"); dbClient.runQuery("DELETE FROM rooms WHERE id = '" + roomID + "' LIMIT 1"); dbClient.runQuery("DELETE FROM users_favourites WHERE roomid = '" + this._roomID + "'"); dbClient.runQuery("DELETE FROM room_votes WHERE roomid = '" + roomID + "'"); dbClient.runQuery("DELETE FROM room_bans WHERE roomid = '" + roomID + "' LIMIT 1"); dbClient.runQuery("DELETE FROM furniture WHERE roomid = '" + roomID + "'"); dbClient.runQuery("DELETE FROM furniture_moodlight WHERE roomid = '" + roomID + "'"); } } if (roomManager.containsRoom(roomID)) { roomManager.getRoom(roomID).kickUsers(byte.Parse("9"), "This room has been deleted"); } } internal void ProcessPacketAGWTF() { if (this._ROOMACCESS_SECONDARY_OK && (this.Room != null)) { this.sendData("@m" + this.Room.Wallitems); } } internal void ProcessPacketAGx() { if ((!this._isMuted && (this.Room != null)) && (this.roomUser != null)) { string Receiver = this.currentPacket.Substring(4).Split(new char[] { ' ' })[0]; string Message = this.currentPacket.Substring(Receiver.Length + 5); userManager.addChatMessage(this._Username, this._roomID, Message); Message = stringManager.filterSwearwords(Message); this.Room.sendWhisper(this.roomUser, Receiver, Message); } } internal void ProcessPacketAGX() { int roomID = 0; roomID = Encoding.decodeVL64(this.currentPacket.Substring(2)); string roomName_B64 = ""; string roomName = ""; string roomOpentype_B64 = ""; string roomOpentype = ""; int show = 0; roomName_B64 = this.currentPacket.Substring(Strings.Len(Encoding.encodeVL64(roomID)) + 2, 2); roomName = stringManager.filterSwearwords(this.currentPacket.Substring(Strings.Len(Encoding.encodeVL64(roomID)) + 4, Encoding.decodeB64(roomName_B64))); roomOpentype_B64 = this.currentPacket.Substring((Strings.Len(Encoding.encodeVL64(roomID)) + Encoding.decodeB64(roomName_B64)) + 4, 2); roomOpentype = this.currentPacket.Substring((Strings.Len(Encoding.encodeVL64(roomID)) + 6) + Encoding.decodeB64(roomName_B64), Encoding.decodeB64(roomOpentype_B64)); show = Encoding.decodeVL64(this.currentPacket.Substring(((Strings.Len(Encoding.encodeVL64(roomID)) + 6) + Encoding.decodeB64(roomName_B64)) + Encoding.decodeB64(roomOpentype_B64), 1)); if ((show != 1) && (show != 0)) { show = 1; } using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("name", stringManager.filterSwearwords(roomName)); dbClient.AddParamWithValue("state", roomManager.getRoomState(roomOpentype)); dbClient.AddParamWithValue("show", show); dbClient.AddParamWithValue("id", roomID); dbClient.AddParamWithValue("owner", this._Username); dbClient.runQuery("UPDATE rooms SET name = @name,state = @state,showname = @show WHERE id = @id AND owner = @owner LIMIT 1"); } } internal void ProcessPacketAGy() { if (!this._inPublicroom) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { this._isOwner = dbClient.findsResult(string.Concat(new object[] { "SELECT id FROM rooms WHERE id = '", this._roomID, "' AND owner = '", this._Username, "'" })); if (!this._isOwner) { this._hasRights = dbClient.findsResult(string.Concat(new object[] { "SELECT userid FROM room_rights WHERE roomid = '", this._roomID, "' AND userid = '", this.userID, "'" })); } if (!this._hasRights) { this._hasRights = dbClient.findsResult("SELECT id FROM rooms WHERE id = '" + this._roomID + "' AND superusers = '1'"); } if (((this._teleporterID == 0) && !this._isOwner) && !rankManager.containsRight(this, "fuse_enter_locked_rooms", this.userID)) { int accessFlag = dbClient.getInt("SELECT state FROM rooms WHERE id = '" + this._roomID + "'"); if (!(this._ROOMACCESS_PRIMARY_OK || (accessFlag == 2))) { return; } if (dbClient.findsResult(string.Concat(new object[] { "SELECT roomid FROM room_bans WHERE roomid = '", this._roomID, "' AND userid = '", this.userID, "'" }))) { if (DateTime.Compare(DateTime.Parse(dbClient.getString(string.Concat(new object[] { "SELECT ban_expire FROM room_bans WHERE roomid = '", this._roomID, "' AND userid = '", this.userID, "'" }))), DateTime.Now) > 0) { this.sendData("C`PA"); this.sendData("@R"); return; } dbClient.runQuery(string.Concat(new object[] { "DELETE FROM room_bans WHERE roomid = '", this._roomID, "' AND userid = '", this.userID, "' LIMIT 1" })); } switch (accessFlag) { case 1: if (!roomManager.containsRoom(this._roomID)) { this.sendData("BC"); } else { roomManager.getRoom(this._roomID).sendDataToRights("A[" + this._Username + Convert.ToChar(2)); this.sendData("A[" + Convert.ToChar(2)); } return; case 2: { string givenPassword = ""; try { givenPassword = this.currentPacket.Substring(Encoding.encodeVL64(this._roomID).Length + 4); } catch { } string roomPassword = dbClient.getString("SELECT password FROM rooms WHERE id = '" + this._roomID + "' LIMIT 1"); if (givenPassword != roomPassword) { this.sendData("@afhFF" + Convert.ToChar(2)); return; } break; } } } this._ROOMACCESS_SECONDARY_OK = true; this.sendData("@i"); } } } internal void ProcessPacketAGY() { int roomID = 0; roomID = Encoding.decodeVL64(this.currentPacket.Substring(2)); string roomDescription_B64 = ""; string roomDescription = ""; string roomPassword_B64 = ""; string roomPassword = ""; int superUsers = 0; int maxVisitors = 0x19; roomDescription_B64 = this.currentPacket.Substring(Strings.Len(Encoding.encodeVL64(roomID)) + 2, 2); roomDescription = stringManager.filterSwearwords(this.currentPacket.Substring(Strings.Len(Encoding.encodeVL64(roomID)) + 4, Encoding.decodeB64(roomDescription_B64))); roomPassword_B64 = this.currentPacket.Substring((Strings.Len(Encoding.encodeVL64(roomID)) + Encoding.decodeB64(roomDescription_B64)) + 4, 2); roomPassword = this.currentPacket.Substring((Strings.Len(Encoding.encodeVL64(roomID)) + 6) + Encoding.decodeB64(roomDescription_B64), Encoding.decodeB64(roomPassword_B64)); superUsers = Encoding.decodeVL64(this.currentPacket.Substring(((Strings.Len(Encoding.encodeVL64(roomID)) + 6) + Encoding.decodeB64(roomDescription_B64)) + Encoding.decodeB64(roomPassword_B64), 1)); if (((superUsers != 0) && (superUsers != 1)) && ((maxVisitors < 10) || (maxVisitors > 50))) { maxVisitors = 0x19; } using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("desc", roomDescription); dbClient.AddParamWithValue("super", superUsers); dbClient.AddParamWithValue("max", maxVisitors); dbClient.AddParamWithValue("pass", roomPassword); dbClient.AddParamWithValue("id", roomID); dbClient.AddParamWithValue("owner", this._Username); dbClient.runQuery("UPDATE rooms SET description = @desc,superusers = @super,visitors_max = @max, password = @pass WHERE id = @id AND owner = @owner LIMIT 1"); } } internal void ProcessPacketAGZ() { this.refreshClub(); } internal void ProcessPacketAh() { if (!((((this.Room == null) || (this.roomUser == null)) || (this.statusManager.containsStatus("swim") || this.statusManager.containsStatus("sit"))) || this.statusManager.containsStatus("lay"))) { int signID = Encoding.decodeVL64(this.currentPacket.Substring(2)); this.statusManager.handleStatus("sign", Convert.ToString(signID), Config.Statuses_Wave_waveDuration); this.statusManager.Refresh(); } } internal void ProcessPacketAH() { if ((((this.Room != null) && (this.roomUser != null)) && (this._tradePartnerRoomUID != -1)) && this.Room.containsUser(this._tradePartnerRoomUID)) { int templateID; int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { templateID = dbClient.getInt(string.Concat(new object[] { "SELECT tid FROM furniture WHERE id = '", itemID, "' AND ownerid = '", this.userID, "' AND roomid = '0'" })); } if (templateID != 0) { this._tradeItems[this._tradeItemCount] = itemID; this._tradeItemCount++; virtualUser Partner = this.Room.getUser(this._tradePartnerRoomUID); this._tradeAccept = false; Partner._tradeAccept = false; this.refreshTradeBoxes(); Partner.refreshTradeBoxes(); } } } internal void ProcessPacketAI() { if (((this._hasRights && !this._inPublicroom) && (this.Room != null)) && (this.roomUser != null)) { int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (this.Room.floorItemManager.containsItem(itemID)) { int X = Encoding.decodeVL64(this.currentPacket.Substring(2 + Encoding.encodeVL64(itemID).Length)); int Y = Encoding.decodeVL64(this.currentPacket.Substring((2 + Encoding.encodeVL64(itemID).Length) + Encoding.encodeVL64(X).Length)); byte Z = Convert.ToByte(Encoding.decodeVL64(this.currentPacket.Substring(((2 + Encoding.encodeVL64(itemID).Length) + Encoding.encodeVL64(X).Length) + Encoding.encodeVL64(Y).Length))); this.Room.floorItemManager.relocateItem(itemID, X, Y, Z); } } } internal void ProcessPacketAj() { if ((this.Room != null) && this.roomUser.Diving) { string DivePacket = this.currentPacket.Substring(2); this.Room.sendData(string.Concat(new object[] { "AJ", this.roomUser.roomUID, Convert.ToChar(13), DivePacket })); } } internal void ProcessPacketAk() { if ((this.Room != null) && this.roomUser.Diving) { this.Room.DiveDoorOpen = true; this.roomUser.walkLock = false; string[] Cords = this.currentPacket.Substring(2).Split(",".ToCharArray()); this.Room.sendData("AGBIGSPLASH position " + Cords[0] + "," + Cords[1]); this.Room.sendData("AGdoor open"); this.Room.sendSpecialCast("cam1", "targetcamera " + this.roomUser.roomUID); this.Room.sqUNIT[this.roomUser.X, this.roomUser.Y] = false; this.Room.sqUNIT[0x1a, 3] = false; this.Room.sqUNIT[0x1a, 4] = false; this.roomUser.X = int.Parse(Cords[0]); this.roomUser.Y = int.Parse(Cords[1]); this.roomUser.Diving = false; this.roomUser.InQueue = false; this.roomUser.H = this.Room.sqFLOORHEIGHT[int.Parse(Cords[0]), int.Parse(Cords[1])]; if (this.roomUser.H <= 7.0) { this.statusManager.addStatus("swim", ""); } this.roomUser.goalX = 20; this.roomUser.goalY = 0x13; } } internal void ProcessPacketAK() { if (((this.Room != null) && (this.roomUser != null)) && !this.roomUser.walkLock) { int goalX = Encoding.decodeVL64(this.currentPacket.Substring(2)); int goalY = Encoding.decodeVL64(this.currentPacket.Substring(2 + Encoding.encodeVL64(goalX).Length)); if ((goalX == this.Room.doorX) && (this.Room.doorY == goalY)) { this.sendData("@R"); this.Handler.ProcessPacket("@u"); } else if (this.roomUser.SPECIAL_TELEPORTABLE) { int oldX = this.roomUser.X; int oldY = this.roomUser.Y; this.roomUser.X = goalX; this.roomUser.Y = goalY; this.roomUser.goalX = -1; this.Room.refreshCoord(goalX, goalY); this.Room.sqUNIT[oldX, oldY] = false; this.Room.setSquareState(oldX, oldY, 1, 1, virtualRoom.squareState.Open); this.refreshAppearance(false, false, true); } else { this.roomUser.goalX = goalX; this.roomUser.goalY = goalY; } } } internal void ProcessPacketAL() { if (((this.Room != null) && (this.roomUser != null)) && !this._inPublicroom) { int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (this.Room.floorItemManager.containsItem(itemID)) { floorItem Item = this.Room.floorItemManager.getItem(itemID); string Sprite = Item.Sprite; if (((!(Sprite != "edice") || !(Sprite != "edicehc")) || !(Sprite != "bottle")) && (((Math.Abs((int) (this.roomUser.X - Item.X)) <= 1) && (Math.Abs((int) (this.roomUser.Y - Item.Y)) <= 1)) || (Sprite == "bottle"))) { this.Room.sendData("AZ" + Encoding.encodeVL64(itemID) + "M"); int rndNum = new Random(DateTime.Now.Millisecond).Next(1, 7); this.Room.sendData("AZ" + Encoding.encodeVL64(itemID) + Encoding.encodeVL64(rndNum), 0x7d0); Item.Var = rndNum.ToString(); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE furniture SET var = '", rndNum, "' WHERE id = '", itemID, "' LIMIT 1" })); } } } } } internal void ProcessPacketAM() { if (((this.Room != null) && (this.roomUser != null)) && !this._inPublicroom) { int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (this.Room.floorItemManager.containsItem(itemID)) { floorItem Item = this.Room.floorItemManager.getItem(itemID); string Sprite = Item.Sprite; if ((!(Sprite != "edice") || !(Sprite != "edicehc")) && ((Math.Abs((int) (this.roomUser.X - Item.X)) <= 1) && (Math.Abs((int) (this.roomUser.Y - Item.Y)) <= 1))) { Item.Var = "0"; this.Room.sendData("AZ" + Encoding.encodeVL64(itemID) + Encoding.encodeVL64(0)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE furniture SET var = '0' WHERE id = '" + itemID + "' LIMIT 1"); } } } } } internal void ProcessPacketAN() { string tmpStatus = "s"; if (((this._isOwner && !this._inPublicroom) && (this.Room != null)) && (this.roomUser != null)) { int itemID = Encoding.decodeVL64(Convert.ToString(this.currentPacket.Substring(2))); if (this.Room.floorItemManager.containsItem(itemID)) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { DataColumn dCol = dbClient.getColumn("SELECT itemid FROM furniture_presents WHERE id = '" + itemID + "'"); if (dCol.Table.Rows.Count > 0) { StringBuilder sb = new StringBuilder(); int lastItemID = 0; foreach (DataRow dRow in dCol.Table.Rows) { sb.Append(" OR id = '" + Convert.ToString(dRow["itemid"]) + "'"); lastItemID = Convert.ToInt32(dRow["itemid"]); } dbClient.runQuery("UPDATE furniture SET roomid = '-' WHERE " + sb.ToString().Substring(4)); this.Room.floorItemManager.removeItem(itemID, 0); catalogueManager.itemTemplate Template = catalogueManager.getTemplate(dbClient.getInt("SELECT tid FROM furniture WHERE id = '" + lastItemID + "'")); if (Template.typeID > 0) { tmpStatus = "s"; } else { tmpStatus = "i"; } if (Template.typeID > 0) { this.sendData(string.Concat(new object[] { "BA", tmpStatus, Convert.ToChar(2), Encoding.encodeVL64(Template.indexID) })); } else { this.sendData(string.Concat(new object[] { "BA", tmpStatus, Convert.ToChar(2), Encoding.encodeVL64(Template.indexID) })); } } dbClient.runQuery(string.Concat(new object[] { "DELETE FROM furniture_presents WHERE id = '", itemID, "' LIMIT ", dCol.Table.Rows.Count })); dbClient.runQuery("DELETE FROM furniture WHERE id = '" + itemID + "' LIMIT 1"); } this.refreshHand("last"); } } } internal void ProcessPacketAo() { if (this.currentPacket.Substring(2, 1) == "0") { this.roomUser.goalX = 10; this.roomUser.goalY = 3; } } internal void ProcessPacketAO() { if (!((((this.Room == null) || (this.roomUser == null)) || this.statusManager.containsStatus("sit")) || this.statusManager.containsStatus("lay"))) { int X = Encoding.decodeVL64(this.currentPacket.Substring(2)); int Y = Encoding.decodeVL64(this.currentPacket.Substring(Encoding.encodeVL64(X).Length + 2)); this.roomUser.Z1 = Rotation.Calculate(this.roomUser.X, this.roomUser.Y, X, Y); this.roomUser.Z2 = this.roomUser.Z1; this.roomUser.Refresh(); } } internal void ProcessPacketAp() { string CS$4$0000 = this.currentPacket.Substring(2); if (CS$4$0000 != null) { if (!(CS$4$0000 == "1")) { if (CS$4$0000 == "2") { this.Room.InfobusPoll_answers[1]++; } else if (CS$4$0000 == "3") { this.Room.InfobusPoll_answers[2]++; } else if (CS$4$0000 == "4") { this.Room.InfobusPoll_answers[3]++; } else if (CS$4$0000 == "5") { this.Room.InfobusPoll_answers[4]++; } else if (CS$4$0000 == "6") { this.Room.InfobusPoll_answers[5]++; } } else { this.Room.InfobusPoll_answers[0]++; } } } internal void ProcessPacketAP() { if (this.currentPacket.Substring(2) != "H") { this.sendData("@aThere is no drink machine."); } } internal void ProcessPacketAPAR() { if ((((this.Room != null) && (this.roomUser != null)) && !this.statusManager.containsStatus("sit")) && !this.statusManager.containsStatus("lay")) { int danceID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (((danceID <= 2) || rankManager.containsRight(this, "fuse_use_club_dance", this.userID)) && ((danceID >= -1) && (danceID <= 4))) { this.statusID = "G`"; this.statusCount = danceID; this.sendData(this.currentPacket); this.Room.sendData(this.statusID + Encoding.encodeVL64(this.roomUser.roomUID) + Encoding.encodeVL64(this.statusCount)); this.statusManager.Refresh(); } } } internal void ProcessPacketapeF() { this.sendData("Fw7b2bb491cfaa4d2abe0494fa466371130001194b691579c1e6193afdaa227db7031a47c9f2c3" + Convert.ToChar(2) + Convert.ToChar(1)); } internal void ProcessPacketApeo() { if (this.Room == null) { userManager.sendData(this.currentPacket.Substring(2) + Convert.ToChar(2)); } } internal void ProcessPacketAq() { if (Config.InfobusOpen) { this.roomUser.goalX = 0x1c; this.roomUser.goalY = 4; } else { this.sendData("BKSorry, the infobus isn't open yet." + Convert.ToChar(2)); } } internal void ProcessPacketAs() { if (!(((this.Room == null) || (this.roomUser == null)) || this.roomUser.walkDoor)) { this.roomUser.walkDoor = true; this.roomUser.goalX = this.Room.doorX; this.roomUser.goalY = this.Room.doorY; } } internal void ProcessPacketAS() { if (((this.Room != null) && (this.roomUser != null)) && !this._inPublicroom) { int itemID = int.Parse(this.currentPacket.Substring(2)); if (this.Room.wallItemManager.containsItem(itemID)) { string Message; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { Message = dbClient.getString("SELECT text FROM furniture_stickies WHERE id = '" + itemID + "'"); } this.sendData(string.Concat(new object[] { "@p", itemID, Convert.ToChar(9), this.Room.wallItemManager.getItem(itemID).Var, " ", Message, Convert.ToChar(2) })); } } } internal void ProcessPacketAt() { if ((this.Room != null) || ((this.roomUser != null) && this.Room.hasSwimmingPool)) { virtualRoom.squareTrigger Trigger = this.Room.getTrigger(this.roomUser.X, this.roomUser.Y); if ((Trigger.Object == "curtains1") || (Trigger.Object == "curtains2")) { this.roomUser.swimOutfit = this.currentPacket.Substring(2); this.Room.sendData(@"@\" + this.roomUser.detailsString); this.Room.sendSpecialCast(Trigger.Object, "open"); this.roomUser.walkLock = false; this.roomUser.goalX = Trigger.goalX; this.roomUser.goalY = Trigger.goalY; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("figure_swim", this.currentPacket.Substring(2)); dbClient.AddParamWithValue("id", this.userID); dbClient.runQuery("UPDATE users SET figure_swim = @figure_swim WHERE id = @id LIMIT 1"); } } } } internal void ProcessPacketAT() { if (((this._hasRights && (this.Room != null)) && (this.roomUser != null)) && !this._inPublicroom) { int itemID = int.Parse(this.currentPacket.Substring(2, this.currentPacket.IndexOf("/") - 2)); if (this.Room.wallItemManager.containsItem(itemID)) { wallItem Item = this.Room.wallItemManager.getItem(itemID); string Sprite = Item.Sprite; switch (Sprite) { case "post.it": case "post.it.vd": { string Colour = "FFFFFF"; if (Sprite == "post.it") { Colour = this.currentPacket.Substring((2 + itemID.ToString().Length) + 1, 6); if ((((Colour != "FFFF33") && (Colour != "FF9CFF")) && (Colour != "9CFF9C")) && (Colour != "9CCEFF")) { return; } } string Message = this.currentPacket.Substring((2 + itemID.ToString().Length) + 7); if (Message.Length <= 0x2ac) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("text", stringManager.filterSwearwords(Message).Replace("/r", Convert.ToChar(13).ToString())); if (Colour != Item.Var) { dbClient.runQuery(string.Concat(new object[] { "UPDATE furniture SET var = '", Colour, "' WHERE id = '", itemID, "' LIMIT 1" })); } Item.Var = Colour; dbClient.runQuery("UPDATE furniture_stickies SET text = @text WHERE id = '" + itemID + "' LIMIT 1"); } this.Room.sendData(string.Concat(new object[] { "AU", itemID, Convert.ToChar(9), Sprite, Convert.ToChar(9), " ", Item.wallPosition, Convert.ToChar(9), Colour, Convert.ToChar(2) })); } break; } } } } } internal void ProcessPacketATNG() { if ((((this.Room != null) && (this.roomUser != null)) && !this._inPublicroom) && this._isOwner) { virtualUser _Target = userManager.getUser(Encoding.decodeVL64(this.currentPacket.Substring(2))); if (((_Target._roomID == this._roomID) && !_Target._hasRights) && !_Target._isOwner) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "INSERT INTO room_rights(roomid,userid) VALUES ('", this._roomID, "','", _Target.userID, "')" })); } _Target._hasRights = true; _Target.statusManager.addStatus("flatctrl", "onlyfurniture"); _Target.roomUser.Refresh(); _Target.sendData("@j"); } } } internal void ProcessPacketAU() { if (((this._isOwner && (this.Room != null)) && (this.roomUser != null)) && !this._inPublicroom) { int itemID = int.Parse(this.currentPacket.Substring(2)); if (this.Room.wallItemManager.containsItem(itemID) && (stringManager.getStringPart(this.Room.wallItemManager.getItem(itemID).Sprite, 0, 7) == "post.it")) { this.Room.wallItemManager.removeItem(itemID, 0); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("DELETE FROM furniture_stickies WHERE id = '" + itemID + "' LIMIT 1"); } } } } internal void ProcessPacketAUL() { if ((this.Room != null) && (this.roomUser != null)) { this.Room.sendData("Ga" + Encoding.encodeVL64(this.roomUser.roomUID)); } } internal void ProcessPacketAV() { if (this._blockCFH) { this.sendData("BKYou have been blocked from Live Help!" + Convert.ToChar(2)); } else { DatabaseClient dbClient; using (dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.findsResult("SELECT id FROM cms_help WHERE username = '" + this._Username + "' AND picked_up = '0'")) { return; } } int messageLength = Encoding.decodeB64(this.currentPacket.Substring(2, 2)); if (messageLength != 0) { int cfhID; string roomName; string cfhMessage = this.currentPacket.Substring(4, messageLength); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("username", this._Username); dbClient.AddParamWithValue("ip", this._ConnectionManager.connectionRemoteIP); dbClient.AddParamWithValue("message", cfhMessage); dbClient.AddParamWithValue("date", DateTime.Now); dbClient.AddParamWithValue("roomid", this._roomID.ToString()); dbClient.runQuery("INSERT INTO cms_help (username,ip,message,date,picked_up,subject,roomid) VALUES (@username,@ip,@message,@date,'0','CFH message [hotel]',@roomid)"); cfhID = dbClient.getInt("SELECT id FROM cms_help WHERE username = @username AND picked_up = '0'"); roomName = dbClient.getString("SELECT name FROM rooms WHERE id = @roomid"); } this.sendData("EAH"); userManager.sendToRank(Config.Minimum_CFH_Rank, true, string.Concat(new object[] { "BT", Encoding.encodeVL64(cfhID), Convert.ToChar(2), "ISent: ", DateTime.Now, Convert.ToChar(2), this._Username, Convert.ToChar(2), cfhMessage, Convert.ToChar(2), Encoding.encodeVL64(this._roomID), Convert.ToChar(2), roomName, Convert.ToChar(2), "I", Convert.ToChar(2), Encoding.encodeVL64(this._roomID) })); } } } internal void ProcessPacketAW() { int filmAmount = 20; this.sendData("@D" + Encoding.encodeVL64(filmAmount)); } internal void ProcessPacketAZ() { if (((this._hasRights && !this._inPublicroom) && (this.Room != null)) && (this.roomUser != null)) { int itemID = 0; if (int.TryParse(this.currentPacket.Split(new char[] { ' ' })[0].Substring(4), out itemID)) { int templateID; DatabaseClient dbClient; using (dbClient = Eucalypt.dbManager.GetClient()) { templateID = dbClient.getInt(string.Concat(new object[] { "SELECT tid FROM furniture WHERE id = '", itemID, "' AND ownerid = '", this.userID, "' AND roomid = '0'" })); } if (templateID != 0) { if (catalogueManager.getTemplate(templateID).typeID == 0) { string _INPUTPOS = this.currentPacket.Substring(itemID.ToString().Length + 5); string _CHECKEDPOS = catalogueManager.wallPositionOK(_INPUTPOS); if (_CHECKEDPOS == _INPUTPOS) { int VarValue = 0; using (dbClient = Eucalypt.dbManager.GetClient()) { string Var = dbClient.getString("SELECT var FROM furniture WHERE id = '" + itemID + "'"); int.TryParse(Var, out VarValue); if (stringManager.getStringPart(catalogueManager.getTemplate(templateID).Sprite, 0, 7) == "post.it") { if (VarValue > 1) { dbClient.runQuery("UPDATE furniture SET var = var - 1 WHERE id = '" + itemID + "' LIMIT 1"); } else { dbClient.runQuery("DELETE FROM furniture WHERE id = '" + itemID + "' LIMIT 1"); } dbClient.runQuery(string.Concat(new object[] { "INSERT INTO furniture(tid,ownerid) VALUES ('", templateID, "','", this.userID, "')" })); itemID = catalogueManager.lastItemID; dbClient.runQuery("INSERT INTO furniture_stickies(id) VALUES ('" + itemID + "')"); Var = "FFFF33"; dbClient.runQuery(string.Concat(new object[] { "UPDATE furniture SET var = '", Var, "' WHERE id = '", itemID, "' LIMIT 1" })); } else if (stringManager.getStringPart(catalogueManager.getTemplate(templateID).Sprite, 0, 10) == "roomdimmer") { dbClient.runQuery(string.Concat(new object[] { "UPDATE furniture_moodlight SET roomid = '", this._roomID, "' WHERE id = '", itemID, "' LIMIT 1" })); } this.Room.wallItemManager.addItem(itemID, templateID, _CHECKEDPOS, Var, true); } } } else { string[] locDetails = this.currentPacket.Split(new char[] { ' ' }); int X = int.Parse(locDetails[1]); int Y = int.Parse(locDetails[2]); byte Z = byte.Parse(locDetails[3]); byte typeID = catalogueManager.getTemplate(templateID).typeID; this.Room.floorItemManager.placeItem(itemID, templateID, X, Y, typeID, Z, this._stackRugs); } } } } } internal void ProcessPacketB_() { if ((this.Room != null) && (this.Room.Lobby != null)) { this.sendData("Ch" + this.Room.Lobby.gameList()); } } internal void ProcessPacketB__() { if (((this.Room != null) && (this.roomUser != null)) && !this.roomUser.walkDoor) { string bSlots = ""; int slotsCount = 0; int partnerUID = Encoding.decodeVL64(this.currentPacket.Substring(2)); virtualUser Partner = userManager.getUser(partnerUID); if (Partner._Badges.Count > 0) { for (int i = 0; i < Partner._Badges.Count; i++) { if (Partner._badgeSlotIDs[i] > 0) { slotsCount++; bSlots = (bSlots + Encoding.encodeVL64(Partner._badgeSlotIDs[i])) + Partner._Badges[i] + Convert.ToChar(2); } } } this.sendData(string.Concat(new object[] { "Cd", partnerUID, Convert.ToChar(2), Encoding.encodeVL64(slotsCount), bSlots })); } } internal void ProcessPacketBA() { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("code", this.currentPacket.Substring(4)); if (dbClient.findsResult("SELECT credits FROM vouchers WHERE voucher = @code")) { int voucherAmount = dbClient.getInt("SELECT credits FROM vouchers WHERE voucher = @code"); dbClient.runQuery("DELETE FROM vouchers WHERE voucher = @code LIMIT 1"); this._Credits += voucherAmount; this.sendData("@F" + this._Credits); this.sendData("CT"); dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET credits = '", voucherAmount, "' WHERE id = '", this.userID, "' LIMIT 1" })); } else { this.sendData("CU1" + Convert.ToChar(2)); } } } internal void ProcessPacketBAG() { } internal void ProcessPacketBb() { if ((((this.Room != null) && (this.roomUser != null)) && (this.Room.Lobby != null)) && (this.gamePlayer == null)) { if (this._Tickets > 1) { if (this.Room.Lobby.validGamerank(this.roomUser.gamePoints)) { if (this.Room.Lobby.isBattleBall) { this.sendData("Ck" + this.Room.Lobby.getCreateGameSettings()); } else { this.sendData(string.Concat(new object[] { "CkRAsecondsUntilRestart", Convert.ToChar(2), "HIRGIHHfieldType", Convert.ToChar(2), "HKIIIISAnumTeams", Convert.ToChar(2), "HJJIIIPAgameLengthChoice", Convert.ToChar(2), "HJIIIIKname", Convert.ToChar(2), "IJ", Convert.ToChar(2), "HsecondsUntilStart", Convert.ToChar(2), "HIRBIHH" })); } } else { this.sendData("ClK"); } } else { this.sendData("ClJ"); } } } internal void ProcessPacketBc() { if ((((this.Room != null) && (this.roomUser != null)) && (this.Room.Lobby != null)) && (this.gamePlayer == null)) { if (this._Tickets > 1) { if (this.Room.Lobby.validGamerank(this.roomUser.gamePoints)) { try { int mapID = -1; int teamAmount = -1; int[] Powerups = null; string Name = ""; int keyAmount = Encoding.decodeVL64(this.currentPacket.Substring(2)); this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(keyAmount).Length + 2); for (int i = 0; i < keyAmount; i++) { int k; int valLen; int j = Encoding.decodeB64(this.currentPacket.Substring(0, 2)); string Key = this.currentPacket.Substring(2, j); if (!(this.currentPacket.Substring(j + 2, 1) == "H")) { goto Label_0177; } int Value = Encoding.decodeVL64(this.currentPacket.Substring(j + 3)); string CS$4$0001 = Key; if (CS$4$0001 != null) { if (!(CS$4$0001 == "fieldType")) { if (CS$4$0001 == "numTeams") { goto Label_0146; } } else { mapID = Value; } } goto Label_014B; Label_0146: teamAmount = Value; Label_014B: k = Encoding.encodeVL64(Value).Length; this.currentPacket = this.currentPacket.Substring((j + k) + 3); continue; Label_0177: valLen = Encoding.decodeB64(this.currentPacket.Substring(j + 3, 2)); string Value = this.currentPacket.Substring(j + 5, valLen); CS$4$0001 = Key; if (CS$4$0001 != null) { if (!(CS$4$0001 == "allowedPowerups")) { if (CS$4$0001 == "name") { goto Label_023F; } } else { string[] ps = Value.Split(new char[] { ',' }); Powerups = new int[ps.Length]; for (int p = 0; p < ps.Length; p++) { int P = int.Parse(ps[p]); if (this.Room.Lobby.allowsPowerup(P)) { Powerups[p] = P; } else { return; } } } } goto Label_0249; Label_023F: Name = stringManager.filterSwearwords(Value); Label_0249: this.currentPacket = this.currentPacket.Substring((j + valLen) + 5); } if (((mapID != -1) && (teamAmount != -1)) && (Name != "")) { this.gamePlayer = new Holo.Virtual.Rooms.Games.gamePlayer(this, this.roomUser.roomUID, null); this.Room.Lobby.createGame(this.gamePlayer, Name, mapID, teamAmount, Powerups); } } catch { } } else { this.sendData("ClK"); } } else { this.sendData("ClJ"); } } } internal void ProcessPacketBe() { if ((((this.Room != null) && (this.Room.Lobby != null)) && (this.gamePlayer != null)) && (this.gamePlayer.Game.State == Game.gameState.Waiting)) { if (this._Tickets > 1) { if (this.Room.Lobby.validGamerank(this.roomUser.gamePoints)) { int j = Encoding.decodeVL64(this.currentPacket.Substring(2)); int teamID = Encoding.decodeVL64(this.currentPacket.Substring(Encoding.encodeVL64(j).Length + 2)); if ((teamID != this.gamePlayer.teamID) && this.gamePlayer.Game.teamHasSpace(teamID)) { if (this.gamePlayer.teamID == -1) { this.gamePlayer.Game.Subviewers.Remove(this.gamePlayer); } this.gamePlayer.Game.movePlayer(this.gamePlayer, this.gamePlayer.teamID, teamID); } else { this.sendData("ClH"); } } else { this.sendData("ClK"); } } else { this.sendData("ClJ"); } } } internal void ProcessPacketBg() { this.leaveGame(); } internal void ProcessPacketBh() { if ((((this.Room != null) && (this.Room.Lobby != null)) && ((this.gamePlayer != null) && (this.gamePlayer.Game != null))) && (this.gamePlayer == this.gamePlayer.Game.Owner)) { int roomUID = Encoding.decodeVL64(this.currentPacket.Substring(2)); for (int i = 0; i < this.gamePlayer.Game.Teams.Length; i++) { foreach (Holo.Virtual.Rooms.Games.gamePlayer Member in this.gamePlayer.Game.Teams[i]) { if (Member.roomUID == roomUID) { Member.sendData("ClRA"); this.gamePlayer.Game.movePlayer(Member, i, -1); return; } } } } } internal void ProcessPacketBj() { if ((((this.Room != null) && (this.Room.Lobby != null)) && (this.gamePlayer != null)) && (this.gamePlayer == this.gamePlayer.Game.Owner)) { this.gamePlayer.Game.startGame(); } } internal void ProcessPacketBk() { if (((this.gamePlayer != null) && (this.gamePlayer.Game.State == Game.gameState.Started)) && (this.gamePlayer.teamID != -1)) { this.gamePlayer.goalX = Encoding.decodeVL64(this.currentPacket.Substring(3)); this.gamePlayer.goalY = Encoding.decodeVL64(this.currentPacket.Substring(Encoding.encodeVL64(this.gamePlayer.goalX).Length + 3)); } } internal void ProcessPacketBl() { if (((this.gamePlayer != null) && (this.gamePlayer.Game.State == Game.gameState.Ended)) && (this.gamePlayer.teamID != -1)) { this.gamePlayer.Game.sendData("BK" + this._Username + " wants to replay!"); } } internal void ProcessPacketBS9() { this.refreshBadges(); } internal void ProcessPacketBUL() { if ((this.Room != null) && (this.roomUser != null)) { DatabaseClient dbClient; int badgeNameLength; using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE users_badges SET slotid = '0' WHERE userid = '" + this.userID + "'"); } int enabledBadgeAmount = 0; for (string szWorkData = this.currentPacket.Substring(2); szWorkData != ""; szWorkData = szWorkData.Substring(badgeNameLength + 2)) { int slotID = Encoding.decodeVL64(szWorkData); szWorkData = szWorkData.Substring(Encoding.encodeVL64(slotID).Length); badgeNameLength = Encoding.decodeB64(szWorkData.Substring(0, 2)); if (badgeNameLength > 0) { string Badge = szWorkData.Substring(2, badgeNameLength); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users_badges SET slotid = '", slotID, "' WHERE userid = '", this.userID, "' AND badgeid = '", Badge, "' LIMIT 1" })); } enabledBadgeAmount++; } } this.refreshBadges(); string szNotify = this.userID + Convert.ToChar(2).ToString() + Encoding.encodeVL64(enabledBadgeAmount); for (int x = 0; x < this._Badges.Count; x++) { if (this._badgeSlotIDs[x] > 0) { szNotify = (szNotify + Encoding.encodeVL64(this._badgeSlotIDs[x])) + this._Badges[x] + Convert.ToChar(2); } } this.Room.sendData("Cd" + szNotify); } } internal void ProcessPacketBUT() { if ((((this.Room != null) && (this.roomUser != null)) && (this.Room.Lobby != null)) && (this.gamePlayer == null)) { int gameID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (this.Room.Lobby.Games.ContainsKey(gameID)) { this.gamePlayer = new Holo.Virtual.Rooms.Games.gamePlayer(this, this.roomUser.roomUID, (Game) this.Room.Lobby.Games[gameID]); this.gamePlayer.Game.Subviewers.Add(this.gamePlayer); this.sendData("Ci" + this.gamePlayer.Game.Sub); } } } internal void ProcessPacketBv() { if ((this._guideRoom > 0) && this._guideSearch) { this.sendData("Fh" + Encoding.encodeVL64(this._guideRoom)); } Config.Rooms_LoadAvertisement_img = ""; if (Config.Rooms_LoadAvertisement_img == "") { this.sendData("DB0"); } else { this.sendData(string.Concat(new object[] { "DB", Config.Rooms_LoadAvertisement_img, Convert.ToChar(2), Config.Rooms_LoadAvertisement_uri })); } } internal void ProcessPacketBV() { int hideFull = Encoding.decodeVL64(this.currentPacket.Substring(2, 1)); int cataID = Encoding.decodeVL64(this.currentPacket.Substring(3)); string Name = navigatorManager.getNameAcces(this._Rank, cataID); if (Name != "") { DataTable dTable; int Type = navigatorManager.getType(cataID); int parentID = navigatorManager.getParent(cataID); StringBuilder Navigator = new StringBuilder(string.Concat(new object[] { @"C\", Encoding.encodeVL64(hideFull), Encoding.encodeVL64(cataID), Encoding.encodeVL64(Type), Name, Convert.ToChar(2), Encoding.encodeVL64(0), Encoding.encodeVL64(0x2710), Encoding.encodeVL64(parentID) })); string _SQL_ORDER_HELPER = ""; if (Type == 0) { if (hideFull == 1) { _SQL_ORDER_HELPER = "AND visitors_now < visitors_max ORDER BY id ASC"; } else { _SQL_ORDER_HELPER = "ORDER BY id ASC"; } } else if (hideFull == 1) { _SQL_ORDER_HELPER = "AND visitors_now < visitors_max ORDER BY visitors_now DESC LIMIT 30"; } else { _SQL_ORDER_HELPER = "ORDER BY visitors_now DESC LIMIT " + Config.Navigator_openCategory_maxResults; } using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dTable = dbClient.getTable(string.Concat(new object[] { "SELECT id,state,showname,visitors_now,visitors_max,name,description,owner,ccts FROM rooms WHERE category = '", cataID, "' ", _SQL_ORDER_HELPER })); } if (Type == 2) { Navigator.Append(Encoding.encodeVL64(dTable.Rows.Count)); } bool canSeeHiddenNames = false; if (Type != 0) { canSeeHiddenNames = rankManager.containsRight(this, "fuse_enter_locked_rooms", this.userID); } foreach (DataRow dRow in dTable.Rows) { if (Type == 0) { Navigator.Append(string.Concat(new object[] { Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), "I", Convert.ToString(dRow["name"]), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_now"])), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_max"])), Encoding.encodeVL64(cataID), Convert.ToString(dRow["description"]), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), "H", Convert.ToString(dRow["ccts"]), Convert.ToChar(2), "HI" })); } else { if (!((Convert.ToInt32(dRow["showname"]) != 0) || canSeeHiddenNames)) { continue; } Navigator.Append(string.Concat(new object[] { Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), Convert.ToString(dRow["name"]), Convert.ToChar(2), Convert.ToString(dRow["owner"]), Convert.ToChar(2), roomManager.getRoomState(Convert.ToInt32(dRow["state"])), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_now"])), Encoding.encodeVL64(Convert.ToInt32(dRow["visitors_max"])), Convert.ToString(dRow["description"]), Convert.ToChar(2) })); } } DataColumn dCol = navigatorManager.getAccesParent(this._Rank, cataID); if (dCol.Table.Rows.Count > 0) { StringBuilder sb = new StringBuilder(); List emptyIDs = new List(); foreach (DataRow dRow in dCol.Table.Rows) { sb.Append(" OR category = '" + Convert.ToString(dRow[0]) + "'"); emptyIDs.Add(Convert.ToInt32(dRow[0])); } dTable = navigatorManager.getGuestroomQuery("SELECT SUM(visitors_now),SUM(visitors_max),category FROM rooms WHERE" + sb.ToString().Substring(3) + " GROUP BY category", false); foreach (DataRow dRow in dTable.Rows) { if (((Convert.ToInt32(dRow[1]) <= 0) || (hideFull != 1)) || (Convert.ToInt32(dRow[0]) < Convert.ToInt32(dRow[1]))) { Navigator.Append(string.Concat(new object[] { Encoding.encodeVL64(Convert.ToInt32(dRow[2])), "H", navigatorManager.getName(Convert.ToInt32(dRow[2])), Convert.ToChar(2), Encoding.encodeVL64(Convert.ToInt32(dRow[0])), Encoding.encodeVL64(Convert.ToInt32(dRow[1])), Encoding.encodeVL64(cataID) })); emptyIDs.Remove(Convert.ToInt32(dRow[2])); } } foreach (int emptyID in emptyIDs) { Navigator.Append(string.Concat(new object[] { Encoding.encodeVL64(emptyID), "H", navigatorManager.getName(emptyID), Convert.ToChar(2), "HH", Encoding.encodeVL64(cataID) })); } } this.sendData(Navigator.ToString()); } } internal void ProcessPacketBw() { if (((this._isOwner && !this._inPublicroom) && (this.Room != null)) && (this.roomUser != null)) { int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (this.Room.floorItemManager.containsItem(itemID)) { string Sprite = this.Room.floorItemManager.getItem(itemID).Sprite; if (!(Sprite.Substring(0, 3).ToLower() != "cf_") || !(Sprite.Substring(0, 4).ToLower() != "cfc_")) { int redeemValue = 0; try { redeemValue = int.Parse(Sprite.Split(new char[] { '_' })[1]); } catch { return; } this.Room.floorItemManager.removeItem(itemID, 0); this._Credits += redeemValue; this.sendData("@F" + this._Credits); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET credits = '", this._Credits, "' WHERE id = '", this.userID, "' LIMIT 1" })); } } } } } internal void ProcessPacketBW() { DataTable dTable; StringBuilder Categories = new StringBuilder(); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dTable = dbClient.getTable("SELECT id,name FROM room_categories WHERE type = '2' AND parent > 0 AND access_rank_min <= " + this._Rank); } foreach (DataRow dRow in dTable.Rows) { Categories.Append(Encoding.encodeVL64(Convert.ToInt32(dRow["id"])) + dRow["name"] + Convert.ToChar(2)); } this.sendData("C]" + Encoding.encodeVL64(dTable.Rows.Count) + Categories.ToString()); } internal void ProcessPacketBX() { string roomCategory; int roomID = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { roomCategory = dbClient.getString(string.Concat(new object[] { "SELECT category FROM rooms WHERE id = '", roomID, "' AND owner = '", this._Username, "'" })); } if (roomCategory != "") { this.sendData("C^" + Encoding.encodeVL64(roomID) + Encoding.encodeVL64(int.Parse(roomCategory))); } } internal void ProcessPacketBY() { int roomID = Encoding.decodeVL64(this.currentPacket.Substring(2)); int cataID = Encoding.decodeVL64(this.currentPacket.Substring(Encoding.encodeVL64(roomID).Length + 2)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.findsResult(string.Concat(new object[] { "SELECT id FROM room_categories WHERE id = '", cataID, "' AND type = '2' AND parent > 0 AND access_rank_min <= ", this._Rank }))) { dbClient.runQuery(string.Concat(new object[] { "UPDATE rooms SET category = '", cataID, "' WHERE id = '", roomID, "' AND owner = '", this._Username, "' LIMIT 1" })); } } } internal void ProcessPacketBZ() { int roomID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (roomManager.containsRoom(roomID)) { this.sendData("C_" + roomManager.getRoom(roomID).Userlist); } else { this.sendData("C_"); } } internal void ProcessPacketCCA() { if ((this._isOwner && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { DatabaseClient dbClient; int songID = Encoding.decodeVL64(this.currentPacket.Substring(2)); bool result = false; using (dbClient = Eucalypt.dbManager.GetClient()) { result = dbClient.findsResult(string.Concat(new object[] { "SELECT id FROM soundmachine_songs WHERE id = '", songID, "' AND userid = '", this.userID, "' AND machineid = '", this.Room.floorItemManager.soundMachineID, "'" })); } if ((this._Credits > 0) && result) { using (dbClient = Eucalypt.dbManager.GetClient()) { DataRow dRow = dbClient.getRow("SELECT title, length FROM soundmachine_songs WHERE id = '" + songID + "'"); string Status = string.Concat(new object[] { Encoding.encodeVL64(songID), this._Username, "\n", DateTime.Today.Day, "\n", DateTime.Today.Month, "\n", DateTime.Today.Year, "\n", Convert.ToString(dRow["length"]), "\n", Convert.ToString(dRow["title"]) }); dbClient.AddParamWithValue("tid", Config.Soundmachine_burnToDisk_diskTemplateID); dbClient.AddParamWithValue("ownerid", this.userID); dbClient.AddParamWithValue("var", Status); dbClient.runQuery("INSERT INTO furniture(tid,ownerid,var) VALUES (@tid,@ownerid,@var)"); dbClient.runQuery("UPDATE soundmachine_songs SET burnt = '1' WHERE id = '" + songID + "' LIMIT 1"); dbClient.runQuery("UPDATE users SET credits = credits - 1 WHERE id = '" + this.userID + "' LIMIT 1"); } this._Credits--; this.sendData("@F" + this._Credits); this.sendData("EB" + soundMachineManager.getMachineSongList(this.Room.floorItemManager.soundMachineID)); this.refreshHand("last"); } else { this.sendData("AD"); } } } internal void ProcessPacketCd() { this.refreshGroupStatus(); } internal void ProcessPacketCD() { this.pingOK = true; this._ConnectionManager.Pinged(); } internal void ProcessPacketCD21() { if (this._guideFinish > -1) { this._guideFinish++; if (this._guideFinish == 2) { if (this._guideCount > 0) { this.sendData("EeI"); } else { this.sendData("Ee"); } this.Handler.ProcessPacket("Eg"); } } this.pingOK = true; this._ConnectionManager.Pinged(); } internal void ProcessPacketCF() { if (rankManager.containsRight(this, "fuse_receive_calls_for_help", this.userID)) { DataRow dRow; DatabaseClient dbClient; int cfhID = Encoding.decodeVL64(this.currentPacket.Substring(4, Encoding.decodeB64(this.currentPacket.Substring(2, 2)))); using (dbClient = Eucalypt.dbManager.GetClient()) { dRow = dbClient.getRow("SELECT picked_up FROM cms_help WHERE id = '" + cfhID + "'"); } if (dRow.Table.Columns.Count != 0) { using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("DELETE FROM cms_help WHERE id = '" + cfhID + "' LIMIT 1"); } userManager.sendToRank(Config.Minimum_CFH_Rank, true, string.Concat(new object[] { "BT", Encoding.encodeVL64(cfhID), Convert.ToChar(2), "HStaff Deleted!", Convert.ToChar(2), "Staff Deleted!", Convert.ToChar(2), "Staff Deleted!", Convert.ToChar(2), "H", Convert.ToChar(2), Convert.ToChar(2), "H", Convert.ToChar(2), "H" })); } } } internal void ProcessPacketCg() { if ((this.Room != null) && (this.roomUser != null)) { DataRow dRow; DatabaseClient dbClient; int groupID = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (dbClient = Eucalypt.dbManager.GetClient()) { dRow = dbClient.getRow("SELECT name,description,roomid FROM groups_details WHERE id = '" + groupID + "'"); } if (dRow.Table.Rows.Count == 1) { string gRoom; string roomName = ""; int roomID = Convert.ToInt32(dRow["roomid"]); if (roomID > 0) { using (dbClient = Eucalypt.dbManager.GetClient()) { roomName = dbClient.getString("SELECT name FROM rooms WHERE id = '" + roomID + "'"); } } else { roomID = -1; } if (roomName == "") { gRoom = "M"; } else { gRoom = Encoding.encodeVL64(Convert.ToInt32(dRow["roomid"])); } this.sendData(string.Concat(new object[] { "Dw", Encoding.encodeVL64(groupID), Convert.ToString(dRow["name"]), Convert.ToChar(2), Convert.ToString(dRow["description"]), Convert.ToChar(2), gRoom, roomName, Convert.ToChar(2) })); } } } internal void ProcessPacketCG() { if (rankManager.containsRight(this, "fuse_receive_calls_for_help", this.userID)) { string toUserName; DatabaseClient dbClient; int cfhID = Encoding.decodeVL64(this.currentPacket.Substring(4, Encoding.decodeB64(this.currentPacket.Substring(2, 2)))); string cfhReply = this.currentPacket.Substring(Encoding.decodeB64(this.currentPacket.Substring(2, 2)) + 6); using (dbClient = Eucalypt.dbManager.GetClient()) { toUserName = dbClient.getString("SELECT username FROM cms_help WHERE id = '" + cfhID + "'"); } if (toUserName == null) { this.sendData("BK" + stringManager.getString("cfh_fail") + Convert.ToChar(2)); } else { virtualUser toVirtualUser = userManager.getUser(userManager.getUserID(toUserName)); if (toVirtualUser._isLoggedIn) { toVirtualUser.sendData("DR" + cfhReply + Convert.ToChar(2)); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("DELETE FROM cms_help WHERE id = '" + cfhID + "' LIMIT 1"); } userManager.sendToRank(Config.Minimum_CFH_Rank, true, "DQ" + Encoding.encodeVL64(cfhID) + Convert.ToChar(2)); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE cms_help SET picked_up = '", this._Username, "' WHERE id = '", cfhID, "' LIMIT 1" })); } } } } } internal void ProcessPacketCh() { if (Encoding.decodeVL64(this.currentPacket.Substring(2)) >= 0) { this.Room.sendData("Dx" + this.currentPacket.Substring(2) + "IH"); this.roomUser.goalX = -1; int wayInit = 0; int x = this.roomUser.X; if (x == (this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).X + 1)) { wayInit = 1; } if (x == (this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).X - 1)) { wayInit = 2; } int y = this.roomUser.Y; if (y == (this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).Y + 1)) { wayInit = 4; } if (y == (this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).Y - 1)) { wayInit = 3; } this.Room.moveUser(this.roomUser, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).X, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).Y, true); Thread.Sleep(500); if (this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).Sprite.Contains("one_way_door*")) { switch (wayInit) { case 1: this.Room.moveUser(this.roomUser, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).X - 1, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).Y, true); break; case 2: this.Room.moveUser(this.roomUser, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).X + 1, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).Y, true); break; case 3: this.Room.moveUser(this.roomUser, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).X, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).Y + 1, true); break; case 4: this.Room.moveUser(this.roomUser, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).X, this.Room.floorItemManager.getItem(Encoding.decodeVL64(this.currentPacket.Substring(2))).Y - 1, true); break; } this.Room.sendData("Dx" + this.currentPacket.Substring(2) + "HH", 500); } } } internal void ProcessPacketCH() { int messageLength = 0; string Message = ""; int staffNoteLength = 0; string staffNote = ""; string targetUser = ""; string CS$4$0000 = this.currentPacket.Substring(2, 2); if (CS$4$0000 != null) { virtualUser _targetUser; if (!(CS$4$0000 == "HH")) { if (CS$4$0000 == "HI") { if (!rankManager.containsRight(this, "fuse_kick", this.userID)) { this.sendData("BK" + stringManager.getString("modtool_accesserror") + Convert.ToChar(2)); } else { messageLength = Encoding.decodeB64(this.currentPacket.Substring(4, 2)); Message = this.currentPacket.Substring(6, messageLength).Replace(Convert.ToChar(1).ToString(), " "); staffNoteLength = Encoding.decodeB64(this.currentPacket.Substring(messageLength + 6, 2)); staffNote = this.currentPacket.Substring(messageLength + 8, staffNoteLength); targetUser = this.currentPacket.Substring((messageLength + staffNoteLength) + 10); if ((Message != "") && !(targetUser == "")) { _targetUser = userManager.getUser(targetUser); if (_targetUser == null) { this.sendData(string.Concat(new object[] { "BK", stringManager.getString("modtool_actionfail"), "\r", stringManager.getString("modtool_usernotfound"), Convert.ToChar(2) })); } else if ((_targetUser.Room != null) && (_targetUser.roomUser != null)) { if (_targetUser._Rank < this._Rank) { _targetUser.Room.removeUser(_targetUser.roomUser.roomUID, true, Message); staffManager.addStaffMessage("kick", this.userID, _targetUser.userID, Message, staffNote); } else { this.sendData(string.Concat(new object[] { "BK", stringManager.getString("modtool_actionfail"), "\r", stringManager.getString("modtool_rankerror"), Convert.ToChar(2) })); } } } } } else if (CS$4$0000 == "HJ") { if (!rankManager.containsRight(this, "fuse_ban", this.userID)) { this.sendData("BK" + stringManager.getString("modtool_accesserror") + Convert.ToChar(2)); } else { int targetUserLength = 0; int banHours = 0; int banIP = Encoding.decodeVL64(this.currentPacket.Substring(this.currentPacket.Length - 1, 1)); messageLength = Encoding.decodeB64(this.currentPacket.Substring(4, 2)); Message = this.currentPacket.Substring(6, messageLength).Replace(Convert.ToChar(1).ToString(), " "); staffNoteLength = Encoding.decodeB64(this.currentPacket.Substring(messageLength + 6, 2)); staffNote = this.currentPacket.Substring(messageLength + 8, staffNoteLength); targetUserLength = Encoding.decodeB64(this.currentPacket.Substring((messageLength + staffNoteLength) + 8, 2)); targetUser = this.currentPacket.Substring((messageLength + staffNoteLength) + 10, targetUserLength); banHours = Encoding.decodeVL64(this.currentPacket.Substring(((messageLength + staffNoteLength) + targetUserLength) + 10)); if (((Message != "") && (targetUser != "")) && (banHours != 0)) { DataRow dRow; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("name", targetUser); dRow = dbClient.getRow("SELECT id,rank,ipaddress_last FROM users WHERE name = @name"); } if (dRow.Table.Rows.Count == 0) { this.sendData(string.Concat(new object[] { "BK", stringManager.getString("modtool_actionfail"), "\r", stringManager.getString("modtool_usernotfound"), Convert.ToChar(2) })); } else if (Convert.ToByte(dRow["rank"]) >= this._Rank) { this.sendData(string.Concat(new object[] { "BK", stringManager.getString("modtool_actionfail"), "\r", stringManager.getString("modtool_rankerror"), Convert.ToChar(2) })); } else { int targetID = Convert.ToInt32(dRow["id"]); string Report = ""; staffManager.addStaffMessage("ban", this.userID, targetID, Message, staffNote); if ((banIP == 1) && rankManager.containsRight(this, "fuse_superban", this.userID)) { userManager.setBan(Convert.ToString(dRow["ipaddress_last"]), banHours, Message, targetID); Report = userManager.generateBanReport(targetID); } else { userManager.setBan(targetID, banHours, Message); Report = userManager.generateBanReport(targetID); } this.sendData("BK" + Report + Convert.ToChar(2)); } } } } else if (CS$4$0000 == "IH") { if (!rankManager.containsRight(this, "fuse_room_alert", this.userID)) { this.sendData("BK" + stringManager.getString("modtool_accesserror") + Convert.ToChar(2)); } else if ((this.Room != null) && (this.roomUser != null)) { messageLength = Encoding.decodeB64(this.currentPacket.Substring(4, 2)); Message = this.currentPacket.Substring(6, messageLength).Replace(Convert.ToChar(1).ToString(), " "); staffNoteLength = Encoding.decodeB64(this.currentPacket.Substring(messageLength + 6, 2)); staffNote = this.currentPacket.Substring(messageLength + 8, staffNoteLength); if (Message != "") { this.Room.sendData("B!" + Message + Convert.ToChar(2)); staffManager.addStaffMessage("ralert", this.userID, this._roomID, Message, staffNote); } } } else if (CS$4$0000 == "II") { if (!rankManager.containsRight(this, "fuse_room_kick", this.userID)) { this.sendData("BK" + stringManager.getString("modtool_accesserror") + Convert.ToChar(2)); } else if ((this.Room != null) && (this.roomUser != null)) { messageLength = Encoding.decodeB64(this.currentPacket.Substring(4, 2)); Message = this.currentPacket.Substring(6, messageLength).Replace(Convert.ToChar(1).ToString(), " "); staffNoteLength = Encoding.decodeB64(this.currentPacket.Substring(messageLength + 6, 2)); staffNote = this.currentPacket.Substring(messageLength + 8, staffNoteLength); if (Message != "") { this.Room.kickUsers(this._Rank, Message); staffManager.addStaffMessage("rkick", this.userID, this._roomID, Message, staffNote); } } } } else if (!rankManager.containsRight(this, "fuse_alert", this.userID)) { this.sendData("BK" + stringManager.getString("modtool_accesserror") + Convert.ToChar(2)); } else { messageLength = Encoding.decodeB64(this.currentPacket.Substring(4, 2)); Message = this.currentPacket.Substring(6, messageLength).Replace(Convert.ToChar(1).ToString(), " "); staffNoteLength = Encoding.decodeB64(this.currentPacket.Substring(messageLength + 6, 2)); staffNote = this.currentPacket.Substring(messageLength + 8, staffNoteLength); targetUser = this.currentPacket.Substring((messageLength + staffNoteLength) + 10); if ((Message != "") && (targetUser != "")) { _targetUser = userManager.getUser(targetUser); if (_targetUser == null) { this.sendData(string.Concat(new object[] { "BK", stringManager.getString("modtool_actionfail"), "\r", stringManager.getString("modtool_usernotfound"), Convert.ToChar(2) })); } else { _targetUser.sendData("B!" + Message + Convert.ToChar(2)); staffManager.addStaffMessage("alert", this.userID, _targetUser.userID, Message, staffNote); } } } } } internal void ProcessPacketCj() { } internal void ProcessPacketCl() { if ((this.Room != null) && (this.roomUser != null)) { int subStringSkip = 2; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { int pollID = Encoding.decodeVL64(this.currentPacket.Substring(subStringSkip)); if (!dbClient.findsResult(string.Concat(new object[] { "SELECT aid FROM poll_results WHERE uid = '", this.userID, "' AND pid = '", pollID, "'" }))) { int countAnswers; subStringSkip += Encoding.encodeVL64(pollID).Length; int questionID = Encoding.decodeVL64(this.currentPacket.Substring(subStringSkip)); subStringSkip += Encoding.encodeVL64(questionID).Length; if (dbClient.findsResult("SELECT type FROM poll_questions WHERE qid = '" + questionID + "' AND type = '3'")) { countAnswers = Encoding.decodeB64(this.currentPacket.Substring(subStringSkip, 2)); subStringSkip += 2; string Answer = dbClient.getString(this.currentPacket.Substring(subStringSkip, countAnswers)); dbClient.getString(string.Concat(new object[] { "INSERT INTO poll_results (pid,qid,aid,answers,uid) VALUES ('", pollID, "','", questionID, "','0','", Answer, "','", this.userID, "')" })); } else { countAnswers = Encoding.decodeVL64(this.currentPacket.Substring(subStringSkip)); subStringSkip += Encoding.encodeVL64(countAnswers).Length; int[] Answer = new int[countAnswers]; for (int i = 0; i < countAnswers; i++) { Answer[i] = Encoding.decodeVL64(this.currentPacket.Substring(subStringSkip)); subStringSkip += Encoding.encodeVL64(Answer[i]).Length; } foreach (int a in Answer) { dbClient.getString(string.Concat(new object[] { "INSERT INTO poll_results (pid,qid,aid,answers,uid) VALUES ('", pollID, "','", questionID, "','", a, "',' ','", this.userID, "')" })); } } } } } } internal void ProcessPacketCL() { DatabaseClient dbClient; int myID = 0; using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("sso", this.currentPacket.Substring(4)); myID = dbClient.getInt("SELECT id FROM users WHERE ticket_sso = @sso LIMIT 1"); } if (myID == 0) { this.Disconnect(); } else { string banReason = userManager.getBanReason(myID); if (banReason != "") { this.sendData("@c" + banReason); this.Disconnect(0x3e8); } else { DataRow dRow; this.userID = myID; using (dbClient = Eucalypt.dbManager.GetClient()) { dRow = dbClient.getRow("SELECT name,figure,sex,mission,rank,guide FROM users WHERE id = '" + this.userID + "'"); } this._Username = Convert.ToString(dRow[0]); this._Figure = Convert.ToString(dRow[1]); this._Sex = Convert.ToChar(dRow[2]); this._Mission = Convert.ToString(dRow[3]); this._Rank = Convert.ToByte(dRow[4]); int intGuide = Convert.ToInt16(dRow[5]); this._stackRugs = true; this._noHeightLimit = false; userManager.addUser(myID, this); this._isLoggedIn = true; string today = DateTime.Today.ToString(); using (dbClient = Eucalypt.dbManager.GetClient()) { if (!dbClient.findsResult(string.Concat(new object[] { "SELECT dailyrespect FROM users WHERE id = '", this.userID, "' AND dailyrespect = '", today, "'" }))) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users SET dailyrespect = '", today, "' AND respect_left = 3 WHERE id = ", this.userID })); this.Respect = 3; } else { this.Respect = dbClient.getInt("SELECT respect_left FROM users WHERE id = " + this.userID); } } this._fuserights = FuserightManager.GenerateFuseList(this.userID); this.sendData("@B" + rankManager.fuseRights(this)); using (dbClient = Eucalypt.dbManager.GetClient()) { this._guideRequest = -1; this._guideRoom = -1; this._guideCount = -1; this._guideSearch = false; this._guideFinish = -1; this.sendData("Fi" + Encoding.encodeVL64(intGuide)); if (intGuide == 1) { this._isGuide = true; } else { this._isGuide = false; } this.sendData("FC"); this._maxFriends = Config.GetMaxFriends; } this.sendData("FdH"); this.sendData("DbIH"); this.sendData("@C"); this.sendData("GGH" + Convert.ToChar(2)); if (Config.enableWelcomeMessage) { this.sendData("BKNew server: Developed by AresCJ [C# Version, Credits to Hebbo and Holo Developers..]\rFollow me on Twitter @AresCJ" + Convert.ToChar(2)); } if (!this.RegisteredPackets) { this.Handler.RegisterLoggedInPackets(); } this.RegisteredPackets = true; this.Handler.DestroyStandardPackets(); } } } internal void ProcessPacketCm() { DataRow dRow; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dRow = dbClient.getRow("SELECT id, date, message FROM cms_help WHERE username = '" + this._Username + "' AND picked_up = '0'"); } if (dRow.Table.Rows.Count == 0) { this.sendData("D\x007fH"); } else { this.sendData(string.Concat(new object[] { "D\x007fI", Convert.ToString(dRow[0]), Convert.ToChar(2), Convert.ToString(dRow[1]), Convert.ToChar(2), Convert.ToString(dRow[2]), Convert.ToChar(2) })); } } internal void ProcessPacketCn() { int cfhID; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { cfhID = dbClient.getInt("SELECT id FROM cms_help WHERE username = '" + this._Username + "' AND picked_up = '0'"); dbClient.runQuery("DELETE FROM cms_help WHERE picked_up = '0' AND username = '" + this._Username + "' LIMIT 1"); } this.sendData("D\x007fH"); userManager.sendToRank(Config.Minimum_CFH_Rank, true, "DQ" + Encoding.encodeVL64(cfhID) + Convert.ToChar(2)); } internal void ProcessPacketCN() { this.sendData("DUH"); } internal void ProcessPacketCo() { if ((this._isOwner && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { this.songEditor = new virtualSongEditor(this.Room.floorItemManager.soundMachineID, this.userID); this.songEditor.loadSoundsets(); this.sendData("Dm" + this.songEditor.getSoundsets()); this.sendData("Dn" + soundMachineManager.getHandSoundsets(this.userID)); } } internal void ProcessPacketCp() { if ((((this.songEditor != null) && this._isOwner) && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { int nameLength = Encoding.decodeB64(this.currentPacket.Substring(2, 2)); string Title = this.currentPacket.Substring(4, nameLength); string Data = this.currentPacket.Substring(nameLength + 6); int Length = soundMachineManager.calculateSongLength(Data); if (Length != -1) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.AddParamWithValue("userid", this.userID); dbClient.AddParamWithValue("machineid", this.Room.floorItemManager.soundMachineID); dbClient.AddParamWithValue("title", stringManager.filterSwearwords(Title)); dbClient.AddParamWithValue("length", Length); dbClient.AddParamWithValue("data", Data); dbClient.runQuery("INSERT INTO soundmachine_songs (userid,machineid,title,length,data) VALUES (@userid,@machineid,@title,@length,@data)"); } this.sendData("EB" + soundMachineManager.getMachineSongList(this.Room.floorItemManager.soundMachineID)); this.sendData(string.Concat(new object[] { "EK", Encoding.encodeVL64(this.Room.floorItemManager.soundMachineID), Title, Convert.ToChar(2) })); } } } internal void ProcessPacketCPAR() { if ((this.Room != null) && (this.Room.floorItemManager.soundMachineID > 0)) { int songID = Encoding.decodeVL64(this.currentPacket.Substring(2)); this.sendData("Dl" + soundMachineManager.getSong(songID)); } } internal void ProcessPacketCPAR21() { if ((((this.songEditor != null) && this._isOwner) && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { int soundSetID = Encoding.decodeVL64(this.currentPacket.Substring(2)); int slotID = Encoding.decodeVL64(this.currentPacket.Substring(Encoding.encodeVL64(soundSetID).Length + 2)); if (((slotID > 0) && (slotID < 5)) && this.songEditor.slotFree(slotID)) { this.songEditor.addSoundset(soundSetID, slotID); this.sendData("Dn" + soundMachineManager.getHandSoundsets(this.userID)); this.sendData("Dm" + this.songEditor.getSoundsets()); } } } internal void ProcessPacketCq() { if ((this._isOwner && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { int songID = Encoding.decodeVL64(this.currentPacket.Substring(2)); this.sendData("Dl" + soundMachineManager.getSong(songID)); this.songEditor = new virtualSongEditor(this.Room.floorItemManager.soundMachineID, this.userID); this.sendData("Dm" + this.songEditor.getSoundsets()); this.sendData("Dn" + soundMachineManager.getHandSoundsets(this.userID)); } } internal void ProcessPacketCr() { if ((((this.songEditor != null) && this._isOwner) && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { int songID = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.findsResult(string.Concat(new object[] { "SELECT id FROM soundmachine_songs WHERE id = '", songID, "' AND userid = '", this.userID, "' AND machineid = '", this.Room.floorItemManager.soundMachineID, "'" }))) { int idLength = Encoding.encodeVL64(songID).Length; int nameLength = Encoding.decodeB64(this.currentPacket.Substring(idLength + 2, 2)); string Title = this.currentPacket.Substring(idLength + 4, nameLength); string Data = this.currentPacket.Substring((idLength + nameLength) + 6); int Length = soundMachineManager.calculateSongLength(Data); if (Length != -1) { dbClient.AddParamWithValue("id", songID); dbClient.AddParamWithValue("title", stringManager.filterSwearwords(Title)); dbClient.AddParamWithValue("length", Length); dbClient.AddParamWithValue("data", Data); dbClient.runQuery("UPDATE soundmachine_songs SET title = @title,data = @data,length = @length WHERE id = @id LIMIT 1"); this.sendData("ES"); this.sendData("EB" + soundMachineManager.getMachineSongList(this.Room.floorItemManager.soundMachineID)); this.Room.sendData("EC" + soundMachineManager.getMachinePlaylist(this.Room.floorItemManager.soundMachineID)); } } } } } internal void ProcessPacketCs() { if ((this._isOwner && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { int Amount = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (Amount < 6) { DatabaseClient dbClient; this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(Amount).Length + 2); using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("DELETE FROM soundmachine_playlists WHERE machineid = '" + this.Room.floorItemManager.soundMachineID + "'"); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < Amount; i++) { int songID = Encoding.decodeVL64(this.currentPacket); sb.Append(string.Concat(new object[] { " ,('", this.Room.floorItemManager.soundMachineID, "','", songID, "','", i, "')" })); this.currentPacket = this.currentPacket.Substring(Encoding.encodeVL64(songID).Length); } if (sb.Length != 0) { using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("INSERT INTO soundmachine_playlists(machineid,songid,pos) VALUES " + sb.ToString().Substring(2)); } } this.Room.sendData("EC" + soundMachineManager.getMachinePlaylist(this.Room.floorItemManager.soundMachineID)); } } } internal void ProcessPacketCSL() { if ((((this.songEditor != null) && this._isOwner) && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { int slotID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (!this.songEditor.slotFree(slotID)) { this.songEditor.removeSoundset(slotID); this.sendData("Dm" + this.songEditor.getSoundsets()); this.sendData("Dn" + soundMachineManager.getHandSoundsets(this.userID)); } } } internal void ProcessPacketCt() { if ((this._isOwner && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { this.sendData("EB" + soundMachineManager.getMachineSongList(this.Room.floorItemManager.soundMachineID)); } } internal void ProcessPacketCu() { if ((this.Room != null) && (this.Room.floorItemManager.soundMachineID > 0)) { this.sendData("EC" + soundMachineManager.getMachinePlaylist(this.Room.floorItemManager.soundMachineID)); } } internal void ProcessPacketCw() { if (((this._hasRights && (this.Room != null)) && (this.roomUser != null)) && !this._inPublicroom) { int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (this.Room.wallItemManager.containsItem(itemID)) { wallItem Item = this.Room.wallItemManager.getItem(itemID); if ((Item.Sprite == "habbowheel") || (Item.Sprite == "ads_lin_wh_c")) { int rndNum = new Random(DateTime.Now.Millisecond).Next(0, 10); catalogueManager.itemTemplate Template = catalogueManager.getTemplate(Item.templateID); this.Room.sendData(string.Concat(new object[] { "AU", itemID, Convert.ToChar(2), Encoding.encodeVL64(Template.indexID), Item.wallPosition, Convert.ToChar(2), "-1", Convert.ToChar(2) })); this.Room.sendData(string.Concat(new object[] { "AU", itemID, Convert.ToChar(2), Encoding.encodeVL64(Template.indexID), Item.wallPosition, Convert.ToChar(2), rndNum, Convert.ToChar(2) })); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE furniture SET var = '", rndNum, "' WHERE id = '", itemID, "' LIMIT 1" })); } } } } } internal void ProcessPacketCx() { if ((this._isOwner && (this.Room != null)) && (this.Room.floorItemManager.soundMachineID > 0)) { DatabaseClient dbClient; int songID = Encoding.decodeVL64(this.currentPacket.Substring(2)); bool result = false; using (dbClient = Eucalypt.dbManager.GetClient()) { result = dbClient.findsResult(string.Concat(new object[] { "SELECT id FROM soundmachine_songs WHERE id = '", songID, "' AND machineid = '", this.Room.floorItemManager.soundMachineID, "'" })); } if (result) { using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE soundmachine_songs SET machineid = '0' WHERE id = '" + songID + "' AND burnt = '1'"); dbClient.runQuery("DELETE FROM soundmachine_songs WHERE id = '" + songID + "' AND burnt = '0' LIMIT 1"); dbClient.runQuery(string.Concat(new object[] { "DELETE FROM soundmachine_playlists WHERE machineid = '", this.Room.floorItemManager.soundMachineID, "' AND songid = '", songID, "'" })); } this.Room.sendData("EC" + soundMachineManager.getMachinePlaylist(this.Room.floorItemManager.soundMachineID)); } } } internal void ProcessPacketDa() { if ((this.Room != null) && (this.roomUser != null)) { this.statusManager.addStatus("joingame", "3 1/"); } } internal void ProcessPacketDBL() { int categoryID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (eventManager.categoryOK(categoryID)) { this.sendData("Eb" + Encoding.encodeVL64(categoryID)); } } internal void ProcessPacketDBL21() { if ((!this._isMuted && (this.Room != null)) && (this.roomUser != null)) { this.Room.sendData("Ei" + Encoding.encodeVL64(this.roomUser.roomUID) + "I"); this.roomUser.isTyping = true; } } internal void ProcessPacketDc() { this.sendData("DcFG"); } internal void ProcessPacketDCA() { if ((this.Room != null) && (this.roomUser != null)) { this.Room.sendData("Ei" + Encoding.encodeVL64(this.roomUser.roomUID) + "H"); this.roomUser.isTyping = false; } } internal void ProcessPacketDE() { if ((!this._inPublicroom && (this.Room != null)) && !((this.roomUser == null) | this._isOwner)) { int Vote = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (((Vote == 1) || (Vote == -1)) && !dbClient.findsResult(string.Concat(new object[] { "SELECT userid FROM room_votes WHERE userid = '", this.userID, "' AND roomid = '", this._roomID, "'" }))) { dbClient.runQuery(string.Concat(new object[] { "INSERT INTO room_votes (userid,roomid,vote) VALUES ('", this.userID, "','", this._roomID, "','", Vote, "')" })); int voteAmount = dbClient.getInt("SELECT SUM(vote) FROM room_votes WHERE roomid = '" + this._roomID + "'"); if (voteAmount < 0) { voteAmount = 0; } this.roomUser.hasVoted = true; this.roomUser.Room.sendNewVoteAmount(voteAmount); } } } } internal void ProcessPacketDF() { if (this.Messenger != null) { int ID = Encoding.decodeVL64(this.currentPacket.Substring(2)); int errorID = -1; if (this.Messenger.hasFriendship(ID)) { if (userManager.containsUser(ID)) { virtualUser _User = userManager.getUser(ID); if (_User._roomID > 0) { if (_User._inPublicroom) { this.sendData("D^I" + Encoding.encodeVL64(_User._roomID)); } else { this.sendData("D^H" + Encoding.encodeVL64(_User._roomID)); } } else { errorID = 2; } } else { errorID = 1; } } else { errorID = 0; } if (errorID != -1) { this.sendData("E]" + Encoding.encodeVL64(errorID)); } } } internal void ProcessPacketDG() { DataColumn dCol; int ownerID = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dCol = dbClient.getColumn("SELECT tag FROM cms_tags WHERE ownerid = '" + ownerID + "' LIMIT 20"); } StringBuilder List = new StringBuilder(Encoding.encodeVL64(ownerID) + Encoding.encodeVL64(dCol.Table.Rows.Count)); foreach (DataRow dRow in dCol.Table.Rows) { List.Append(Convert.ToString(dRow["tag"]) + Convert.ToChar(2)); } this.sendData("E^" + List.ToString()); } internal void ProcessPacketDH() { this.sendData("E_" + Encoding.encodeVL64(3) + navigatorManager.getRandomRooms()); } internal void ProcessPacketDl() { this.sendData("FIRA"); } internal void ProcessPacketDm() { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.getInt("SELECT guide_allowed FROM users WHERE id = " + this.userID) == 1) { this.sendData("E`PBIJKPAQARASAPB"); this.sendData("GJRGK"); } } } internal void ProcessPacketDn() { this.sendData("FYQA1\x0002Bouncing Ball level 1\x0002III2\x0002Bouncing Ball level 2\x0002IJI3\x0002Bouncing Ball level 3\x0002IKI4\x0002Bouncing Ball level 4\x0002IPAI5\x0002Bouncing Ball level 5\x0002IQAH\x0001FYQA1\x0002Bouncing Ball level 1\x0002III2\x0002Bouncing Ball level 2\x0002IJI3\x0002Bouncing Ball level 3\x0002IKI4\x0002Bouncing Ball level 4\x0002IPAI5\x0002Bouncing Ball level 5\x0002IQAH"); } internal void ProcessPacketDr() { this.sendData("BrDa"); } internal void ProcessPacketDThingy() { string Target = this.currentPacket.Substring(4); DatabaseClient dbClient = Eucalypt.dbManager.GetClient(); try { virtualUser _Target = userManager.getUser(Target); if (_Target._Rank <= 3) { object CS$0$0001 = this._mutedIDs; this._mutedIDs = string.Concat(new object[] { CS$0$0001, "<", _Target.userID, ">" }); this.sendData("FcI"); } } catch { } finally { if (dbClient != null) { dbClient.Dispose(); } } } internal void ProcessPacketDu() { this.sendData("FLPBH"); } internal void ProcessPacketDv() { this.sendData("DvBKDv"); } internal void ProcessPacketDw() { this.sendData("DwFL"); } internal void ProcessPacketDx() { this.sendData("DxQA"); } internal void ProcessPacketDy() { if (this.currentPacket.Substring(2) == "PB") { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.getInt("SELECT guide_allowed FROM users WHERE id = " + this.userID) == 1) { dbClient.runQuery("UPDATE users SET guide_allowed = '0' WHERE id = '" + this.userID + "' LIMIT 1"); this.sendData("EdI"); } } } } internal void ProcessPacketDz() { if (((this.Room != null) && (this.roomUser != null)) && !this._inPublicroom) { int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (this.Room.floorItemManager.containsItem(itemID) && (this.Room.floorItemManager.getItem(itemID).Sprite == "val_randomizer")) { int rndNum = new Random(DateTime.Now.Millisecond).Next(1, 5); this.Room.sendData(string.Concat(new object[] { "AX", itemID, Convert.ToChar(2), "123456789", Convert.ToChar(2) })); this.Room.sendData(string.Concat(new object[] { "AX", itemID, Convert.ToChar(2), rndNum, Convert.ToChar(2) }), 0x1388); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE furniture SET var = '", rndNum, "' WHERE id = '", itemID, "' LIMIT 1" })); } } } } internal void ProcessPacketEA() { this.sendData("Ep" + Encoding.encodeVL64(eventManager.categoryAmount)); } internal void ProcessPacketEAT() { if (((this._hasRights && !this._inPublicroom) && (this.Room != null)) && (this.roomUser != null)) { virtualUser _Target = userManager.getUser(Encoding.decodeVL64(this.currentPacket.Substring(2))); if (((_Target._roomID == this._roomID) && (!_Target._isOwner || (((_Target._Rank - 1) <= this._Rank) && !rankManager.containsRight(_Target, "fuse_any_room_controller", this.userID)))) && (!_Target._isOwner || (((_Target._Rank - 1) <= this._Rank) && !rankManager.containsRight(_Target, "fuse_kick_immunity", this.userID)))) { string banExpireMoment = DateTime.Now.AddMinutes((double) Config.Rooms_roomBan_banDuration).ToString(); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "INSERT INTO room_bans (roomid,userid,ban_expire) VALUES ('", this._roomID, "','", _Target.userID, "','", banExpireMoment, "')" })); } _Target.roomUser.walkLock = true; _Target.roomUser.walkDoor = true; _Target.roomUser.goalX = this.Room.doorX; _Target.roomUser.goalY = this.Room.doorY; } } } internal void ProcessPacketEB() { string Target = this.currentPacket.Substring(4); DatabaseClient dbClient = Eucalypt.dbManager.GetClient(); try { virtualUser _Target = userManager.getUser(Target); if (_Target._Rank <= 3) { this._mutedIDs = this._mutedIDs.Replace("<" + _Target.userID + ">", ""); this.sendData("FcK"); } } catch { } finally { if (dbClient != null) { dbClient.Dispose(); } } } internal void ProcessPacketEC() { if (rankManager.containsRight(this, "fuse_receive_calls_for_help", this.userID)) { int roomID; int idLength = Encoding.decodeB64(this.currentPacket.Substring(2, 2)); int cfhID = Encoding.decodeVL64(this.currentPacket.Substring(4, idLength)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { roomID = dbClient.getInt("SELECT roomid FROM cms_help WHERE id = '" + cfhID + "'"); } if (roomID != 0) { if (roomManager.getRoom(roomID).isPublicroom) { this.sendData("D^I" + Encoding.encodeVL64(roomID)); } else { this.sendData("D^H" + Encoding.encodeVL64(roomID)); } } } } internal void ProcessPacketEd() { if (!this._inPublicroom) { this._guideCount = 0; this._guideRoom = this.Room.roomID; this._guideSearch = true; this._guideFinish = 0; userManager.sendToGuides(this.userID, this.Room.roomID, string.Concat(new object[] { "Ec", this.userID, Convert.ToChar(2), this._Username, Convert.ToChar(2) })); this.sendData("Fe"); } } internal void ProcessPacketEe() { this._guideCount = 0; virtualUser toVirtualUser = userManager.getUser(this._guideRequest); if (toVirtualUser._isLoggedIn && (this._guideRoom > 0)) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery("UPDATE users SET guide_points = guide_points + 1 WHERE id = " + this.userID); } toVirtualUser.sendData("Fg" + Encoding.encodeVL64(this.userID)); this.sendData("D^H" + Encoding.encodeVL64(this._guideRoom) + Convert.ToChar(2)); } } internal void ProcessPacketEg() { if (!this._inPublicroom) { this._guideFinish = -1; this._guideCount = 0; this._guideRoom = 0; this._guideSearch = false; userManager.sendToGuides(this.userID, 0, "Eh" + this.userID + Convert.ToChar(2)); } } internal void ProcessPacketEj() { this._guideRequest = 0; } internal void ProcessPacketEk() { this._guideRequest = -1; } internal void ProcessPacketEPAR() { if (((this._hostsEvent && this._isOwner) && !this._inPublicroom) && (this.roomUser != null)) { this._hostsEvent = false; eventManager.removeEvent(this._roomID); this.Room.sendData("Er-1"); } } internal void ProcessPacketEr() { this.refreshEffect(); } internal void ProcessPacketEs() { if (this.Respect != 0) { this.Respect--; int receiverUserID = Encoding.decodeVL64(this.currentPacket.Substring(2)); virtualUser _User = userManager.getUser(receiverUserID); if (_User.roomUser.roomID == this.roomUser.roomID) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.getInt(string.Concat(new object[] { "SELECT userid FROM users_respected WHERE userid = ", this.userID, " AND respectedid = ", _User.userID, " LIMIT 1" })) != this.userID) { dbClient.runQuery(string.Concat(new object[] { "INSERT INTO users_respected (userid,respectedid) VALUES ('", this.userID, "','", _User.userID, "')" })); dbClient.runQuery("UPDATE users SET respect_received = respect_received + 1 WHERE id = " + receiverUserID + " LIMIT 1"); dbClient.runQuery("UPDATE users SET respect_given = respect_given + 1 WHERE id = " + this.userID + " LIMIT 1"); } } this.Room.sendData("Fx" + Encoding.encodeVL64(receiverUserID) + "QRB"); } } } internal void ProcessPacketESL() { if (((this._hostsEvent && this._isOwner) && !this._inPublicroom) && (this.roomUser != null)) { int categoryID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (eventManager.categoryOK(categoryID)) { int categoryLength = Encoding.encodeVL64(categoryID).Length; int nameLength = Encoding.decodeB64(this.currentPacket.Substring(categoryLength + 2, 2)); string Name = this.currentPacket.Substring(categoryLength + 4, nameLength); string Description = this.currentPacket.Substring((categoryLength + nameLength) + 6); eventManager.editEvent(categoryID, this._roomID, Name, Description); this.Room.sendData("Er" + eventManager.getEvent(this._roomID)); } } } internal void ProcessPacketEt() { int effectID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if ((this.Room != null) && (this.roomUser != null)) { this.statusID = "Ge"; this.statusCount = effectID; this.Room.sendData(this.statusID + Encoding.encodeVL64(this.roomUser.roomUID) + Encoding.encodeVL64(this.statusCount)); } } internal void ProcessPacketEu() { int effectID = Encoding.decodeVL64(this.currentPacket.Substring(2)); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if ((dbClient.getInt(string.Concat(new object[] { "SELECT effect_timemax FROM users_effects WHERE userid = '", this.userID, "' AND effect_id = '", effectID, "' AND effect_activated = '0' LIMIT 1" })) >= 1) && (dbClient.getInt(string.Concat(new object[] { "SELECT effect_timemax FROM users_effects WHERE userid = '", this.userID, "' AND effect_id = '", effectID, "' AND effect_activated = '1' LIMIT 1" })) <= 0)) { dbClient.runQuery(string.Concat(new object[] { "UPDATE users_effects SET effect_activated = '1' WHERE userid = '", this.userID, "' AND effect_id = ", effectID, " LIMIT 1" })); this.sendData("GN" + Encoding.encodeVL64(effectID) + Encoding.encodeVL64(dbClient.getInt(string.Concat(new object[] { "SELECT effect_timemax FROM users_effects WHERE userid = '", this.userID, "' AND effect_id = '", effectID, "' AND effect_activated = '1' LIMIT 1" })))); } } } internal void ProcessPacketEU() { if (this._isOwner || this._hasRights) { string settingData = roomManager.moodlight.getSettings(this._roomID); if (settingData != null) { this.sendData("Em" + settingData); } } } internal void ProcessPacketEUT() { int categoryID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if ((categoryID >= 1) && (categoryID <= 11)) { this.sendData("Eq" + Encoding.encodeVL64(categoryID) + eventManager.getEvents(categoryID)); } } internal void ProcessPacketEv() { this._activateBuy = true; this.Handler.ProcessPacket("Ad" + this.currentPacket.Substring(2) + "@@H"); } internal void ProcessPacketEV() { if (this._isOwner || this._hasRights) { int presetID = Encoding.decodeVL64(this.currentPacket.Substring(2, 1)); int bgState = Encoding.decodeVL64(this.currentPacket.Substring(3, 1)); string presetColour = this.currentPacket.Substring(6, Encoding.decodeB64(this.currentPacket.Substring(4, 2))); int presetDarkF = Encoding.decodeVL64(this.currentPacket.Substring(presetColour.Length + 6)); if (presetDarkF > 0xff) { presetDarkF = 0xff; } if (presetDarkF < 0x9b) { presetDarkF = 0x55; } if (!((presetID < 1) | (presetID > 3)) && (!((bgState > 2) | (bgState < 1)) && ((((!(presetColour != "#000000") || !(presetColour != "#82F349")) || (!(presetColour != "#F2F851") || !(presetColour != "#EA4532"))) || (!(presetColour != "#E759DE") || !(presetColour != "#0053F7"))) || !(presetColour != "#74F5F5")))) { roomManager.moodlight.setSettings(this._roomID, true, presetID, bgState, presetColour, presetDarkF); } } } internal void ProcessPacketEW() { if (this._isOwner || this._hasRights) { roomManager.moodlight.setSettings(this._roomID, false, 0, 0, null, 0); } } internal void ProcessPacketEY() { if ((this._inPublicroom || (this.roomUser == null)) || this._hostsEvent) { this.sendData("EoH"); } else { this.sendData("EoI"); } } internal void ProcessPacketEZ() { if (((this._isOwner && !this._hostsEvent) && !this._inPublicroom) && (this.roomUser != null)) { int categoryID = Encoding.decodeVL64(this.currentPacket.Substring(2)); if (eventManager.categoryOK(categoryID)) { int categoryLength = Encoding.encodeVL64(categoryID).Length; int nameLength = Encoding.decodeB64(this.currentPacket.Substring(categoryLength + 2, 2)); string Name = this.currentPacket.Substring(categoryLength + 4, nameLength); string Description = this.currentPacket.Substring((categoryLength + nameLength) + 6); this._hostsEvent = true; eventManager.createEvent(categoryID, this.userID, this._roomID, Name, Description); this.Room.sendData("Er" + eventManager.getEvent(this._roomID)); } } } internal void ProcessPacketF464() { this.sendData("G{IH"); } internal void ProcessPacketF873() { this.sendData("Gz" + recyclerManager.rewardString); } internal void ProcessPacketF893() { int count = Encoding.decodeVL64(this.currentPacket.Substring(2)); int id_1 = Encoding.decodeVL64(this.currentPacket.Substring(2 + Encoding.encodeVL64(count).Length)); int id_2 = Encoding.decodeVL64(this.currentPacket.Substring((2 + Encoding.encodeVL64(id_1).Length) + Encoding.encodeVL64(count).Length)); int id_3 = Encoding.decodeVL64(this.currentPacket.Substring(((2 + Encoding.encodeVL64(id_1).Length) + Encoding.encodeVL64(id_2).Length) + Encoding.encodeVL64(count).Length)); int id_4 = Encoding.decodeVL64(this.currentPacket.Substring((((2 + Encoding.encodeVL64(id_1).Length) + Encoding.encodeVL64(id_2).Length) + Encoding.encodeVL64(id_3).Length) + Encoding.encodeVL64(count).Length)); int id_5 = Encoding.decodeVL64(this.currentPacket.Substring(((((2 + Encoding.encodeVL64(id_1).Length) + Encoding.encodeVL64(id_2).Length) + Encoding.encodeVL64(id_3).Length) + Encoding.encodeVL64(id_4).Length) + Encoding.encodeVL64(count).Length)); if ((((count == 5) && (id_1 != id_2)) && ((id_2 != id_3) && (id_3 != id_4))) && (id_4 != id_5)) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { if (dbClient.getInt("SELECT ownerid FROM furniture WHERE id = '" + id_1 + "'") == this.userID) { dbClient.runQuery("UPDATE furniture SET ownerid = '-1' WHERE id = '" + id_1 + "' LIMIT 1"); } else { return; } if (dbClient.getInt("SELECT ownerid FROM furniture WHERE id = '" + id_2 + "'") == this.userID) { dbClient.runQuery("UPDATE furniture SET ownerid = '-1' WHERE id = '" + id_2 + "' LIMIT 1"); } else { return; } if (dbClient.getInt("SELECT ownerid FROM furniture WHERE id = '" + id_3 + "'") == this.userID) { dbClient.runQuery("UPDATE furniture SET ownerid = '-1' WHERE id = '" + id_3 + "' LIMIT 1"); } else { return; } if (dbClient.getInt("SELECT ownerid FROM furniture WHERE id = '" + id_4 + "'") == this.userID) { dbClient.runQuery("UPDATE furniture SET ownerid = '-1' WHERE id = '" + id_4 + "' LIMIT 1"); } else { return; } if (dbClient.getInt("SELECT ownerid FROM furniture WHERE id = '" + id_5 + "'") == this.userID) { dbClient.runQuery("UPDATE furniture SET ownerid = '-1' WHERE id = '" + id_5 + "' LIMIT 1"); } else { return; } this.sendData("AC"); dbClient.runQuery(string.Concat(new object[] { "INSERT INTO furniture(tid,ownerid,var) VALUES (1627,", this.userID, ",'", DateTime.Now.ToString("yyyy-MM-dd"), "')" })); int recyclingBoxID = 0; int receivementID = 0; recyclingBoxID = dbClient.getInt("SELECT MAX(id) FROM furniture"); int chance = 0; int randomID = new Random().Next(1, 0x2710); if ((randomID > 0x251c) && (chance == 0)) { chance = 200; } if ((randomID > 0x23be) && (chance == 0)) { chance = 0x7d0; } if ((randomID > 0x1d4c) && (chance == 0)) { chance = 40; } if ((randomID > 0x157c) && (chance == 0)) { chance = 5; } int reward = dbClient.getInt("SELECT rclr_reward FROM system_recycler WHERE chance = '" + chance + "' ORDER BY RAND() LIMIT 1"); dbClient.runQuery(string.Concat(new object[] { "INSERT INTO furniture(tid,roomid,ownerid) VALUES (", reward, ",'-1','", this.userID, "')" })); receivementID = dbClient.getInt("SELECT MAX(id) FROM furniture"); dbClient.runQuery(string.Concat(new object[] { "INSERT INTO furniture_presents(id,itemid) VALUES ('", recyclingBoxID, "','", receivementID, "')" })); this.refreshHand("last"); this.sendData("G{HH"); } } } internal void ProcessPacketFH() { try { int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); string toStatus = this.currentPacket.Substring(Encoding.encodeVL64(itemID).Length + 2); floorItem Item = this.Room.floorItemManager.getItem(itemID); catalogueManager.itemTemplate Template = catalogueManager.getTemplate(Item.templateID); if (((Math.Abs((int) (this.roomUser.X - Item.X)) <= 1) && (Math.Abs((int) (this.roomUser.Y - Item.Y)) <= 1)) || (Template.nexttoRequired != 1)) { if (Template.maxStatus == -1) { int roomIDTeleporter2; int idTeleporter2; if (Item.Z == 2) { if ((this.roomUser.X != (Item.X + 1)) || (Item.Y != this.roomUser.Y)) { return; } } else if (Item.Z == 0) { if ((this.roomUser.Y != (Item.Y - 1)) || (Item.X != this.roomUser.X)) { return; } } else if ((Item.Z == 4) && ((this.roomUser.Y != (Item.Y + 1)) || (Item.X != this.roomUser.X))) { return; } this.roomUser.goalX = -1; this.Room.sendData(string.Concat(new object[] { "AX", itemID, Convert.ToChar(2), 1, Convert.ToChar(2) })); this.Room.moveUser(this.roomUser, Item.X, Item.Y, true); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { idTeleporter2 = dbClient.getInt("SELECT teleportid FROM furniture WHERE id = '" + itemID + "'"); roomIDTeleporter2 = dbClient.getInt("SELECT roomid FROM furniture WHERE id = '" + idTeleporter2 + "'"); } if (roomIDTeleporter2 > 0) { new TeleporterUsageSleep(this.useTeleporter).BeginInvoke(Item, idTeleporter2, roomIDTeleporter2, null, null); } else { this.Room.sendData(string.Concat(new object[] { "AX", itemID, Convert.ToChar(2), 0, Convert.ToChar(2) }), 750); } } else if ((Template.rightsRequired != 1) || this._hasRights) { if (Template.drinkIDs != "") { this.Room.sendData("G`" + Encoding.encodeVL64(this.roomUser.roomUID) + Encoding.encodeVL64(0)); if (Template.drinkIDs.Contains("\n")) { string handItem = Template.drinkIDs.Split(new char[] { '\r' })[0]; handItem = handItem.Replace("\n", ""); int rndNum = new Random().Next(1, int.Parse(handItem)); handItem = Template.drinkIDs.Split(new char[] { '\r' })[rndNum]; handItem = handItem.Replace("\n", ""); this.statusManager.carryItem(int.Parse(handItem)); } else { this.statusManager.carryItem(int.Parse(Template.drinkIDs)); } } if ((Encoding.decodeVL64(toStatus) > 0) | (Encoding.decodeVL64(toStatus) < 10)) { this.Room.floorItemManager.toggleItemStatus(itemID, toStatus, this._hasRights); } } } } catch { } } internal void ProcessPacketFI() { try { if ((!this._inPublicroom && (this.Room != null)) && (this.roomUser != null)) { int itemID = Encoding.decodeVL64(this.currentPacket.Substring(2)); catalogueManager.itemTemplate Template = catalogueManager.getTemplate(this.Room.wallItemManager.getItem(itemID).templateID); int toStatus = 0; if ((Template.rightsRequired != 1) || this._hasRights) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { toStatus = dbClient.getInt("SELECT var FROM furniture WHERE id = " + itemID + " LIMIT 1"); if (toStatus == 1) { toStatus = 0; } else { toStatus = 1; } } this.Room.wallItemManager.toggleItemStatus(itemID, toStatus); } } } catch { } } internal void ProcessPacketFR() { if ((((this.Room != null) && (this.roomUser != null)) && (this._tradePartnerRoomUID != -1)) && this.Room.containsUser(this._tradePartnerRoomUID)) { virtualUser Partner = this.Room.getUser(this._tradePartnerRoomUID); this._tradeConfirm = true; this.sendData("Am" + Encoding.encodeVL64(this.userID) + "I"); Partner.sendData("Am" + Encoding.encodeVL64(this.userID) + "I"); if (Partner._tradeConfirm) { int i; DatabaseClient dbClient; Random tradeid = new Random(); string tradeidis = this._Username + "-" + Convert.ToString(tradeid.Next(0xf4240, 0x98967f)) + "-" + Partner._Username; StringBuilder sb = new StringBuilder("'a'='b'"); for (i = 0; i < this._tradeItemCount; i++) { if (this._tradeItems[i] > 0) { sb.Append(" OR id = '" + this._tradeItems[i] + "'"); } } using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE furniture SET ownerid = '", Partner.userID, "',roomid = '0' WHERE", sb.ToString() })); } sb.Remove(7, sb.Length - 7); for (i = 0; i < Partner._tradeItemCount; i++) { if (Partner._tradeItems[i] > 0) { sb.Append(" OR id = '" + Partner._tradeItems[i] + "'"); } } using (dbClient = Eucalypt.dbManager.GetClient()) { dbClient.runQuery(string.Concat(new object[] { "UPDATE furniture SET ownerid = '", this.userID, "',roomid = '0' WHERE", sb.ToString() })); } this.abortTrade(); } } } internal void ProcessPacketFS() { this.ProcessPacketAF(); } internal void ProcessPacketLB() { if ((this.Room != null) && (this.roomUser != null)) { string Mode = this.currentPacket.Substring(2); this.refreshHand(Mode); } } internal void ProcessPacketRR() { this.sendData("YDAAXhttp://hotel-nl.holo-hotel.co.uk/dcr/r36_20090630_0501_18816_a9e9d9ea454515efb391924f2c1fa9b9/Anhttp://hotel-nl.holo-hotel.co.uk/gamedata/external?id=external_variables&hash=e171b6e6e96cab5963cdf7e6584062fd4042d61c"); } private void refresh_cat() { catalogueManager.Init(true); } private void refresh_config() { Config.Init(true); } private void refresh_eco() { recyclerManager.Init(true); } private void refresh_filter() { stringManager.initFilter(true); } private void refresh_fuse() { rankManager.Init(true); } private void refresh_modeldata() { modeldataManager.Init(true); } private void refresh_strings() { stringManager.Init("en", true); } internal void refreshAppearance(bool Reload, bool refreshSettings, bool refreshRoom) { if (Reload) { DataRow dRow; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dRow = dbClient.getRow("SELECT figure,sex,mission FROM users WHERE id = '" + this.userID + "'"); } this._Figure = Convert.ToString(dRow["figure"]); this._Sex = Convert.ToChar(dRow["sex"]); this._Mission = Convert.ToString(dRow["mission"]); } if (refreshSettings) { this.sendData(string.Concat(new object[] { "@E", this._ConnectionManager.ConnectionID, Convert.ToChar(2), this._Username, Convert.ToChar(2), this._Figure, Convert.ToChar(2), this._Sex, Convert.ToChar(2), this._Mission, Convert.ToChar(2), Convert.ToChar(2), "PCch=s02/53,51,44", Convert.ToChar(2), "HI" })); } if ((refreshRoom && (this.Room != null)) && (this.roomUser != null)) { this.Room.sendData(string.Concat(new object[] { "DJ", Encoding.encodeVL64(this.roomUser.roomUID), this._Figure, Convert.ToChar(2), this._Sex, Convert.ToChar(2), this._Mission, Convert.ToChar(2) })); } } internal void refreshBadges() { DataColumn col1; DataColumn col2; DataColumn col3; int i; this._Badges.Clear(); this._badgeSlotIDs.Clear(); using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { col1 = dbClient.getColumn("SELECT badgeid FROM users_badges WHERE userid = '" + this.userID + "' ORDER BY slotid ASC"); col2 = dbClient.getColumn("SELECT slotid FROM users_badges WHERE userid = '" + this.userID + "' ORDER BY slotid ASC"); col3 = dbClient.getColumn("SELECT badgecode FROM system_archievements ORDER BY indexid ASC"); } string[] myBadges = dataHandling.dColToArray(col1); string[] myBadgeSlotIDs = dataHandling.dColToArray(col2); string[] sysArchievements = dataHandling.dColToArray(col3); StringBuilder sbMessage = new StringBuilder(); StringBuilder listArchievements = new StringBuilder(); int badgeCount = 0; for (i = 0; i < myBadges.Length; i++) { if (myBadges[i].Length > 2) { if (Convert.ToInt32(myBadgeSlotIDs[i]) > 0) { this._badgeSlotIDs.Add(Convert.ToInt32(myBadgeSlotIDs[i])); } else { this._badgeSlotIDs.Add(0); } badgeCount++; this._Badges.Add(myBadges[i]); sbMessage.Append(myBadges[i] + Convert.ToChar(2)); } } this.sendData("Ce" + Encoding.encodeVL64(badgeCount) + sbMessage.ToString() + "H"); for (i = 0; i < sysArchievements.Length; i++) { listArchievements.Append(string.Concat(new object[] { Encoding.encodeVL64(i), "I", sysArchievements[i], 1 })); } this.sendData(string.Concat(new object[] { "FtSHJIACH_Graduate1", Convert.ToChar(2), "PAIACH_Login1", Convert.ToChar(2), "PAJACH_Login2", Convert.ToChar(2), "PAKACH_Login3", Convert.ToChar(2), "PAPAACH_Login4", Convert.ToChar(2), "PAQAACH_Login5", Convert.ToChar(2), "PBIACH_RoomEntry1", Convert.ToChar(2), "PBJACH_RoomEntry2", Convert.ToChar(2), "PBKACH_RoomEntry3", Convert.ToChar(2), "SBRAACH_RegistrationDuration6", Convert.ToChar(2), "SBSAACH_RegistrationDuration7", Convert.ToChar(2), "SBPBACH_RegistrationDuration8", Convert.ToChar(2), "SBQBACH_RegistrationDuration9", Convert.ToChar(2), "SBRBACH_RegistrationDuration10", Convert.ToChar(2), "RAIACH_AvatarLooks1", Convert.ToChar(2), "IJGLB", Convert.ToChar(2), "IKGLC", Convert.ToChar(2), "IPAGLD", Convert.ToChar(2), "IQAGLE", Convert.ToChar(2), "IRAGLF", Convert.ToChar(2), "ISAGLG", Convert.ToChar(2), "IPBGLH", Convert.ToChar(2), "IQBGLI", Convert.ToChar(2), "IRBGLJ", Convert.ToChar(2), "SAIACH_Student1", Convert.ToChar(2), "PCIHC1", Convert.ToChar(2), "PCJHC2", Convert.ToChar(2), "PCKHC3", Convert.ToChar(2), "PCPAHC4", Convert.ToChar(2), "PCQAHC5", Convert.ToChar(2), "QAIACH_GamePlayed1", Convert.ToChar(2), "QAJACH_GamePlayed2", Convert.ToChar(2), "QAKACH_GamePlayed3", Convert.ToChar(2), "QAPAACH_GamePlayed4", Convert.ToChar(2), "QAQAACH_GamePlayed5", Convert.ToChar(2) })); this.sendData("DtIH" + Convert.ToChar(1) + "FCH"); } internal void refreshClub() { DataRow dRow; int restingDays = 0; int passedMonths = 0; int restingMonths = 0; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dRow = dbClient.getRow("SELECT months_expired,months_left,date_monthstarted FROM users_club WHERE userid = '" + this.userID + "' LIMIT 1"); } if (dRow.Table.Columns.Count > 0) { passedMonths = Convert.ToInt32(dRow["months_expired"]); restingMonths = Convert.ToInt32(dRow["months_left"]) - 1; restingDays = ((int) DateTime.Parse(Convert.ToString(dRow["date_monthstarted"]), new CultureInfo("en-GB")).Subtract(DateTime.Now).TotalDays) + 0x1f; this._clubMember = true; } this.sendData(string.Concat(new object[] { "@Gclub_habbo", Convert.ToChar(2), Encoding.encodeVL64(restingDays), Encoding.encodeVL64(passedMonths), Encoding.encodeVL64(restingMonths), "I" })); } internal void refreshEffect() { DataColumn dCol; DatabaseClient dbClient; int EffectsCount = 0; using (dbClient = Eucalypt.dbManager.GetClient()) { dCol = dbClient.getColumn("SELECT effect_id FROM users_effects WHERE userid = '" + this.userID + "'"); } string[] Effects = dataHandling.dColToArray(dCol); StringBuilder Effectlist = new StringBuilder(); if (Effects.Length > 0) { using (dbClient = Eucalypt.dbManager.GetClient()) { for (int i = dbClient.getInt("SELECT COUNT(*) FROM users_effects WHERE userid = '" + this.userID + "'"); i < 0x1b; i++) { if (dbClient.getInt(string.Concat(new object[] { "SELECT effect_id FROM users_effects WHERE userid = '", this.userID, "' AND effect_id = ", i, " LIMIT 1" })) != 0) { int effectStatus = dbClient.getInt(string.Concat(new object[] { "SELECT effect_id FROM users_effects WHERE userid = '", this.userID, "' AND effect_id = ", i, " AND effect_activated = 1 LIMIT 1" })); int effectTime = dbClient.getInt(string.Concat(new object[] { "SELECT effect_timemax FROM users_effects WHERE userid = '", this.userID, "' AND effect_id = ", i, " ORDER BY effect_timemax DESC LIMIT 1" })); int effectLeft = dbClient.getInt(string.Concat(new object[] { "SELECT effect_timeleft FROM users_effects WHERE userid = '", this.userID, "' AND effect_id = ", i, " ORDER BY effect_timeleft DESC LIMIT 1" })); DataRow effectCount = dbClient.getRow(string.Concat(new object[] { "SELECT effect_id FROM users_effects WHERE userid = '", this.userID, "' AND effect_id = ", i })); EffectsCount++; if (effectStatus == i) { Effectlist.Append(Encoding.encodeVL64(i) + Encoding.encodeVL64(effectTime) + Encoding.encodeVL64(effectCount.Table.Rows.Count) + "M"); } else { Effectlist.Append(Encoding.encodeVL64(i) + Encoding.encodeVL64(effectTime) + Encoding.encodeVL64(effectCount.Table.Rows.Count - 1) + Encoding.encodeVL64(effectLeft)); } } } } } this.sendData("GL" + Encoding.encodeVL64(EffectsCount) + Effectlist); } internal void refreshGroupStatus() { DatabaseClient dbClient; using (dbClient = Eucalypt.dbManager.GetClient()) { this._groupID = dbClient.getInt("SELECT groupid FROM groups_memberships WHERE userid = '" + this.userID + "' AND is_current = '1'"); } if (this._groupID > 0) { using (dbClient = Eucalypt.dbManager.GetClient()) { this._groupMemberRank = dbClient.getInt(string.Concat(new object[] { "SELECT member_rank FROM groups_memberships WHERE userid = '", this.userID, "' AND groupID = '", this._groupID, "'" })); } } } internal void refreshHand(string Mode) { if ((this.Room != null) && (this.roomUser != null)) { DataTable dTable; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { dTable = dbClient.getTable("SELECT furniture.id,furniture.tid,furniture.var FROM users, furniture WHERE furniture.ownerid = users.id AND furniture.ownerid = '" + this.userID + "' AND furniture.roomid = '0' ORDER BY pickedup ASC"); } StringBuilder Hand = new StringBuilder(""); int startID = 0; int stopID = dTable.Rows.Count; int useVar = 0; switch (Mode) { case "H": case "last": this._handPage = (stopID - 1) / 9; break; case "I": case "next": this._handPage++; break; case "J": case "prev": this._handPage--; break; case "PA": case "update": break; default: this._handPage = 0; break; } try { if (stopID <= 0) { goto Label_0476; } Label_018B: startID = this._handPage * 9; if (stopID > (startID + 9)) { stopID = startID + 9; } if ((startID > stopID) || (startID == stopID)) { this._handPage--; goto Label_018B; } for (int f = startID; f < stopID; f++) { DataRow dRow = dTable.Rows[f]; catalogueManager.itemTemplate Template = catalogueManager.getTemplate(Convert.ToInt32(dRow["tid"])); int Recycleable = 1; if (!Template.isRecycleable) { Recycleable = 0; } if (Template.typeID == 0) { if (Template.Sprite == "poster") { useVar = int.Parse(Template.Colour); } else { useVar = 0; } if ((Template.Sprite == "post.it") || (Template.Sprite == "post.it.vd")) { useVar = Convert.ToInt32(dRow["var"]); } Hand.Append(Encoding.encodeVL64(Convert.ToInt32(dRow["id"])) + Encoding.encodeVL64(f) + "I" + Convert.ToChar(2).ToString() + Encoding.encodeVL64(int.Parse(Convert.ToString(dRow["id"]))) + Encoding.encodeVL64(Template.indexID) + Convert.ToChar(2).ToString() + Encoding.encodeVL64(Recycleable) + Encoding.encodeVL64(Recycleable) + "MK"); } else { Hand.Append(string.Concat(new object[] { Encoding.encodeVL64(Convert.ToInt32(dRow["id"])), Encoding.encodeVL64(f), "S", Convert.ToChar(2).ToString(), Encoding.encodeVL64(int.Parse(Convert.ToString(dRow["id"]))), Encoding.encodeVL64(Template.indexID), Convert.ToChar(2), Convert.ToChar(2), useVar, Convert.ToChar(2).ToString(), Encoding.encodeVL64(Recycleable), Encoding.encodeVL64(Recycleable), Convert.ToChar(2).ToString(), "M" })); } } Label_0476: Hand.Append(Encoding.encodeVL64(dTable.Rows.Count)); this.sendData(string.Concat(new object[] { "BL", Encoding.encodeVL64(stopID - startID), Hand.ToString(), Convert.ToChar(1), "C[", this.Room.Heightmap })); } catch { this.sendData(string.Concat(new object[] { "BLHH", Convert.ToChar(1), "C[", this.Room.Heightmap })); } } } internal void refreshTradeBoxes() { if (((this.Room != null) && this.Room.containsUser(this._tradePartnerRoomUID)) && (this.roomUser != null)) { this._tradeAccept = false; virtualUser Partner = this.Room.getUser(this._tradePartnerRoomUID); StringBuilder tradeBoxes = new StringBuilder("Al" + Encoding.encodeVL64(this.roomUser.userID)); if (this._tradeItemCount > 0) { tradeBoxes.Append(catalogueManager.tradeItemList(this._tradeItems)); } else { tradeBoxes.Append("H"); } tradeBoxes.Append(Encoding.encodeVL64(Partner.roomUser.userID)); if (Partner._tradeItemCount > 0) { tradeBoxes.Append(catalogueManager.tradeItemList(Partner._tradeItems)); } else { tradeBoxes.Append("H"); } this.sendData(tradeBoxes.ToString()); } } internal void refreshValueables(bool Credits, bool Tickets) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { this._Credits = dbClient.getInt("SELECT credits FROM users WHERE id = '" + this.userID + "' LIMIT 1"); this._Pixels = dbClient.getInt("SELECT pixels FROM users WHERE id = '" + this.userID + "' LIMIT 1"); } this.sendData("@F" + this._Credits); this.sendData("Fv" + Encoding.encodeVL64(this._Pixels) + "I"); } public void Reset() { if (!this._isDisconnected) { try { this._isDisconnected = true; this.leaveCurrentRoom("", false); if (this.Messenger != null) { this.Messenger.Clear(); } userManager.removeUser(this.userID); } catch (Exception e) { Out.WriteDCError("FATAL ERROR DURING DISCONNECTION:\r" + e.ToString()); } } } internal void sendData(string packet) { this._ConnectionManager.sendData(packet); } internal void SetHandler(messageHandler _Handler) { this.Handler = _Handler; } private void showBrb() { int iCount = 0; try { bool CS$4$0001; goto Label_0084; Label_0006: this.refreshAppearance(false, false, true); this.Room.sendShout(this.roomUser, "\n\n\n I'm brb! .\n I'm already gone for: " + ((iCount / 2)).ToString() + " minutes.\n\n\n ik ben al 00 minuten weg "); iCount++; if (iCount > 30) { this.Room.sendShout(this.roomUser, "\n\n\n I'm gone for over 30 minutes now. "); Thread.CurrentThread.Abort(); this.brbLooper = null; } Thread.Sleep(0x7530); Label_0084: CS$4$0001 = true; goto Label_0006; } catch { Thread.CurrentThread.Abort(); this.brbLooper = null; } } private void useTeleporter(floorItem Teleporter1, int idTeleporter2, int roomIDTeleporter2) { try { Thread.Sleep(500); this.roomUser.walkLock = true; string Sprite = Teleporter1.Sprite; if (roomIDTeleporter2 == this._roomID) { floorItem Teleporter2 = this.Room.floorItemManager.getItem(idTeleporter2); this.Room.sendData(string.Concat(new object[] { "AX", Teleporter2.ID, Convert.ToChar(2), 2, Convert.ToChar(2) }), 500); this.Room.sendData(string.Concat(new object[] { "AX", Teleporter1.ID, Convert.ToChar(2), 2, Convert.ToChar(2) }), 500); this.Room.sendData(string.Concat(new object[] { @"A\", Encoding.encodeVL64(Teleporter2.ID), this._Username, Convert.ToChar(2) }), 500); this.roomUser.X = Teleporter2.X; this.roomUser.Y = Teleporter2.Y; this.roomUser.H = Teleporter2.H; this.roomUser.Z1 = Teleporter2.Z; this.roomUser.Z2 = Teleporter2.Z; this.roomUser.Refresh(); this.roomUser.walkLock = false; this.Room.sendData(string.Concat(new object[] { "AX", Teleporter2.ID, Convert.ToChar(2), 1, Convert.ToChar(2) }), 750); this.Room.sendData(string.Concat(new object[] { "AX", Teleporter1.ID, Convert.ToChar(2), 0, Convert.ToChar(2) }), 750); this.Room.sendData(string.Concat(new object[] { "AX", Teleporter2.ID, Convert.ToChar(2), 0, Convert.ToChar(2) }), 750); Thread.Sleep(250); int newX = Teleporter2.X; int newY = Teleporter2.Y; if (Teleporter2.Z == 4) { newY = Teleporter2.Y + 1; } if (Teleporter2.Z == 2) { newX = Teleporter2.X + 1; } this.Room.moveUser(this.roomUser, newX, newY, true); this.Room.sendData(string.Concat(new object[] { "AX", Teleporter1.ID, Convert.ToChar(2), 1, Convert.ToChar(2) })); } else { this._teleporterID = idTeleporter2; this._teleporterRoomID = roomIDTeleporter2; this.Room.sendData(string.Concat(new object[] { "AX", Teleporter1.ID, Convert.ToChar(2), 2, Convert.ToChar(2) })); this.Handler.ProcessPacket("@U" + Encoding.encodeVL64(roomIDTeleporter2)); this.Handler.ProcessPacket("@BH" + Encoding.encodeVL64(roomIDTeleporter2) + "H"); this.Room.sendData(string.Concat(new object[] { "AX", Teleporter1.ID, Convert.ToChar(2), 0, Convert.ToChar(2) }), 500); } } catch { } } public string IP { get { return this._ConnectionManager.connectionRemoteIP; } } private delegate void TeleporterUsageSleep(floorItem Teleporter1, int idTeleporter2, int roomIDTeleporter2); private delegate void timedDisconnector(int ms); } }