gekware / minecraft-server-hibernation-pterodactyl-egg

egg for gekware/minecraft-server-hibernation
https://github.com/gekware/minecraft-server-hibernation
MIT License
36 stars 8 forks source link

Specify config parameters in msh exec string #4

Closed PadowYT2 closed 2 years ago

PadowYT2 commented 2 years ago

On startup it creates a config.json. Can I somehow prevent generating it and startup with the variables in the startup? Also is #gekware/minecraft-server-hibernation/122 a thing in the egg. Because the limit is stuck to 100% (if 100% allocated)

idlenode commented 2 years ago

yes

BolverBlitz commented 2 years ago

The config.json isn´t generated on startup, its made when a server gets installed the first time (Or you clicked "Reinstall Server"). Its only generated on startup when it was deleted, but then the port, memory and other settings will be wrong and will lead to a crash.

Thats why i generate the config on installation and there are no variables, exept server jar name you can edit in the startup tab. Just click reinstall after to generate the config.

PadowYT2 commented 2 years ago

Not about talking about about how it works/generates (not the point). I'm trying to say that is there a way to startup without it. And about second question?

BolverBlitz commented 2 years ago

Yes, you can remove the generation. Remove Line 59 of the install skript:

curl -o config.json -X GET "https://api.ebg.pw/api/v1/MSH-ConfigGenerator/2-4-1?FileName=${SERVER_JARFILE}&ServerType=${VENDOR}&Version=${MINECRAFT_VERSION}&RAM=${SERVER_MEMORY}&Port=${SERVER_PORT}&StopTime=${TBSES}&StopServerAllowKill=${KILL_TIME}"

But your egg wont work without manual settings then (Exept it randomly runs on default minecraft port)

PadowYT2 commented 2 years ago

Yes, you can remove the generation. Remove Line 59 of the install skript:

curl -o config.json -X GET "https://api.ebg.pw/api/v1/MSH-ConfigGenerator/2-4-1?FileName=${SERVER_JARFILE}&ServerType=${VENDOR}&Version=${MINECRAFT_VERSION}&RAM=${SERVER_MEMORY}&Port=${SERVER_PORT}&StopTime=${TBSES}&StopServerAllowKill=${KILL_TIME}"

Well I meant remove it and make functional in startup or somewhere else

BolverBlitz commented 2 years ago

@gekigek99 If MSH supports the stuff as start parameters, then yes. Like: ./msh -port 4000 -ram 1024 ... etc

As far as i know, it dosn´t.

PadowYT2 commented 2 years ago

@gekigek99 If MSH supports the stuff as start parameters, then yes. Like: ./msh -port 4000 -ram 1024 ... etc

As far as i know, it dosn´t.

How about the second question?

gekigek99 commented 2 years ago

@BolverBlitz @PadowYT2

port and ram can be set in the start parameters (in the dev branch), as you can see here

this is relative to the msh executable tho, in the egg I know that there might be some restrictions to prevent server resources abuse.

BolverBlitz commented 2 years ago

Ok, great. Then only the minecraft protocol version will be wrong on first startup but that dosn´t mean it wont work.

PadowYT2 commented 2 years ago

@BolverBlitz @PadowYT2

port and ram can be set in the start parameters (in the dev branch), as you can see here

this is relative to the msh executable tho, in the egg I know that there might be some restrictions to prevent server resources abuse.

That's great, I know how to add it in the egg, the catch is, is there an example how to use them?

BolverBlitz commented 2 years ago

Once the next MSH Version gets released i´ll update the egg to use start parameters as you sugested, currently some reqired parameters aren´t supported so cant do it right now.

gekigek99 commented 2 years ago

@PadowYT2 Now i'm not from pc so I can't test it but an example could be this (write this string in the egg command to start the server):

.\msh.exe -p 4000 -P "-Xmx1024 -Xms1024"

@BolverBlitz correct me if i'm wrong

PadowYT2 commented 2 years ago

@PadowYT2 Now i'm not from pc so I can't test it but an example could be this (write this string in the egg command to start the server):

.\msh.exe -p 4000 -P "-Xmx1024 -Xms1024"

@BolverBlitz correct me if i'm wrong

correction theres no .exe in ptero xD, but I'll try that too, thanks

BolverBlitz commented 2 years ago

You should use ptero variables: {{SERVER_MEMORY}}, {{SERVER_PORT}}

.\msh -P "-Xmx{{SERVER_MEMORY}} -Xms128M" -p {{SERVER_PORT}}"

idlenode commented 2 years ago

okey

PadowYT2 commented 2 years ago

Well, I realised that on startup it removes ", any ideas? And the error ofc is flag provided but not defined: -Xms1G Should be:

./msh -f server.jar -P "-Xms1G -Xmx1G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true" -p 25566 -h test -s "Waiting for someone to join" -d 0

Turned to


./msh -f server.jar -P -Xms1G -Xmx1G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -p 25566 -h test -s Waiting for someone to join -d 0```
gekigek99 commented 2 years ago

correction theres no .exe in ptero xD, but I'll try that too, thanks

The .exe was obviously to be "crisp and clear" about the command, obviously you can call the executable as you prefer.

Again, I'm not the espert on ptero servers but maybe you can try replacing " with ' or \" or `

As @BolverBlitz you probably want to add also the ptero parameters in that string.

@PadowYT2 @idlenode if you like the egg remember to star this repo and msh repo on github.

PadowYT2 commented 2 years ago

\"

~~Seemed to work, except now it is problem with variables, what's wrong? flag provided but not defined: -Xmx1G -P "-Xms1G -Xmx1G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true"~~ EDIT: Seems a problem with docker/pterodactyl, on pc it works fine, I'll ask on the pterodactyl server

BolverBlitz commented 2 years ago

One Step ahead of your @PadowYT2 https://discord.com/channels/122900397965705216/404105683336953866/958434997214269530

However, i found a soloution in case its not possible.

gekigek99 commented 2 years ago

I added the requested parameters here

PadowYT2 commented 2 years ago

One Step ahead of your @PadowYT2 https://discord.com/channels/122900397965705216/404105683336953866/958434997214269530

However, i found a soloution in case its not possible.

I'll still try to make a way, I already made it by making bash as startup and then running the command

I added the requested parameters here

-d 1 doesn't work ig? https://cdn.padow.ru/GBbd

BolverBlitz commented 2 years ago

Once the new version is made public, i´ll completly remake the egg all based on startparameters like most other eggs.q We hope to release it in the next 48h, the egg will follow this week.

gekigek99 commented 2 years ago

-d 1 doesn't work ig?

@PadowYT2 from the image you sent, the log level was set correctly to 1, to have more in depth logging you should set it to 3

I can already say that that error you see while joining is caused by the server failing to start

PadowYT2 commented 2 years ago

should've be "fixed #2 and fixes #4", thanks!