diff --git a/.gitignore b/.gitignore
index 50c0415..8d76898 100644
--- a/.gitignore
+++ b/.gitignore
@@ -250,4 +250,5 @@ ModelManifest.xml
.paket/paket.exe
# FAKE - F# Make
-.fake/
\ No newline at end of file
+.fake/
+GameBinaries
diff --git a/Torch.API/Torch.API.csproj b/Torch.API/Torch.API.csproj
index 4c93e33..d66de92 100644
--- a/Torch.API/Torch.API.csproj
+++ b/Torch.API/Torch.API.csproj
@@ -32,29 +32,43 @@
MinimumRecommendedRules.ruleset
+
+ False
+ ..\GameBinaries\HavokWrapper.dll
+
..\packages\NLog.4.4.1\lib\net45\NLog.dll
True
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Common.dll
+
+ False
+ ..\GameBinaries\Sandbox.Common.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Game.dll
+
+ False
+ ..\GameBinaries\Sandbox.Game.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Graphics.dll
+
+ False
+ ..\GameBinaries\Sandbox.Graphics.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.Game.dll
+
+ False
+ ..\GameBinaries\SpaceEngineers.Game.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.ObjectBuilders.dll
+
+ False
+ ..\GameBinaries\SpaceEngineers.ObjectBuilders.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.ObjectBuilders.XmlSerializers.dll
+
+ False
+ ..\GameBinaries\SpaceEngineers.ObjectBuilders.XmlSerializers.dll
+
+
+ False
+ ..\GameBinaries\SteamSDK.dll
@@ -69,44 +83,57 @@
+
+ ..\Torch.Server\bin\x64\Release\Torch.dll
+
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.dll
- False
+ ..\GameBinaries\VRage.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Audio.dll
-
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Game.dll
-
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Game.XmlSerializers.dll
-
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Input.dll
-
-
+
False
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Library.dll
- False
+ ..\GameBinaries\VRage.Audio.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Math.dll
+
+ ..\GameBinaries\VRage.Dedicated.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Native.dll
+
+ False
+ ..\GameBinaries\VRage.Game.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.OpenVRWrapper.dll
+
+ False
+ ..\GameBinaries\VRage.Game.XmlSerializers.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render.dll
+
+ False
+ ..\GameBinaries\VRage.Input.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render11.dll
+
+ ..\GameBinaries\VRage.Library.dll
-
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Scripting.dll
+
+ False
+ ..\GameBinaries\VRage.Math.dll
+
+
+ False
+ ..\GameBinaries\VRage.Native.dll
+
+
+ False
+ ..\GameBinaries\VRage.OpenVRWrapper.dll
+
+
+ False
+ ..\GameBinaries\VRage.Render.dll
+
+
+ False
+ ..\GameBinaries\VRage.Render11.dll
+
+
+ False
+ ..\GameBinaries\VRage.Scripting.dll
diff --git a/Torch.Client/Properties/AssemblyInfo.cs b/Torch.Client/Properties/AssemblyInfo.cs
index ea6cf1e..7aa4672 100644
--- a/Torch.Client/Properties/AssemblyInfo.cs
+++ b/Torch.Client/Properties/AssemblyInfo.cs
@@ -1,16 +1,4 @@
-
-using System.Reflection;
-using System.Runtime.InteropServices;
+using System.Reflection;
-[assembly: AssemblyTitle("Torch Client")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Torch")]
-[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-
-[assembly: AssemblyVersion("1.0.89.540")]
-[assembly: AssemblyFileVersion("1.0.89.540")]
\ No newline at end of file
+[assembly: AssemblyVersion("1.0.105.498")]
+[assembly: AssemblyFileVersion("1.0.105.498")]
\ No newline at end of file
diff --git a/Torch.Client/Properties/AssemblyInfo.tt b/Torch.Client/Properties/AssemblyInfo.tt
index c1b48cf..9937cb7 100644
--- a/Torch.Client/Properties/AssemblyInfo.tt
+++ b/Torch.Client/Properties/AssemblyInfo.tt
@@ -4,19 +4,7 @@
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
-
using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("Torch Client")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Torch")]
-[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
<# var dt = DateTime.Now;
int major = 1;
diff --git a/Torch.Client/Properties/AssemblyInfo1.cs b/Torch.Client/Properties/AssemblyInfo1.cs
new file mode 100644
index 0000000..013f62e
--- /dev/null
+++ b/Torch.Client/Properties/AssemblyInfo1.cs
@@ -0,0 +1,12 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Torch Client")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Torch")]
+[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/Torch.Client/Torch.Client.csproj b/Torch.Client/Torch.Client.csproj
index cafcd96..6dacd83 100644
--- a/Torch.Client/Torch.Client.csproj
+++ b/Torch.Client/Torch.Client.csproj
@@ -108,6 +108,7 @@
True
True
+
diff --git a/Torch.Server/Properties/AssemblyInfo.cs b/Torch.Server/Properties/AssemblyInfo.cs
index 68a074f..7aa4672 100644
--- a/Torch.Server/Properties/AssemblyInfo.cs
+++ b/Torch.Server/Properties/AssemblyInfo.cs
@@ -1,16 +1,4 @@
-
-using System.Reflection;
-using System.Runtime.InteropServices;
+using System.Reflection;
-[assembly: AssemblyTitle("Torch Server")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Torch")]
-[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-
-[assembly: AssemblyVersion("1.0.89.540")]
-[assembly: AssemblyFileVersion("1.0.89.540")]
\ No newline at end of file
+[assembly: AssemblyVersion("1.0.105.498")]
+[assembly: AssemblyFileVersion("1.0.105.498")]
\ No newline at end of file
diff --git a/Torch.Server/Properties/AssemblyInfo.tt b/Torch.Server/Properties/AssemblyInfo.tt
index eee6580..9937cb7 100644
--- a/Torch.Server/Properties/AssemblyInfo.tt
+++ b/Torch.Server/Properties/AssemblyInfo.tt
@@ -4,19 +4,7 @@
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
-
using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("Torch Server")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Torch")]
-[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
<# var dt = DateTime.Now;
int major = 1;
diff --git a/Torch.Server/Properties/AssemblyInfo1.cs b/Torch.Server/Properties/AssemblyInfo1.cs
new file mode 100644
index 0000000..c1db141
--- /dev/null
+++ b/Torch.Server/Properties/AssemblyInfo1.cs
@@ -0,0 +1,12 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Torch Server")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Torch")]
+[assembly: AssemblyCopyright("Copyright © Torch API 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/Torch.Server/Torch.Server.csproj b/Torch.Server/Torch.Server.csproj
index 4026157..571a865 100644
--- a/Torch.Server/Torch.Server.csproj
+++ b/Torch.Server/Torch.Server.csproj
@@ -45,46 +45,48 @@
False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\DedicatedServer64\HavokWrapper.dll
+ ..\GameBinaries\HavokWrapper.dll
False
False
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Microsoft.CodeAnalysis.dll
+ ..\GameBinaries\Microsoft.CodeAnalysis.dll
False
- ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Microsoft.CodeAnalysis.CSharp.dll
+ ..\GameBinaries\Microsoft.CodeAnalysis.CSharp.dll
..\packages\NLog.4.4.1\lib\net45\NLog.dll
True
-
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\Sandbox.Common.dll
-
-
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\Sandbox.Game.dll
-
-
+
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\Sandbox.Graphics.dll
+ ..\GameBinaries\Sandbox.Common.dll
-
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\SpaceEngineers.Game.dll
+
+ False
+ ..\GameBinaries\Sandbox.Game.dll
+
+
+ False
+ ..\GameBinaries\Sandbox.Graphics.dll
+
+
+ False
+ ..\GameBinaries\SpaceEngineers.Game.dll
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\SpaceEngineers.ObjectBuilders.dll
+ ..\GameBinaries\SpaceEngineers.ObjectBuilders.dll
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\SpaceEngineers.ObjectBuilders.XmlSerializers.dll
+ ..\GameBinaries\SpaceEngineers.ObjectBuilders.XmlSerializers.dll
False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SteamSDK.dll
- False
+ ..\GameBinaries\SteamSDK.dll
@@ -101,51 +103,57 @@
4.0
-
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.dll
+
+ False
+ ..\GameBinaries\VRage.dll
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Audio.dll
+ ..\GameBinaries\VRage.Audio.dll
-
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Dedicated.dll
+
+ False
+ ..\GameBinaries\VRage.Dedicated.dll
-
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Game.dll
+
+ False
+ ..\GameBinaries\VRage.Game.dll
-
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Game.XmlSerializers.dll
+
+ False
+ ..\GameBinaries\VRage.Game.XmlSerializers.dll
-
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Input.dll
+
+ False
+ ..\GameBinaries\VRage.Input.dll
-
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Library.dll
+
+ False
+ ..\GameBinaries\VRage.Library.dll
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Math.dll
+ ..\GameBinaries\VRage.Math.dll
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Native.dll
+ ..\GameBinaries\VRage.Native.dll
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.OpenVRWrapper.dll
+ ..\GameBinaries\VRage.OpenVRWrapper.dll
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Render.dll
+ ..\GameBinaries\VRage.Render.dll
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Render11.dll
+ ..\GameBinaries\VRage.Render11.dll
False
- ..\..\..\..\..\..\..\steamcmd\steamapps\common\SpaceEngineersDedicatedServer\DedicatedServer64\VRage.Scripting.dll
+ ..\GameBinaries\VRage.Scripting.dll
@@ -158,6 +166,7 @@
True
AssemblyInfo.tt
+
Component
diff --git a/Torch.Server/TorchServer.cs b/Torch.Server/TorchServer.cs
index 711ab5a..32a6748 100644
--- a/Torch.Server/TorchServer.cs
+++ b/Torch.Server/TorchServer.cs
@@ -24,6 +24,7 @@ using VRage.Dedicated;
using VRage.FileSystem;
using VRage.Game;
using VRage.Game.ModAPI;
+using VRage.Game.ObjectBuilder;
using VRage.Game.SessionComponents;
using VRage.Profiler;
@@ -59,11 +60,11 @@ namespace Torch.Server
MyPerServerSettings.GameDSName = MyPerServerSettings.GameNameSafe + "Dedicated";
MyPerServerSettings.GameDSDescription = "Your place for space engineering, destruction and exploring.";
MySessionComponentExtDebug.ForceDisable = true;
- MyPerServerSettings.AppId = 244850u;
- var gameVersion = MyPerGameSettings.BasicGameInfo.GameVersion;
- MyFinalBuildConstants.APP_VERSION = gameVersion ?? 0;
+ MyPerServerSettings.AppId = 244850;
+ MyFinalBuildConstants.APP_VERSION = MyPerGameSettings.BasicGameInfo.GameVersion;
+ //MyGlobalTypeMetadata.Static.Init();
- //TODO: Allows players to filter servers for Torch in the server browser.
+ //TODO: Allows players to filter servers for Torch in the server browser. Need to init Steam before this
//SteamServerAPI.Instance.GameServer.SetKeyValue("SM", "Torch");
}
diff --git a/Torch.Server/ViewModels/SteamUserViewModel.cs b/Torch.Server/ViewModels/SteamUserViewModel.cs
new file mode 100644
index 0000000..30c3096
--- /dev/null
+++ b/Torch.Server/ViewModels/SteamUserViewModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Torch.Server.ViewModels
+{
+ class SteamUserViewModel
+ {
+ }
+}
diff --git a/Torch.Server/Views/ConfigControl.xaml b/Torch.Server/Views/ConfigControl.xaml
index 68e5b92..0bf2f5e 100644
--- a/Torch.Server/Views/ConfigControl.xaml
+++ b/Torch.Server/Views/ConfigControl.xaml
@@ -1,185 +1,207 @@
-
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
-
+
+
\ No newline at end of file
diff --git a/Torch.Server/Views/PluginsControl.xaml b/Torch.Server/Views/PluginsControl.xaml
index 1b7261d..b2229d7 100644
--- a/Torch.Server/Views/PluginsControl.xaml
+++ b/Torch.Server/Views/PluginsControl.xaml
@@ -11,16 +11,19 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/Torch.Server/Views/PropertyGrid.xaml b/Torch.Server/Views/PropertyGrid.xaml
new file mode 100644
index 0000000..28d01e6
--- /dev/null
+++ b/Torch.Server/Views/PropertyGrid.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Torch.Server/Views/PropertyGrid.xaml.cs b/Torch.Server/Views/PropertyGrid.xaml.cs
new file mode 100644
index 0000000..f26fef4
--- /dev/null
+++ b/Torch.Server/Views/PropertyGrid.xaml.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Torch.Server.Views
+{
+ ///
+ /// Interaction logic for PropertyGrid.xaml
+ ///
+ public partial class PropertyGrid : UserControl
+ {
+ public PropertyGrid()
+ {
+ InitializeComponent();
+ }
+
+ public void SetObject(object obj)
+ {
+ var props = obj.GetType().GetProperties();
+ foreach (var prop in props)
+ {
+ var p = prop.GetValue(obj);
+ Grid.Items.Add(new PropertyView(p, prop.Name));
+ }
+ }
+ }
+
+ public class PropertyView : ViewModel
+ {
+ private object _obj;
+
+ public string Name { get; }
+ public string Value { get { return _obj.ToString(); } }
+ public DataTemplate ValueEditTemplate;
+
+ public PropertyView(object obj, string name)
+ {
+ Name = name;
+ _obj = obj;
+
+ ValueEditTemplate = new DataTemplate();
+ }
+ }
+
+ /*
+ public class PropertyGridDataTemplateSelector : DataTemplateSelector
+ {
+ public override DataTemplate SelectTemplate(object item, DependencyObject container)
+ {
+ if (item is IEnumerable)
+ {
+
+ }
+ }
+ }*/
+}
diff --git a/Torch.Server/Views/TorchUI.xaml b/Torch.Server/Views/TorchUI.xaml
index 6be87f3..c8dd984 100644
--- a/Torch.Server/Views/TorchUI.xaml
+++ b/Torch.Server/Views/TorchUI.xaml
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:Torch.Server"
xmlns:views="clr-namespace:Torch.Server.Views"
mc:Ignorable="d"
- Title="Torch" Height="600" Width="800">
+ Title="Torch" Height="800" Width="800">
@@ -17,13 +17,13 @@
-
-
+
+
-
-
+
+
diff --git a/Torch.Server/Views/WorldSelectControl.xaml b/Torch.Server/Views/WorldSelectControl.xaml
new file mode 100644
index 0000000..1c213b1
--- /dev/null
+++ b/Torch.Server/Views/WorldSelectControl.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/Torch.Server/Views/WorldSelectControl.xaml.cs b/Torch.Server/Views/WorldSelectControl.xaml.cs
new file mode 100644
index 0000000..de546fc
--- /dev/null
+++ b/Torch.Server/Views/WorldSelectControl.xaml.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Sandbox.Game.Gui;
+
+namespace Torch.Server.Views
+{
+ ///
+ /// Interaction logic for WorldSelectControl.xaml
+ ///
+ public partial class WorldSelectControl : UserControl
+ {
+ public WorldSelectControl()
+ {
+ InitializeComponent();
+ //LoadWorlds();
+ }
+
+ public void LoadWorlds(string path = null)
+ {
+ WorldList.Items.Clear();
+ var worlds = new MyLoadWorldInfoListResult(path);
+ worlds.Task.Wait();
+
+ foreach (var world in worlds.AvailableSaves)
+ {
+ WorldList.Items.Add(world.Item1);
+ }
+ }
+ }
+}
diff --git a/Torch/Commands/Command.cs b/Torch/Commands/Command.cs
index c0b7291..74cc11c 100644
--- a/Torch/Commands/Command.cs
+++ b/Torch/Commands/Command.cs
@@ -21,10 +21,11 @@ namespace Torch.Commands
public Type Module { get; }
public List Path { get; } = new List();
public ITorchPlugin Plugin { get; }
+ public string SyntaxHelp { get; }
+
private readonly MethodInfo _method;
private ParameterInfo[] _parameters;
private int? _requiredParamCount;
- public string SyntaxHelp { get; }
public Command(ITorchPlugin plugin, MethodInfo commandMethod)
{
@@ -76,7 +77,7 @@ namespace Torch.Commands
}
}
- _requiredParamCount = _requiredParamCount ?? 0;
+ _requiredParamCount = _requiredParamCount ?? _parameters.Length;
LogManager.GetLogger(nameof(Command)).Debug($"Params: {_parameters.Length} ({_requiredParamCount} required)");
SyntaxHelp = sb.ToString();
}
@@ -97,7 +98,7 @@ namespace Torch.Commands
return false;
}
- //Fill omitted default parameters
+ //Fill remaining parameters with default values
for (var i = 0; i < parameters.Length; i++)
{
if (parameters[i] == null)
@@ -109,13 +110,6 @@ namespace Torch.Commands
_method.Invoke(moduleInstance, parameters);
return true;
}
-
- public void Invoke(CommandContext context)
- {
- var moduleInstance = (CommandModule)Activator.CreateInstance(Module);
- moduleInstance.Context = context;
- _method.Invoke(moduleInstance, null);
- }
}
public static class Extensions
diff --git a/Torch/Commands/CommandManager.cs b/Torch/Commands/CommandManager.cs
index 487ae55..a7f1b5f 100644
--- a/Torch/Commands/CommandManager.cs
+++ b/Torch/Commands/CommandManager.cs
@@ -100,11 +100,13 @@ namespace Torch.Commands
var splitArgs = Regex.Matches(argText, "(\"[^\"]+\"|\\S+)").Cast().Select(x => x.ToString().Replace("\"", "")).ToList();
_log.Trace($"Invoking {cmdPath} for player {player.DisplayName}");
var context = new CommandContext(_torch, command.Plugin, player, argText, splitArgs);
- //command.Invoke(context);
- if (command.TryInvoke(context))
- _log.Info($"Player {player.DisplayName} ran command '{msg.Text}'");
- else
- context.Respond($"Invalid Syntax: {command.SyntaxHelp}");
+ _torch.Invoke(() =>
+ {
+ if (command.TryInvoke(context))
+ _log.Info($"Player {player.DisplayName} ran command '{msg.Text}'");
+ else
+ context.Respond($"Invalid Syntax: {command.SyntaxHelp}");
+ });
}
}
}
diff --git a/Torch/Managers/ChatManager.cs b/Torch/Managers/ChatManager.cs
index 89ec076..2edbe20 100644
--- a/Torch/Managers/ChatManager.cs
+++ b/Torch/Managers/ChatManager.cs
@@ -27,10 +27,7 @@ namespace Torch.Managers
public void Init()
{
- //HACK
- MyMultiplayer.Static.ChatMessageReceived += Static_ChatMessageReceived;
- _log.Warn("Chat intercept broken, chat hiding will not work!");
- //NetworkManager.Instance.RegisterNetworkHandlers(new ChatIntercept());
+ NetworkManager.Instance.RegisterNetworkHandlers(new ChatIntercept());
}
private void Static_ChatMessageReceived(ulong arg1, string arg2, SteamSDK.ChatEntryTypeEnum arg3)
@@ -70,28 +67,6 @@ namespace Torch.Managers
public override bool Handle(ulong remoteUserId, CallSite site, BitStream stream, object obj, MyPacket packet)
{
- /*
- var msg = new ChatMsg();
-
- var msgLength = stream.ByteLength - stream.BytePosition - 8;
- var bytes = new byte[msgLength];
- stream.ReadBytes(bytes, stream.BytePosition, msgLength);
-
- msg.Text = Encoding.Unicode.GetString(bytes);
- msg.Author = stream.ReadUInt64();
-
- var log = LogManager.GetLogger("HandleDebug");
- var sb = new StringBuilder();
-
- foreach (char c in msg.Text.ToCharArray())
- {
- sb.Append(Convert.ToString(c, 2).PadLeft(16, '0'));
- }
-
- log.Debug(sb.ToString());*/
- //stream.ResetRead(packet);
- //var msg = MySerializer.CreateAndRead(stream);
-
var msg = new ChatMsg();
Serialize(site.MethodInfo, stream, ref msg);
diff --git a/Torch/Managers/EntityManager.cs b/Torch/Managers/EntityManager.cs
index b977e58..1cae748 100644
--- a/Torch/Managers/EntityManager.cs
+++ b/Torch/Managers/EntityManager.cs
@@ -75,6 +75,7 @@ namespace Torch.Managers
public void InitConcealment(double concealInterval)
{
+ return;
Log.Info($"Initializing concealment to run every {concealInterval}ms");
_concealedAabbTree = new MyDynamicAABBTreeD(MyConstants.GAME_PRUNING_STRUCTURE_AABB_EXTENSION);
_concealTimer = new Timer(concealInterval);
diff --git a/Torch/Managers/NetworkManager/NetworkManager.cs b/Torch/Managers/NetworkManager/NetworkManager.cs
index 2418852..ab81614 100644
--- a/Torch/Managers/NetworkManager/NetworkManager.cs
+++ b/Torch/Managers/NetworkManager/NetworkManager.cs
@@ -116,7 +116,7 @@ namespace Torch.Managers
var networkId = stream.ReadNetworkId();
//this value is unused, but removing this line corrupts the rest of the stream
var blockedNetworkId = stream.ReadNetworkId();
- var eventId = (uint)stream.ReadByte();
+ var eventId = (uint)stream.ReadInt16();
CallSite site;
@@ -152,7 +152,8 @@ namespace Torch.Managers
//we're handling the network live in the game thread, this needs to go as fast as possible
var discard = false;
- Parallel.ForEach(_networkHandlers, handler =>
+ foreach (var handler in _networkHandlers)
+ //Parallel.ForEach(_networkHandlers, handler =>
{
try
{
@@ -164,7 +165,7 @@ namespace Torch.Managers
//ApplicationLog.Error(ex.ToString());
_log.Error(ex);
}
- });
+ };
//one of the handlers wants us to discard this packet
if (discard)
diff --git a/Torch/PluginManifest.cs b/Torch/PluginManifest.cs
new file mode 100644
index 0000000..ea739dc
--- /dev/null
+++ b/Torch/PluginManifest.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Torch
+{
+ public class PluginManifest
+ {
+ public string Repository { get; set; }
+ public string Version { get; set; }
+ }
+}
diff --git a/Torch/Torch.csproj b/Torch/Torch.csproj
index 200607e..03d7a31 100644
--- a/Torch/Torch.csproj
+++ b/Torch/Torch.csproj
@@ -32,48 +32,37 @@
MinimumRecommendedRules.ruleset
+
+ False
+ ..\GameBinaries\HavokWrapper.dll
+
..\packages\NLog.4.4.1\lib\net45\NLog.dll
True
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Common.dll
- False
+
+ ..\packages\Octokit.0.24.0\lib\net45\Octokit.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Game.dll
- False
+
+ ..\GameBinaries\Sandbox.Common.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Graphics.dll
- False
+
+ ..\GameBinaries\Sandbox.Game.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.Game.dll
- False
+
+ ..\GameBinaries\Sandbox.Graphics.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.ObjectBuilders.dll
- False
+
+ ..\GameBinaries\SpaceEngineers.Game.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.ObjectBuilders.XmlSerializers.dll
- False
+
+ ..\GameBinaries\SpaceEngineers.ObjectBuilders.dll
-
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\DedicatedServer64\SpaceEngineersDedicated.exe
- False
+
+ ..\GameBinaries\SpaceEngineers.ObjectBuilders.XmlSerializers.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SteamSDK.dll
- False
+
+ ..\GameBinaries\SteamSDK.dll
@@ -83,64 +72,44 @@
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.dll
- False
+
+ ..\GameBinaries\VRage.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Audio.dll
- False
+
+ ..\GameBinaries\VRage.Audio.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Game.dll
- False
+
+ ..\GameBinaries\VRage.Dedicated.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Game.XmlSerializers.dll
- False
+
+ ..\GameBinaries\VRage.Game.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Input.dll
- False
+
+ ..\GameBinaries\VRage.Game.XmlSerializers.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Library.dll
- False
+
+ ..\GameBinaries\VRage.Input.dll
+
+
+ ..\GameBinaries\VRage.Library.dll
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Math.dll
- False
+ ..\GameBinaries\VRage.Math.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Native.dll
- False
+
+ ..\GameBinaries\VRage.Native.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.OpenVRWrapper.dll
- False
+
+ ..\GameBinaries\VRage.OpenVRWrapper.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render.dll
- False
+
+ ..\GameBinaries\VRage.Render.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render11.dll
- False
+
+ ..\GameBinaries\VRage.Render11.dll
-
- False
- C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Scripting.dll
- False
+
+ ..\GameBinaries\VRage.Scripting.dll
@@ -162,6 +131,7 @@
+
@@ -169,6 +139,7 @@
+
diff --git a/Torch/TorchBase.cs b/Torch/TorchBase.cs
index e1e0216..dea5825 100644
--- a/Torch/TorchBase.cs
+++ b/Torch/TorchBase.cs
@@ -192,7 +192,13 @@ namespace Torch
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
- Log.Fatal((Exception)e.ExceptionObject);
+ var ex = (Exception)e.ExceptionObject;
+ Log.Fatal(ex);
+ if (ex is ReflectionTypeLoadException rex)
+ {
+ foreach (var x in rex.LoaderExceptions)
+ Log.Fatal(x);
+ }
Console.ReadLine();
Environment.Exit(-1);
}
diff --git a/Torch/Updater/PluginUpdater.cs b/Torch/Updater/PluginUpdater.cs
new file mode 100644
index 0000000..5a86593
--- /dev/null
+++ b/Torch/Updater/PluginUpdater.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Octokit;
+
+namespace Torch.Updater
+{
+ public class PluginUpdater
+ {
+ public async Task CheckForUpdate(PluginManifest manifest)
+ {
+ var split = manifest.Repository.Split('/');
+
+ if (split.Length != 2)
+ return;
+
+ var client = new GitHubClient(new ProductHeaderValue("Torch"));
+ var releases = await client.Repository.Release.GetAll(split[0], split[1]);
+ var currentVersion = new Version(manifest.Version);
+ var latestVersion = new Version(releases[0].TagName);
+
+ if (latestVersion > currentVersion)
+ {
+ //update
+ }
+ }
+ }
+}
diff --git a/Torch/packages.config b/Torch/packages.config
index 1c68ff1..18ffc48 100644
--- a/Torch/packages.config
+++ b/Torch/packages.config
@@ -1,4 +1,5 @@
+
\ No newline at end of file