wow-rp-addons / LibMSP

The “Mary Sue Protocol” (“MSP” for short) is a simple challenge/response protocol for RP UI add-ons within WoW to communicate with each other and publish text information to other clients (such as RP character names and descriptions).
Creative Commons Zero v1.0 Universal
2 stars 1 forks source link

Add Unit function-based fields to LibMSP #10

Closed ghost closed 6 years ago

ghost commented 6 years ago

These, along with VP, should be the domain of LibMSP. During msp:Update() it may make sense to fill out all the unit fields with their proper data, instead of relying on the parent addon to do it for us.

The Unit function fields are:

As these are supposed to be filled exclusively with appropriate data from those functions, it makes more sense to me if we handle them in LibMSP during msp:Update(), rather than expect other addons to handle them properly.

The downside is that this may necessitate adding a PLAYER_LOGIN handler of some sort, as some of those functions (notably UnitGUID()) are not necessarily guaranteed to work prior to login being completed. I've considered adding a "Chomp loaded" callback to Chomp (which would occur during PLAYER_LOGIN), so if I do that we could make use of that here to save a bit of overhead with a frame and such.

The upside of the downside is that some addons don't currently delay their user of UnitGUID() to PLAYER_LOGIN, so it doesn't always get reliably set.

Any comments, additions, or objections @Ellypse?

GnomTEC commented 6 years ago

I have no problem with this, but probably i will fill this field anyway in my addon as i don't like to think about which field i have to set and which not. For me it is more consistent if i set all fields, so i know i have nothing forgotten. :-)

And beside this, good work from you here in this projekt and also from Ellypse. I'm happy that we try to get a common baseline for our addons.

ghost commented 6 years ago

It'll work perfectly fine if you set them yourself. This is mainly a fallback to make sure that addons like MRP don't run into the situation with UnitGUID() where it doesn't get filled because they're trying to do it before PLAYER_LOGIN.

Also, please test GnomTEC as much as you can with the latest development branch (8.0 only), and file bugs with any problems you encounter! The new LibMSP should be API-compatible with the old, but it's possible I made a mistake somewhere along the way.

I'll be tagging a v10 release by the end of this weekend, which should be ideal for shipping with 8.0-only updates to addons.

ghost commented 6 years ago

Fixed in development branch, closing.