Thread Tools Display Modes
03-26-09, 07:44 PM   #1
seebs
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 155
Mail API...

I would like to someday fix SimpleMail.

Here's the basic problem: As of the last time I looked at the API, there was only one event available to determine that Something Has Changed In The Mailbox. There was no way to find out what specifically happened.

So... Let's say I try to grab an item from a mailbox slot.

Have I succeeded? I don't know. I can't ask for "notify me when that item has been successfully grabbed." If I try to grab items without waiting for events, most of them never get grabbed. If I wait for events... Well, how many should I wait for? If I only wait for one, I get extra notifications later which I misinterpret as responses to later actions. If I wait for several, I sometimes guess wrong how many I was expecting. If the mailbox happens to decide to reload with additional items while I'm clearing stuff out, things get even more confused.

Is there a sane way to do this? The basic thing I want to do is "identify a list of matching messages, then grab all objects and money from them." The second part seems to be the hard part. I have something that works about 80% of the time, but sometimes you have to reset it and try again, and I don't know exactly why. I'm not sure whether there's a viable way to approach this.
  Reply With Quote
03-26-09, 07:49 PM   #2
Yhor
A Pyroguard Emberseer
 
Yhor's Avatar
Join Date: May 2007
Posts: 1,077
<snip>
So... Let's say I try to grab an item from a mailbox slot.

Have I succeeded? I don't know. I can't ask for "notify me when that item has been successfully grabbed." If I try to grab items without waiting for events, most of them never get grabbed. If I wait for events... Well, how many should I wait for? If I only wait for one, I get extra notifications later which I misinterpret as responses to later actions. If I wait for several, I sometimes guess wrong how many I was expecting.
<snip>
Wouldn't there be an event for receiving the mail item? (received loot)

I'm a nub, so please ignore if that's just ridiculous.

Last edited by Yhor : 03-26-09 at 07:51 PM.
  Reply With Quote
03-26-09, 07:54 PM   #3
seebs
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 155
Originally Posted by Yhor View Post
Wouldn't there be an event for receiving the mail item? (received loot)

I'm a nub, so please ignore if that's just ridiculous.
Actually, that's one of the things I thought about trying to check. However!

* You might be moving things in your own bags (shuffling things as they come in.)
* This doesn't help for the extra "event showing that a mail item has gone away because you grabbed its contents."
  Reply With Quote
03-26-09, 08:55 PM   #4
Yhor
A Pyroguard Emberseer
 
Yhor's Avatar
Join Date: May 2007
Posts: 1,077
Originally Posted by seebs View Post
Actually, that's one of the things I thought about trying to check. However!

* You might be moving things in your own bags (shuffling things as they come in.)
* This doesn't help for the extra "event showing that a mail item has gone away because you grabbed its contents."
There -shouldn't- be an even for moving items from in your inventory, to another location in your inventory. At least I've never seen this before.

For 2nd point, could you make it ignore clams, boxes, etc..., to avoid the issue altogether? Or are you accounting for user interference?
  Reply With Quote
03-27-09, 04:35 PM   #5
seebs
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 155
Originally Posted by Yhor View Post
There -shouldn't- be an even for moving items from in your inventory, to another location in your inventory. At least I've never seen this before.
Huh! Maybe I'm confused. Or I just wasn't paying attention while debugging.

For 2nd point, could you make it ignore clams, boxes, etc..., to avoid the issue altogether? Or are you accounting for user interference?
I mean mailbox items. If you get an "auction expired" message, then the message autodeletes when you grab the item from it. Similarly, if you get mail from someone holding 12 items, you grab 11 of them and nothing special happens, but when you grab the 12th it suddenly deletes the message.
  Reply With Quote
03-27-09, 05:49 PM   #6
Yhor
A Pyroguard Emberseer
 
Yhor's Avatar
Join Date: May 2007
Posts: 1,077
Okay, I misunderstood your intention. I think.

The basic thing I want to do is "identify a list of matching messages, then grab all objects and money from them." The second part seems to be the hard part. I have something that works about 80% of the time, but sometimes you have to reset it and try again, and I don't know exactly why. I'm not sure whether there's a viable way to approach this.
So what you're trying to "fix" is when Simplemail makes an attempt to grab all items from the mail, it leaves a few behind? and generally (guessing, from my experience), this happens more frequently when the item count is greater in size (not stacks in a single slot)? If this is true in your case, I'll offer the idea I had as to why this happens.

Non bulk mail, for me, seems to collect almost instantly and grabs items as fast as I can click them or as fast as my mail mod attempts to grab them (I haven't used a mailmod in awhile, my last one was postal (I think). Rarely ever an issue with single item mail.

Bulk mail seemed to have problems grabbing all items, it would appear to skip items and collect the next, very sporadic 'looking' behaviour. After paying close attention to this, I noticed that it actually did not skip the items as it appeared it had, but instead, it was making the action on the items to grab them so fast that it 'got caught' in a time restriction, such as a GCD for mail (I'm not sure there is such a thing, I'm just giving my recollection of what the behaviour looked like).

I wonder if it's possible to put a timer on the 'grab' function to throttle it down enough, to maybe sync up with the server, or whatever the issue may be. And I am curious if what I'm suggesting is even the -real- cause.

I hope I don't sound like a complete idiot, and actually help with my observations. I don't know anything about the mail API: If it sounds completely unreasonable, or if I just don't have enough experience to help, I completely understand you telling me to get lost .

Hopefully someone who -does- know more than me can tear theirselves away from the legalese threads and give something new instead of hashing over the same thing until it's dust in the wind .

~The last part was joking, please bash me in PMs; if you must bash me, don't do it here.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Mail API...

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off