Bug 4302 - Trigger Action/Global Hotkey command order

Still not sure how Space Empires enters the equation… Unless it was mentioned in the Bug 1948 report, which you said it was related to Bug 4302?

Anyway, looking forward to your fix and I will sure put it to test with MH and let you know :slight_smile:

Ok,

Found the problem. Corrected fix submitted.

Your module was not affected by the bug in the fix, someone else found it using the Space Empires module. It was discussed on another thread somewhere.

B.

I am getting confused again… the fix for the bug (4302) or the bug in the fix (1948?) ?

Are you saying global hotkeys don’t jump the queue anymore now, whatever the module? That would be great :slight_smile:

This thread is about bug 4302. I have fixed bug 4302.

Thus spake Brent Easton:

Ok,
Found the problem. Corrected fix submitted.
B.

Merged to trunk@8255. Uploaded 3.2.0-svn8255, try that.


J.

Well, I sure hope you did, but something else must be broken then.

I am getting the same exact error as with the previous botched fix/build (8224).
See http://www.vassalengine.org/forum/viewtopic.php?f=5&t=5376&start=15#p35414.

Basically the Marvel Heroes module does not work at all any more with this patch. At least not in network mode. Just to clarify: I tried a previous build (8249) and with that it works fine (but of course with those issues mentioned in the previous post relating to bug 4302, afaik).

Please let me know if I can help (by demonstrating you the crash, by showing you the original bug in action etc).

Both the test module supplied by Seth plus my own test module are now working with svn 8255.

Could you please describe the exact sequence of events using the MH with svn 8255 module to generate the Stack Overflow error.

Thanks,
B.

  1. Start new game with computer A. Pick a side, say Avengers (not “solo play”). It will take a bit for the initial splash screen to pop up (see first snapshot, MH module page).
  2. Join room with computer B and wait for side selection. Join as another side, say X-Men, and wait for splash screen.
  3. Now on computer A click on the “click if ready” button next to Avengers: should change to “(A’s username) is ready”
  4. Then on computer B click on the “click if ready” button next to X-Men: should change to “(B’s username) is ready” (and some other button/cards also become visible). At this stage you get the Stack Overflow error for computer B (whereas A will still be there peacefully waiting for A to check in).

You could also revert 3 and 4 (checking in first B and then A) and the same bug will appear (on computer A this time).

No such stack overflow with earlier builds, like 8249 or beta1.

Those check-in buttons are in the Game Board (main map), when editing the module, towards the bottom.


Also, if you do the above procedure with 8249, say, you can then continue by selecting a scenario and clicking “start game”. After a while the splash screen will disappear on both computers and the actual game board will show up (see 2nd snap shot, MH module page). If computer A (=Avengers) was the one starting the game and the random selection gave Avengers the starting position (check game log) you will be able to do things (for example on the Avengers map right click on the heroes to see commands like “set ready”, “set supporting”). However, if the starting side was selected to be the X-Men, then computer B (=X-Men) won’t be able to do anything (discounting dragging cards from the decks, which is not supposed to be done) because the currentPlayer variable is not updated correctly for him and I think it’s the hotkey triggering the turn counter jumping the queue.

To check the value of currentPlayer on both computers issue ALT-SHIFT-D and a “debugging” window will pop up. The last line shows currentPlayer, among other things.

Thanks for investigating this.

Brent, any news about this?

I just can’t sort this out unless we can get a simpler example that demonstrates the error.

Ok, but can you at least tell me if you tried the 4 steps I indicated with the MH module to see the error message? Or is it just me doing something wrong? Thanks.

Yes, I tried it, it failed. It is way too complex to try and debug using the MH module.

I am currently working on resolving the related issue in the Space Empires module which is being caused by the same attempted bug fix. I have managed to isolate it and and am hoping if I fix it, it will fix your problem as well. I am up to my elbows in Vassal entrails as I type this.

Aagh, my brain hurts. Getting a circular command reference when processing nested Triggers. Will try again tomorrow.

Thxs, Brent. I know MH is too messy/convoluted to use it for debugging. I imagine this is a really nasty bug to properly fix, so take your time, of course. I just wanted to make sure you saw/acknowledged the issue with the initial fix vs MH, so that when 3.2.0 is officially released MH would still work :slight_smile:

Ok, I have finally cracked this. My previous attempt to fix this by playing with the Trigger Action code was doomed to failure. The key was to change the way the Global Key Command trait works since it was the offender, firing off hot keys that where sent immediately to the client when all other commands generated by a key stroke are batched up and executed in one go.

Global Hot Key now captures the commands generated by the Hot Key and returns them to be added to the Key Stroke command sequence.

This fix fixes the Stack Overflow problem caused by the previous fix and also fixes the operation of both the Marvel Heroes module and the little test module that displayed the problem.

Brent does this fix the stackoverflow I just submitted off of a trigger? It
does not use a GKC at all, just a straightfwd trigger

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of Brent Easton
Sent: Saturday, August 11, 2012 6:15 PM
To: messages@vassalengine.org
Subject: Re: [messages] [Technical Support & Bugs] Bug 4302 - Trigger
Action/Global Hotkey command order

Ok, I have finally cracked this. My previous attempt to fix this by playing
with the Trigger Action code was doomed to failure. The key was to change
the way the Global Key Command trait works since it was the offender, firing
off hot keys that where sent immediately to the client when all other
commands generated by a key stroke are batched up and executed in one go.

Global Hot Key now captures the commands generated by the Hot Key and
returns them to be added to the Key Stroke command sequence.

This fix fixes the Stack Overflow problem caused by the previous fix and
also fixes the operation of both the Marvel Heroes module and the little
test module that displayed the problem.


Read this topic online here:
https://forum.vassalengine.org/t/bug-4302-trigger-action-global-hotkey-command-order/5132/22

Yes, it should fix that also.

On 12/08/2012 9:40 AM, Tim McCarron wrote:

Brent does this fix the stackoverflow I just submitted off of a trigger? It
does not use a GKC at all, just a straightfwd trigger


Brent Easton
Analyst/Programmer
University of Western Sydney
Email: b.easton@exemail.com.au

So, in other words, GKC’s were the culprits then? I guess I was suspecting as much when I asked about them in this other post last week ([url]GKC: fully resolved or just initiated?]).

Unless you tested the $currentPlayer$ thing yourself already I will give the fix a full try with MH as soon as Joel publishes the updated Windows build.

In the meanwhile, thxs a lot already!

Only because of the way they where being fired off by Global Hotkey traits in counters that are in turn fired off as part of a Trigger sequence. Other module and map level components such as Global property commands may also cause a similar problem. There was no inherent problem in GKC’s as such.

Brent.

Thus spake barbanera:

“Brent Easton” wrote:

Ok, I have finally cracked this. My previous attempt to fix this by
playing with the Trigger Action code was doomed to failure. The key
was to change the way the Global Key Command trait works since it was
the offender, firing off hot keys that where sent immediately to the
client when all other commands generated by a key stroke are batched
up and executed in one go.

Global Hot Key now captures the commands generated by the Hot Key and
returns them to be added to the Key Stroke command sequence.

This fix fixes the Stack Overflow problem caused by the previous fix
and also fixes the operation of both the Marvel Heroes module and the
little test module that displayed the problem.

So, in other words, GKC’s were the culprits then? I guess I was
suspecting as much when I asked about them in this other post last week
(GKC: fully resolved or just initiated?).

Unless you tested the $currentPlayer$ thing yourself already I will
give the fix a full try with MH as soon as Joel publishes the updated
Windows build.

In the meanwhile, thxs a lot already!

Build uploaded, try it out.


J.