Hi,
What’s your name?
Can I get you to have a look at
RFE [2818259] Cannot report Save/Load Deck commands
also while you are in the Deck code? The Save/Load commands are hard-coded with no report format attached. You need to make them similiar to the way ‘Reversible?’ works.
If you can get this committed to your 3.1 branch, I will merge it into the TRUNK.
First of all, Deck’s are actually made up of two parts - a DrawPile which is the AbstractConfigurable part that is defined in the module and a Deck which is a GamePiece and actually exists when the game is running. DrawPile is just an Editable shell that doesn’t really do anything, all the action takes place in Deck.
In Deck, the ‘Send To Deck’ functionality is confusing called ‘Reshuffle’, so look for varables named ‘reshuffleXXXX’.
The SendToDeck functionality is implemented in
Deck.sendToDeck() at line Deck:1152
This is called from one of two places, depending on whether the player hits the SendToDeck Hotkey, or right-clicks and select the Send To Deck command.
The Hot Key Listener is set up in Deck:354-363 where a global KeyListener is registered with the module. If the key is hit, the actionPerformed() method is called at Deck:356.
The Menu Command is set up at Deck:935-945 in getKeyCommands(). The menu is actually built by the generic map menubuilder VASSAL.build.module.map.MenuDisplayer.
Commands are the most vitally important part of VASSAL to understand. Commands are the objects that are stored in log files and/or sent accross the network to other clients attached to a multi-player room. Anything you do that affects any aspect of VASSAL that you need to send to other clients MUST be encoded as a Command.
You will see this sort of construct often:
Command c = new DoSomethingCommands(…);
c.execute(); // Execute the Command on my client;
GameModule.getGameModule().sendAndLog(c); // Send Command to log file and other clients
When another client receives the Command, it will call the execute() method to do the same work on it as occured on the generating client.
This is the best way to use commands as exactly the same code will be exeucted at both ends.
You also see another way where a Generic command is used to capture the change of state of something, especially GamePieces.
ChangeTracker change = new ChangeTracker(gamePiece)
// Do some stuff that changes gamePiece
Command c = change.getChangeCommand();
GameModule.getGameModule().sendAndLog(c);
c.execute() is NOT called on our client because the changes have already happened. ChangeTracker returns a generic ChangePiece command that just updates the ‘state’ of the GamePiece to reflect the accumulated changes to the gamePiece. The same code is NOT executed at both ends.
The ‘type’ of a gamepiece is an accumulated string that represents the structure of all trait levels in a GamePiece. It is built up from all of the myGetType() calls of the individual Decorators.
The ‘state’ of a gamepiece is an accumulated string that represents the current state of all trait levels in a GamePiece. It is built up from all of the myGetState() calls of the individual Decorators.
Hope this helps, Keep asking questions…
I’m very keen to get you going. Your productivity is much diminished without debug capability.
Did Joel suggestion work? Sounds like you are debugging the ModuleManager and not the Player or Editor to me. The best entrypoint to use is:
VASSAL.launch.Editor
with the program arguments
–edit “D:\Vassal\Modules\A Most Dangerous Time\updater_test.vmod.zip”
If you are still having trouble, please post screnshots of the different tabs of the Debug Configuration you are trying to use.
Regards,
Brent.
Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org
Post generated using Mail2Forum (mail2forum.com)