Serbien Muss Sterbien

@pdietrich2 I am getting error “Defunct Custom Code” when downloading this module to my PC. It says to contact the module designer when this happens. Let me know if you need any further info. Thank you in advance for any help you are able to provide, I look forward to playing this game :slight_smile:

Ryan,

this is from a post at boardgamegeek.

Peter

JoelCFC25

@JoelCFC25

25.09.2024 (edited)

There is nothing more current than what you can find on the VASSAL site. Here’s an exchange from November 2022 discussing the issue and the module creator’s inability to do anything about it (this is basically an object lesson in the pitfalls of adopting someone else’s work without the tech know-how to maintain it going forward).

It’s not the case that custom code has been deleted from anything–in fact, the issue is that the custom code is still present in the module. Current versions of VASSAL will not run that code because it uses deprecated methods that were obsoleted as Java advanced several major versions from what existed back when the code was created.

You can still install and run a legacy version of VASSAL (3.2.17) that will run this module without complaints. Get it from the release archive. It can be installed side-by-side with any current version of VASSAL you have, you do not need to uninstall/replace what you already have. If you’re a Windows user, choose the “Custom install” option when running the installer.

EDIT: A clarification on legacy versions of VASSAL–if you install 3.2.17, the module will run normally. Other versions all the way up through 3.5.8 should also run it, but with a dismissable warning prompt at the start that the module contains custom code and isn’t guaranteed to work. From version 3.6.0 to current, the module simply won’t run due to the obsolete custom code.

The upshot is that someone who wants the problem fixed should adopt the module and fix the problem.

The problem is, that some custom code in the module 1914: Serbien Muss Sterbien uses parts of the Vassal API (Application Programming Interface) which have been deprecated or even removed.

This is the same problem as reported with 1914: Offensive à outrance - also by Peter (@pdietrich2 ) - see this discussion. As explained there, the fix is to recompile the custom code against a newer Vassal, making sure to fix the code so that it doesn’t call removed or deprecated API.

As with the other module, the module 1914: Serbien Muss Sterbien does contain the source code for the custom code. However, the source code is very out of date. Fortunately, Joel (@uckelman ) has maintained a repository of the code which is relatively up-to-date with the Vassal API.

That means, to fix the issue, unpack the module, get the code, and rebuild it

$ mkdir tmp
$ unzip 1914-SerbienMussSterbien 108.vmod -d tmp
$ cd tmp
$ rm -rf sources net com
$ git clone https://github.com/uckelman/tite-ocs.git
$ cd tite-ocs 
$ javac -d ../                                          \
        --release 11                                    \
        -Xlint                                          \
        -cp /usr/share/vassal/lib/Vengine.jar           \
        --source-path src                               \
        `find src/net -name "*.java"` 
$ cd ..
$ rm -rf tite-ocs
$ zip -r ../1914-SerbienMussSterbien_1.8.2.vmod .
$ cd ..
$ rm -rf tmp

(above is for MacOS or Linux).

If you want @pdietrich2 you can either

  1. add me temporarily as owner on the 1914: Serbien Muss Sterbien and i will upload a new version of the module,
  2. Pick up the update module and upload it yourself (note, I will delete this file sometime soon), or
  3. do the above yourself.

Yours,
Christian

@pdietrich2 : I see you added me as owner, so I have uploaded the updated module to the page and did some general clean-up of the page, as well as adding a screenshot of the module in action. I have removed myself as owner.

@Beecrafty : since this update should fix your problem, please mark this problem as solved - only you can do that.

@pdietrich2 : Do you want similar help with 1914: Offensive à outrance? If so, drop me a message.

Yours,
Christian

Thank you so much for the help! The module is working now. I have marked the question as “Solved”

@pdietrich2: Again, I see you added me as owner of 1914: Offensive à outrance, and I did a similar thing for that as I did for 1914: Serbien Muss Sterbien. However, there’s something messed up somewhere in the module that causes Vassal to crash - specifically a StackOverflowError is thrown at some point during the loading of the module. I’ve took a brief look to see if I could identify the problem, but with no luck.

I have uploaded a new version of the module (4.0.1-broken), even though it is broken. Hopefully someone with a bit more time will be able to progress on the problem.

Also, it would be nice if you (@pdietrich2) gave me a heads up if you want my help.

Yours,
Christian