mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-25 12:45:18 +00:00
Merge branch 'master' of https://github.com/Sanae6/SmoOnlineServer
This commit is contained in:
commit
967a89a55b
3 changed files with 31 additions and 3 deletions
11
README.md
11
README.md
|
@ -20,6 +20,15 @@ dotnet run --project Server/Server.csproj -c Release
|
||||||
```
|
```
|
||||||
If you ran `dotnet build` instead of `dotnet run`, you can find the binary at `Server/bin/net6.0/Release/Server.exe`
|
If you ran `dotnet build` instead of `dotnet run`, you can find the binary at `Server/bin/net6.0/Release/Server.exe`
|
||||||
|
|
||||||
|
## Running under systemd
|
||||||
|
|
||||||
|
If you have systemd, you can use the existing systemd serivce.
|
||||||
|
```shell
|
||||||
|
cp smo.serivce /etc/systemd/system/smo.service
|
||||||
|
# edit ExecStart to your path for the server executable and change WorkingDirectory to the server directory
|
||||||
|
chmod +x filepath to the server executable
|
||||||
|
systemctl enable --now smo.service
|
||||||
|
```
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
|
@ -27,4 +36,4 @@ Run `help` to get what commands are available in the server console.
|
||||||
Run the `loadsettings` command in the console to update the settings without restarting.
|
Run the `loadsettings` command in the console to update the settings without restarting.
|
||||||
Server address and port will require a server restart, but everything else should update when you run `loadsettings`.
|
Server address and port will require a server restart, but everything else should update when you run `loadsettings`.
|
||||||
|
|
||||||
[//]: # (TODO: Document all commands, possibly rename them too.)
|
[//]: # (TODO: Document all commands, possibly rename them too.)
|
||||||
|
|
|
@ -239,7 +239,7 @@ CommandHandler.RegisterCommand("send", args => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stage.Contains("Stage") && !stage.Contains("Zone")) {
|
if (!stage.Contains("Stage") && !stage.Contains("Zone")) {
|
||||||
return "Invalid Stage Name!";
|
return "Invalid Stage Name! ```cap -> Cap Kingdom\ncascade -> Cascade Kingdom\nsand -> Sand Kingdom\nlake -> Lake Kingdom\nwooded -> Wooded Kingdom\ncloud -> Cloud Kingdom\nlost -> Lost Kingdom\nmetro -> Metro Kingdom\nsea -> Sea Kingdom\nsnow -> Snow Kingdom\nlunch -> Luncheon Kingdom\nruined -> Ruined Kingdom\nbowser -> Bowser's Kingdom\nmoon -> Moon Kingdom\nmush -> Mushroom Kingdom\ndark -> Dark Side\ndarker -> Darker Side```";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sbyte.TryParse(args[2], out sbyte scenario) || scenario < -1)
|
if (!sbyte.TryParse(args[2], out sbyte scenario) || scenario < -1)
|
||||||
|
@ -273,7 +273,7 @@ CommandHandler.RegisterCommand("sendall", args => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stage.Contains("Stage") && !stage.Contains("Zone")) {
|
if (!stage.Contains("Stage") && !stage.Contains("Zone")) {
|
||||||
return "Invalid Stage Name!";
|
return "Invalid Stage Name! ```cap -> Cap Kingdom\ncascade -> Cascade Kingdom\nsand -> Sand Kingdom\nlake -> Lake Kingdom\nwooded -> Wooded Kingdom\ncloud -> Cloud Kingdom\nlost -> Lost Kingdom\nmetro -> Metro Kingdom\nsea -> Sea Kingdom\nsnow -> Snow Kingdom\nlunch -> Luncheon Kingdom\nruined -> Ruined Kingdom\nbowser -> Bowser's Kingdom\nmoon -> Moon Kingdom\nmush -> Mushroom Kingdom\ndark -> Dark Side\ndarker -> Darker Side```";
|
||||||
}
|
}
|
||||||
|
|
||||||
Client[] players = server.Clients.Where(c => c.Connected).ToArray();
|
Client[] players = server.Clients.Where(c => c.Connected).ToArray();
|
||||||
|
|
19
smo.service
Normal file
19
smo.service
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
[Unit]
|
||||||
|
Description="Super Mario Odyssey Multiplayer Server"
|
||||||
|
After=network.target
|
||||||
|
StartLimitIntervalSec=0
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
# Uncommnt User to run under a different user
|
||||||
|
# User=user
|
||||||
|
# change ExecStart to the path of the server file
|
||||||
|
ExecStart="/home/user/SMOServer/Server"
|
||||||
|
# change WorkingDirectory to the folder of your server
|
||||||
|
WorkingDirectory=/home/user/SMOServer/
|
||||||
|
# ensure the service restarts after crashing
|
||||||
|
Restart=always
|
||||||
|
# amount of time to wait before restarting the service
|
||||||
|
RestartSec=5
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in a new issue