Actually, all hope is not lost.
First off, if you unpack the module, you will see that the Java sources custom modules is in the sub-directory source
(kudo’s to @pdietrich2 for providing the sources). You can ignore the sub-directory source/com
as that code isn’t used in the module (in fact, you should probably remove that sub-directory).
Secondly, the file source/net/cantab/hayward/george/OCS/edits.required
shows you the translation from standard Vassal elements to the custom elements. The file contains sed
regular expression substitutions, and the script source/net/cantab/hayward/george/OCS/exec.edits
shows you have these are executed. If you reverse these regular expressions - e.g.,
s/VASSAL.build.module.BasicCommandEncoder/net.cantab.hayward.george.OCS.BasicCommandEncoderOverride/g
to
s/net.cantab.hayward.george.OCS.BasicCommandEncoderOverride/VASSAL.build.module.BasicCommandEncoder/g
and then execute source/net/cantab/hayward/george/OCS/exec.edits
then that will revert the module to the standard Vassal elements.
Of course, that will mean a loss of functionality in the module.
So, a better way is to fix the custom code and recompile it (see also Simple Workflow). Assuming you have installed VASSAL in /opt/vassal/current
(on Linux), do
cd source
javac -cp /opt/vassal/current/lib/Vengine.jar --release 11 `find net -name "*,java"`
and when that compiles cleanly, copy the generated .class
files (with directory structure) to the root of the unpacked archive
tar -cf - `find . -name "*.class"` | tar -xf - -C ..
Of course, any errors in the custom code need to be fixed first:
net/cantab/hayward/george/OCS/RegionOverride.java:255: error: cannot find symbol
Labeler.drawLabel(g, getLocalizedConfigureName(), posX, posY + labelOffset, f, Labeler.CENTER,
^
symbol: variable CENTER
location: class Labeler
net/cantab/hayward/george/OCS/RegionOverride.java:256: error: cannot find symbol
Labeler.TOP, fg, bg, fg);
^
symbol: variable TOP
location: class Labeler
net/cantab/hayward/george/OCS/RegionOverride.java:255: warning: [removal] drawLabel(Graphics,String,int,int,Font,int,int,Color,Color,Color) in Labeler has been deprecated and marked for removal
Labeler.drawLabel(g, getLocalizedConfigureName(), posX, posY + labelOffset, f, Labeler.CENTER,
^
net/cantab/hayward/george/OCS/MapOverride.java:176: warning: [removal] mapCoordinates(Point) in Map has been deprecated and marked for removal
Point p = mapCoordinates(activeViewport.getRealViewPosition());
^
net/cantab/hayward/george/OCS/MapOverride.java:192: warning: [removal] mapCoordinates(Point) in Map has been deprecated and marked for removal
Point p = mapCoordinates(activeViewport.getRealViewPosition());
^
net/cantab/hayward/george/OCS/MapOverride.java:293: warning: [removal] mapCoordinates(Point) in Map has been deprecated and marked for removal
Point p = mapCoordinates(e.getPoint());
^
net/cantab/hayward/george/OCS/MapOverride.java:363: warning: [removal] componentCoordinates(Point) in Map has been deprecated and marked for removal
p = componentCoordinates(p);
^
net/cantab/hayward/george/OCS/MapOverride.java:992: warning: [removal] launchButton in Map has been deprecated and marked for removal
GameModule.getGameModule().getToolBar().add(launchButton);
^
net/cantab/hayward/george/OCS/MapOverride.java:995: error: cannot find symbol
new IntConfigurer(MAIN_WINDOW_HEIGHT, null, new Integer(-1));
^
symbol: variable MAIN_WINDOW_HEIGHT
location: class MapOverride
net/cantab/hayward/george/OCS/MapOverride.java:997: warning: [removal] ComponentSplitter in VASSAL.tools has been deprecated and marked for removal
final ComponentSplitter splitter = new ComponentSplitter();
^
net/cantab/hayward/george/OCS/MapOverride.java:997: warning: [removal] ComponentSplitter in VASSAL.tools has been deprecated and marked for removal
final ComponentSplitter splitter = new ComponentSplitter();
^
net/cantab/hayward/george/OCS/MapOverride.java:1006: warning: [removal] mainWindowDock in Map has been deprecated and marked for removal
mainWindowDock = splitter.splitBottom(
^
net/cantab/hayward/george/OCS/MapOverride.java:1032: error: cannot find symbol
PlayerRoster.addSideChangeListener(this);
^
symbol: method addSideChangeListener(MapOverride)
location: class PlayerRoster
net/cantab/hayward/george/OCS/Parsing/ScenarioBuilder.java:53: warning: [removal] isMacOSX() in Info has been deprecated and marked for removal
return Info.isMacOSX() ? new MacOSXMenuManager() : new MyMenuManager();
^
net/cantab/hayward/george/OCS/Parsing/ScenarioBuilder.java:59: error: no suitable constructor found for ArchiveWriter(ZipFile)
final ArchiveWriter archive = new ArchiveWriter(new ZipFile(
^
constructor ArchiveWriter.ArchiveWriter(String) is not applicable
(argument mismatch; ZipFile cannot be converted to String)
constructor ArchiveWriter.ArchiveWriter(FileArchive) is not applicable
(argument mismatch; ZipFile cannot be converted to FileArchive)
net/cantab/hayward/george/OCS/Parsing/ScenarioBuilder.java:61: warning: [removal] BasicModule in VASSAL.launch has been deprecated and marked for removal
GameModule.init(new BasicModule(archive));
^
net/cantab/hayward/george/OCS/Parsing/ScenarioBuilder.java:61: warning: [removal] BasicModule(DataArchive) in BasicModule has been deprecated and marked for removal
GameModule.init(new BasicModule(archive));
^
net/cantab/hayward/george/OCS/DragHandlerReplace.java:273: warning: [removal] makeDragCursor(double) in DragHandlerNoImage has been deprecated and marked for removal
protected void makeDragCursor(double zoom) {
^
net/cantab/hayward/george/OCS/DragHandlerReplace.java:274: warning: [removal] makeDragCursor(double) in DragHandlerNoImage has been deprecated and marked for removal
super.makeDragCursor(zoom);
^
net/cantab/hayward/george/OCS/DragHandlerReplace.java:308: warning: [removal] mapCoordinates(Point) in Map has been deprecated and marked for removal
updateRange(baseMap.mapCoordinates(p));
^
net/cantab/hayward/george/OCS/HexGridNumberingOverride.java:155: error: cannot find symbol
int alignment = Labeler.TOP;
^
symbol: variable TOP
location: class Labeler
net/cantab/hayward/george/OCS/HexGridNumberingOverride.java:158: error: cannot find symbol
alignment = Labeler.CENTER;
^
symbol: variable CENTER
location: class Labeler
net/cantab/hayward/george/OCS/HexGridNumberingOverride.java:189: error: cannot find symbol
Labeler.CENTER,
^
symbol: variable CENTER
location: class Labeler
net/cantab/hayward/george/OCS/HexGridNumberingOverride.java:185: warning: [removal] drawLabel(Graphics,String,int,int,Font,int,int,Color,Color,Color) in Labeler has been deprecated and marked for removal
Labeler.drawLabel(g2d, getName(getRow(gridp), getColumn(gridp)),
^
net/cantab/hayward/george/OCS/HexGridNumberingOverride.java:207: error: cannot find symbol
Labeler.CENTER,
^
symbol: variable CENTER
location: class Labeler
net/cantab/hayward/george/OCS/HexGridNumberingOverride.java:203: warning: [removal] drawLabel(Graphics,String,int,int,Font,int,int,Color,Color,Color) in Labeler has been deprecated and marked for removal
Labeler.drawLabel(g2d, getName(getRow(gridp), getColumn(gridp)),
^
net/cantab/hayward/george/OCS/HexGridNumberingOverride.java:331: error: getRawRow(Point) in HexGridNumberingOverride cannot override getRawRow(Point) in HexGridNumbering
protected int getRawRow(Point p) {
^
attempting to assign weaker access privileges; was public
net/cantab/hayward/george/OCS/HexGridNumberingOverride.java:382: warning: [removal] Logger in VASSAL.tools.logging has been deprecated and marked for removal
Logger.log(e1);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
10 errors
18 warnings
Most of these seem relatively simple to fix, e.g., Labeler.CENTER
is now 'c'
, and PlayerRoster.addSideChangeListener
seems now to be PlayerRoster.getInstance().addSideChangeListenerToInstance
. Other issues may take a bit more thought. Note, warnings can be ignored for now, although deprecation warnings will be needed to be addressed for the module to work with future Vassal releases.
Yours,
Christian