Defunct Custom Code

I was sent a Vassal module to update. When opening I get the Defunct Custom Code error with the following details:

net.cantab.hayward.george.OCS.MapOverride => VASSAL.build.module.PlayerRoster.addSideChangeListener(VASSAL.build.module.PlayerRoster$SideChangeListener), 3.6.0

I haven’t dealt with custom code before and am not sure how to proceed

The message is telling you that custom code in the module uses something in Vassal that has been removed.

The message tells you what was removed (VASSAL.build.module.PlayerRoster.addSideChangeListener), what uses the removed thing (net.cantab.hayward.george.OCS.MapOverride), and the version of Vassal in which the removed thing was removed (3.6.0).

You can consult the Javadoc for Vassal from the last version before the thing was removed to find out what the replacement is. The Javadoc for all recent versions of Vassal is here. In this case, you’d need to look at 3.5.8, the last release before 3.6.0. Here’s what it says about VASSAL.build.module.PlayerRoster.addSideChangeListener:

Deprecated, for removal: This API element is subject to removal in a future version. use GameModule.addSideChangeListenerToPlayerRoster(SideChangeListener)

So your replacement function is GameModule.addSideChangeListenerToPlayerRoster. You’ll need to use that instead, and recompile the custom code after updating it.

Thanks for the reply. All I need to do now is learn how to edit Java. :slight_smile:

If you’re not able to manage, let me know which module it is and I will see about updating the code.

The file can be found here. It is a play test version for a game in development.
https://drive.google.com/drive/folders/1XSDexSuq-11-9DJuRraRx7uYQFSihCUq?usp=sharing
Is there a tutorial for using a compiler with Vassal modules? I should learn.

You need to give me access in order for me to see it.

Why do you have code you’re not able to recompile in a module which is in development? This typically happens with old modules, not new ones.

Sorry, I forgot to set the sharing on the folder, Should be good to go.
It is for a physical board game in development, the Vassal module is for playtesting. The original module was done by someone that is no longer available and I was asked to update some of the game components.
1916 Romania - Prelude to Blitzkrieg

I happen to have a repo containing all of George’s TiTE/OCS code, which is what this module uses. I’m in the process of updating it to current standards so that it will work with 3.6, which may take a day or two yet. Once that’s done, I’ll make sure you get the code.

Thanks a lot. Sorry to be a pain.
Where would I start if I want to do some of my own coding?

Here’s the repo for the TiTE/OCS code on GitHub.

I’ve updated as much of it now as I have time for. MapOverride still doesn’t compile, due to the docking and splitter code in its base class having changed dramatically since 2015. There may also be other problems—any class that draws on a Map is unlikely to work correctly on HiDPI displays unless updated to account for them. (Doing that in Vassal itself was a major part of the work between 3.2 and 3.3.)

My recommendation is not to use any of this code if you can avoid it, unless you can find somebody willing to finish updating it and competent enough to succeed.

Thanks for your time Joel, I’ll see what I can do with the file.