quest global vars : wildcards behavior
i was a bit worried about the way the global variables are organized :
whenever you set a variable 'name' to 'value', the code checks for var with such name that already applies, and removes them. e.g you can't have a (charid, name) variable if (otherchar, name), or (anychar, name). Such variables would apply, you would retrieve them, and the code prevents ambigous cases where you get 2 values for a name (as charid is one of anychar) Code:
// clean up expired vars and get rid of the one we're going to set if there e.g. try targlobal a variable for a (player,npc,zone), you will delete all vars with the same name that are anyzone, any player, or anynpc, no matter if they apply to this player or not. i suggest changing this. The deletion query would be : Code:
DELETE FROM quest_globals WHERE expdate < %li || (name='%s' && ((npcid=0 || npcid=%i ) && ( charid=0 || charid=%i) && (zoneid=0 ||zoneid=%i))) Code:
DELETE FROM quest_globals WHERE expdate < %li || (name='%s' && (npcid=%i ) && (charid=%i) && (zoneid=%i))) This will however give several variables with same name in the Embparser::Event process. But, simply by changing the query to sort results, you can apply precedence of more-specific over less-specific, saying : Code:
database.RunQuery(query, MakeAnyLenString(&query, The results are more conform to what i thought wildcards should be. I'd like to know what you think. |
All times are GMT -4. The time now is 06:30 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.