• 0

    posted a message on LibDataBroker-1.1 not-really-official thread
    Quote from Tristanian
    Anyway I played around with this "crash dummy plugin" today and unfortunately I wasn't that much impressed. I got it to show (after numerous failed attempts with templates overriding each other). Everything seemed fine until I entered combat and ended up with a very nice 500kb action blocked taint log :p Apparently anchoring the plugin to non-secure buttons that can update their properties (eg width) dynamically, even in combat, was a bad idea, then I implemented a check to screw that specific update and got rid of the taint, until I decided to add something else (non-secure) on the display while in combat. Yep, it "exploded" again (not error, just action blocked). Then, there is the issue with potential script handlers being overridden by the display that uses specific handlers for movement or updating or whatnot. Sure you can probably "wrap" your functions around the existing handlers inherited but imo its a bit "hackish".

    I modified ButtonBin to test. Got the plugin to work, but as you said, ButtonBin was tainting like hell. The resize of anchored blocks makes it unpracticable with secure plugins in the way, as in-combat move/resize/hide/show are controlled. Implementing secure stuff would break too many features, so it's not worth it. The same goes for Fortress (and tekBlocks :p).

    It looks like it's preferable to design a secure display from the ground to perfectly fit secure plugins, than trying to add the secure feature to an existing display.

    So far, it seems SBC is the only *possible* candidate for secure stuff.

    Quote from funkydude
    I feel it's best if the display addon set's a secure attribute if the plugin is secure. then run OnEnter, and do normal things if it's not.

    Do you mean you will code a secure version of your OnEnter script ?

    I looked a bit into wrappers (never used them so far) and the ability to set a "pre" and "post" snippets seems good. Display would use the "pre" snippet since it's the one that can override/alterate the default script (if any, and if it's possibly tainting) and the plugin would use the "post" snippet.

    Possible problem is post snippets no being executed if there's no associated script to begin with. I will try that tomorrow. (Don't forget secure templates aren't just OnEnter/OnLeave but almost everything else, so that solution may not be for the best.)


    A wonderful guide to the new secure system I strongly encourage developers to read in their spare time: http://www.iriel.org/wow/docs/SecureHeadersGuide%20-%20pre1.pdf.
    Posted in: Data Broker AddOns
  • 0

    posted a message on LibDataBroker-1.1 not-really-official thread
    Quote from funkydude
    Ara like I said in pm I'm not sure how the secure stuff is supposed to mesh with non-secure when it comes to OnEnter. Since the display addon creates the script, then runs the function, I think what you're trying to do is make your own OnEnter, which is in my opinion the wrong way to do it. The display needs to set it.


    That's the interesting point (for me at least :p) where we (I) have to try to find an elegant solution that works for other scripts as you want your OnEnter because it's a part of your display feature, and some secure blocks requires the implementation of SecureHandlerEnterLeaveTemplate with attributes "_onenter" and "_onleave" to show/hide the menu properly in combat (and in my crash dummy plugin it serves as an anchor to pass attributes to the menu since there's 2 blocks for dual wielding capable classes :p).

    Quote from Tekkub
    If you implement it and users of your plugin and someone else's display like it, they *will* whine that it doesn't work with said display.

    Quote from Tekkub
    You simply cannot expect the display to handle all your fancy stuffs... but you could use those fancy bits to try to win users for your display.


    I think people are naturally lazy, and once they feel comfortable with a display, it's really hard to make them change, not to mention they have a tendency to irrationally defend "their" display, unless the author doesnt look active (like Fortress ?) :p

    Anyway, it's always good to plan a (not sure of the word) fallback (be it a shortcut to the missing functions or whatever).
    Posted in: Data Broker AddOns
  • 0

    posted a message on Button Bin - Minimalistic LDB display addon
    Quote from KnThrak
    Odd - I have Broker_Professions, and I could swear it works in combat. Granted I've never tried to build a Helicopter while healing an Archimonde raid, but I could swear it works. Just odd.

    Hrm, if tradeskills don't work, that'd be a real case for Secure Buttons. However my comment from before remains: Does it need to be LDB? (see TradesBar for example)
    The main reason for asking this is that from what I understand it'd be a huge addition and would likely (?) cause considerably code-bloat in the process.

    And if the gains are fairly limited in total number I'd find it codewise smarter to use specialized addons for those cases and keep LDB lean and mean. If that makes sense.


    CastSpellByName taints with everything except professions. But you missed the point: being able in combat to: cast spells (that are not professions), set targets and execute cycling macro on them, or applying a weapon buff that just vanished, or whatever is possible with secure stuff (alot!).

    It could be an ultra small addition. For exemple, I use a modified version of SBC that works with secure blocks. All I added is ", obj.secureTemplate" in an existing line, added the line "if obj.OnCreate then obj.OnCreate(obj, block) end", and added a check "if not obj.secureTemplate then *existing_code_here* end" to not apply a script, and it's working ! Not bloated at all and add a great deal of possibilities !

    But the last part is not really satisfying (well it is for me but not necessary for others :p). It requires a solution that lets displays and plugins use scripts/attributes in a non-conflicting/non-bloated way.

    Too bad there's very few authors that know how secure stuff works. It will probably take longer to find an elegant solution.
    Posted in: Data Broker AddOns
  • 0

    posted a message on Auto repair, need help please
    By the way, you can remove your CostString function and use the new API: GetCoinTextureString( amount, fontHeight ). http://forums.worldofwarcraft.com/thread.html?topicId=10043170854&pageNo=1&sid=1#5
    Posted in: Lua Code Discussion
  • 0

    posted a message on LibDataBroker-1.1 not-really-official thread
    Here is the *alpha* plugin I use to test secure stuff: http://perso.orange.fr/aranarth/wow/addons/Ara_Broker_Poisons-r2.zip (only tested with wotlk beta client).

    Currently, it doesnt provide an alternative for non-"secure compliant" displays, and simply doesn't show any menu OnEnter.

    It requires the display to use "secureTemplate" and "OnCreate" (I already provided implementation samples in previous posts). The difficult part is to not override the secure button with conflicting scripts (like OnEnter, if Funky can confirm :p) that's where you check for the presence of "secureTemplate" on the DO to not apply these scripts (or add wrappers/snippet ? to dig). I need more tests now to give more info.

    Be sure to buy some poisons, or bring oils (or warlock stones) to populate the plugin's buff menu (you can check the list of supported consumables in the code).

    @Funky: the config menu doesnt taint anymore on right click. The only thing I found that taint is when you check/uncheck the option to show/hide the buff frame while in combat. It just needs to be grayed out.

    (The initialization process of this "crash dummy plugin" is not easy to follow because I wanted to support AddonLoader. That complicated things. And right now I disabled it on the toc file because of a Blizzard bug with LoadManagers and LoadOnDemand :()

    @Tristanian: here is an exemple of a "secureTemplate" value: "SecureActionButtonTemplate,SecureHandlerEnterLeaveTemplate". It is used as 4th argument to CreateFrame. As Funky said, if the attribute is nil, the button will simply be non secure. (EDIT: the forum mangled the secureTemplate !! :p)
    Posted in: Data Broker AddOns
  • 0

    posted a message on ChatFrame_AddMessageEventFilter or ???
    We're talking about early blizzard's script code. Common pratice doesn't apply here :)

    If you stay into their pre BC code for too long, you will easily forget how to do a simple table lookup and go crazy with 400 gsub. Seriouly :) Take a look at FrameXML\ChatFrame.lua:2217
    function ChatFrame_MessageEventHandler(self, event, ...)
    	if ( strsub(event, 1, 8) == "CHAT_MSG" ) then
    		local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11 = ...;
    		local type = strsub(event, 10);
    		local info = ChatTypeInfo[type];
    
    		local filter, newarg1 = false;
    		if ( chatFilters[event] ) then
    			for _, filterFunc in next, chatFilters[event] do
    				filter, newarg1 = filterFunc(arg1);
    				arg1 = (newarg1 or arg1);
    				if ( filter ) then
    					return true;
    				end
    			end
    		end
    		
    		local channelLength = strlen(arg4);
    		if ( (strsub(type, 1, 7) == "CHANNEL") and (type ~= "CHANNEL_LIST") and ((arg1 ~= "INVITE") or (type ~= "CHANNEL_NOTICE_USER")) ) then
    			if ( arg1 == "WRONG_PASSWORD" ) then
    				local staticPopup = getglobal(StaticPopup_Visible("CHAT_CHANNEL_PASSWORD") or "");
    				if ( staticPopup and staticPopup.data == arg9 ) then
    					-- Don't display invalid password messages if we're going to prompt for a password (bug 102312)
    					return;
    				end
    			end
    			
    			local found = 0;
    			for index, value in pairs(self.channelList) do
    				if ( channelLength > strlen(value) ) then
    					-- arg9 is the channel name without the number in front...
    					if ( ((arg7 > 0) and (self.zoneChannelList[index] == arg7)) or (strupper(value) == strupper(arg9)) ) then
    						found = 1;
    						info = ChatTypeInfo["CHANNEL"..arg8];
    						if ( (type == "CHANNEL_NOTICE") and (arg1 == "YOU_LEFT") ) then
    							self.channelList[index] = nil;
    							self.zoneChannelList[index] = nil;
    						end
    						break;
    					end
    				end
    			end
    			if ( (found == 0) or not info ) then
    				return true;
    			end
    		end
    
    		if ( type == "SYSTEM" or type == "TEXT_EMOTE" or type == "SKILL" or type == "LOOT" or type == "MONEY" or
    		     type == "OPENING" or type == "TRADESKILLS" or type == "PET_INFO" ) then
    			self:AddMessage(arg1, info.r, info.g, info.b, info.id);
    		elseif ( strsub(type,1,7) == "COMBAT_" ) then
    			self:AddMessage(arg1, info.r, info.g, info.b, info.id);
    		elseif ( strsub(type,1,6) == "SPELL_" ) then
    			self:AddMessage(arg1, info.r, info.g, info.b, info.id);
    		elseif ( strsub(type,1,10) == "BG_SYSTEM_" ) then
    			self:AddMessage(arg1, info.r, info.g, info.b, info.id);
    		elseif ( strsub(type,1,11) == "ACHIEVEMENT" ) then
    			self:AddMessage(arg1, info.r, info.g, info.b, info.id);
    		elseif ( strsub(type,1,18) == "GUILD_ACHIEVEMENT" ) then
    			self:AddMessage(arg1, info.r, info.g, info.b, info.id);
    		elseif ( type == "IGNORED" ) then
    			self:AddMessage(format(CHAT_IGNORED, arg2), info.r, info.g, info.b, info.id);
    		elseif ( type == "FILTERED" ) then
    			self:AddMessage(format(CHAT_FILTERED, arg2), info.r, info.g, info.b, info.id);
    		elseif ( type == "RESTRICTED" ) then
    			self:AddMessage(CHAT_RESTRICTED, info.r, info.g, info.b, info.id);
    		elseif ( type == "CHANNEL_LIST") then
    			if(channelLength > 0) then
    				self:AddMessage(format(getglobal("CHAT_"..type.."_GET")..arg1, tonumber(arg8), arg4), info.r, info.g, info.b, info.id);
    			else
    				self:AddMessage(arg1, info.r, info.g, info.b, info.id);
    			end
    		elseif (type == "CHANNEL_NOTICE_USER") then
    			if(strlen(arg5) > 0) then
    				-- TWO users in this notice (E.G. x kicked y)
    				self:AddMessage(format(getglobal("CHAT_"..arg1.."_NOTICE"), arg8, arg4, arg2, arg5), info.r, info.g, info.b, info.id);
    			elseif ( arg1 == "INVITE" ) then
    				self:AddMessage(format(getglobal("CHAT_"..arg1.."_NOTICE"), arg4, arg2), info.r, info.g, info.b, info.id);
    			else
    				self:AddMessage(format(getglobal("CHAT_"..arg1.."_NOTICE"), arg8, arg4, arg2), info.r, info.g, info.b, info.id);
    			end
    		elseif (type == "CHANNEL_NOTICE") then
    ...
    

    Dont try to hang youself afterward, and tell me "it's well done" :)

    PS: I only pasted half of the function, but the second part is unimaginably worse like this (line 2347):
    body = format(getglobal("CHAT_"..type.."_GET")..languageHeader..arg1, pflag.."|Hplayer:"..arg2..":"..arg11.."|h".."["..arg2.."]".."|h");
    

    It's hilarous to find 13 ".." concat (which means 13 string created) when he seems to know that format exists xD

    Sorry for this bad mouthing, but it's good to laugh some times :p
    Posted in: Lua Code Discussion
  • 0

    posted a message on ChatFrame_AddMessageEventFilter or ???
    Quote from Mikk
    Stop hitting the glue bottle so deep and read my code. The locals are called a1..aN, the globals are called arg1..argN. They do not interfere.


    His point was: whatever1..whateverN could hide arg1..argN.

    But I just tested and it's not (or no longer) the case.
    Posted in: Lua Code Discussion
  • 0

    posted a message on LibDataBroker-1.1 not-really-official thread
    I would like to extend the LDB spec for displays that would like to add support for secure stuff (mostly buttons). But Im just a plugin author, not a display author (yet), so implementation need to be discussed. Here is how I see it:

    The secure object requires 2 DO's attributes, both set by the plugin at DO's creation time:
    - one string (DO.secureTemplate) that hold a list of secure templates. It will be used by the display when calling CreateFrame to create the button. This is the attribute of choice for the display to check if we have to deal with secure stuff.
    - one function (DO.OnCreate) that will be called by the display once it has set everything, to let the plugin implements the secure templates. Function definition: function( DO, button ). The DO argument is also interesting for plugins that want to create multiple blocks and don't know what block is entered; with that it could set cross references between DOs and buttons, and more.

    The function attribute may also be used by non secure objects as a way to get cosmetical informations (ie: a plugin could retrieve the font to apply it on its tooltip to look more integrated, and with libTooltip coming soon that may be interesting).

    These 2 attributes don't require any callback registrations, as it is only used to initialize the button.

    @Tristanian: IMHO there's no need for exemples, reading comments from FrameXML\SecureTemplates.lua and associated files, and, why not, the new secure system with wrappers and snippet of code here, will highlight possibilities, then it's up to the author to find what he want to do with all that. Think of possible combat management if you want.

    The important part is how scripts/attributes/wrappers are handled, who use what, etc.

    If it helps displays, we could set the "type" attribute to something like "secure". But the plugin will still have to provide the secure templates so that could be redundant, not to mention that "type" attributes may not be all exclusive.

    (more to come ?)
    Posted in: Data Broker AddOns
  • 0

    posted a message on Button Bin - Minimalistic LDB display addon
    Quote from Tristanian
    I would love to sell the idea honestly, I'd like to believe I'm open minded and all that :p but all I've seen so far is some basic examples. Can we have the custom spec outlined for us please or at least a very rough idea so we can brainstorm and discuss it. For instance, what kind of attributes do we need in the LDB object (I've seen 2-3 so far explained), which ones are displays going to use, which ones will be used purely by the DO. What is the proposed way that a display goes about "detecting" the spec (let's say set type attribute to "secure object"), does the display need to fire/register callbacks and if yes when and how (I've seen so far that the display may/will need to detect and call a func defined by the DO). This is the kind of thing I'm talking about when I say "outline the spec". Without this plus some solid, useful examples (call me weird but using tradeskills or applying weapon buffs when I'm fighting a mob that is about to eat me for breakfast isn't exactly very common, on the other hand let's say storing target(s) on a button/block is something that may interest me), this is all vaporware.


    Let's discuss about it in the LDB thread. Thought Im not gifted with words and will have to chose them carefully. It's hard if you're not fluent in english, and as some philosopher said: "people forgive more easily bad actions than bad mouthing" :p

    Quote from Caliban7263
    I couldn't find it on wowinterface.com - only "Ara Broker Guild Friends" and "Ara Dotimer"...

    It has yet to be released, there's alot of polishing to do before and maybe a redesign of the way to handle tradeskill CDs (there's alot of mouse/modifier combo in the shadow if you wanna try that alpha version :p).
    Posted in: Data Broker AddOns
  • 0

    posted a message on GUID to Player Name
    There is no way to work with GUID, intentionally.

    Anyway, I can't think of a case where you can't or don't get the name associated with that GUID:
    - In combat events you get both GUID and Name for source and destination.
    - When you use UnitGUID(unit) you can chain with UnitName(unit).
    Posted in: Lua Code Discussion
  • 0

    posted a message on Button Bin - Minimalistic LDB display addon
    Quote from Tristanian
    There is no need to extend the basic LDB spec. You are basically asking display authors to support a/your custom LDB spec. To be perfectly honest, I'm not that crazy about secure buttons as LDB objects, it creates a huge headache of possible issues with the buttons been created with proper handlers so that that won't taint every second, plus it's an implementation mostly suited for action buttons/action bars/action whatever rather than data feeds, but I'm willing to see how you picture this working.


    I was asked what could use secure stuff, and I gave concrete exemples with my addons. But give the possibility and you will see other authors that will start to make use of it. It's just a matter of time. (Exploring all the possibilities, always trying to achieve what was impossible before, is what I think is so great about programming :p)

    I see many addon authors that cower in fear when they hear "secure" and only think of taint issues and horribly complexe implementations. Let's prove they are dead wrong. As of 3.0, secure stuff has never been so easy and flexible to use. Also, Alestane and Iriel released a very detailed guide for everyone to start using it from scratch.

    I really want LDB to be more than just text and config shortcuts. You can largely widen the possibilities in a few lines! Ever wanted to promote LDB over *similar* addons ? Be the first to implement this! (Damn Im so bad to sell the idea it hurts :p)
    Posted in: Data Broker AddOns
  • 0

    posted a message on Button Bin - Minimalistic LDB display addon
    Quote from dhedbor
    Problem implementing this is that it isn't part of the LDB definition. I'm a bit vary of adding special hacks to support something like this. Perhaps it'd be better to discuss the implications and implementation details in a general LDB thread?


    Quote from Torhal
    Definitely. This sounds like a possible spec-update, and I'd hope this would be under general concensus rather than a Microsoft-style "because we want to do this, and we don't care about the spec" action.


    Sure, as I posted in the SBC thread: more display may want to allow secure buttons and I think we should standardize the field names and extend the LDB spec (It's probably been made extensible just to support secure stuff !!;):rolleyes:).

    I made a vague request in the LDB thread 2 days ago, but got no answer at all, so I contacted LDB display authors instead :p
    Posted in: Data Broker AddOns
  • 0

    posted a message on StatBlockCore v2: Make use of your broker plugins!
    Quote from funkydude
    I haven't come across a plugin that would need this yet.

    I made a post about plugins that are limited and would benefit or could be made with secure buttons: http://forums.wowace.com/showthread.php?t=13736&page=8#79

    I think the implementation could be done easily. For exemple you would change
    local newBlock = _G.CreateFrame("Button", "StatBlockCore_"..name, UIParent)

    into
    local newBlock = _G.CreateFrame("Button", "StatBlockCore_"..name, UIParent, obj.secureTemplate)

    That way, only plugins that use the "secureTemplate" field will see their button secure; other buttons will remain standard.

    Also, add the following line after you finish your part of the initialization:
    if obj.OnCreate then obj.OnCreate(obj, newBlock) end

    That way, the plugin would be able to initialize the button actions (attributes) before the player can interact.

    EDIT: removed code for OnDrag* as there's no need for it. Still, I think it would be better to declare your functions outside so you don't create closures for each block (except mousewheel which use local values). I modified your code and it works well, netting some memory.

    Only taint I got was from mousewheel on secure buttons in combat (not a big deal), everything else is fine.

    More display may want to allow secure buttons and I think we should standardize the field names and extend the LDB spec (It's been probably made extensible just to support secure stuff !! ;) :rolleyes:).
    Posted in: Data Broker AddOns
  • 0

    posted a message on Button Bin - Minimalistic LDB display addon
    Quote from dhedbor
    I'll investiage the possibility of making secure buttons work in ButtonBin (most likely on a per-bin level). The drawbacks of course is that things can't be moved or resized during combat which would require some tweaking.


    Secure stuff would need some communications between the plugin and the display. Using fields on the data object would be the perfect place:
    - a "secure" or "secureTemplate" field, supplied by the plugin to provide the template(s) string, used by the display as the 4th argument of CreateFrame. That way, only plugins that provide a template field would get secure buttons, other plugins would still get their standard one.
    - a "callback" or "OnCreate" field, supplied by the plugin that contains a function that the display would call upon creation of the button with the button reference as first argument. (This is needed by the plugin to initialize attributes before the user can interact.)

    EDIT: removed the secure _ondrag* attributes stuff, it's not a drawback :)
    Posted in: Data Broker AddOns
  • 0

    posted a message on Button Bin - Minimalistic LDB display addon
    (Warning, entering Rowne mode)

    Quote from dhedbor
    Secure buttons? Hasn't crossed my mind. What kind of addon do you have that would need this? Seems somewhat backwards to how LDB displayers work but if you got a real example...


    I think an LDB displayer could be more than just a "display". With secure buttons you widen the field of addon possibilities. Casting spells, targeting, using items (on other items), executing macros, setting maintanks, changing other control attributes, cycling multiple actions, using 2 actions in one click with the PreClick and PostClick wrappers, lists of dynamic size... all out AND in combat.

    For concrete exemples, I have an alpha plugin (actually only working with SBC through dirty tricks) that allow to apply stones/oils/poisons on main hand and off hand depending of the block (the secure menu is shared between these two secure buttons that use SecureHandlerEnterLeaveTemplate to display the stone/oil/poison selection menu and serve as anchors to dynamically set the "item-slot" attributes of the consumable buttons in the menu, and of course a SecureActionButtonTemplate to refresh the previous applied buff on click, show a config menu on right-click and remove weapon buff on middle click.)
    You can get it here: http://forums.wowace.com/showthread.php?t=13616.

    Also, there's at least 2 plugins I made that would benefit from an "in combat" use:
    - Ara Broker Guild & Friends: http://www.wowinterface.com/downloads/info11205-Ara_Broker_Guild_Friends.html to whisp a guilmate in combat in just one quick click and other available actions.
    - Ara Broker Tradeskills: screen sample here: http://perso.orange.fr/aranarth/wow/ara_broker_tradeskills_01.jpg and alpha download here: http://perso.orange.fr/aranarth/wow/addons/Ara_Tradeskills.zip. Having to wait the end of combat notification to use tradeskills or check other infos from the menu is annoying.

    I have another pre 3.0 project that requires a rewrite but would be able to do more than what it did. What it did was displaying a list of missing (or present, while holding a configurable keybind) buffs (food, flasks or elixirs, oils, class buffs including talented ones like demonic sacrifice or soul link) that could be clicked to recast. With a submenu in case there's, say, different buff possibilities for the same category (like hit food, AP food or stam food).
    With LDB secure buttons I could make a block that shows the next missing buff, you could chain click to rebuff (or use keybinds to skip or apply); on enter, the clickable menu I was talking above would show, etc...

    There's more than that to share and I know other devs that would like to benefit from all the features of secure stuff. But what is lacking is a "display" that holds the power to give life to these projects (and give the possibility to improve previous plugins :))

    If you're interested, there's some spec to discuss :p
    Posted in: Data Broker AddOns
  • To post a comment, please or register a new account.