Hi, I bring the HideWired code. In the steps that from one emu to another change anything, I will put different codes to facilitate everything.
The command hides the wireds of the room. If they enter a room with activated hirewired they will appear hidden. If someone does reload in the room, hidewired is set to 0 and the furnis will be visible. If someone does Floor, it will be the same.
-All this in the emu, with the Microsoft Visual Studio program (latest versions recommended)
-1- Go to emu\HabboHotel\Rooms\Chat\Commands\User and we created a file called HideWiredCommand.cs with the following code:
CLOUD:
2- In the previous folder, we opened CommandMananger.cs. We look for the next line:
and below it we add:
3- We search the file 'GetRoomEntryDataEvent.cs' situated in emu\Communication\Packets\Incoming\Rooms\Engine
We look for the following code:
and below it, we add:
4- Go to emu\Communication\Packets\Incoming\Rooms\Furni\Wired and open SaveWiredConfigEvent.cs
We are looking for:
We add below:
5- Go to ObjetsComposer.cs in emu\Communication\Packets\Outgoing\Rooms\Engine
Look:
Add below:
6- Go to emu\Communication\Packets\Outgoing\Rooms\Furni\Wired and we created a file called 'HideWiredConfigComposer.cs' whose code is:
CLOUD:
The command hides the wireds of the room. If they enter a room with activated hirewired they will appear hidden. If someone does reload in the room, hidewired is set to 0 and the furnis will be visible. If someone does Floor, it will be the same.
-All this in the emu, with the Microsoft Visual Studio program (latest versions recommended)
-1- Go to emu\HabboHotel\Rooms\Chat\Commands\User and we created a file called HideWiredCommand.cs with the following code:
CLOUD:
PLUS:using System.Linq;using System.Text;using System.Collections.Generic;using Cloud.Communication.Packets.Outgoing.Inventory.Furni;using System.Globalization;using Cloud.Database.Interfaces;using Cloud.Communication.Packets.Outgoing;using Cloud.HabboHotel.Items;using Cloud.Communication.Packets.Outgoing.Rooms.Engine;using Cloud.Communication.Packets.Outgoing.Rooms.Chat;namespace Cloud.HabboHotel.Rooms.Chat.Commands.User{ class HideWiredCommand : IChatCommand { public string PermissionRequired { get { return ""; } } public string Parameters { get { return ""; } } public string Description { get { return "Oculta los Wired de la sala."; } } public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (!Room.CheckRights(Session, false, false)) { Session.SendWhisper("¡No tienes permiso para ocultar wireds en esta sala!"); return; } Room.HideWired = !Room.HideWired; if (Room.HideWired) Session.SendWhisper("Los Wired han sido ocultados."); else Session.SendWhisper("Los Wired son ahora visibles."); using (IQueryAdapter con = CloudServer.GetDatabaseManager().GetQueryReactor()) { con.SetQuery("UPDATE `rooms` SET `hide_wired` = @enum WHERE `id` = @id LIMIT 1"); con.AddParameter("enum", CloudServer.BoolToEnum(Room.HideWired)); con.AddParameter("id", Room.Id); con.RunQuery(); } List<ServerPacket> list = new List<ServerPacket>(); list = Room.HideWiredMessages(Room.HideWired); Room.SendMessage(list); } }}
using System;using System.Linq;using System.Text;using System.Collections.Generic;using Plus.Communication.Packets.Outgoing.Inventory.Furni;using System.Globalization;using Plus.Database.Interfaces;using Plus.Communication.Packets.Outgoing;using Plus.HabboHotel.Items;using Plus.Communication.Packets.Outgoing.Rooms.Engine;using Plus.Communication.Packets.Outgoing.Rooms.Chat;namespace Plus.HabboHotel.Rooms.Chat.Commands.User{ class HideWiredCommand : IChatCommand { public string PermissionRequired { get { return ""; } } public string Parameters { get { return ""; } } public string Description { get { return "Oculta los Wired de la sala."; } } public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (!Room.CheckRights(Session, false, false)) { Session.SendWhisper("¡No tienes permiso para ocultar wireds en esta sala!"); return; } Room.HideWired = !Room.HideWired; if (Room.HideWired) Session.SendWhisper("Los Wired han sido ocultados."); else Session.SendWhisper("Los Wired son ahora visibles."); using (IQueryAdapter con = HabboEnvironment.GetDatabaseManager().GetQueryReactor()) { con.SetQuery("UPDATE `rooms` SET `hide_wired` = @enum WHERE `id` = @id LIMIT 1"); con.AddParameter("enum", HabboEnvironment.BoolToEnum(Room.HideWired)); con.AddParameter("id", Room.Id); con.RunQuery(); } List<ServerPacket> list = new List<ServerPacket>(); list = Room.HideWiredMessages(Room.HideWired); Room.SendMessage(list); } }}
2- In the previous folder, we opened CommandMananger.cs. We look for the next line:
this.Register("lay", new LayCommand());
and below it we add:
this.Register("hidewired", new HideWiredCommand());
3- We search the file 'GetRoomEntryDataEvent.cs' situated in emu\Communication\Packets\Incoming\Rooms\Engine
We look for the following code:
if (!Room.GetRoomUserManager().AddAvatarToRoom(Session)) { Room.GetRoomUserManager().RemoveUserFromRoom(Session, false, false); return;//TODO: Remove? }
and below it, we add:
Room.SendObjects(Session); if (Room.HideWired && Room.CheckRights(Session, true, false)) Session.SendMessage(new RoomNotificationComposer("furni_placement_error", "message", "El wired está oculto en la sala."));
4- Go to emu\Communication\Packets\Incoming\Rooms\Furni\Wired and open SaveWiredConfigEvent.cs
We are looking for:
int ItemId = Packet.PopInt();
We add below:
Session.SendMessage(new HideWiredConfigComposer());
5- Go to ObjetsComposer.cs in emu\Communication\Packets\Outgoing\Rooms\Engine
Look:
List<Item> l = new List<Item>();
Add below:
if (Room.HideWired) { for (int i = 0; i < Objects.Count(); i++) { Item it = Objects; if (it == null) continue; if (it.IsWired) continue; l.Add(it); } Objects = l.ToArray(); base.WriteInteger(Objects.Length); for (int i = 0; i < Objects.Count(); i++) { Item Item = Objects; WriteFloorItem(Item, Convert.ToInt32(Item.UserID)); } }
6- Go to emu\Communication\Packets\Outgoing\Rooms\Furni\Wired and we created a file called 'HideWiredConfigComposer.cs' whose code is:
CLOUD:
PLUS:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Cloud.Communication.Packets.Outgoing.Rooms.Furni.Wired{ class HideWiredConfigComposer : ServerPacket { public HideWiredConfigComposer() : base(ServerPacketHeader.HideWiredConfigMessageComposer) { } }}
7- Go to emu\HabboHotel\Rooms and open room.csSearch:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Plus.Communication.Packets.Outgoing.Rooms.Furni.Wired{ class HideWiredConfigComposer : ServerPacket { public HideWiredConfigComposer() : base(ServerPacketHeader.HideWiredConfigMessageComposer) { } }}
and we add below:public int IdleTime { get; set; }
We are looking for:private bool _hideWired;
Below, we add:this.Landscape = Data.Landscape;
Look for:this._hideWired = Data.HideWired;
Above of that code, we add:public List<string> WordFilterList { get { return this._wordFilterList; } set { this._wordFilterList = value; } }
8- In that same folder, we open RoomData.csSearch:public List<ServerPacket> HideWiredMessages(bool hideWired) { List<ServerPacket> list = new List<ServerPacket>(); Item[] items = this.GetRoomItemHandler().GetFloor.ToArray(); if (hideWired) { for (int i = 0; i < items.Count(); i++) { Item item = items; if (!item.IsWired) continue; list.Add(new ObjectRemoveComposer(item, 0)); } } else { for (int i = 0; i < items.Count(); i++) { Item item = items; if (!item.IsWired) continue; list.Add(new ObjectAddComposer(item, this)); } } return list; } public bool HideWired { get { return this._hideWired; } set { this._hideWired = value; } }
Below, add:public bool PetMorphsAllowed;
Search:public bool HideWired;
Below, we add:this.PetMorphsAllowed = CloudServer.EnumToBool(Row["pet_morphs_allowed"].ToString());
9- In that same folder, we open RoomItemHandling.csLook for:this.HideWired = CloudServer.EnumToBool(Row["hide_wired"].ToString());
Below, we add:if (newItem) if (Item.IsWired) if (Item.IsWired) {
10- We go to our database and execute the following SQL code:if (_room.HideWired) { _room.HideWired = false; Session.SendWhisper("El Wired está oculto."); _room.SendMessage(_room.HideWiredMessages(false)); }
Once ready, we compile and it should work. All the credits of codes to their respective authors (I do not know authorship).If it has served you, all comments are useful to continue contributing things to this community ^^ALTER TABLE rooms ADD COLUMN hide_wired enum('0','1') NOT NULL DEFAULT '0';
Last edited: