What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Q: Settings load error handling, chat hooks etc.

yury2808

New Member
Joined
Jun 30, 2011
Messages
53
Reaction score
0
Heya,

While server is down - right time to question some things I was fighting recently with as a plugin writer.

First thing I've found was crashing on settings load when using "double" as setting object property: most of the time, it (HB core) was unable to parse it from the XML.

Inspecting the settings XML - it was allright, but on load the initial settings get failed...

Assuming, I can NOT construct Styx.Helpers.Settings class without the path to the setting file and I can't catch particular property of it being failed, the Q is:

How to correctly handle the situation, when settings are broken for some reason? Is there a right way to init with defaults (fully/partially) when load crashes?

Next one I'm curious of: is it possible to get "alive" hooking of LUA/HB chat events when bot is loaded, but not yet started?

At the moment, HB does not fire these events to the plugin until you "start", but rather keep "backlog" of the events and then fire bunch of them on start. (might be wrong on this, though).

Last, but not least: is there a "right" way to get the main winform object to get invokes via it for the threading purposes? Surething, I might find it using some .net internals, but if there is an API provided by HB, it would be most correct way to do it.

Thank you,
Me.
 
Back
Top