• 0

    posted a message on Officially stumped
    Except it doesn't seem to be embedding properly based on the errors he's been reporting.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Officially stumped
    I think you can fix the AceComm stuff by doing something like

    AceComm.RegisterComm(lib, "gBankComm", "OnCommReceived")


    And then anywhere you send data you'd use this pattern
    AceComm.SendCommMessage(lib, "gBankComm", message, "WHISPER", sender, "BULK")


    Essentially the same as before, except you call the functions with dot notation and specify the library object as the explicit "self" parameter.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Officially stumped
    Actually, he is correct. The sender parameter is a unit name, not a unitID. You should be doing a comparison like
    if sender == UnitName("player") then return end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Officially stumped
    AceComm:Embed(lib)
    lib:RegisterComm("gBankComm", "OnCommReceived")


    That combo doesn't work?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Officially stumped
    It's looking good. I fixed some needless table generation in the GUILDBANKFRAME_OPEN function. I also cleaned up the table access in GUILDBANKBAGSLOTS_CHANGED. (I also changed it to not store anything for empty slots, since this is how MobileVault handles it, but you could change it back.)

    http://pastey.net/143580
    Posted in: Lua Code Discussion
  • 0

    posted a message on Officially stumped
    For #2:
    Well, you could generate a hash value of the serialized tables and send that first. Then send the tables. Then on the receiver's side hash the serialized table and compare the hashes. If they match then everything was received.

    I think somebody mentioned Allara's CRC32 code either in this thread or the official GBankComm thread.

    Edit: LibCompress: http://www.wowace.com/addons/libcompress/ Might be worth looking at the compression and/or the check-summing.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Officially stumped
    Quote from myrroddin

    Or... something like this? The only thing that makes me cringe is the G_R_U() function. Wasn't there something about "arg1" being depreciated?


    The global variable arg1 was depreciated. But you named the first parameter of the event function arg1 so that is fine... if a little vague for people looking at your code.

    Personally I'd name that parameter "wasLocalChange" based on the Wowpedia description of the the event.

    arg1 nil if this event was triggered by the client cache being updated after a call to GuildRoster, 1 if there was a local change to Guild roster data
    Posted in: Lua Code Discussion
  • 0

    posted a message on Officially stumped
    No that wouldn't be better, as the lib stands now that would erase the saved guild bank stuff. You should probably do something like

    lib.guildBank = {
        [1] = {
            links = {},  --store the slot item links here
            stacks = {}, --store the slot stack counts here
            name = "Tab Name",
            texture = "path\\to\\tab_texture",
            canView = true, --or false depending
        },
        ...
        --or to how ever many tab the bank has
        [8] = {
            links = {},  --store the slot item links here
            stacks = {}, --store the slot stack counts here
            name = "Tab Name",
            texture = "path\\to\\tab_texture",
            canView = true, --or false depending
        }
    }


    Have lib.guildBank just be the guild bank and nothing more. If you need the guild name keep it in lib.guildName or something.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Officially stumped
    You save the player's name as pName, but index the tables with player.

    Edit: You also keep switching lib.guildBank[guildName] from a string to a table and back again, all over the place.

    I.E.
     lib.guildBank[guildName] = guildName 


    Then trying to index it
     lib.guildBank[guildName][page..i] = nil 
    Posted in: Lua Code Discussion
  • 0

    posted a message on Officially stumped
    In the ZIP, your lib.xml is missing an opening < on the first line.

    Edit: And the way you register the event for scanning the page won't work unless you're using AceEvent-3.0. The Blizzard API :RegisterEvent() function doesn't take aliases. So you'll prolly want to rename the scan function to match the event so the event frame actually calls it.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hermes: The great messenger of your raid's cooldowns
    Quote from Phanx
    Do you have any plans to offer other display styles? I can see where this will be useful once my guild starts raiding again in Cataclysm, but I probably would not use this addon if the only display style is to have a dozen buttons shown on my screen all the time.


    Seconded. Even something like hiding cooldowns that do not exist in the raid would be nice, instead of seeing all those grayed out buttons.
    Posted in: General AddOns
  • 0

    posted a message on LibGuildBankComm-1.0 Official Thread
    Quote from lilsparky
    i'm confused. why index this by guildName at all? you should only ever have one guild for a toon, right?

    ...

    guildName seems superfluous since you already know your guild name.


    The code for the data storage/page scanning in the lib was based on my addon MobileVault which keeps track of multiple guild banks since a player can have toons in multiple guilds. I'm guessing it is just an artifact of that.
    Posted in: Libraries
  • 0

    posted a message on LibGuildBankComm-1.0 Official Thread
    You can't broadcast only changes. I've tried this method and it does not work. People never have the same base, which means you can't apply a change set uniformly. In order to ensure valid data the entire tab needs to be serialized and sent to users.
    Posted in: Libraries
  • 0

    posted a message on Confounded by an error
    That error most likely occurs because the client receiving the message has not seen that specific item yet. If the client has to query the server for the item information then the returns from GetItemInfo() are nil since that client function returns before the server can respond to the query.

    You'll have to find some way to query and delay processing until the local client knows about the item.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Bartender4 - missing icons
    Go into Bartender options, go the the Bag Bar entry on the left side. Uncheck "One Bag" in the right side window.
    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.