internal void RemoveAllRooms() { int count = this.loadedRooms.Count; int num = 0; foreach (Room current in this.loadedRooms.Values) { CyberEnvironment.GetGame().GetRoomManager().UnloadRoom(current); Console.Clear(); Console.WriteLine("<<- SERVER SHUTDOWN ->> ROOM ITEM SAVE: " + string.Format("{0:0.##}", (double)num / (double)count * 100.0) + "%"); checked { num++; } } Console.WriteLine("RoomManager Destroyed!"); }
internal void SerializeGroupInfo(Guild Group, ServerMessage Response, GameClient Session, Room Room, bool NewWindow = false) { if (Room == null) { return; } DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0); DateTime dateTime2 = dateTime.AddSeconds((double)Group.CreateTime); Response.Init(Outgoing.GroupDataMessageComposer); Response.AppendUInt(Group.Id); Response.AppendBoolean(true); Response.AppendUInt(Group.State); Response.AppendString(Group.Name); Response.AppendString(Group.Description); Response.AppendString(Group.Badge); Response.AppendUInt(Group.RoomId); Response.AppendString((CyberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Group.RoomId) == null) ? "No room found.." : CyberEnvironment.GetGame().GetRoomManager().GenerateRoomData(Group.RoomId).Name); Response.AppendInt32((Group.CreatorId == Session.GetHabbo().Id) ? 3 : (Group.Requests.Contains(Session.GetHabbo().Id) ? 2 : (Group.Members.ContainsKey(Session.GetHabbo().Id) ? 1 : 0))); Response.AppendInt32(Group.Members.Count); Response.AppendBoolean(Session.GetHabbo().FavouriteGroup == Group.Id); Response.AppendString(string.Concat(new object[] { dateTime2.Day, "-", dateTime2.Month, "-", dateTime2.Year })); Response.AppendBoolean(Group.CreatorId == Session.GetHabbo().Id); Response.AppendBoolean(Group.Admins.ContainsKey(Session.GetHabbo().Id)); Response.AppendString((CyberEnvironment.getHabboForId(Group.CreatorId) == null) ? "" : CyberEnvironment.getHabboForId(Group.CreatorId).Username); Response.AppendBoolean(NewWindow); Response.AppendBoolean(Group.AdminOnlyDeco == 0u); Response.AppendInt32(Group.Requests.Count); Response.AppendBoolean(Group.HasForum); if (Room != null) { Room.SendMessage(Response); return; } if (Session != null) { Session.SendMessage(Response); } }
internal void InitGroups() { this.Bases = new HashSet <GroupBases>(); this.Symbols = new HashSet <GroupSymbols>(); this.BaseColours = new HashSet <GroupBaseColours>(); this.SymbolColours = new HybridDictionary(); this.BackGroundColours = new HybridDictionary(); this.Groups = new HybridDictionary(); this.ClearInfo(); using (IQueryAdapter dbClient = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { dbClient.setQuery("SELECT * FROM group_badgeparts"); DataTable table = dbClient.getTable(); if (table == null) { return; } foreach (DataRow row in table.Rows) { switch (row["type"].ToString().ToLower()) { case "base": this.Bases.Add(new GroupBases(int.Parse(row["id"].ToString()), row["code"].ToString(), row["code2"].ToString())); break; case "symbol": this.Symbols.Add(new GroupSymbols(int.Parse(row["id"].ToString()), row["code"].ToString(), row["code2"].ToString())); break; case "base_color": this.BaseColours.Add(new GroupBaseColours(int.Parse(row["id"].ToString()), row["code"].ToString())); break; case "symbol_color": this.SymbolColours.Add(int.Parse(row["id"].ToString()), new GroupSymbolColours(int.Parse(row["id"].ToString()), row["code"].ToString())); break; case "other_color": this.BackGroundColours.Add(int.Parse(row["id"].ToString()), new GroupBackGroundColours(int.Parse(row["id"].ToString()), row["code"].ToString())); break; } } } }
public void SaveWired(WiredItem Item) { if (Item == null) { return; } checked { using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { string text = ""; int num = 0; foreach (RoomItem current in Item.Items) { if (num != 0) { text += ";"; } text += current.Id; num++; } if (Item.OtherString == null) { Item.OtherString = ""; } if (Item.OtherExtraString == null) { Item.OtherExtraString = ""; } if (Item.OtherExtraString2 == null) { Item.OtherExtraString2 = ""; } queryreactor.setQuery("REPLACE INTO wired_items VALUES (@id, @items, @delay, @string, @bool, @extrastring, @extrastring2)"); queryreactor.addParameter("id", Item.Item.Id); queryreactor.addParameter("items", text); queryreactor.addParameter("delay", Item.Delay); queryreactor.addParameter("string", Item.OtherString); queryreactor.addParameter("bool", CyberEnvironment.BoolToEnum(Item.OtherBool)); queryreactor.addParameter("extrastring", Item.OtherExtraString); queryreactor.addParameter("extrastring2", Item.OtherExtraString2); queryreactor.runQuery(); } } }
internal Guild GetGroup(uint GroupId) { if (this.Groups != null) { if (this.Groups.Contains(GroupId)) { return((Guild)this.Groups[GroupId]); } using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT * FROM groups WHERE id=" + GroupId + " LIMIT 1"); DataRow row = queryreactor.getRow(); Guild result; if (row == null) { result = null; return(result); } queryreactor.setQuery("SELECT user_id, rank FROM group_memberships WHERE group_id=" + GroupId); DataTable table = queryreactor.getTable(); queryreactor.setQuery("SELECT user_id FROM group_requests WHERE group_id=" + GroupId); DataTable table2 = queryreactor.getTable(); Dictionary <uint, GroupUser> dictionary = new Dictionary <uint, GroupUser>(); Dictionary <uint, GroupUser> dictionary2 = new Dictionary <uint, GroupUser>(); List <uint> list = new List <uint>(); foreach (DataRow dataRow in table.Rows) { dictionary.Add((uint)dataRow[0], new GroupUser((uint)dataRow[0], GroupId, int.Parse(dataRow[1].ToString()))); if (int.Parse(dataRow[1].ToString()) >= 1) { dictionary2.Add((uint)dataRow[0], new GroupUser((uint)dataRow[0], GroupId, int.Parse(dataRow[1].ToString()))); } } foreach (DataRow dataRow2 in table2.Rows) { list.Add((uint)dataRow2[0]); } Guild group = new Guild((uint)row[0], row[1].ToString(), row[2].ToString(), (uint)row[6], row[3].ToString(), (int)row[5], (uint)row[4], (int)row[8], (int)row[9], dictionary, list, dictionary2, (uint)Convert.ToUInt16(row[7]), (uint)Convert.ToUInt16(row[10]), row["has_forum"].ToString() == "1", row["forum_name"].ToString(), row["forum_description"].ToString(), uint.Parse(row["forum_messages_count"].ToString()), double.Parse(row["forum_score"].ToString()), uint.Parse(row["forum_lastposter_id"].ToString()), row["forum_lastposter_name"].ToString(), int.Parse(row["forum_lastposter_timestamp"].ToString())); this.Groups.Add((uint)row[0], group); result = group; return(result); } } return(null); }
internal ServerMessage SerializeNewFlatCategories() { var flatcat = CyberEnvironment.GetGame().GetNavigator().PrivateCategories.OfType <FlatCat>(); var rooms = CyberEnvironment.GetGame().GetRoomManager().loadedRooms; ServerMessage Message = new ServerMessage(Outgoing.NavigatorNewFlatCategoriesMessageComposer); Message.AppendInt32(flatcat.Count()); foreach (FlatCat cat in flatcat) { Message.AppendInt32(cat.Id); Message.AppendInt32(cat.UsersNow); Message.AppendInt32(500); } return(Message); }
internal void UpdateEvent(RoomEvent Event) { using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery(string.Concat(new object[] { "REPLACE INTO room_events VALUES (", Event.RoomId, ", @name, @desc, ", Event.Time, ")" })); queryreactor.addParameter("name", Event.Name); queryreactor.addParameter("desc", Event.Description); queryreactor.runQuery(); } this.SerializeEventInfo(Event.RoomId); }
internal static void Initialize() { SongManager.songs = new Dictionary <uint, SongData>(); SongManager.cacheTimer = new Dictionary <uint, double>(); DataTable table; SongManager.songs.Clear(); using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT * FROM songs ORDER BY id"); table = queryreactor.getTable(); } foreach (DataRow dRow in table.Rows) { SongData songFromDataRow = SongManager.GetSongFromDataRow(dRow); SongManager.songs.Add(songFromDataRow.Id, songFromDataRow); } }
internal SupportTicket(uint Id, int Score, int Type, uint SenderId, uint ReportedId, string Message, uint RoomId, string RoomName, double Timestamp, List <string> ReportedChats) { this.Id = Id; this.Score = Score; this.Type = Type; this.Status = TicketStatus.OPEN; this.SenderId = SenderId; this.ReportedId = ReportedId; this.ModeratorId = 0u; this.Message = Message; this.RoomId = RoomId; this.RoomName = RoomName; this.Timestamp = Timestamp; this.SenderName = CyberEnvironment.GetGame().GetClientManager().GetNameById(SenderId); this.ReportedName = CyberEnvironment.GetGame().GetClientManager().GetNameById(ReportedId); this.ModName = CyberEnvironment.GetGame().GetClientManager().GetNameById(this.ModeratorId); this.ReportedChats = ReportedChats; }
internal static void ProcessThread() { double num = (double)CyberEnvironment.GetUnixTimestamp(); List <uint> list = new List <uint>(); foreach (KeyValuePair <uint, double> current in SongManager.cacheTimer) { if (num - current.Value >= 180.0) { list.Add(current.Key); } } foreach (uint current2 in list) { SongManager.songs.Remove(current2); SongManager.cacheTimer.Remove(current2); } }
public bool OnCycle() { long num = CyberEnvironment.Now(); if (this.mNext < num) { List <WiredItem> conditions = this.mRoom.GetWiredHandler().GetConditions(this); List <WiredItem> effects = this.mRoom.GetWiredHandler().GetEffects(this); foreach (RoomUser current in this.mUsers) { if (conditions.Count > 0) { foreach (WiredItem current2 in conditions) { if (current2.Execute(new object[] { current })) { this.mRoom.GetWiredHandler().OnEvent(current2); } } } if (effects.Count > 0) { foreach (WiredItem current3 in effects) { if (current3.Execute(new object[] { current, this.Type })) { this.mRoom.GetWiredHandler().OnEvent(current3); } } } } this.Room.GetWiredHandler().OnEvent(this); this.mNext = 0L; return(true); } return(false); }
internal void start() { using (IQueryAdapter queryReactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { uint itemsLoaded = 0; uint catalogPageLoaded = 0; uint navigatorLoaded = 0; uint roomModelLoaded = 0; uint videoPlaylistLoaded = 0; uint achievementLoaded = 0; uint pollLoaded = 0; this.BanManager.LoadBans(queryReactor); this.RoleManager.LoadRights(queryReactor); this.ItemManager.LoadItems(queryReactor, out itemsLoaded); Logging.WriteLine("Loaded a total of " + itemsLoaded + " item definition(s)."); this.PinataHandler.Initialize(queryReactor); this.globalInventory = new InventoryGlobal(); this.VideoManager.Load(queryReactor, out videoPlaylistLoaded); Logging.WriteLine("Loaded a total of " + videoPlaylistLoaded + " video playlist(s)."); this.Catalog.Initialize(queryReactor, out catalogPageLoaded); Logging.WriteLine("Loaded a total of " + catalogPageLoaded + " catalogue page(s)."); this.Navigator.Initialize(queryReactor, out navigatorLoaded); Logging.WriteLine("Loaded a total of " + navigatorLoaded + " official room(s)."); this.RoomManager.LoadModels(queryReactor, out roomModelLoaded); Logging.WriteLine("Loaded a total of " + roomModelLoaded + " room model(s)."); this.RoomManager.InitVotedRooms(queryReactor); this.AchievementManager = new AchievementManager(queryReactor, out achievementLoaded); Logging.WriteLine("Loaded a total of " + achievementLoaded + " achievement(s)."); this.questManager.Initialize(queryReactor); this.PollManager.Init(queryReactor, out pollLoaded); Logging.WriteLine("Loaded a total of " + pollLoaded + " poll(s)."); this.talentManager.Initialize(queryReactor); this.ModerationTool.LoadMessagePresets(queryReactor); this.ModerationTool.LoadPendingTickets(queryReactor); PetRace.Init(queryReactor); AntiPublicistas.Load(queryReactor); this.GetGroupManager().InitGroups(); SongManager.Initialize(); LowPriorityWorker.Init(queryReactor); } this.StartGameLoop(); PixelManager.StartPixelTimer(); }
internal static ServerMessage SerializeRoomVisits(uint UserId) { ServerMessage result; using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT room_id,hour,minute FROM user_roomvisits WHERE user_id = " + UserId + " ORDER BY entry_timestamp DESC LIMIT 50"); DataTable table = queryreactor.getTable(); ServerMessage serverMessage = new ServerMessage(Outgoing.ModerationToolRoomVisitsMessageComposer); serverMessage.AppendUInt(UserId); serverMessage.AppendString(CyberEnvironment.GetGame().GetClientManager().GetNameById(UserId)); if (table != null) { serverMessage.AppendInt32(table.Rows.Count); IEnumerator enumerator = table.Rows.GetEnumerator(); try { while (enumerator.MoveNext()) { DataRow dataRow = (DataRow)enumerator.Current; RoomData roomData = CyberEnvironment.GetGame().GetRoomManager().GenerateNullableRoomData(Convert.ToUInt32(dataRow["room_id"])); serverMessage.AppendBoolean(false); serverMessage.AppendUInt(roomData.Id); serverMessage.AppendString(roomData.Name); serverMessage.AppendInt32((int)dataRow["hour"]); serverMessage.AppendInt32((int)dataRow["minute"]); } goto IL_120; } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } } serverMessage.AppendInt32(0); IL_120: result = serverMessage; } return(result); }
internal void LogPM(uint From_Id, uint ToId, string Message) { uint arg_10_0 = this.GetClient().GetHabbo().Id; DateTime arg_16_0 = DateTime.Now; using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery(string.Concat(new object[] { "INSERT INTO chatlogs_console VALUES (NULL, ", From_Id, ", ", ToId, ", @message, UNIX_TIMESTAMP())" })); queryreactor.addParameter("message", Message); queryreactor.runQuery(); } }
internal bool RequestExists(uint requestID) { if (this.requests.ContainsKey(requestID)) { return(true); } checked { bool result; using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT user_one_id FROM messenger_friendships WHERE user_one_id = @myID AND user_two_id = @friendID"); queryreactor.addParameter("myID", (int)this.UserId); queryreactor.addParameter("friendID", (int)requestID); result = queryreactor.findsResult(); } return(result); } }
internal void UpdateForum() { if (!HasForum) { return; } using (IQueryAdapter Adapter = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { Adapter.setQuery("UPDATE groups SET has_forum = '1', forum_name = @name , forum_description = @desc , forum_messages_count = @msgcount , forum_score = @score , forum_lastposter_id = @lastposterid , forum_lastposter_name = @lastpostername , forum_lastposter_timestamp = @lasttimestamp WHERE id =" + Id); Adapter.addParameter("name", ForumName); Adapter.addParameter("desc", ForumDescription); Adapter.addParameter("msgcount", ForumMessagesCount); Adapter.addParameter("score", ForumScore.ToString()); Adapter.addParameter("lastposterid", ForumLastPosterId); Adapter.addParameter("lastpostername", ForumLastPosterName); Adapter.addParameter("lasttimestamp", ForumLastPosterTimestamp); Adapter.runQuery(); } }
internal void Disconnect() { if (this.GetHabbo() != null) { using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.runFastQuery(this.GetHabbo().GetQueryString); } this.GetHabbo().OnDisconnect(); } if (!this.Disconnected) { if (this.Connection != null) { this.Connection.Dispose(); } this.Disconnected = true; } }
internal static uint GetLinkedTele(uint TeleId, Room pRoom) { uint result; using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT tele_two_id FROM tele_links WHERE tele_one_id = " + TeleId); DataRow row = queryreactor.getRow(); if (row == null) { result = 0u; } else { result = Convert.ToUInt32(row[0]); } } return(result); }
internal void HandleRequest(uint sender) { using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.runFastQuery(string.Concat(new object[] { "DELETE FROM messenger_requests WHERE (from_id = ", this.UserId, " AND to_id = ", sender, ") OR (to_id = ", this.UserId, " AND from_id = ", sender, ")" })); } this.requests.Remove(sender); }
internal void LoadBans() { this.Bans = new Dictionary <long, double>(); DataTable table; using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT user_id, expire FROM room_bans WHERE room_id = " + this.Id); table = queryreactor.getTable(); } if (table == null) { return; } foreach (DataRow dataRow in table.Rows) { this.Bans.Add((long)((ulong)((uint)dataRow[0])), Convert.ToDouble(dataRow[1])); } }
internal TonerData(uint Item) { this.ItemId = Item; DataRow row; using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT enabled,data1,data2,data3 FROM room_items_toner WHERE id=" + this.ItemId + " LIMIT 1"); row = queryreactor.getRow(); } if (row == null) { throw new NullReferenceException("No toner data found in the database for " + this.ItemId); } this.Enabled = int.Parse(row[0].ToString()); this.Data1 = (int)row[1]; this.Data2 = (int)row[2]; this.Data3 = (int)row[3]; }
public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights) { RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) { return; } if (User.CurrentEffect == 172 || User.CurrentEffect == 5 || User.CurrentEffect == 173) { if (Item.ExtraData != "5") { if (!Item.VikingCotieBurning) { Item.ExtraData = "1"; Item.UpdateState(); Item.VikingCotieBurning = true; GameClient clientByUsername = CyberEnvironment.GetGame().GetClientManager().GetClientByUsername(Item.GetRoom().Owner); if (clientByUsername != null) { if (clientByUsername.GetHabbo().Username != Item.GetRoom().Owner) { clientByUsername.SendNotif("" + User.GetUsername() + " ha empezado a quemar una cabaña vikingo de tu Sala!"); } } this.mItem = Item; Timer Timer = new Timer(5000); Timer.Elapsed += OnElapse; Timer.Enabled = true; return; } } else { Session.SendNotif("¡Lo sentimos! Esta cabaña Vikingo ya ha sido quemada y no hay marcha atrás!"); } } }
internal static MoplaBreed CreateMonsterplantBreed(Pet Pet) { MoplaBreed breed = null; if (Pet.Type == 16) { Tuple <string, string> tuple = GeneratePlantData(Pet.Rarity); breed = new MoplaBreed(Pet, Pet.PetId, Pet.Rarity, tuple.Item1, tuple.Item2, 0, 1); using (IQueryAdapter adapter = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { adapter.setQuery("INSERT INTO bots_monsterplants (pet_id, rarity, plant_name, plant_data) VALUES (@petid , @rarity , @plantname , @plantdata)"); adapter.addParameter("petid", Pet.PetId); adapter.addParameter("rarity", Pet.Rarity); adapter.addParameter("plantname", tuple.Item1); adapter.addParameter("plantdata", tuple.Item2); adapter.runQuery(); } } return(breed); }
internal void AddBan(int pId, long Time) { if (!this.Bans.ContainsKey((long)Convert.ToInt32(pId))) { this.Bans.Add((long)pId, (double)checked (unchecked ((long)CyberEnvironment.GetUnixTimestamp()) + Time)); } using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.runFastQuery(string.Concat(new object[] { "REPLACE INTO room_bans VALUES (", pId, ", ", this.Id, ", '", (CyberEnvironment.GetUnixTimestamp() + Time), "')" })); } }
internal ServerMessage SerializeFavoriteRooms(GameClient Session) { ServerMessage serverMessage = new ServerMessage(Outgoing.NavigatorListingsMessageComposer); serverMessage.AppendInt32(6); serverMessage.AppendString(""); serverMessage.AppendInt32(Session.GetHabbo().FavoriteRooms.Count); object[] array = Session.GetHabbo().FavoriteRooms.ToArray(); for (int i = 0; i < array.Length; i++) { uint roomId = (uint)array[i]; RoomData roomData = CyberEnvironment.GetGame().GetRoomManager().GenerateRoomData(roomId); if (roomData != null) { roomData.Serialize(serverMessage, false); } } serverMessage.AppendBoolean(false); return(serverMessage); }
internal static uint GetHopperId(uint NextRoom) { uint result; using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.setQuery("SELECT hopper_id FROM items_hopper WHERE room_id = @room LIMIT 1"); queryreactor.addParameter("room", NextRoom); string @string = queryreactor.getString(); if (@string == null) { result = 0u; } else { result = Convert.ToUInt32(@string); } } return(result); }
internal void DeliverRandomPinataItem(RoomUser User, Room Room, RoomItem Item) { if (Room == null || Item == null || Item.GetBaseItem().InteractionType != InteractionType.pinata || !this.Pinatas.ContainsKey(Item.GetBaseItem().ItemId)) { return; } PinataItem pinataItem; this.Pinatas.TryGetValue(Item.GetBaseItem().ItemId, out pinataItem); if (pinataItem == null || pinataItem.Rewards.Count < 1) { return; } int getX = Item.GetX; int getY = Item.GetY; double getZ = Item.GetZ; Thread.Sleep(900); Item.refreshItem(); Item.BaseItem = pinataItem.Rewards[new Random().Next(checked (pinataItem.Rewards.Count - 1))]; Item.ExtraData = ""; Room.GetRoomItemHandler().RemoveFurniture(User.GetClient(), Item.Id, false); using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.runFastQuery(string.Concat(new object[] { "UPDATE items SET base_item = '", Item.BaseItem, "', extra_data = '' WHERE id = ", Item.Id })); queryreactor.runQuery(); } Room.GetRoomItemHandler().SetFloorItem(Item, getX, getY, getZ, 0, false); ServerMessage serverMessage = new ServerMessage(Outgoing.AddFloorItemMessageComposer); Item.Serialize(serverMessage); serverMessage.AppendString(Room.Owner); Room.SendMessage(serverMessage); Room.GetRoomItemHandler().SetFloorItem(User.GetClient(), Item, Item.GetX, Item.GetY, 0, true, false, true); }
public bool Execute(params object[] Stuff) { RoomUser roomUser = (RoomUser)Stuff[0]; RoomItem roomItem = (RoomItem)Stuff[1]; if (!this.mItems.Contains(roomItem) || (roomUser.LastItem != 0 && roomUser.LastItem == roomItem.Id)) { return(false); } this.mUsers.Enqueue(roomUser); if (this.mDelay == 0) { this.OnCycle(); } else { this.mNext = checked (CyberEnvironment.Now() + unchecked ((long)this.mDelay)); this.mRoom.GetWiredHandler().EnqueueCycle(this); } return(true); }
internal void CreateFriendship(uint friendID) { using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.runFastQuery(string.Concat(new object[] { "REPLACE INTO messenger_friendships (user_one_id,user_two_id) VALUES (", this.UserId, ",", friendID, ")" })); } this.OnNewFriendship(friendID); GameClient clientByUserID = CyberEnvironment.GetGame().GetClientManager().GetClientByUserID(friendID); if (clientByUserID != null && clientByUserID.GetHabbo().GetMessenger() != null) { clientByUserID.GetHabbo().GetMessenger().OnNewFriendship(this.UserId); } }
internal void Pick(uint pModeratorId, bool UpdateInDb) { this.Status = TicketStatus.PICKED; this.ModeratorId = pModeratorId; this.ModName = CyberEnvironment.getHabboForId(pModeratorId).Username; if (UpdateInDb) { using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor()) { queryreactor.runFastQuery(string.Concat(new object[] { "UPDATE moderation_tickets SET status = 'picked', moderator_id = ", pModeratorId, ", timestamp = '", CyberEnvironment.GetUnixTimestamp(), "' WHERE id = ", this.Id })); } } }