ago

[RELEASED] Server mod loader + priest + crops + seasons + server packs + bag of holding

Recommended Posts

Is it intended that if sharedClassLoader=true the addCallback(...) method will always throw a notfoundexception?

Share this post


Link to post
Share on other sites
On 2/3/2019 at 7:43 PM, bdew said:

Looks like the maven repo is dead again, returning 404 errors for everything.

 

My mirror is here if anyone needs it - https://dl.bdew.net/agorepo/

I restarted the nginx containers. But according to the logs there were just requests from gradle with the https redirect 301 but no follow up requests.

I just rebuilt a mod with a fresh download from the repository and it seems to work again on my end.

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, Sklo:D said:

Is it intended that if sharedClassLoader=true the addCallback(...) method will always throw a notfoundexception?

 

Can you please PM me the exception and stack trace? I haven't had the time yet to test it but maybe the stacktrace gives some ideas.

 

The general idea was to provide a way for modified server code to call a mod api even if the mod resides in its own classloader. But the same should work if the mod is in the same classloader.

Share this post


Link to post
Share on other sites
18 hours ago, ago said:

 

Can you please PM me the exception and stack trace? I haven't had the time yet to test it but maybe the stacktrace gives some ideas.

 

The general idea was to provide a way for modified server code to call a mod api even if the mod resides in its own classloader. But the same should work if the mod is in the same classloader.

 

I don't use that feature in any of my mods, but i did some poking around and it looks like addCallback is trying to get the CtClass of the target object and that fails

 

Full stacktrace here:

 

Spoiler

java.lang.RuntimeException: Error in preinit
        at net.bdew.wurm.server.ServerMod.preInit(ServerMod.java:973)
        at org.gotti.wurmunlimited.modloader.ModLoaderShared.lambda$loadModsFromModDir$6(ModLoaderShared.java:166)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
        at org.gotti.wurmunlimited.modloader.ModLoaderShared.loadModsFromModDir(ModLoaderShared.java:164)
        at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(DelegatedLauncher.java:20)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at javassist.Loader.run(Loader.java:286)
        at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLauncher.java:33)
Caused by: org.gotti.wurmunlimited.modloader.classhooks.HookException: javassist.NotFoundException: net.bdew.wurm.server.TestCallback
        at org.gotti.wurmunlimited.modloader.callbacks.Callbacks.getCtClass(Callbacks.java:111)
        at org.gotti.wurmunlimited.modloader.callbacks.Callbacks.addCallback(Callbacks.java:189)
        at org.gotti.wurmunlimited.modloader.classhooks.HookManager.addCallback(HookManager.java:363)
        at net.bdew.wurm.server.TestCallback.install(TestCallback.java:21)
        at net.bdew.wurm.server.ServerMod.preInit(ServerMod.java:936)
        ... 18 more
Caused by: javassist.NotFoundException: net.bdew.wurm.server.TestCallback
        at javassist.ClassPool.get(ClassPool.java:422)
        at org.gotti.wurmunlimited.modloader.callbacks.Callbacks.getCtClass(Callbacks.java:108)
        ... 22 more

 

 

Digging deeper getCtClass is creating a new class pool with a ClassClassPath which tries loading the class file through getResourceAsStream ... which doesn't work with mods that use shared class loader as reported here https://github.com/ago1024/WurmServerModLauncher/issues/51

Edited by bdew
  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, bdew said:

 

I don't use that feature in any of my mods, but i did some poking around and it looks like addCallback is trying to get the CtClass of the target object and that fails

 

Full stacktrace here:

 

  Hide contents


[10:10:28 VORM.] SCHWERWIEGEND org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher: Error in preinit
java.lang.RuntimeException: Error in preinit
        at net.bdew.wurm.server.ServerMod.preInit(ServerMod.java:973)
        at org.gotti.wurmunlimited.modloader.ModLoaderShared.lambda$loadModsFromModDir$6(ModLoaderShared.java:166)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1492)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
        at org.gotti.wurmunlimited.modloader.ModLoaderShared.loadModsFromModDir(ModLoaderShared.java:164)
        at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(DelegatedLauncher.java:20)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at javassist.Loader.run(Loader.java:286)
        at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLauncher.java:33)
Caused by: org.gotti.wurmunlimited.modloader.classhooks.HookException: javassist.NotFoundException: net.bdew.wurm.server.TestCallback
        at org.gotti.wurmunlimited.modloader.callbacks.Callbacks.getCtClass(Callbacks.java:111)
        at org.gotti.wurmunlimited.modloader.callbacks.Callbacks.addCallback(Callbacks.java:189)
        at org.gotti.wurmunlimited.modloader.classhooks.HookManager.addCallback(HookManager.java:363)
        at net.bdew.wurm.server.TestCallback.install(TestCallback.java:21)
        at net.bdew.wurm.server.ServerMod.preInit(ServerMod.java:936)
        ... 18 more
Caused by: javassist.NotFoundException: net.bdew.wurm.server.TestCallback
        at javassist.ClassPool.get(ClassPool.java:422)
        at org.gotti.wurmunlimited.modloader.callbacks.Callbacks.getCtClass(Callbacks.java:108)
        ... 22 more

 

 

Digging deeper getCtClass is creating a new class pool with a ClassClassPath which tries loading the class file through getResourceAsStream ... which doesn't work with mods that use shared class loader as reported here https://github.com/ago1024/WurmServerModLauncher/issues/51

 

Exactly the problem which occurs

Share this post


Link to post
Share on other sites

I attempted to tackle to resource loading issue... I tried replacing the the JA Loader that HookManager uses with a customized URLClassLoader (that has a list of all mod jars which use sharedClassLoader) which then chains back to the JA Loader.

 

It looks like it's almost working right, except that now mod classes and vanilla classes end up being loaded by a different class loader - which breaks mods that put classes in vanilla packages in attempt to use package-private stuff, e.g.

java.lang.IllegalAccessError: class com.wurmonline.server.spells.ModifyGestationTime cannot access its superclass com.wurmonline.server.spells.ReligiousSpell

While this mod can be fixed to use ModReligiousSpell, i'm sure there will be other mods broken by this change which will be harder to fix.

 

If anyone wants to hack more on this approach, here's what i got... https://github.com/bdew-wurm/WurmModLoaderShared/commit/bbd9e7e2f91db64f64e937ba3d5959fef402b14c

 

A different approach could be trying to subclass JA Loader and adding resource loading functionality to it, i might try it next time i want to get my hands dirty in ja/modlauncher internals :P

 

Edit: Another idea is to have my "customized URLClassLoader" grab the bytecode from the ClassPool then defineClass() instead of delegating to the JA Loader. I'm not sure how crazy that idea is, i might try it later.

Edited by bdew

Share this post


Link to post
Share on other sites

I went a different path. Since the Loader is already a classloader I simply added the proper getResource/findResource/findResources methods.

Version 0.41

modloader

  • ItemIdParser and CreatureTemplateParser can read ids from the modsupport db after the server has started
  • Fix resource loading and callback api from shared class loader [#51]

https://github.com/ago1024/WurmServerModLauncher/releases/tag/v0.41

 

Share this post


Link to post
Share on other sites

Whatever happened to the creaturedemo mod that was included in version .35? Is there a compatible mod that works with version .40+?

Share this post


Link to post
Share on other sites
Posted (edited)

I realized I downloaded the new version of the mod loader and now the Sindusk ServerTweaks and Discord Relay mods are not working. Before this morning, they were working with the older version of the mod loader. Here is the print out: 

Spoiler

[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: ModLoader version v0.41-08a7cb2
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Game version 1.8.0.3
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\bountymod.properties
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\buyermerchant.properties
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\DiscordRelay.properties
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\globalchat.properties
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\harvesthelper\harvesthelper.jar!/META-INF/org.gotti.wurmunlimited.modloader/harvesthelper.properties
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Copying mods\harvesthelper\harvesthelper.jar!/META-INF/org.gotti.wurmunlimited.modloader/harvesthelper.config to mods\harvesthelper.config
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\harvesthelper.properties
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\harvesthelper.config
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\httpserver\httpserver.jar!/META-INF/org.gotti.wurmunlimited.modloader/httpserver.properties
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Copying mods\httpserver\httpserver.jar!/META-INF/org.gotti.wurmunlimited.modloader/httpserver.config to mods\httpserver.config
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\httpserver.properties
[01:05:29 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\httpserver.config
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\minipets.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\newportals.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\scriptrunner\scriptrunner.jar!/META-INF/org.gotti.wurmunlimited.modloader/scriptrunner.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Copying mods\scriptrunner\scriptrunner.jar!/META-INF/org.gotti.wurmunlimited.modloader/scriptrunner.config to mods\scriptrunner.config
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\scriptrunner.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\scriptrunner.config
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\servermap\servermap.jar!/META-INF/org.gotti.wurmunlimited.modloader/servermap.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Copying mods\servermap\servermap.jar!/META-INF/org.gotti.wurmunlimited.modloader/servermap.config to mods\servermap.config
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\servermap.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\servermap.config
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\serverpacks\serverpacks.jar!/META-INF/org.gotti.wurmunlimited.modloader/serverpacks.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\serverpacks.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\ServerTweaks.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\SinduskLibrary.properties
[01:05:30 PM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Reading mods\startergear.properties
[01:05:30 PM] SEVERE org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher: Illegal char <*> at index 0: *.jar
java.nio.file.InvalidPathException: Illegal char <*> at index 0: *.jar
	at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
	at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
	at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
	at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
	at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
	at sun.nio.fs.AbstractPath.resolve(AbstractPath.java:53)
	at org.gotti.wurmunlimited.modloader.ModInstanceBuilder.getClassLoaderEntries(ModInstanceBuilder.java:83)
	at org.gotti.wurmunlimited.modloader.ModInstanceBuilder.createClassLoader(ModInstanceBuilder.java:131)
	at org.gotti.wurmunlimited.modloader.ModInstanceBuilder.createModInstance(ModInstanceBuilder.java:63)
	at org.gotti.wurmunlimited.modloader.ModLoaderShared.lambda$loadModsFromModDir$1(ModLoaderShared.java:141)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.gotti.wurmunlimited.modloader.ModLoaderShared.loadModsFromModDir(ModLoaderShared.java:143)
	at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(DelegatedLauncher.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at javassist.Loader.run(Loader.java:286)
	at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLauncher.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at PatchedLauncher.main(PatchedLauncher.java:20)

 

I remove ServerTweaks and Discord Relay and the mod loader works again because none of the others have this <*> in the file. 

 

Here is the initial post I made about this in the Sindusk thread 

Any assistance is appreciated! 

Edited by WittleBunnBun

Share this post


Link to post
Share on other sites
On 3/1/2019 at 10:03 PM, Brian said:

Whatever happened to the creaturedemo mod that was included in version .35? Is there a compatible mod that works with version .40+?

 

It's essentially the demo case for the CreatureMod https://github.com/ago1024/CreatureMod/releases and has been superseeded by CreatureMod.

Share this post


Link to post
Share on other sites
18 hours ago, WittleBunnBun said:

I realized I downloaded the new version of the mod loader and now the Sindusk ServerTweaks and Discord Relay mods are not working. Before this morning, they were working with the older version of the mod loader. Here is the print out: 

 

Any assistance is appreciated!

 

A recent fix required to check for named jars first. This seems to break the wildcard lookup. I'll put a fix out tonight.

  • Like 1

Share this post


Link to post
Share on other sites

Ago is truly a hero for the WU Community \o/

 

 

Share this post


Link to post
Share on other sites
Posted (edited)

How do I get the server to start modded on a remote host? From what I understand I have to use the modlauncher.bat file, then start the server that way. My host uses WurmServerLauncher to start the server on their system. What do I, or they, need to do to make it an automated startup process that is configurable to a dashboard scenario to make it work? Can I rename some file as WurmServerLauncher that is actually patched? Do I need to rename the modlauncher.jar to server.jar, will that then make it launch modded? 

 

Thanks!

Edited by Grishord

Share this post


Link to post
Share on other sites

Pingperfect offers a console button that opens to a modlauncher install/update.  I would assume other hosts have something similar?

Share this post


Link to post
Share on other sites
4 minutes ago, Batta said:

Pingperfect offers a console button that opens to a modlauncher install/update.  I would assume other hosts have something similar?

 

I'm the only person they're offering Wurm to right now so they don't have any system in place.

Share this post


Link to post
Share on other sites

Best way is probably to run modlauncher.bat

The other option is to patch WurmServerLauncher. Run patcher.bat. This will modifiy server.jar and create a modified WurmServerLauncher-patched.exe. You can run this or copy WurmServerLauncher-patched.exe over WurmServerLauncher.exe and run WurmServerLauncher.exe.

Share this post


Link to post
Share on other sites
Posted (edited)
On 3/10/2019 at 6:38 AM, ago said:

Best way is probably to run modlauncher.bat

The other option is to patch WurmServerLauncher. Run patcher.bat. This will modifiy server.jar and create a modified WurmServerLauncher-patched.exe. You can run this or copy WurmServerLauncher-patched.exe over WurmServerLauncher.exe and run WurmServerLauncher.exe.

 

When I run the patcher it doesn't create the WurmServerLauncher-patched.exe, any idea why that would be?

 

Edit: but when I run it again, it says patchedlauncher already exists?

 

Edit for people that read this in the future: The problem was that my host is running linux, but I was trying to patch with a .bat file, but it needed to be patched with the .sh patcher on a linux system. which is why I wasn't getting a patched version of the launcher. Assuming no more edits happen to this post this was the issue here and that's how you resolve it.

 

Edited by Grishord

Share this post


Link to post
Share on other sites

We just rebuilt our server database, at cherry harvest season.  On the rebuilt server, cherries are still in season, but when we type /seasons we get the usual stuff for a brand new server (oleander upcoming, cherries 11 days away).  How can we sync up the HarvestHelper with our actual seasons on the server?

Share this post


Link to post
Share on other sites
2 hours ago, Batta said:

We just rebuilt our server database, at cherry harvest season.  On the rebuilt server, cherries are still in season, but when we type /seasons we get the usual stuff for a brand new server (oleander upcoming, cherries 11 days away).  How can we sync up the HarvestHelper with our actual seasons on the server?

 

Your problem is not with Harvest Helper but with your map not being synced up to the database. cherries will probably stay harvestable until the next time their season (starts and) ends. The other should work correctly at the times show by /seasons.

Share this post


Link to post
Share on other sites
21 minutes ago, bdew said:

 

Your problem is not with Harvest Helper but with your map not being synced up to the database. cherries will probably stay harvestable until the next time their season (starts and) ends. The other should work correctly at the times show by /seasons.

Okay, thank you.  That's not so bad, then.  Nice to have cherries for a long time.  ?

 

Share this post


Link to post
Share on other sites
Posted (edited)

not sure if you noticed, been poking around in 1.9, for priest restrictions they added in more checks

isAllowVynoraOnSurface

isAllowMagranonInCave

isAllowFoOnSurface

isAllowLibilaInCave

those will also need to be set to true before it even checks the old ones.

 

hmm or maybe not, meh i dunno, half asleep.

Edited by Cuddles
forgot libs.

Share this post


Link to post
Share on other sites

Is the mod loader ready for the update or should we wait? 

On 3/13/2019 at 8:32 AM, ago said:

Version 0.43-beta1

 

Share this post


Link to post
Share on other sites

Apr 09, 2019 7:26:42 AM com.wurmonline.server.Server pollIntraCommands
WARNING: null
java.lang.NullPointerException
        at org.gotti.wurmunlimited.modloader.ReflectionUtil.getPrivateField(ReflectionUtil.java:73)
        at org.gotti.wurmunlimited.modcomm.intra.ModIntraServer.getConnection(ModIntraServer.java:89)
        at com.wurmonline.server.intra.ModIntraServerMessage.poll(ModIntraServerMessage.java:79)
        at com.wurmonline.server.Server.pollIntraCommands(Server.java:4046)
        at com.wurmonline.server.Server.run(Server.java:2561)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.