From 9c630549263a509abeabb803d702290966990776 Mon Sep 17 00:00:00 2001 From: John Gross Date: Thu, 17 Jan 2019 10:29:05 -0800 Subject: [PATCH 01/11] Add SteamCMD beta arguments --- Torch.Server/Initializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Torch.Server/Initializer.cs b/Torch.Server/Initializer.cs index 3e83980..7289f36 100644 --- a/Torch.Server/Initializer.cs +++ b/Torch.Server/Initializer.cs @@ -31,7 +31,7 @@ namespace Torch.Server private const string RUNSCRIPT = @"force_install_dir ../ login anonymous -app_update 298740 +app_update 298740 -beta playtest -betapassword nt7WuDw9kdvC quit"; private TorchConfig _config; From 36b931f6800bb51d0d2ffd3edbd847ffb67d5b67 Mon Sep 17 00:00:00 2001 From: John Gross Date: Thu, 17 Jan 2019 14:51:24 -0800 Subject: [PATCH 02/11] Fix compilation errors, disable XML warnings --- Torch.API/Torch.API.csproj | 1 + Torch.Client/Torch.Client.csproj | 1 + Torch.Server/Torch.Server.csproj | 1 + Torch/Torch.csproj | 1 + Torch/VRageGame.cs | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Torch.API/Torch.API.csproj b/Torch.API/Torch.API.csproj index c7137e0..10bedc2 100644 --- a/Torch.API/Torch.API.csproj +++ b/Torch.API/Torch.API.csproj @@ -31,6 +31,7 @@ prompt MinimumRecommendedRules.ruleset $(SolutionDir)\bin\x64\Release\Torch.API.xml + 1591 diff --git a/Torch.Client/Torch.Client.csproj b/Torch.Client/Torch.Client.csproj index 40f2506..82a74fa 100644 --- a/Torch.Client/Torch.Client.csproj +++ b/Torch.Client/Torch.Client.csproj @@ -36,6 +36,7 @@ MinimumRecommendedRules.ruleset true $(SolutionDir)\bin\x64\Release\Torch.Client.xml + 1591 torchicon.ico diff --git a/Torch.Server/Torch.Server.csproj b/Torch.Server/Torch.Server.csproj index 545f740..0e0b2fb 100644 --- a/Torch.Server/Torch.Server.csproj +++ b/Torch.Server/Torch.Server.csproj @@ -51,6 +51,7 @@ MinimumRecommendedRules.ruleset true $(SolutionDir)\bin\x64\Release\Torch.Server.xml + 1591 Torch.Server.Program diff --git a/Torch/Torch.csproj b/Torch/Torch.csproj index 1a50d4f..defaca4 100644 --- a/Torch/Torch.csproj +++ b/Torch/Torch.csproj @@ -33,6 +33,7 @@ MinimumRecommendedRules.ruleset $(SolutionDir)\bin\x64\Release\Torch.xml true + 1591 diff --git a/Torch/VRageGame.cs b/Torch/VRageGame.cs index e470878..eafe74a 100644 --- a/Torch/VRageGame.cs +++ b/Torch/VRageGame.cs @@ -277,7 +277,7 @@ namespace Torch MyObjectBuilder_Checkpoint checkpoint = MyLocalCache.LoadCheckpoint(sessionPath, out checkpointSize); if (MySession.IsCompatibleVersion(checkpoint)) { - if (MyWorkshop.DownloadWorldModsBlocking(checkpoint.Mods, null).Success) + if (MyWorkshop.DownloadWorldModsBlocking(checkpoint.Mods).Success) { // MySpaceAnalytics.Instance.SetEntry(MyGameEntryEnum.Load); MySession.Load(sessionPath, checkpoint, checkpointSize); From b66db19c0a6a7c42fd3ce4bb36d88becfd44bda7 Mon Sep 17 00:00:00 2001 From: John Gross Date: Thu, 17 Jan 2019 15:07:50 -0800 Subject: [PATCH 03/11] Fix post world generation behavior --- Torch.Server/Managers/InstanceManager.cs | 10 +++++++++- Torch.Server/Views/WorldGeneratorDialog.xaml.cs | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Torch.Server/Managers/InstanceManager.cs b/Torch.Server/Managers/InstanceManager.cs index 245f8d1..b47cb4e 100644 --- a/Torch.Server/Managers/InstanceManager.cs +++ b/Torch.Server/Managers/InstanceManager.cs @@ -87,7 +87,15 @@ namespace Torch.Server.Managers public void SelectWorld(string worldPath, bool modsOnly = true) { DedicatedConfig.LoadWorld = worldPath; - DedicatedConfig.SelectedWorld = DedicatedConfig.Worlds.FirstOrDefault(x => x.WorldPath == worldPath); + + var worldInfo = DedicatedConfig.Worlds.FirstOrDefault(x => x.WorldPath == worldPath); + if (worldInfo?.Checkpoint == null) + { + worldInfo = new WorldViewModel(worldPath); + DedicatedConfig.Worlds.Add(worldInfo); + } + + DedicatedConfig.SelectedWorld = worldInfo; if (DedicatedConfig.SelectedWorld?.Checkpoint != null) { DedicatedConfig.Mods.Clear(); diff --git a/Torch.Server/Views/WorldGeneratorDialog.xaml.cs b/Torch.Server/Views/WorldGeneratorDialog.xaml.cs index cfbfad8..eec25de 100644 --- a/Torch.Server/Views/WorldGeneratorDialog.xaml.cs +++ b/Torch.Server/Views/WorldGeneratorDialog.xaml.cs @@ -93,7 +93,6 @@ namespace Torch.Server _instanceManager.SelectWorld(worldPath, false); - _instanceManager.LoadInstance(worldPath); _instanceManager.ImportSelectedWorldConfig(); Close(); } From ae3edd67da3831f994bc3a977d0938a1f1dac4b5 Mon Sep 17 00:00:00 2001 From: John Gross Date: Thu, 17 Jan 2019 15:52:16 -0800 Subject: [PATCH 04/11] Update chat schtuff --- .../ViewModels/SessionSettingsViewModel.cs | 10 ++++++++-- Torch/Managers/ChatManager/ChatManagerClient.cs | 17 ++++++----------- Torch/Managers/ChatManager/ChatManagerServer.cs | 8 ++++---- Torch/VRageGame.cs | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Torch.Server/ViewModels/SessionSettingsViewModel.cs b/Torch.Server/ViewModels/SessionSettingsViewModel.cs index 9f43d01..5a658ca 100644 --- a/Torch.Server/ViewModels/SessionSettingsViewModel.cs +++ b/Torch.Server/ViewModels/SessionSettingsViewModel.cs @@ -120,8 +120,14 @@ namespace Torch.Server.ViewModels public bool EnableSaving { get => _settings.EnableSaving; set => SetValue(ref _settings.EnableSaving, value); } [Torch.Views.Display(Description = "Enables respawn screen.", Name = "Enable Respawn Screen in the Game", GroupName = "Players")] - public bool EnableRespawnScreen { get => _settings.EnableRespawnScreen; set => SetValue(ref _settings.EnableRespawnScreen, value); } - + public bool StartInRespawnScreen { get => _settings.StartInRespawnScreen; set => SetValue(ref _settings.StartInRespawnScreen, value); } + + [Torch.Views.Display(Description = "Enables research.", Name = "Enable Research", GroupName = "Players")] + public bool EnableResearch { get => _settings.EnableResearch; set => SetValue(ref _settings.EnableResearch, value); } + + [Torch.Views.Display(Description = "Enables Good.bot hints.", Name = "Enable Good.bot hints", GroupName = "Players")] + public bool EnableGoodBotHints { get => _settings.EnableGoodBotHints; set => SetValue(ref _settings.EnableGoodBotHints, value); } + [Torch.Views.Display(Description = "Enables infinite ammunition in survival game mode.", Name = "Enable Infinite Ammunition in Survival", GroupName = "Others")] public bool InfiniteAmmo { get => _settings.InfiniteAmmo; set => SetValue(ref _settings.InfiniteAmmo, value); } diff --git a/Torch/Managers/ChatManager/ChatManagerClient.cs b/Torch/Managers/ChatManager/ChatManagerClient.cs index 0ded357..f7b175c 100644 --- a/Torch/Managers/ChatManager/ChatManagerClient.cs +++ b/Torch/Managers/ChatManager/ChatManagerClient.cs @@ -48,7 +48,8 @@ namespace Torch.Managers.ChatManager MyMultiplayerBase.SendScriptedChatMessage(ref scripted); } else - MyMultiplayer.Static.SendChatMessage(message); + throw new NotImplementedException("Chat system changes broke this"); + //MyMultiplayer.Static.SendChatMessage(message); } else if (HasHud) MyHud.Chat.ShowMessage(MySession.Static.LocalHumanPlayer?.DisplayName ?? "Player", message); @@ -59,12 +60,6 @@ namespace Torch.Managers.ChatManager { if (HasHud) MyHud.Chat?.ShowMessage(author, message, font); - MySession.Static.GlobalChatHistory.GlobalChatHistory.Chat.Enqueue(new MyGlobalChatItem() - { - Author = author, - AuthorFont = font, - Text = message - }); } /// @@ -76,7 +71,7 @@ namespace Torch.Managers.ChatManager { _chatMessageRecievedReplacer = _chatMessageReceivedFactory.Invoke(); _scriptedChatMessageRecievedReplacer = _scriptedChatMessageReceivedFactory.Invoke(); - _chatMessageRecievedReplacer.Replace(new Action(Multiplayer_ChatMessageReceived), + _chatMessageRecievedReplacer.Replace(new Action(Multiplayer_ChatMessageReceived), MyMultiplayer.Static); _scriptedChatMessageRecievedReplacer.Replace( new Action(Multiplayer_ScriptedChatMessageReceived), MyMultiplayer.Static); @@ -130,12 +125,12 @@ namespace Torch.Managers.ChatManager } - private void Multiplayer_ChatMessageReceived(ulong steamUserId, string message) + private void Multiplayer_ChatMessageReceived(ulong steamUserId, string messageText, ChatChannel channel, long targetId, string customAuthorName) { - var torchMsg = new TorchChatMessage(steamUserId, message, + var torchMsg = new TorchChatMessage(steamUserId, $"[{channel}] {messageText}", (steamUserId == MyGameService.UserId) ? MyFontEnum.DarkBlue : MyFontEnum.Blue); if (!RaiseMessageRecieved(torchMsg) && HasHud) - _hudChatMessageReceived.Invoke(MyHud.Chat, steamUserId, message); + _hudChatMessageReceived.Invoke(MyHud.Chat, steamUserId, $"[{channel}] {messageText}"); } private void Multiplayer_ScriptedChatMessageReceived(string message, string author, string font) diff --git a/Torch/Managers/ChatManager/ChatManagerServer.cs b/Torch/Managers/ChatManager/ChatManagerServer.cs index ba92ad3..6a0ec34 100644 --- a/Torch/Managers/ChatManager/ChatManagerServer.cs +++ b/Torch/Managers/ChatManager/ChatManagerServer.cs @@ -137,13 +137,13 @@ namespace Torch.Managers.ChatManager return consumed; } - private void MpStaticChatMessageReceived(ulong a, string b) + private void MpStaticChatMessageReceived(ulong steamUserId, string messageText, ChatChannel channel, long targetId, string customAuthorName) { var tmp = false; - RaiseMessageRecieved(new ChatMsg() + RaiseMessageRecieved(new ChatMsg { - Author = a, - Text = b + Author = steamUserId, + Text = messageText }, ref tmp); } diff --git a/Torch/VRageGame.cs b/Torch/VRageGame.cs index eafe74a..e470878 100644 --- a/Torch/VRageGame.cs +++ b/Torch/VRageGame.cs @@ -277,7 +277,7 @@ namespace Torch MyObjectBuilder_Checkpoint checkpoint = MyLocalCache.LoadCheckpoint(sessionPath, out checkpointSize); if (MySession.IsCompatibleVersion(checkpoint)) { - if (MyWorkshop.DownloadWorldModsBlocking(checkpoint.Mods).Success) + if (MyWorkshop.DownloadWorldModsBlocking(checkpoint.Mods, null).Success) { // MySpaceAnalytics.Instance.SetEntry(MyGameEntryEnum.Load); MySession.Load(sessionPath, checkpoint, checkpointSize); From 6973bc8e7d8ba8fe4be98d762a8d5f1d03220660 Mon Sep 17 00:00:00 2001 From: John Gross Date: Thu, 17 Jan 2019 15:58:35 -0800 Subject: [PATCH 05/11] Make Jenkins download playtest branch --- Jenkins/jenkins-grab-se.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkins/jenkins-grab-se.ps1 b/Jenkins/jenkins-grab-se.ps1 index 7670e02..f3c636e 100644 --- a/Jenkins/jenkins-grab-se.ps1 +++ b/Jenkins/jenkins-grab-se.ps1 @@ -1,6 +1,6 @@ pushd -$steamData = "C:/Steam/Data/" +$steamData = "C:/Steam/Data-playtest/" $steamCMDPath = "C:/Steam/steamcmd/" $steamCMDZip = "C:/Steam/steamcmd.zip" @@ -17,6 +17,6 @@ if (!(Test-Path $steamCMDPath)) { } cd "$steamData" -& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740" "+quit" +& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740 -beta playtest -betapassword nt7WuDw9kdvC" "+quit" popd \ No newline at end of file From 1a0f80dce7de599d233d2743af486d9d4e3af032 Mon Sep 17 00:00:00 2001 From: John Gross Date: Thu, 17 Jan 2019 16:07:13 -0800 Subject: [PATCH 06/11] Actually finish making Jenkins work --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e554cf4..b2a5471 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,7 +22,7 @@ node { stage('Acquire SE') { bat 'powershell -File Jenkins/jenkins-grab-se.ps1' bat 'IF EXIST GameBinaries RMDIR GameBinaries' - bat 'mklink /J GameBinaries "C:/Steam/Data/DedicatedServer64/"' + bat 'mklink /J GameBinaries "C:/Steam/Data-playtest/DedicatedServer64/"' } stage('Acquire NuGet Packages') { From 30729049b317987e016146264a79b2cf46245812 Mon Sep 17 00:00:00 2001 From: John Gross Date: Thu, 17 Jan 2019 17:02:03 -0800 Subject: [PATCH 07/11] Give Mr. Parenthesis a friend --- Torch/Managers/MultiplayerManagerBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Torch/Managers/MultiplayerManagerBase.cs b/Torch/Managers/MultiplayerManagerBase.cs index d892a8e..30bf775 100644 --- a/Torch/Managers/MultiplayerManagerBase.cs +++ b/Torch/Managers/MultiplayerManagerBase.cs @@ -116,7 +116,7 @@ namespace Torch.Managers protected void RaiseClientJoined(ulong steamId) { var vm = new PlayerViewModel(steamId) { State = ConnectionState.Connected }; - _log.Info($"Player {vm.Name} joined ({vm.SteamId}"); + _log.Info($"Player {vm.Name} joined ({vm.SteamId})"); Players.Add(steamId, vm); PlayerJoined?.Invoke(vm); } From 8c7891809e94965e61b25c074f0157019ab5eba6 Mon Sep 17 00:00:00 2001 From: John Gross Date: Mon, 21 Jan 2019 16:11:44 -0800 Subject: [PATCH 08/11] Update readme --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index f80cbe2..f553aaa 100644 --- a/README.md +++ b/README.md @@ -18,18 +18,10 @@ Torch is the successor to SE Server Extender and gives server admins the tools t * Unzip the Torch release into its own directory and run the executable. It will automatically download the SE DS and generate the other necessary files. - If you already have a DS installed you can unzip the Torch files into the folder that contains the DedicatedServer64 folder. -## Torch.Client -* An optional client-side version of Torch. More documentation to come. - # Building To build Torch you must first have a complete SE Dedicated installation somewhere. Before you open the solution, run the Setup batch file and enter the path of that installation's DedicatedServer64 folder. The script will make a symlink to that folder so the Torch solution can find the DLL references it needs. In both cases you will need to set the InstancePath in TorchConfig.xml to an existing dedicated server instance as Torch can't fully generate it on its own yet. -# Official Plugins -Install plugins by unzipping them into the 'Plugins' folder which should be in the same location as the Torch files. If it doesn't exist you can simply create it. -* [Essentials](https://github.com/TorchAPI/Essentials): Adds a slew of chat commands and other tools to help manage your server. -* [Concealment](https://github.com/TorchAPI/Concealment): Adds game logic and physics optimizations that significantly improve sim speed. - If you have a more enjoyable server experience because of Torch, please consider supporting us on Patreon. [![Patreon](http://i.imgur.com/VzzIMgn.png)](https://www.patreon.com/bePatron?u=847269)! From bbcfc9fb0746c51a16da189aabbe94fa789bdb8d Mon Sep 17 00:00:00 2001 From: Jimmacle Date: Thu, 31 Jan 2019 08:45:01 -0800 Subject: [PATCH 09/11] Update jenkins-grab-se.ps1 --- Jenkins/jenkins-grab-se.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkins/jenkins-grab-se.ps1 b/Jenkins/jenkins-grab-se.ps1 index f3c636e..70a5537 100644 --- a/Jenkins/jenkins-grab-se.ps1 +++ b/Jenkins/jenkins-grab-se.ps1 @@ -17,6 +17,6 @@ if (!(Test-Path $steamCMDPath)) { } cd "$steamData" -& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740 -beta playtest -betapassword nt7WuDw9kdvC" "+quit" +& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740 -beta playtest -betapassword nt7WuDw9kdvC validate" "+quit" -popd \ No newline at end of file +popd From c3addd05f7d1744ee70be07c31e877b6df9407d3 Mon Sep 17 00:00:00 2001 From: Jimmacle Date: Thu, 31 Jan 2019 08:46:19 -0800 Subject: [PATCH 10/11] Keen why did you change the beta password --- Jenkins/jenkins-grab-se.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkins/jenkins-grab-se.ps1 b/Jenkins/jenkins-grab-se.ps1 index 70a5537..26ca62e 100644 --- a/Jenkins/jenkins-grab-se.ps1 +++ b/Jenkins/jenkins-grab-se.ps1 @@ -17,6 +17,6 @@ if (!(Test-Path $steamCMDPath)) { } cd "$steamData" -& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740 -beta playtest -betapassword nt7WuDw9kdvC validate" "+quit" +& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740 -beta playtest -betapassword nt8WuDw9kdvE validate" "+quit" popd From 8f755a5cfca53e869c1b477cd65e33d8eae8e9f8 Mon Sep 17 00:00:00 2001 From: Jimmacle Date: Thu, 31 Jan 2019 11:45:11 -0800 Subject: [PATCH 11/11] Update Initializer.cs --- Torch.Server/Initializer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Torch.Server/Initializer.cs b/Torch.Server/Initializer.cs index 7289f36..0844df8 100644 --- a/Torch.Server/Initializer.cs +++ b/Torch.Server/Initializer.cs @@ -31,7 +31,7 @@ namespace Torch.Server private const string RUNSCRIPT = @"force_install_dir ../ login anonymous -app_update 298740 -beta playtest -betapassword nt7WuDw9kdvC +app_update 298740 -beta playtest -betapassword nt8WuDw9kdvE quit"; private TorchConfig _config; @@ -235,4 +235,4 @@ quit"; Process.GetCurrentProcess().Kill(); } } -} \ No newline at end of file +}