From 6272c1227ba18b85e32ab8df934c1b7d0d6ee111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=AAOhmcodes=E2=84=A2=E2=9C=AA?= Date: Wed, 24 Jan 2024 09:29:00 -0800 Subject: [PATCH] remove update config completely --- Enshrouded.cs/Enshrouded.cs | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/Enshrouded.cs/Enshrouded.cs b/Enshrouded.cs/Enshrouded.cs index d8a6aff..e64c59c 100644 --- a/Enshrouded.cs/Enshrouded.cs +++ b/Enshrouded.cs/Enshrouded.cs @@ -17,7 +17,7 @@ public class Enshrouded: SteamCMDAgent name = "WindowsGSM.Enshrouded", // WindowsGSM.XXXX author = "ohmcodes", description = "WindowsGSM plugin for supporting Enshrouded Dedicated Server", - version = "1.0.0", + version = "1.0.1", url = "https://github.com/ohmcodes/WindowsGSM.Enshrouded", // Github repository link (Best practice) color = "#34c9eb" // Color Hex }; @@ -96,8 +96,6 @@ public async Task Start() param += $"-slotCount={_serverData.ServerMaxPlayer} "; param += $"-name=\"\"\"{_serverData.ServerName}\"\"\""; - UpdateConfig(); - // Prepare Process var p = new Process { @@ -164,11 +162,6 @@ public async Task Update(bool validate = false, string custom = null) Error = error; await Task.Run(() => { p.WaitForExit(); }); - if( error != null && p != null) - { - UpdateConfig(); - } - return p; } @@ -192,26 +185,5 @@ public async Task GetRemoteBuild() var steamCMD = new Installer.SteamCMD(); return await steamCMD.GetRemoteBuild(AppId); } - - public void UpdateConfig() - { - var serverConfig = new - { - name = $"{_serverData.ServerName}", - ip = $"{_serverData.ServerIP}", - gamePort = _serverData.ServerPort, - queryPort = _serverData.ServerQueryPort, - slotCount = _serverData.ServerMaxPlayer - }; - - // Convert the object to JSON format - string jsonContent = JsonConvert.SerializeObject(serverConfig, Formatting.Indented); - - // Specify the file path - string filePath = Functions.ServerPath.GetServersServerFiles(_serverData.ServerID, "enshrouded_server.json"); - - // Write the JSON content to the file - File.WriteAllText(filePath, jsonContent); - } } }