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
Wired not saved
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="tyutu" data-source="post: 435955" data-attributes="member: 71974"><p>I'm trying to add a Wired to my hotel, but its settings do not save. An example is the ResetAtSetTimeBox.cs, I open it normally takes a delay time and saved, but when I open it again the configuration is not saved.</p><p>[CODE]using System.Linq;</p><p>using System.Collections.Concurrent;</p><p></p><p>using Plus.Communication.Packets.Incoming;</p><p>using Plus.HabboHotel.Rooms;</p><p></p><p>namespace Plus.HabboHotel.Items.Wired.Boxes.Effects</p><p>{</p><p> internal class ResetAtSetTimeBox : IWiredItem</p><p> {</p><p> public Room Instance { get; set; }</p><p> public Item Item { get; set; }</p><p> public WiredBoxType Type { get { return WiredBoxType.EffectResetAtSetTime; } }</p><p> public ConcurrentDictionary<int, Item> SetItems { get; set; }</p><p> public int TickCount { get; set; }</p><p> public string StringData { get; set; }</p><p> public bool BoolData { get; set; }</p><p> public int Delay { get { return this._delay; } set { this._delay = value; this.TickCount = value; } }</p><p> public string ItemsData { get; set; }</p><p></p><p> private long _next;</p><p> private int _delay = 0;</p><p> private bool Requested = false;</p><p></p><p> public ResetAtSetTimeBox(Room Instance, Item Item)</p><p> {</p><p> this.Instance = Instance;</p><p> this.Item = Item;</p><p> this.SetItems = new ConcurrentDictionary<int, Item>();</p><p> }</p><p></p><p> public void HandleSave(ClientPacket Packet)</p><p> {</p><p> this.SetItems.Clear();</p><p> int Unknown = Packet.PopInt();</p><p> string Unknown2 = Packet.PopString();</p><p></p><p> int FurniCount = Packet.PopInt();</p><p> for (int i = 0; i < FurniCount; i++)</p><p> {</p><p> Item SelectedItem = Instance.GetRoomItemHandler().GetItem(Packet.PopInt());</p><p> if (SelectedItem != null)</p><p> SetItems.TryAdd(SelectedItem.Id, SelectedItem);</p><p> }</p><p></p><p> int Delay = Packet.PopInt();</p><p> this.Delay = Delay;</p><p> }</p><p></p><p> public bool Execute(params object[] Params)</p><p> {</p><p> if (this._next == 0 || this._next < PlusEnvironment.Now())</p><p> this._next = PlusEnvironment.Now() + this.Delay;</p><p></p><p></p><p> this.Requested = true;</p><p> this.TickCount = Delay;</p><p> return true;</p><p> }</p><p></p><p> public bool OnCycle()</p><p> {</p><p> if (this.SetItems.Count == 0 || !Requested)</p><p> return false;</p><p></p><p> long Now = PlusEnvironment.Now();</p><p> if (_next < Now)</p><p> {</p><p> foreach (Item Item in this.SetItems.Values.ToList())</p><p> {</p><p> if (Item == null)</p><p> continue;</p><p></p><p> if (!Instance.GetRoomItemHandler().GetFloor.Contains(Item))</p><p> {</p><p> Item n = null;</p><p> SetItems.TryRemove(Item.Id, out n);</p><p> continue;</p><p> }</p><p></p><p> Item.Interactor.OnWiredTrigger(Item);</p><p> }</p><p></p><p> Requested = false;</p><p></p><p> this._next = 0;</p><p> this.TickCount = Delay;</p><p></p><p> }</p><p> return true;</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="tyutu, post: 435955, member: 71974"] I'm trying to add a Wired to my hotel, but its settings do not save. An example is the ResetAtSetTimeBox.cs, I open it normally takes a delay time and saved, but when I open it again the configuration is not saved. [CODE]using System.Linq; using System.Collections.Concurrent; using Plus.Communication.Packets.Incoming; using Plus.HabboHotel.Rooms; namespace Plus.HabboHotel.Items.Wired.Boxes.Effects { internal class ResetAtSetTimeBox : IWiredItem { public Room Instance { get; set; } public Item Item { get; set; } public WiredBoxType Type { get { return WiredBoxType.EffectResetAtSetTime; } } public ConcurrentDictionary<int, Item> SetItems { get; set; } public int TickCount { get; set; } public string StringData { get; set; } public bool BoolData { get; set; } public int Delay { get { return this._delay; } set { this._delay = value; this.TickCount = value; } } public string ItemsData { get; set; } private long _next; private int _delay = 0; private bool Requested = false; public ResetAtSetTimeBox(Room Instance, Item Item) { this.Instance = Instance; this.Item = Item; this.SetItems = new ConcurrentDictionary<int, Item>(); } public void HandleSave(ClientPacket Packet) { this.SetItems.Clear(); int Unknown = Packet.PopInt(); string Unknown2 = Packet.PopString(); int FurniCount = Packet.PopInt(); for (int i = 0; i < FurniCount; i++) { Item SelectedItem = Instance.GetRoomItemHandler().GetItem(Packet.PopInt()); if (SelectedItem != null) SetItems.TryAdd(SelectedItem.Id, SelectedItem); } int Delay = Packet.PopInt(); this.Delay = Delay; } public bool Execute(params object[] Params) { if (this._next == 0 || this._next < PlusEnvironment.Now()) this._next = PlusEnvironment.Now() + this.Delay; this.Requested = true; this.TickCount = Delay; return true; } public bool OnCycle() { if (this.SetItems.Count == 0 || !Requested) return false; long Now = PlusEnvironment.Now(); if (_next < Now) { foreach (Item Item in this.SetItems.Values.ToList()) { if (Item == null) continue; if (!Instance.GetRoomItemHandler().GetFloor.Contains(Item)) { Item n = null; SetItems.TryRemove(Item.Id, out n); continue; } Item.Interactor.OnWiredTrigger(Item); } Requested = false; this._next = 0; this.TickCount = Delay; } return true; } } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Wired not saved
Top