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 Q&A
HabboEMU - Furniture owner issue
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="Damien" data-source="post: 447229" data-attributes="member: 72299"><p>inside the <strong>ObjectsComposer.cs </strong>and <strong>ItemsComposer.cs </strong>classes add this method:</p><p>[CODE]</p><p>private void WriteFurniOwners(Item[] Objects)</p><p>{</p><p> Dictionary<int, string> furniOwners = new Dictionary<int, string>();</p><p> foreach (Item Item in Objects)</p><p> {</p><p> if (!furniOwners.ContainsKey(Item.UserID))</p><p> furniOwners.Add(Item.UserID, Item.Username);</p><p> }</p><p></p><p> WriteInteger(furniOwners.Count);</p><p> foreach (var furniOwner in furniOwners)</p><p> {</p><p> WriteInteger(furniOwner.Key);</p><p> WriteString(furniOwner.Value);</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p></p><p>Then replace that first loop with this:</p><p>[CODE]</p><p>WriteFurniOwners(Objects);</p><p>[/CODE]</p><p></p><p></p><p>And it should look something like this:</p><p><img src="https://image.prntscr.com/image/l7E7okZsTpqq-jB7N2H_Pg.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p><span style="color: rgb(163, 143, 132)">This is not the best solution. A better solution would be to create a dictionary in the room class that handles that data and load the data when the items are loaded.</span></p></blockquote><p></p>
[QUOTE="Damien, post: 447229, member: 72299"] inside the [B]ObjectsComposer.cs [/B]and [B]ItemsComposer.cs [/B]classes add this method: [CODE] private void WriteFurniOwners(Item[] Objects) { Dictionary<int, string> furniOwners = new Dictionary<int, string>(); foreach (Item Item in Objects) { if (!furniOwners.ContainsKey(Item.UserID)) furniOwners.Add(Item.UserID, Item.Username); } WriteInteger(furniOwners.Count); foreach (var furniOwner in furniOwners) { WriteInteger(furniOwner.Key); WriteString(furniOwner.Value); } } [/CODE] Then replace that first loop with this: [CODE] WriteFurniOwners(Objects); [/CODE] And it should look something like this: [IMG]https://image.prntscr.com/image/l7E7okZsTpqq-jB7N2H_Pg.png[/IMG] [COLOR=rgb(163, 143, 132)]This is not the best solution. A better solution would be to create a dictionary in the room class that handles that data and load the data when the items are loaded.[/COLOR] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
HabboEMU - Furniture owner issue
Top