public void Parse(GameClient Session, ClientMessage Packet) { Room Room = SilverwaveEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId); if (Room == null) { return; } RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) { return; } User.UnIdle(); int Action = Packet.PopWiredInt32(); User.DanceId = 0; Room.SendMessage(new ActionComposer(User, Action)); if (Action == 5) // idle { User.IsAsleep = true; Room.SendMessage(new SleepComposer(User, true)); } SilverwaveEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.SOCIAL_WAVE); }
private static List<RoomItem> GetFurniItems(ClientMessage Request, Room Room) { List<RoomItem> Items = new List<RoomItem>(); int FurniCount = Request.PopWiredInt32(); for (int i = 0; i < FurniCount; i++) { RoomItem Item = Room.GetRoomItemHandler().GetItem(Request.PopWiredUInt()); if (Item != null) { Items.Add(Item); } } return Items; }
public static void SaveWired(GameClient Session, RoomItem Item, ClientMessage Request) { if (!Item.IsWired) { return; } Room Room = Item.GetRoom(); WiredHandler Handler = Room.GetWiredHandler(); switch (Item.GetBaseItem().InteractionType) { #region Triggers case InteractionType.triggerroomenter: { int Unknown = Request.PopWiredInt32(); string User = Request.PopFixedString(); WiredItem WItem = Handler.GetWired(Item); WItem.OtherString = User; Handler.ReloadWired(WItem); break; } case InteractionType.triggeronusersay: { int Unknown = Request.PopWiredInt32(); int OwnerOnly = Request.PopWiredInt32(); string Message = Request.PopFixedString(); WiredItem WItem = Handler.GetWired(Item); WItem.OtherString = Message; WItem.OtherBool = (OwnerOnly == 1); Handler.ReloadWired(WItem); break; } case InteractionType.triggerrepeater: { int Unknown = Request.PopWiredInt32(); int Delay = Request.PopWiredInt32() * 500; WiredItem WItem = Handler.GetWired(Item); WItem.Delay = Delay; Handler.ReloadWired(WItem); break; } case InteractionType.triggerstatechanged: { int Unknown = Request.PopWiredInt32(); string Unknown2 = Request.PopFixedString(); List<RoomItem> Items = GetFurniItems(Request, Room); int Delay = Request.PopWiredInt32(); WiredItem WItem = Handler.GetWired(Item); WItem.Delay = Delay * 500; WItem.Items = Items; Handler.ReloadWired(WItem); break; } case InteractionType.triggerwalkonfurni: { int Unknown = Request.PopWiredInt32(); string Message = Request.PopFixedString(); List<RoomItem> Items = GetFurniItems(Request, Room); int Delay = Request.PopWiredInt32(); WiredItem WItem = Handler.GetWired(Item); WItem.Delay = Delay * 500; WItem.Items = Items; Handler.ReloadWired(WItem); break; } case InteractionType.triggerwalkofffurni: { int Unknown = Request.PopWiredInt32(); string Message = Request.PopFixedString(); List<RoomItem> Items = GetFurniItems(Request, Room); int Delay = Request.PopWiredInt32(); WiredItem WItem = Handler.GetWired(Item); WItem.Delay = Delay * 500; WItem.Items = Items; Handler.ReloadWired(WItem); break; } #endregion #region Effects case InteractionType.actionkickuser: case InteractionType.actionshowmessage: { int Unknown = Request.PopWiredInt32(); string Message = Request.PopFixedString(); WiredItem WItem = Handler.GetWired(Item); WItem.OtherString = Message; Handler.ReloadWired(WItem); break; } case InteractionType.actionteleportto: { int Unknown = Request.PopWiredInt32(); string Unknown2 = Request.PopFixedString(); List<RoomItem> Items = GetFurniItems(Request, Room); int Delay = Request.PopWiredInt32(); WiredItem WItem = Handler.GetWired(Item); WItem.Items = Items; WItem.Delay = Delay * 500; Handler.ReloadWired(WItem); break; } case InteractionType.actiontogglestate: { int Unknown = Request.PopWiredInt32(); string Unknown2 = Request.PopFixedString(); List<RoomItem> Items = GetFurniItems(Request, Room); int Delay = Request.PopWiredInt32(); WiredItem WItem = Handler.GetWired(Item); WItem.Items = Items; WItem.Delay = Delay * 500; Handler.ReloadWired(WItem); break; } case InteractionType.actionmoverotate: { int Unknown = Request.PopWiredInt32(); int Movement = Request.PopWiredInt32(); int Rotation = Request.PopWiredInt32(); string Unknown2 = Request.PopFixedString(); List<RoomItem> Items = GetFurniItems(Request, Room); int Delay = Request.PopWiredInt32(); WiredItem WItem = Handler.GetWired(Item); WItem.Items = Items; WItem.Delay = Delay * 500; WItem.OtherString = Rotation + ";" + Movement; Handler.ReloadWired(WItem); break; } #endregion #region Conditions case InteractionType.conditionfurnishaveusers: case InteractionType.conditionfurnihasfurni: case InteractionType.conditiontriggeronfurni: { int Unknown = Request.PopWiredInt32(); string Unknown2 = Request.PopFixedString(); List<RoomItem> Items = GetFurniItems(Request, Room); WiredItem WItem = Handler.GetWired(Item); WItem.Items = Items; Handler.ReloadWired(WItem); break; } #endregion } Session.SendMessage(new ServerMessage(Outgoing.SaveWired)); }
private static void RemoveFromPlaylist(GameClient Session, ClientMessage Message) { Room Instance = Session.GetHabbo().CurrentRoom; if (Instance == null || !Instance.GotMusicController() || !Instance.CheckRights(Session, true)) { return; } SongItem TakenItem = Instance.GetRoomMusicController().RemoveDisk(Message.PopWiredInt32()); // playlist will skip to the next item automatically if it has to if (TakenItem == null) { return; } Session.GetHabbo().GetInventoryComponent().AddNewItem(TakenItem.itemID, TakenItem.baseItem.ItemId, TakenItem.songID.ToString(), 0, true, true,0,0); Session.SendMessage(JukeboxComposer.Compose(Session)); Session.SendMessage(JukeboxComposer.Compose(Instance.GetRoomMusicController().PlaylistCapacity, Instance.GetRoomMusicController().Playlist.Values.ToList())); }
private static void GetSongData(GameClient Session, ClientMessage Message) { int Amount = Message.PopWiredInt32(); List<SongData> Songs = new List<SongData>(); for (int i = 0; i < Amount; i++) { SongData Song = GetSong(Message.PopWiredUInt()); if (Song == null) continue; Songs.Add(Song); } Session.SendMessage(JukeboxComposer.Compose(Songs)); }