How do you reset a server in code?

Post Reply
ChristienChapman
Member
Posts: 117
Joined: Sat May 28, 2022 00:04

How do you reset a server in code?

by ChristienChapman » Post

Is there a way to shutdown a server and then reset in code?

Example:


serverRestart()
God bless you.

List of releases:
Minetest Zombies Minigame - viewtopic.php?f=9&t=28442&p=412633#p412633

- > cdb_1d60e1a03f83

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: How do you reset a server in code?

by Nathan.S » Post

There is a chat command to shutdown a server, but nothing to bring it back up. I'm pretty sure you'll need an external script to restart the server.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Blockhead
Member
Posts: 1686
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: How do you reset a server in code?

by Blockhead » Post

It's possible to shut the server down from Lua (ref), but you will need proper external tools to make it restart automatically, such as running it as a systemd service like the minetestserver package for Debian (& derivatives) provide, or running the server from a shell script in a loop if you want the rudimentary solution (sysvinit, upstart and so on have their own way to do it I'm sure, anyone who wants to tell us about that feel free).
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

ChristienChapman
Member
Posts: 117
Joined: Sat May 28, 2022 00:04

Re: How do you reset a server in code?

by ChristienChapman » Post

Oh. I was thinking of branching a server for a peoject. I will just reset the world another way cause this sounds harder.
God bless you.

List of releases:
Minetest Zombies Minigame - viewtopic.php?f=9&t=28442&p=412633#p412633

- > cdb_1d60e1a03f83

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests