ago

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

Recommended Posts

1 hour ago, bdew said:

 

Logs?

nah sorry, I don't see anything related to it, in the logs either, anyhow I don't use that along with a few other bits like spellmod or hitching or any of that, because they're not on my radar ... so I disable them, I tried the Christmas mod on an earlier version of wurm, might be 1.1.2 or something around Christmas time and it worked ok, but for some reason after that, it refused to load the launcher after that...

Share this post


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

@ozmods [08:47:57] You almost made it, but the error report is useless. :P

 

(Hint: there is no such thing as "nothing related in the logs" if the launcher fails to load)

 

New build, fixes the christmas mod...

 

https://github.com/bdew-wurm/WurmServerModLauncher/releases/tag/v0.21.1-alpha1.3-3

cheers mate, there are some real clods on this forum, then there is funny buggers, then there is you, funny bugger, cheers for the update, always appreciate you guys and all you do.

Share this post


Link to post
Share on other sites
On 2/9/2017 at 0:21 PM, bdew said:

 

Try doing what ago said

 

 

I somehow missed all the answers about the class loader, but yes. I guess that will work then, but it felt like it was discouraged to use a shared class loader? It didn't occur to me that having it in the same class loader is vaguely like "in the same jar" then, because it definitely throws when it's not sharing the same class loader :) 

Share this post


Link to post
Share on other sites

Version 0.22

script runner mod

The mod can run scripts on various hooks

  • onServerStarted: The server has started and is ready to process connections
  • onPlayerLogin: The player has logged in
  • onPlayerLogout: The player has logged out
  • onPlayerMessage: The player sent a chat message to the server
  • onItemTemplatesCreated: The item templates have been initialized
  • onServerPoll: once per second server loop

The scripts must be Javascript and run on the Nashorn Javascript engine included in
the Java 8 runtime. The scripts are loaded from the respective subdirectory in
mods/scriptrunner/scripts and must have the file ending .js

A few samples are provided name *.js.example

 

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

 

There is also a build for the alpha server

https://github.com/ago1024/WurmServerModLauncher/releases/tag/v0.22-alpha6

 

I needed a way to automaticly give a logged in player admin permissions on a fresh server in a docker image.

 

Share this post


Link to post
Share on other sites

Version 0.23

ModLoader

  • Call ActionPerformers in a loop and remove those that throw exceptions
  • Remove BehaviourProviders that throw exceptions
  • Added basic ModQuestions framework

 

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

 

Version 0.23-beta

ModLoader

  • Call ActionPerformers in a loop and remove those that throw exceptions
  • Remove BehaviourProviders that throw exceptions
  • Added basic ModQuestions framework

Christmasmod

  • Removed lots of the bytecode hackery. Using custom ActionPerformer to handle unwrapping the gift

Serverfixes

  • Temporary fix for NPE on Start=server starts removed

This is a prerelease and intended to be used on Wurm Unlimited 1.3 Beta (buildid 1656833) servers only

https://github.com/ago1024/WurmServerModLauncher/releases/tag/v0.23-beta

Share this post


Link to post
Share on other sites

Thanks for the quick update!

 

harvesthelper needs an update to add the seasons for new stuff (pine, hazelnut, hops, oak, orange)

Edited by bdew

Share this post


Link to post
Share on other sites

Thanks for the hint. I'll finally have to actually read the change announcement ;)

 

EDIT: It's checked in and will come with the next critical fix or when the beta ends.

Edited by ago

Share this post


Link to post
Share on other sites

Is there a way we can add a tool which can check the com.wurmonline.shared.constants.SteamVersion.class and the 4 fields: 

    static final int MAJOR = 1;
    static final int COMPATIBILITY = 3;
    static final int CLIENT = 1;
    static final int SERVER = 1;

 

It would be nice if we had a nice looking helper method that wraps all the ugly bytecode I believe we'd have to use in order to access this information in the config() or init() methods.

 

If I were to do this I'd get a codeIterator for this method "<clinit>" in the SteamVersion.class.

Here is a bytecode print for it:

max_stack: 6
max_locals: 0
code_length: 23
attributes_count: 1
exception_table_length: 0

00000000 : new                 com.wurmonline.shared.constants.SteamVersion
00000003 : dup
00000004 : iconst_1
00000005 : iconst_3
00000006 : iconst_1
00000007 : iconst_1
00000008 : invokespecial       void com.wurmonline.shared.constants.SteamVersion.<init>(int, int, int, int)
0000000B : putstatic           com.wurmonline.shared.constants.SteamVersion com.wurmonline.shared.constants.SteamVersion.current
0000000E : ldc                 "^(?:version=)?(?<major>\d+)\.(?<compatibility>\d+)\.(?<client>\d+)\.(?<server>\d+);?$"
00000010 : invokestatic        java.util.regex.Pattern java.util.regex.Pattern.compile(java.lang.String)
00000013 : putstatic           java.util.regex.Pattern com.wurmonline.shared.constants.SteamVersion.versionPattern
00000016 : return

Using the CodeIterator we could get lines 4, 5, 6, and 7. With that info check it against whatever version the modder supplies.

 

Also, I'm not sure but it might be more useful if the modder could supply a say an arraylist of either version objects or simple 4 digit numbers so we can specify compatibility for more then on release.

Edited by joedobo

Share this post


Link to post
Share on other sites

Not entirely sure what you mean, but maybe something like this would work for you:
 

package com.wurmonline.shared.constants;

public class Version
{
	static public int getMajor() { return SteamVersion.MAJOR; }
	static public int getCompat() { return SteamVersion.COMPATIBILITY; }
	static public int getClient() { return SteamVersion.CLIENT; }
	static public int getServer() { return SteamVersion.SERVER; }
}

Could very well be that I am completely misunderstanding...

 

Edited by Friya

Share this post


Link to post
Share on other sites
Just now, Friya said:

Not entirely sure what you mean, but maybe something like this would work for you:
 


package com.wurmonline.shared.constants;

public class Version
{
	static public int getMajor() { return SteamVersion.MAJOR; }
	static public int getCompat() { return SteamVersion.COMPATIBILITY; }
	static public int getClient() { return SteamVersion.CLIENT; }
	static public int getServer() { return SteamVersion.SERVER; }
}

Could very well be that I am completely misunderstanding...

 

 

That information isn't available during mod launchers configure() or the  init() methods. In order to use the code in the way you have done, I'd either have to hook into the creation of that classes object or do it in onServerStarted(). I need to disable mods before doing bytecode changes.

 

Basically, if the server version someone is trying to use my mod on isn't on the approved version list I supply, nothing happens.

Share this post


Link to post
Share on other sites

The one test I did in one of my mods was calling it from configure()

 

Share this post


Link to post
Share on other sites
10 minutes ago, Friya said:

The one test I did in one of my mods was calling it from configure()

 

 

Is there a warning in your log file, it will be near the top, saying something to the effect of initializing an object early? 

 

You can force mod launcher to initialize objects before they normaly are done. Although, in this case, I doubt that someone will want to do bytecode changes on SteamVersion.class so maybe it doesn't matter.  If you initialize an object in configure any potential bytecode changes that someone tries later in execution will get blocked.

Share this post


Link to post
Share on other sites

Well, yes. It will have been loaded. It's hard to get around. If it was Creature or so, I'd not recommend dipping in there that early. :)

 

But like you say, I doubt anyone will modify that class, but I guess if it's a concern you can defrost it (I'm not too familiar with the intricacies of that, though).

Edited by Friya

Share this post


Link to post
Share on other sites

A frozen class usually means Java already loaded that class. Java won't forget the class file unless you can get rid of the class loader that loaded it. And you can not make Java load the same class again unless you're using a different class loader tree.

 

I can probably add some code to retrieve the version and add it to the properties passed to the module.

https://github.com/ago1024/WurmServerModLauncher/issues/24

Edited by ago

Share this post


Link to post
Share on other sites

Ago any chance you could add the color and size options to the creature template builder?

 

The code is reachable and several lines hacking around with hookmanager allows us to bust out big or tiny creatures, and change their color. However I felt like adding it to the mod loader like other methods are handled would be a bit more simple. I could be wrong, been meaning to test it but just havn't had the time.

 

If you need I could try to find the exact methods again and post them here for ya. Let me know, I think it will add an easy dynamic for modders to get fun different creatures going using current models.

Share this post


Link to post
Share on other sites

Looks like you already added it in 0.24 nice, thanks, added a couple others I didn't think of as well!

Share this post


Link to post
Share on other sites

Version 0.24

ModLoader

  • Automaticly add steamVersion property to properties passed to mods #24
  • Allow multiple ModVehicleBehaviours per item or creature template #17
  • Add color and size modifier, fire and glowing to CreatureTemplateBuilder #23
  • ModPlayerProperties allows to store custom data for a player

WurmUnlimited update

  • Added meat material to modded creatures (bdew)
  • Added flyway-core to classpath in manifest (bdew)
  • Add new season items for HarvestHelper

ChristmasMod

  • Rebuilt ChristmasMod to use an ActionPerformer for open instead of hacking the byte code
  • Christmas mod used ModPlayerProperties to store the yearly "reimbursed" flag

Distribution

  • add sources to maven artifacts
  • add decompiled, line-aligned sources to common.jar, server.jar artifacts

 

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

Share this post


Link to post
Share on other sites

Not sure why but server wont load after running this update. Is there a log I can check??

Share this post


Link to post
Share on other sites

yes. There is server.log in the dedicated server folder

Share this post


Link to post
Share on other sites

This is what I am getting??

 

 

 

[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: ModLoader version v0.24-8d9c668
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\creaturedemo.properties
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\creaturedemo\creaturedemo.jar]
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\gameplaytweaks.properties
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\gameplaytweaks\gameplaytweaks.jar]
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\playercount.properties
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\playercount\playercount.jar]
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\players.properties
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\players\players.jar]
[06:57:27 AM] WARNING org.gotti.wurmunlimited.modloader.ModLoaderShared: Mod players loaded server class com.wurmonline.server.MiscConstants during phase load
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\serverpacks.properties
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\serverpacks\serverpacks.jar]
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\serversettings.properties
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\serversettings\serversettings.jar]
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Loading mods\skillmod.properties
[06:57:27 AM] INFO org.gotti.wurmunlimited.modloader.ModLoaderShared: Classpath: [mods\skillmod\skillmod.jar]
[06:57:27 AM] INFO org.gotti.wurmunlimited.mods.serverpacks.ServerPackMod: serverPort: 8787
[06:57:27 AM] INFO org.gotti.wurmunlimited.mods.serverpacks.ServerPackMod: publicServerAddress: null
[06:57:27 AM] INFO org.gotti.wurmunlimited.mods.serverpacks.ServerPackMod: publicServerPort: 0
[06:57:27 AM] INFO org.gotti.wurmunlimited.mods.serverpacks.ServerPackMod: internalServerAddress: null
[06:57:27 AM] INFO org.luceat.wu.mods.skillmod.SkillMod: useSkillMod: true
[06:57:27 AM] INFO org.luceat.wu.mods.skillmod.SkillMod: statFactor: false
[06:57:27 AM] SEVERE org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher: multiple points
java.lang.NumberFormatException: multiple points
    at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
    at sun.misc.FloatingDecimal.parseFloat(Unknown Source)
    at java.lang.Float.parseFloat(Unknown Source)
    at java.lang.Float.<init>(Unknown Source)
    at org.luceat.wu.mods.skillmod.SkillMod.configure(SkillMod.java:50)
    at org.gotti.wurmunlimited.modloader.ModLoaderShared.lambda$loadModsFromModDir$1(ModLoaderShared.java:99)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
    at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.forEach(Unknown Source)
    at org.gotti.wurmunlimited.modloader.ModLoaderShared.loadModsFromModDir(ModLoaderShared.java:97)
    at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(DelegatedLauncher.java:18)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at javassist.Loader.run(Loader.java:288)
    at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLauncher.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at PatchedLauncher.main(PatchedLauncher.java:20)

Not sure why but server wont load after running this update. Is there a log I can check??

Share this post


Link to post
Share on other sites

Hm. SkillMod interprets the new steamVersion property as skill and tries to parse the version "1.3.1.1" as number which fails.

Share this post


Link to post
Share on other sites

There is some error with the NumberFormating of float values from the properties file. I haven't looked into that yet but it is fine in the 0.23-beta.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now