GithubHelp home page GithubHelp logo

steveplays28 / restart-server Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 224 KB

Minecraft Fabric mod that adds a restart command to dedicated servers.

Home Page: https://www.curseforge.com/minecraft/mc-mods/restart-server

License: GNU Lesser General Public License v2.1

Java 100.00%
fabricmc minecraft mod modding quiltmc curseforge modrinth

restart-server's People

Contributors

arnokeesman avatar steveplays28 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

arnokeesman

restart-server's Issues

UTF-8 support

If I use cyrilic letters in config, it shows as CE2BF5-like text

Relative Path To Script

I have a Start.sh file in the root of my server installation that I wish to point to. Unfortunately, it is not specified what the 'origin' of the start script path you specify is. I've tried Start.sh and ../Start.sh to no avail.

Reference map could not be read

[main/WARN]: Reference map 'restart-server-refmap.json' for restart-server.mixins.json could not be read. If this is a development environment you can ignore this message

Small warning, but might be worth looking into sometime.

/restart only works from console, and if any players are on, the server will "gracefully" crash.

In 1.20.4 I am able to use the mod, but restarting only works from the console when no players are online. If any player is on it will stop, but then crash. Additionally, issuing /restart from the game doesn't have an effect. It will print in console, but nothing actually happens, which is shown here, followed by a console-issued restart.

[22:44:03] [Server thread/INFO]: [Restart Server] Restarting server...
[22:44:12] [Server thread/INFO]: [Restart Server] Restarting server...
[22:44:12] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.NoSuchMethodError: 'void net.minecraft.server.network.ServerPlayNetworkHandler.method_14367(net.minecraft.text.Text)'
	at io.github.steveplays28.restartserver.commands.RestartCommand.lambda$execute$2(RestartCommand.java:28) ~[restart-server-1.2.0+mc1.19.x-1.20.x.jar:?]
	at java.util.ArrayList.forEach(Unknown Source) ~[?:?]
	at io.github.steveplays28.restartserver.commands.RestartCommand.execute(RestartCommand.java:28) ~[restart-server-1.2.0+mc1.19.x-1.20.x.jar:?]
	at io.github.steveplays28.restartserver.commands.RestartCommand.lambda$register$0(RestartCommand.java:20) ~[restart-server-1.2.0+mc1.19.x-1.20.x.jar:?]
	at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
	at net.minecraft.command.FixedCommandAction.execute(FixedCommandAction.java:29) ~[server-intermediary.jar:?]
	at net.minecraft.command.FixedCommandAction.execute(FixedCommandAction.java:13) ~[server-intermediary.jar:?]
	at net.minecraft.command.SourcedCommandAction.method_54405(SourcedCommandAction.java:8) ~[server-intermediary.jar:?]
	at net.minecraft.command.CommandQueueEntry.execute(CommandQueueEntry.java:8) ~[server-intermediary.jar:?]
	at net.minecraft.command.CommandExecutionContext.run(CommandExecutionContext.java:107) ~[server-intermediary.jar:?]
	at net.minecraft.server.command.CommandManager.callWithContext(CommandManager.java:378) ~[server-intermediary.jar:?]
	at net.minecraft.server.command.CommandManager.execute(CommandManager.java:308) ~[server-intermediary.jar:?]
	at net.minecraft.server.command.CommandManager.executeWithPrefix(CommandManager.java:298) ~[server-intermediary.jar:?]
	at net.minecraft.server.dedicated.MinecraftDedicatedServer.executeQueuedCommands(MinecraftDedicatedServer.java:299) ~[server-intermediary.jar:?]
	at net.minecraft.server.dedicated.MinecraftDedicatedServer.tickWorlds(MinecraftDedicatedServer.java:284) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:845) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:683) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:270) ~[server-intermediary.jar:?]
	at java.lang.Thread.run(Unknown Source) ~[?:?]
[22:44:12] [Server thread/ERROR]: This crash report has been saved to: C:\Users\userpathhere
[22:44:12] [Server thread/INFO]: BlueMap unloaded!
[22:44:12] [Server thread/INFO]: Safely shutdown!
[22:44:12] [Server thread/INFO]: Shutting down Geyser.
[22:44:13] [Server thread/INFO]: Geyser shutdown successfully.
[22:44:13] [WebSocketConnectReadThread-95/INFO]: The skin uploader has been closed
[22:44:15] [Server thread/INFO]: Stopping server
[22:44:15] [Server thread/INFO]: Saving players
[22:44:15] [Server thread/INFO]: foobar lost connection: Server closed
[22:44:15] [Server thread/INFO]: foobar left the game
[22:44:15] [Server thread/INFO]: Saving worlds
[22:44:15] [Server thread/INFO]: Saving chunks for level 'ServerLevel[Build Test]'/minecraft:overworld
[22:44:15] [Server thread/INFO]: Saving chunks for level 'ServerLevel[Build Test]'/minecraft:the_end
[22:44:15] [Server thread/INFO]: Saving chunks for level 'ServerLevel[Build Test]'/minecraft:the_nether
[22:44:15] [Server thread/INFO]: ThreadedAnvilChunkStorage (superflat): All chunks are saved
[22:44:15] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[22:44:15] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[22:44:15] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
[22:45:15] [Server Watchdog/ERROR]: A single server tick took 60.00 seconds (should be max 0.05)
[22:45:15] [Server Watchdog/ERROR]: Considering it to be crashed, server will forcibly shutdown.
[22:45:15] [Server Watchdog/ERROR]: This crash report has been saved to: C:\Users\userpathhere

[Enhancement] Pre- & Post- Stop/Start Scripts

In my specific scenario, I use Byobu for creating new windows in the terminal to run the server in. However, upon restart, the new window is created before the old window actually has a chance to finish up and close, which unnecessarily increments the window number. Whilst superficial, it would be nice to fix this.

I imagine some fix is possible if we could better define at which part of the process certain scripts run.

Also just having a config option to determine whether the mod waits for the server to entirely close/finish up or not before running the start script would be great.

1.18 doesn't work

Releases of the mod say it works on 1.18.x and 1.19.x and so does fabric.mod.json but it just doesn't on 1.18.
I know the README says you won't backport so it'd just be nice if you could remove the apparent support for 1.18.
There's a backport of the dev branch for 1.18.2 on my fork (doesn't work on 1.19), just let me know if you want a PR for it.

Fails to restart server

I'm not sure why but whenever I try to restart with the command it doesn't work. Heres the log.
[00:50:53] [Server thread/INFO]: �[38;5;11m[Restart Server] Restarting server...�[0m
[00:50:53] [Server thread/INFO]: [Restart Server] java.io.IOException: Cannot run program "cmd": error=2, No such file or directory
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at java.base/java.lang.Runtime.exec(Runtime.java:594)
at java.base/java.lang.Runtime.exec(Runtime.java:418)
at java.base/java.lang.Runtime.exec(Runtime.java:315)
at io.github.steveplays28.restartserver.commands.RestartCommand.execute(RestartCommand.java:34)
at io.github.steveplays28.restartserver.commands.RestartCommand.lambda$register$0(RestartCommand.java:19)
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264)
at net.minecraft.class_2170.method_9249(class_2170.java:287)
at net.minecraft.class_2170.method_44252(class_2170.java:280)
at net.minecraft.class_3176.method_13941(class_3176.java:299)
at net.minecraft.class_3176.method_3813(class_3176.java:284)
at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:824)
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:671)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:265)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: error=2, No such file or directory
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.(ProcessImpl.java:314)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
... 15 more

[00:50:53] [Server thread/INFO]: �[38;5;9m[Restart Server] Server restart failed.�[0m

Player leave scheduled restart instantly restarting upon join.

I am currently running a Fabric MC 1.19.2 server with a few server + client side mods. When the variable: "restartIfNoPlayersHaveBeenOnline" is set to true, whenever a player attempts to join the server, they are greeted with: "Server is restarting...". This will happen regardless of the time that the variable: "noPlayersWaitTime" is set to. I have reinstalled the config to its defaults, and the server is joinable, but as soon as the "restartIfNoPlayersHaveBeenOnline" variable is set to true, it restarts upon a join attempt.

I have tried to tweak the times and settings for a verity of the scheduled restarts, but none seem to effect it except for the one mentioned above.

Update 1.20.1

Do you happen to have any future updates for 1.20.1?

[Enhancement] Restart Countdown

Configurable countdown of the last X seconds before the server actually performs the restart. Seems better than just saying "restarting in ~2m".

Furthermore, instead of a restart message like "restarting in ~2m", it would be better if you could use a placeholder to specify where the total restart grace period is displayed. Something like `"restarting in ~${time}", for a basic example. This would work better alongside the above suggestion of a configurable timer, as the timer message could also be configured dynamically using a similar placeholder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.