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 Tutorials
[Plusr2] How to create room bundles (for newbs)
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="JayC" data-source="post: 451451" data-attributes="member: 36373"><p>I stepped through on debug mode, and its getting the items correctly. If I put nothing on the page, the page loads in the catalog. The items are being created with the correct Item ID and amount. Here is my catalog composer:</p><p>[CODE]if (!Page.Template.Equals("frontpage") && !Page.Template.Equals("club_buy"))</p><p> {</p><p> base.WriteInteger(Page.Items.Count);</p><p> foreach (CatalogItem Item in Page.Items.Values)</p><p> {</p><p> base.WriteInteger(Item.Id);</p><p> base.WriteString(Item.Name);</p><p> base.WriteBoolean(false);//IsRentable</p><p> base.WriteInteger(Item.CostCredits);</p><p></p><p> </p><p>if (Item.CostDiamonds > 0)</p><p> {</p><p> WriteInteger(Item.CostDiamonds);</p><p> WriteInteger(5); // Diamonds</p><p> }</p><p></p><p> if (Item.CostPixels > 0)</p><p> {</p><p> WriteInteger(Item.CostPixels);</p><p> WriteInteger(0); // Duckets</p><p> }</p><p></p><p> if (Item.CostPoints > 0)</p><p> {</p><p> WriteInteger(Item.CostPoints);</p><p> WriteInteger(103); // GOTW Points</p><p> }</p><p></p><p> base.WriteBoolean(ItemUtility.CanGiftItem(Item));</p><p></p><p> if (Item.Data.InteractionType == InteractionType.DEAL || Item.Data.InteractionType == InteractionType.ROOMDEAL)</p><p> {</p><p> CatalogDeal deal = null;</p><p> if (!PlusEnvironment.GetGame().GetCatalog().TryGetDeal(Item.Data.BehaviourData, out deal))</p><p> {</p><p> WriteInteger(0);//Count</p><p> }</p><p> else</p><p> {</p><p> WriteInteger(deal.ItemDataList.Count);</p><p></p><p> foreach (CatalogItem dealItem in deal.ItemDataList.ToList())</p><p> {</p><p> WriteString(dealItem.Data.Type.ToString());</p><p> WriteInteger(dealItem.Data.SpriteId);</p><p> WriteString("");</p><p> WriteInteger(dealItem.Amount);</p><p> WriteBoolean(false);</p><p> }</p><p> }</p><p> }</p><p> else</p><p> {</p><p> base.WriteInteger(string.IsNullOrEmpty(Item.Badge) ? 1 : 2);//Count 1 item if there is no badge, otherwise count as 2.</p><p> {</p><p> if (!string.IsNullOrEmpty(Item.Badge))</p><p> {</p><p> base.WriteString("b");</p><p> base.WriteString(Item.Badge);</p><p> }</p><p></p><p> base.WriteString(Item.Data.Type.ToString());</p><p> if (Item.Data.Type.ToString().ToLower() == "b")</p><p> {</p><p> //This is just a badge, append the name.</p><p> base.WriteString(Item.Data.ItemName);</p><p> }</p><p> else</p><p> {</p><p> base.WriteInteger(Item.Data.SpriteId);</p><p> if (Item.Data.InteractionType == InteractionType.WALLPAPER || Item.Data.InteractionType == InteractionType.FLOOR || Item.Data.InteractionType == InteractionType.LANDSCAPE)</p><p> {</p><p> base.WriteString(Item.Name.Split('_')[2]);</p><p> }</p><p> else if (Item.Data.InteractionType == InteractionType.BOT)//Bots</p><p> {</p><p> CatalogBot CatalogBot = null;</p><p> if (!PlusEnvironment.GetGame().GetCatalog().TryGetBot(Item.ItemId, out CatalogBot))</p><p> base.WriteString("hd-180-7.ea-1406-62.ch-210-1321.hr-831-49.ca-1813-62.sh-295-1321.lg-285-92");</p><p> else</p><p> base.WriteString(CatalogBot.Figure);</p><p> }</p><p> else if (Item.ExtraData != null)</p><p> {</p><p> base.WriteString(Item.ExtraData != null ? Item.ExtraData : string.Empty);</p><p> }</p><p> base.WriteInteger(Item.Amount);</p><p> base.WriteBoolean(Item.IsLimited); // IsLimited</p><p> if (Item.IsLimited)</p><p> {</p><p> base.WriteInteger(Item.LimitedEditionStack);</p><p> base.WriteInteger(Item.LimitedEditionStack - Item.LimitedEditionSells);</p><p> }</p><p> }</p><p> base.WriteInteger(0); //club_level</p><p> base.WriteBoolean(ItemUtility.CanSelectAmount(Item));</p><p> base.WriteBoolean(true);</p><p> base.WriteString("");</p><p> }</p><p> }</p><p> }</p><p> }[/CODE]</p><p></p><p>My guess is I am not writing out to the packet correctly.</p></blockquote><p></p>
[QUOTE="JayC, post: 451451, member: 36373"] I stepped through on debug mode, and its getting the items correctly. If I put nothing on the page, the page loads in the catalog. The items are being created with the correct Item ID and amount. Here is my catalog composer: [CODE]if (!Page.Template.Equals("frontpage") && !Page.Template.Equals("club_buy")) { base.WriteInteger(Page.Items.Count); foreach (CatalogItem Item in Page.Items.Values) { base.WriteInteger(Item.Id); base.WriteString(Item.Name); base.WriteBoolean(false);//IsRentable base.WriteInteger(Item.CostCredits); if (Item.CostDiamonds > 0) { WriteInteger(Item.CostDiamonds); WriteInteger(5); // Diamonds } if (Item.CostPixels > 0) { WriteInteger(Item.CostPixels); WriteInteger(0); // Duckets } if (Item.CostPoints > 0) { WriteInteger(Item.CostPoints); WriteInteger(103); // GOTW Points } base.WriteBoolean(ItemUtility.CanGiftItem(Item)); if (Item.Data.InteractionType == InteractionType.DEAL || Item.Data.InteractionType == InteractionType.ROOMDEAL) { CatalogDeal deal = null; if (!PlusEnvironment.GetGame().GetCatalog().TryGetDeal(Item.Data.BehaviourData, out deal)) { WriteInteger(0);//Count } else { WriteInteger(deal.ItemDataList.Count); foreach (CatalogItem dealItem in deal.ItemDataList.ToList()) { WriteString(dealItem.Data.Type.ToString()); WriteInteger(dealItem.Data.SpriteId); WriteString(""); WriteInteger(dealItem.Amount); WriteBoolean(false); } } } else { base.WriteInteger(string.IsNullOrEmpty(Item.Badge) ? 1 : 2);//Count 1 item if there is no badge, otherwise count as 2. { if (!string.IsNullOrEmpty(Item.Badge)) { base.WriteString("b"); base.WriteString(Item.Badge); } base.WriteString(Item.Data.Type.ToString()); if (Item.Data.Type.ToString().ToLower() == "b") { //This is just a badge, append the name. base.WriteString(Item.Data.ItemName); } else { base.WriteInteger(Item.Data.SpriteId); if (Item.Data.InteractionType == InteractionType.WALLPAPER || Item.Data.InteractionType == InteractionType.FLOOR || Item.Data.InteractionType == InteractionType.LANDSCAPE) { base.WriteString(Item.Name.Split('_')[2]); } else if (Item.Data.InteractionType == InteractionType.BOT)//Bots { CatalogBot CatalogBot = null; if (!PlusEnvironment.GetGame().GetCatalog().TryGetBot(Item.ItemId, out CatalogBot)) base.WriteString("hd-180-7.ea-1406-62.ch-210-1321.hr-831-49.ca-1813-62.sh-295-1321.lg-285-92"); else base.WriteString(CatalogBot.Figure); } else if (Item.ExtraData != null) { base.WriteString(Item.ExtraData != null ? Item.ExtraData : string.Empty); } base.WriteInteger(Item.Amount); base.WriteBoolean(Item.IsLimited); // IsLimited if (Item.IsLimited) { base.WriteInteger(Item.LimitedEditionStack); base.WriteInteger(Item.LimitedEditionStack - Item.LimitedEditionSells); } } base.WriteInteger(0); //club_level base.WriteBoolean(ItemUtility.CanSelectAmount(Item)); base.WriteBoolean(true); base.WriteString(""); } } } }[/CODE] My guess is I am not writing out to the packet correctly. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Tutorials
[Plusr2] How to create room bundles (for newbs)
Top