diff --git a/README.md b/README.md new file mode 100644 index 0000000..9145742 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# Super Mario Odyssey: Online Server + +The official server for the [Super Mario Odyssey: Online](https://github.com/CraftyBoss/SuperMarioOdysseyOnline) mod. + + +## Windows Setup +1. Download latest build from [Releases](https://github.com/Sanae6/SmoOnlineServer/releases) +2. Run `SMO.Server.exe` +3. `settings.json` is autogenerated in step 2, modify it however you'd like. + +## Building (Mac/Linux Setup) + +Must have the [.NET 6 SDK](https://dotnet.microsoft.com/en-us/download) and Git installed. +Run these commands in your shell: +```shell +git clone https://github.com/Sanae6/SmoOnlineServer +cd SmoOnlineServer +# replace run with build to only build the server +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` + + +## Commands + +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. +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.) \ No newline at end of file diff --git a/Server/DiscordBot.cs b/Server/DiscordBot.cs index 9c600c7..2849032 100644 --- a/Server/DiscordBot.cs +++ b/Server/DiscordBot.cs @@ -40,6 +40,7 @@ public class DiscordBot { $"Console log:```{Logger.PrefixNewLines(text, $"{level} [{source}]")}```"); } } catch (Exception e) { + // don't log again, it'll just stack overflow the server! await Console.Error.WriteLineAsync("Exception in discord logger"); await Console.Error.WriteLineAsync(e.ToString()); } @@ -63,8 +64,6 @@ public class DiscordBot { string mentionPrefix = $"{DiscordClient.CurrentUser.Mention} "; DiscordClient.MessageCreated += async (_, args) => { DiscordMessage msg = args.Message; - Console.WriteLine( - $"{msg.Content} {DiscordClient.CurrentUser.Mention} {msg.Content.StartsWith(mentionPrefix)}"); if (msg.Content.StartsWith(Prefix)) { await msg.Channel.TriggerTypingAsync(); await msg.RespondAsync(string.Join('\n', diff --git a/SmoMultiplayerServer.sln b/SmoMultiplayerServer.sln index add5aec..eaa120c 100644 --- a/SmoMultiplayerServer.sln +++ b/SmoMultiplayerServer.sln @@ -7,6 +7,9 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csproj", "{CE222C1F-FBCE-4690-BD14-B7D6290A473E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External Items", "External Items", "{38C80331-521C-4097-8652-4DF384E5B9C1}" + ProjectSection(SolutionItems) = preProject + README.md = README.md + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution