Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
[Plus/Cloud/Osore] HideWired Command
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="HTheAlexitoH" data-source="post: 437489" data-attributes="member: 70830"><p>My ObjectsComposer:</p><p>[code]</p><p>using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p></p><p>using Cloud.Utilities;</p><p>using Cloud.HabboHotel.Rooms;</p><p>using Cloud.HabboHotel.Items;</p><p>using Cloud.HabboHotel.Groups;</p><p>using Cloud.HabboHotel.Users;</p><p></p><p>namespace Cloud.Communication.Packets.Outgoing.Rooms.Engine</p><p>{</p><p> class ObjectsComposer : ServerPacket</p><p> {</p><p> public ObjectsComposer(Item[] Objects, Room Room)</p><p> : base(ServerPacketHeader.ObjectsMessageComposer)</p><p> {</p><p> base.WriteInteger(1);</p><p> base.WriteInteger(Room.OwnerId);</p><p> base.WriteString(Room.OwnerName);</p><p></p><p> List<Item> l = new List<Item>();</p><p> if (Room.HideWired)</p><p> {</p><p> for (int i = 0; i < Objects.Count(); i++)</p><p> {</p><p> Item it = Objects[i];</p><p> if (it == null)</p><p> continue;</p><p></p><p> if (it.IsWired)</p><p> continue;</p><p></p><p> l.Add(it);</p><p> }</p><p> Objects = l.ToArray();</p><p> base.WriteInteger(Objects.Length);</p><p> for (int i = 0; i < Objects.Count(); i++)</p><p> {</p><p> Item Item = Objects[i];</p><p> WriteFloorItem(Item, Convert.ToInt32(Item.UserID));</p><p> }</p><p> }</p><p> else</p><p> {</p><p> base.WriteInteger(Objects.Length);</p><p> for (int i = 0; i < Objects.Count(); i++)</p><p> {</p><p> Item Item = Objects[i];</p><p> WriteFloorItem(Item, Convert.ToInt32(Item.UserID));</p><p> }</p><p> }</p><p> }</p><p></p><p> private void WriteFloorItem(Item Item, int UserID)</p><p> {</p><p> base.WriteInteger(Item.Id);</p><p> base.WriteInteger(Item.GetBaseItem().SpriteId);</p><p> base.WriteInteger(Item.GetX);</p><p> base.WriteInteger(Item.GetY);</p><p> base.WriteInteger(Item.Rotation);</p><p> base.WriteString(String.Format("{0:0.00}", TextHandling.GetString(Item.GetZ)));</p><p> base.WriteString(String.Empty);</p><p></p><p> if (Item.LimitedNo > 0)</p><p> {</p><p> base.WriteInteger(1);</p><p> base.WriteInteger(256);</p><p> base.WriteString(Item.ExtraData);</p><p> base.WriteInteger(Item.LimitedNo);</p><p> base.WriteInteger(Item.LimitedTot);</p><p> }</p><p> else if (Item.Data.InteractionType == InteractionType.FX_PROVIDER)</p><p> {</p><p> base.WriteInteger(0);</p><p> base.WriteInteger(1);</p><p> base.WriteInteger(1);</p><p> base.WriteString("effectId");</p><p> base.WriteString(Item.ExtraData);</p><p> }</p><p> else if (Item.Data.InteractionType == InteractionType.PINATA)</p><p> {</p><p> base.WriteInteger(0);</p><p> base.WriteInteger(7);</p><p> base.WriteString("6");</p><p> if (Item.ExtraData.Length <= 0) base.WriteInteger(0);</p><p> else base.WriteInteger(int.Parse(Item.ExtraData));</p><p> base.WriteInteger(100);</p><p> }</p><p> else if (Item.Data.InteractionType == InteractionType.PINATATRIGGERED)</p><p> {</p><p> base.WriteInteger(0);</p><p> base.WriteInteger(7); //</p><p> base.WriteString("0");</p><p> if (Item.ExtraData.Length <= 0) base.WriteInteger(0);</p><p> else base.WriteInteger(int.Parse(Item.ExtraData));</p><p> base.WriteInteger(1);</p><p> }</p><p> else if (Item.Data.InteractionType == InteractionType.MAGICEGG)</p><p> {</p><p> base.WriteInteger(0);</p><p> base.WriteInteger(7);</p><p> base.WriteString(Item.ExtraData);</p><p> if (Item.ExtraData.Length <= 0)</p><p> {</p><p> base.WriteInteger(0);</p><p> }</p><p> else</p><p> {</p><p> base.WriteInteger(int.Parse(Item.ExtraData));</p><p> }</p><p> base.WriteInteger(23);</p><p> }</p><p> else if (Item.Data.InteractionType == InteractionType.MAGICCHEST)</p><p> {</p><p> base.WriteInteger(0);</p><p> base.WriteInteger(7);</p><p> base.WriteString(Item.ExtraData);</p><p> if (Item.ExtraData.Length <= 0)</p><p> {</p><p> base.WriteInteger(0);</p><p> }</p><p> else</p><p> {</p><p> base.WriteInteger(int.Parse(Item.ExtraData));</p><p> }</p><p> base.WriteInteger(1);</p><p> }</p><p> else</p><p> {</p><p> ItemBehaviourUtility.GenerateExtradata(Item, this);</p><p> }</p><p></p><p> base.WriteInteger(-1); // to-do: check</p><p> base.WriteInteger((Item.GetBaseItem().Modes > 1) ? 1 : 0);</p><p> base.WriteInteger(UserID);</p><p> }</p><p> }</p><p>}</p><p>[/code]</p><p></p><p>Search where you do not have it and add part of the code of my page.</p><p></p><p>You can probably find</p><p>[code]private void WriteFloorItem(Item Item, int UserID)[/code]</p><p></p><p>And put the code of the 5th step, but adding (above all that)</p><p>[code]List<Item> l = new List<Item>();[/code]</p></blockquote><p></p>
[QUOTE="HTheAlexitoH, post: 437489, member: 70830"] My ObjectsComposer: [code] using System; using System.Linq; using System.Text; using System.Collections.Generic; using Cloud.Utilities; using Cloud.HabboHotel.Rooms; using Cloud.HabboHotel.Items; using Cloud.HabboHotel.Groups; using Cloud.HabboHotel.Users; namespace Cloud.Communication.Packets.Outgoing.Rooms.Engine { class ObjectsComposer : ServerPacket { public ObjectsComposer(Item[] Objects, Room Room) : base(ServerPacketHeader.ObjectsMessageComposer) { base.WriteInteger(1); base.WriteInteger(Room.OwnerId); base.WriteString(Room.OwnerName); List<Item> l = new List<Item>(); if (Room.HideWired) { for (int i = 0; i < Objects.Count(); i++) { Item it = Objects[i]; 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[i]; WriteFloorItem(Item, Convert.ToInt32(Item.UserID)); } } else { base.WriteInteger(Objects.Length); for (int i = 0; i < Objects.Count(); i++) { Item Item = Objects[i]; WriteFloorItem(Item, Convert.ToInt32(Item.UserID)); } } } private void WriteFloorItem(Item Item, int UserID) { base.WriteInteger(Item.Id); base.WriteInteger(Item.GetBaseItem().SpriteId); base.WriteInteger(Item.GetX); base.WriteInteger(Item.GetY); base.WriteInteger(Item.Rotation); base.WriteString(String.Format("{0:0.00}", TextHandling.GetString(Item.GetZ))); base.WriteString(String.Empty); if (Item.LimitedNo > 0) { base.WriteInteger(1); base.WriteInteger(256); base.WriteString(Item.ExtraData); base.WriteInteger(Item.LimitedNo); base.WriteInteger(Item.LimitedTot); } else if (Item.Data.InteractionType == InteractionType.FX_PROVIDER) { base.WriteInteger(0); base.WriteInteger(1); base.WriteInteger(1); base.WriteString("effectId"); base.WriteString(Item.ExtraData); } else if (Item.Data.InteractionType == InteractionType.PINATA) { base.WriteInteger(0); base.WriteInteger(7); base.WriteString("6"); if (Item.ExtraData.Length <= 0) base.WriteInteger(0); else base.WriteInteger(int.Parse(Item.ExtraData)); base.WriteInteger(100); } else if (Item.Data.InteractionType == InteractionType.PINATATRIGGERED) { base.WriteInteger(0); base.WriteInteger(7); // base.WriteString("0"); if (Item.ExtraData.Length <= 0) base.WriteInteger(0); else base.WriteInteger(int.Parse(Item.ExtraData)); base.WriteInteger(1); } else if (Item.Data.InteractionType == InteractionType.MAGICEGG) { base.WriteInteger(0); base.WriteInteger(7); base.WriteString(Item.ExtraData); if (Item.ExtraData.Length <= 0) { base.WriteInteger(0); } else { base.WriteInteger(int.Parse(Item.ExtraData)); } base.WriteInteger(23); } else if (Item.Data.InteractionType == InteractionType.MAGICCHEST) { base.WriteInteger(0); base.WriteInteger(7); base.WriteString(Item.ExtraData); if (Item.ExtraData.Length <= 0) { base.WriteInteger(0); } else { base.WriteInteger(int.Parse(Item.ExtraData)); } base.WriteInteger(1); } else { ItemBehaviourUtility.GenerateExtradata(Item, this); } base.WriteInteger(-1); // to-do: check base.WriteInteger((Item.GetBaseItem().Modes > 1) ? 1 : 0); base.WriteInteger(UserID); } } } [/code] Search where you do not have it and add part of the code of my page. You can probably find [code]private void WriteFloorItem(Item Item, int UserID)[/code] And put the code of the 5th step, but adding (above all that) [code]List<Item> l = new List<Item>();[/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
[Plus/Cloud/Osore] HideWired Command
Top