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

Don't store internal data in msp.my #13

Closed GnomTEC closed 6 years ago

GnomTEC commented 6 years ago

msp.my is expected to be filled by the addon with data.

In my case i wipe msp.my before filling with new char data from internal addon db because empty fields are not stored there and i iterate through all stored fields and don't bother about which fields are not available and should be cleared.

Now i had to implement a workaround for 'TT' as it is used internal by LibMSP.

    local tt = msp.my['TT']
    wipe( msp.my )
    msp.my['TT'] = tt

    for field, value in pairs( GnomTEC_Badge.db.char["Flag"]["Fields"] ) do
        -- we also don't want to send ui escape sequences to others
        value = cleanpipe(value)
        msp.my[ field ] = value
    end
ghost commented 6 years ago

msp.my.TT was always listed in the header information as being an internal field. (i.e., in this old revision).

I assumed this was actually the case, when working on the rewrite. It's there as a shortcut for elsewhere in the code to not have to add a special case there instead.

GnomTEC commented 6 years ago

Yes, i checked this and you are right... probably i never read the header information. :-)

But anyway it's not a good idea, but i can live with it for now (expecting that nobody will add another internal value in this array).