Rename to Torch, add command system

This commit is contained in:
John Gross
2016-12-17 01:59:03 -08:00
parent 7d51ac9295
commit fb521abbda
85 changed files with 366 additions and 354 deletions

View File

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace Piston.API
{
public static class PistonAPI
{
public static IServerControls ServerControls { get; }
public static IEnvironmentInfo EnvironmentInfo { get; }
}
}

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TestPlugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestPlugin")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bf0d9941-b488-4880-b378-a9bf942d140d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,35 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Piston.API;
using PistonAPI;
using Sandbox;
namespace TestPlugin
{
[Plugin("Test Plugin")]
public class TestPlugin : IPistonPlugin
{
public void Dispose()
{
MySandboxGame.Log.WriteLineAndConsole("TestDispose");
}
public void Init(object gameInstance)
{
MySandboxGame.Log.WriteLineAndConsole("TestInit");
}
public void Update()
{
MySandboxGame.Log.WriteLineAndConsole("TestUpdate");
}
public void Reload()
{
MySandboxGame.Log.WriteLineAndConsole("TestReload");
}
}
}

View File

@@ -1,81 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BF0D9941-B488-4880-B378-A9BF942D140D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TestPlugin</RootNamespace>
<AssemblyName>TestPlugin</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Sandbox.Game, Version=0.1.6103.31727, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Game.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="VRage">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="TestPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PistonAPI\Piston.API.csproj">
<Project>{fba5d932-6254-4a1e-baf4-e229fa94e3c2}</Project>
<Name>Piston.API</Name>
</ProjectReference>
<ProjectReference Include="..\PistonClient\Piston.Client.csproj">
<Project>{e36df745-260b-4956-a2e8-09f08b2e7161}</Project>
<Name>Piston.Client</Name>
</ProjectReference>
<ProjectReference Include="..\PistonServer\Piston.Server.csproj">
<Project>{ca50886b-7b22-4cd8-93a0-c06f38d4f77d}</Project>
<Name>Piston.Server</Name>
</ProjectReference>
<ProjectReference Include="..\Piston\Piston.csproj">
<Project>{7e01635c-3b67-472e-bcd6-c5539564f214}</Project>
<Name>Piston</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,4 +1,4 @@
namespace Piston.API namespace Torch.API
{ {
public interface IEnvironmentInfo public interface IEnvironmentInfo
{ {

View File

@@ -1,6 +1,6 @@
using System.Windows.Controls; using System.Windows.Controls;
namespace Piston.API namespace Torch.API
{ {
public interface IServerControls public interface IServerControls
{ {

View File

@@ -6,10 +6,11 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using VRage.Plugins; using VRage.Plugins;
namespace Piston.API namespace Torch.API
{ {
public interface IPistonPlugin : IPlugin public interface ITorchPlugin : IPlugin
{ {
void Init(ITorchServer server);
void Reload(); void Reload();
} }
} }

14
Torch.API/ITorchServer.cs Normal file
View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Torch.API
{
public interface ITorchServer
{
void Start();
void Stop();
}
}

View File

@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("PistonAPI")] [assembly: AssemblyTitle("TorchAPI")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PistonAPI")] [assembly: AssemblyProduct("TorchAPI")]
[assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]

View File

@@ -7,8 +7,8 @@
<ProjectGuid>{FBA5D932-6254-4A1E-BAF4-E229FA94E3C2}</ProjectGuid> <ProjectGuid>{FBA5D932-6254-4A1E-BAF4-E229FA94E3C2}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PistonAPI</RootNamespace> <RootNamespace>Torch.API</RootNamespace>
<AssemblyName>PistonAPI</AssemblyName> <AssemblyName>Torch.API</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
@@ -48,9 +48,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="IEnvironmentInfo.cs" /> <Compile Include="IEnvironmentInfo.cs" />
<Compile Include="IPistonPlugin.cs" /> <Compile Include="ITorchPlugin.cs" />
<Compile Include="IServerControls.cs" /> <Compile Include="IServerControls.cs" />
<Compile Include="PistonAPI.cs" /> <Compile Include="ITorchServer.cs" />
<Compile Include="TorchAPI.cs" />
<Compile Include="PluginAttribute.cs" /> <Compile Include="PluginAttribute.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>

11
Torch.API/TorchAPI.cs Normal file
View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace Torch.API
{
}

View File

@@ -20,7 +20,7 @@ using VRage.Utils;
using VRageRender; using VRageRender;
using Game = Sandbox.Engine.Platform.Game; using Game = Sandbox.Engine.Platform.Game;
namespace Piston.Client namespace Torch.Client
{ {
public class GameInitializer public class GameInitializer
{ {
@@ -44,7 +44,7 @@ namespace Piston.Client
} }
//Add myself to the credits because I'm awesome. //Add myself to the credits because I'm awesome.
var credits = new MyCreditsDepartment("Piston Developed By") { Persons = new List<MyCreditsPerson> var credits = new MyCreditsDepartment("Torch Developed By") { Persons = new List<MyCreditsPerson>
{ {
new MyCreditsPerson("JIMMACLE"), new MyCreditsPerson("JIMMACLE"),
new MyCreditsPerson("REXXAR"), new MyCreditsPerson("REXXAR"),
@@ -102,8 +102,8 @@ namespace Piston.Client
{ {
var pistonBtn = new MyGuiControlImageButton var pistonBtn = new MyGuiControlImageButton
{ {
Name = "PistonButton", Name = "TorchButton",
Text = "Piston", Text = "Torch",
HighlightType = MyGuiControlHighlightType.WHEN_CURSOR_OVER, HighlightType = MyGuiControlHighlightType.WHEN_CURSOR_OVER,
Visible = true, Visible = true,
}; };
@@ -119,7 +119,7 @@ namespace Piston.Client
//Fix Marek's name. //Fix Marek's name.
MyPerGameSettings.Credits.Departments[1].Persons[0].Name.Clear().Append("MEARK ROAS"); MyPerGameSettings.Credits.Departments[1].Persons[0].Name.Clear().Append("MEARK ROAS");
MyScreenManager.AddScreen(new PistonConsoleScreen()); MyScreenManager.AddScreen(new TorchConsoleScreen());
} }
private void InitializeRender() private void InitializeRender()
@@ -149,7 +149,6 @@ namespace Piston.Client
} }
MyRenderProxy.Initialize(_renderer); MyRenderProxy.Initialize(_renderer);
MyRenderProxy.IS_OFFICIAL = true;
MyRenderProxy.GetRenderProfiler().SetAutocommit(false); MyRenderProxy.GetRenderProfiler().SetAutocommit(false);
MyRenderProxy.GetRenderProfiler().InitMemoryHack("MainEntryPoint"); MyRenderProxy.GetRenderProfiler().InitMemoryHack("MainEntryPoint");
} }

View File

@@ -1,7 +1,7 @@
using System; using System;
using System.Windows; using System.Windows;
namespace Piston.Client namespace Torch.Client
{ {
public static class Program public static class Program
{ {
@@ -15,7 +15,7 @@ namespace Piston.Client
} }
catch (Exception e) catch (Exception e)
{ {
MessageBox.Show($"Piston encountered an error trying to initialize the game.\n{e.Message}"); MessageBox.Show($"Torch encountered an error trying to initialize the game.\n{e.Message}");
return; return;
} }

View File

@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace Piston.Server.Properties { namespace Torch.Client.Properties {
using System; using System;
@@ -39,7 +39,7 @@ namespace Piston.Server.Properties {
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Piston.Server.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Torch.Client.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;

View File

@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace Piston.Client.Properties { namespace Torch.Client.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

View File

@@ -7,8 +7,8 @@
<ProjectGuid>{E36DF745-260B-4956-A2E8-09F08B2E7161}</ProjectGuid> <ProjectGuid>{E36DF745-260B-4956-A2E8-09F08B2E7161}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Piston.Client</RootNamespace> <RootNamespace>Torch.Client</RootNamespace>
<AssemblyName>PistonClient</AssemblyName> <AssemblyName>Torch.Client</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@@ -87,8 +87,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="GameInitializer.cs" /> <Compile Include="GameInitializer.cs" />
<Compile Include="PistonConsoleScreen.cs" /> <Compile Include="TorchConsoleScreen.cs" />
<Compile Include="PistonSettingsScreen.cs" /> <Compile Include="TorchSettingsScreen.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
@@ -114,9 +114,9 @@
<AppDesigner Include="Properties\" /> <AppDesigner Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Piston\Piston.csproj"> <ProjectReference Include="..\Torch\Torch.csproj">
<Project>{7E01635C-3B67-472E-BCD6-C5539564F214}</Project> <Project>{7E01635C-3B67-472E-BCD6-C5539564F214}</Project>
<Name>Piston</Name> <Name>Torch</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@@ -10,18 +10,18 @@ using Sandbox.Gui;
using VRage.Utils; using VRage.Utils;
using VRageMath; using VRageMath;
namespace Piston.Client namespace Torch.Client
{ {
public class PistonConsoleScreen : MyGuiScreenBase public class TorchConsoleScreen : MyGuiScreenBase
{ {
private MyGuiControlTextbox _textBox; private MyGuiControlTextbox _textBox;
public override string GetFriendlyName() public override string GetFriendlyName()
{ {
return "Piston Console"; return "Torch Console";
} }
public PistonConsoleScreen() : base(isTopMostScreen: true) public TorchConsoleScreen() : base(isTopMostScreen: true)
{ {
BackgroundColor = new Vector4(0, 0, 0, 0.5f); BackgroundColor = new Vector4(0, 0, 0, 0.5f);
Size = new Vector2(0.5f); Size = new Vector2(0.5f);
@@ -33,7 +33,7 @@ namespace Piston.Client
Elements.Clear(); Elements.Clear();
Elements.Add(new MyGuiControlLabel Elements.Add(new MyGuiControlLabel
{ {
Text = "Piston Console", Text = "Torch Console",
OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP,
Position = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP) Position = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP)
}); });
@@ -50,8 +50,8 @@ namespace Piston.Client
var pistonBtn = new MyGuiControlImageButton var pistonBtn = new MyGuiControlImageButton
{ {
Name = "PistonButton", Name = "TorchButton",
Text = "Piston", Text = "Torch",
HighlightType = MyGuiControlHighlightType.WHEN_CURSOR_OVER, HighlightType = MyGuiControlHighlightType.WHEN_CURSOR_OVER,
Visible = true, Visible = true,
OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP

View File

@@ -7,13 +7,13 @@ using Sandbox.Graphics.GUI;
using VRage.Utils; using VRage.Utils;
using VRageMath; using VRageMath;
namespace Piston.Client namespace Torch.Client
{ {
public class PistonSettingsScreen : MyGuiScreenBase public class TorchSettingsScreen : MyGuiScreenBase
{ {
public override string GetFriendlyName() => "Piston Settings"; public override string GetFriendlyName() => "Piston Settings";
public PistonSettingsScreen() : base(new Vector2(0.5f), null, new Vector2(0.5f), true, null, 0f, 0f) public TorchSettingsScreen() : base(new Vector2(0.5f), null, new Vector2(0.5f), true, null, 0f, 0f)
{ {
this.BackgroundColor = new Vector4(0); this.BackgroundColor = new Vector4(0);
RecreateControls(true); RecreateControls(true);

View File

@@ -1,7 +1,7 @@
<Application x:Class="Piston.Launcher.App" <Application x:Class="Torch.Launcher.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Piston.Launcher" xmlns:local="clr-namespace:Torch.Launcher"
StartupUri="MainWindow.xaml"> StartupUri="MainWindow.xaml">
<Application.Resources> <Application.Resources>

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
namespace Piston.Launcher namespace Torch.Launcher
{ {
/// <summary> /// <summary>
/// Interaction logic for App.xaml /// Interaction logic for App.xaml

View File

@@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace Piston.Launcher namespace Torch.Launcher
{ {
public class Config public class Config
{ {

View File

@@ -1,9 +1,9 @@
<Window x:Class="Piston.Launcher.MainWindow" <Window x:Class="Torch.Launcher.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Piston.Launcher" xmlns:local="clr-namespace:Torch.Launcher"
mc:Ignorable="d" mc:Ignorable="d"
Title="Piston Launcher" ResizeMode="NoResize" Height="220" Width="400"> Title="Piston Launcher" ResizeMode="NoResize" Height="220" Width="400">
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">

View File

@@ -17,7 +17,7 @@ using System.IO;
using System.Reflection; using System.Reflection;
using Microsoft.Win32; using Microsoft.Win32;
namespace Piston.Launcher namespace Torch.Launcher
{ {
/// <summary> /// <summary>
/// Interaction logic for MainWindow.xaml /// Interaction logic for MainWindow.xaml
@@ -25,14 +25,14 @@ namespace Piston.Launcher
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
private Config _config; private Config _config;
private PistonFileManager _fileManager; private TorchFileManager _fileManager;
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
_config = Config.Load(); _config = Config.Load();
Title += $" v{_config.Version}"; Title += $" v{_config.Version}";
_fileManager = new PistonFileManager(_config.RemoteFilePath); _fileManager = new TorchFileManager(_config.RemoteFilePath);
CheckSpaceDirectory(); CheckSpaceDirectory();
CheckSEBranch(); CheckSEBranch();

View File

@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace Piston.Launcher.Properties { namespace Torch.Launcher.Properties {
using System; using System;
@@ -39,7 +39,7 @@ namespace Piston.Launcher.Properties {
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Piston.Launcher.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Torch.Launcher.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;

View File

@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace Piston.Launcher.Properties { namespace Torch.Launcher.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

View File

@@ -1,9 +1,9 @@
<Window x:Class="Piston.Launcher.SpaceDirPrompt" <Window x:Class="Torch.Launcher.SpaceDirPrompt"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Piston.Launcher" xmlns:local="clr-namespace:Torch.Launcher"
mc:Ignorable="d" mc:Ignorable="d"
Title="Select SE Directory" Height="120" Width="500"> Title="Select SE Directory" Height="120" Width="500">
<StackPanel> <StackPanel>

View File

@@ -13,7 +13,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace Piston.Launcher namespace Torch.Launcher
{ {
/// <summary> /// <summary>
/// Interaction logic for SpaceDirPrompt.xaml /// Interaction logic for SpaceDirPrompt.xaml

View File

@@ -7,8 +7,8 @@
<ProjectGuid>{19292801-5B9C-4EE0-961F-0FA37B3A6C3D}</ProjectGuid> <ProjectGuid>{19292801-5B9C-4EE0-961F-0FA37B3A6C3D}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Piston.Launcher</RootNamespace> <RootNamespace>Torch.Launcher</RootNamespace>
<AssemblyName>PistonLauncher</AssemblyName> <AssemblyName>Torch.Launcher</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@@ -69,7 +69,7 @@
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="Config.cs" /> <Compile Include="Config.cs" />
<Compile Include="PistonFileManager.cs" /> <Compile Include="TorchFileManager.cs" />
<Compile Include="MainWindow.xaml.cs"> <Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>

View File

@@ -10,13 +10,13 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
namespace Piston.Launcher namespace Torch.Launcher
{ {
public class PistonFileManager public class TorchFileManager
{ {
private readonly string _baseUri; private readonly string _baseUri;
public PistonFileManager(string baseUri) public TorchFileManager(string baseUri)
{ {
_baseUri = baseUri; _baseUri = baseUri;
} }

View File

@@ -12,19 +12,19 @@ using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Threading; using System.Windows.Threading;
using Piston; using Torch;
using Piston.Server.ViewModels;
using Sandbox; using Sandbox;
using Sandbox.Engine.Multiplayer; using Sandbox.Engine.Multiplayer;
using Sandbox.Game.Multiplayer; using Sandbox.Game.Multiplayer;
using Sandbox.Game.World; using Sandbox.Game.World;
using SteamSDK; using SteamSDK;
using Torch.Server.ViewModels;
using VRage.Game; using VRage.Game;
using VRage.Library.Collections; using VRage.Library.Collections;
using VRage.Network; using VRage.Network;
using VRage.Utils; using VRage.Utils;
namespace Piston.Server namespace Torch.Server
{ {
/// <summary> /// <summary>
/// Provides a proxy to the game's multiplayer-related functions. /// Provides a proxy to the game's multiplayer-related functions.
@@ -39,21 +39,24 @@ namespace Piston.Server
public MTObservableCollection<ChatItemInfo> ChatView { get; } = new MTObservableCollection<ChatItemInfo>(); public MTObservableCollection<ChatItemInfo> ChatView { get; } = new MTObservableCollection<ChatItemInfo>();
public PlayerInfo LocalPlayer { get; private set; } public PlayerInfo LocalPlayer { get; private set; }
internal MultiplayerManager(ServerManager serverManager) private TorchServer _server;
internal MultiplayerManager(TorchServer server)
{ {
serverManager.SessionLoaded += OnSessionLoaded; _server = server;
_server.Server.SessionLoaded += OnSessionLoaded;
} }
public void KickPlayer(ulong steamId) => PistonServer.Server.BeginGameAction(() => MyMultiplayer.Static.KickClient(steamId)); public void KickPlayer(ulong steamId) => _server.Server.BeginGameAction(() => MyMultiplayer.Static.KickClient(steamId));
public void BanPlayer(ulong steamId, bool banned = true) public void BanPlayer(ulong steamId, bool banned = true)
{ {
PistonServer.Server.BeginGameAction(() => _server.Server.BeginGameAction(() =>
{ {
MyMultiplayer.Static.BanClient(steamId, banned); MyMultiplayer.Static.BanClient(steamId, banned);
if (_gameOwnerIds.ContainsKey(steamId)) if (_gameOwnerIds.ContainsKey(steamId))
MyMultiplayer.Static.BanClient(_gameOwnerIds[steamId], banned); MyMultiplayer.Static.BanClient(_gameOwnerIds[steamId], banned);
}); });
} }
/// <summary> /// <summary>

View File

@@ -8,25 +8,27 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Threading; using System.Windows.Threading;
using Piston; using Torch;
namespace Piston.Server namespace Torch.Server
{ {
public static class Program public static class Program
{ {
private static TorchServer _server = new TorchServer();
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
PistonServer.Init(); _server.Init();
PistonServer.Server.RunArgs = new[] { "-console" }; _server.Server.RunArgs = new[] { "-console" };
if (args.Contains("-nogui")) if (args.Contains("-nogui"))
PistonServer.Server.StartServer(); _server.Server.StartServer();
else else
StartUI(); StartUI();
if (args.Contains("-autostart") && !PistonServer.Server.IsRunning) if (args.Contains("-autostart") && !_server.Server.IsRunning)
PistonServer.Server.StartServerThread(); _server.Server.StartServerThread();
Dispatcher.Run(); Dispatcher.Run();
} }
@@ -34,13 +36,13 @@ namespace Piston.Server
public static void StartUI() public static void StartUI()
{ {
Thread.CurrentThread.Name = "UI Thread"; Thread.CurrentThread.Name = "UI Thread";
PistonServer.UI.Show(); _server.UI.Show();
} }
public static void FullRestart() public static void FullRestart()
{ {
PistonServer.Server.StopServer(); _server.Server.StopServer();
Process.Start("PistonServer.exe", "-autostart"); Process.Start("TorchServer.exe", "-autostart");
Environment.Exit(1); Environment.Exit(1);
} }
} }

View File

@@ -7,11 +7,11 @@ using System.Windows;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("PistonServer")] [assembly: AssemblyTitle("TorchServer")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PistonServer")] [assembly: AssemblyProduct("TorchServer")]
[assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]

View File

@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace Piston.Client.Properties { namespace Torch.Server.Properties {
using System; using System;
@@ -39,7 +39,7 @@ namespace Piston.Client.Properties {
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Piston.Client.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Torch.Server.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;

View File

@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace Piston.Server.Properties { namespace Torch.Server.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

View File

@@ -7,7 +7,7 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using Piston; using Torch;
using Sandbox; using Sandbox;
using Sandbox.Engine.Multiplayer; using Sandbox.Engine.Multiplayer;
using Sandbox.Game; using Sandbox.Game;
@@ -18,7 +18,7 @@ using VRage.Game;
using VRage.Game.SessionComponents; using VRage.Game.SessionComponents;
using VRage.Profiler; using VRage.Profiler;
namespace Piston.Server namespace Torch.Server
{ {
public class ServerManager : IDisposable public class ServerManager : IDisposable
{ {
@@ -74,20 +74,20 @@ namespace Piston.Server
AutoResetEvent e = new AutoResetEvent(false); AutoResetEvent e = new AutoResetEvent(false);
MySandboxGame.Static.Invoke(() => MySandboxGame.Static.Invoke(() =>
{ {
try try
{ {
action(); action();
} }
catch (Exception ex) catch (Exception ex)
{ {
//log //log
} }
finally finally
{ {
e.Set(); e.Set();
} }
}); });
//timeout so we don't accidentally hang the server //timeout so we don't accidentally hang the server
e.WaitOne(60000); e.WaitOne(60000);

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -7,8 +7,8 @@
<ProjectGuid>{CA50886B-7B22-4CD8-93A0-C06F38D4F77D}</ProjectGuid> <ProjectGuid>{CA50886B-7B22-4CD8-93A0-C06F38D4F77D}</ProjectGuid>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Piston.Server</RootNamespace> <RootNamespace>Torch.Server</RootNamespace>
<AssemblyName>PistonServer</AssemblyName> <AssemblyName>Torch.Server</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@@ -37,7 +37,7 @@
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<StartupObject>Piston.Server.Program</StartupObject> <StartupObject>Torch.Server.Program</StartupObject>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>SpaceEngineers.ico</ApplicationIcon> <ApplicationIcon>SpaceEngineers.ico</ApplicationIcon>
@@ -119,7 +119,7 @@
<DependentUpon>PistonUI.xaml</DependentUpon> <DependentUpon>PistonUI.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="MultiplayerManager.cs" /> <Compile Include="MultiplayerManager.cs" />
<Compile Include="PistonServer.cs" /> <Compile Include="TorchServer.cs" />
<Compile Include="Views\PlayerListControl.xaml.cs"> <Compile Include="Views\PlayerListControl.xaml.cs">
<DependentUpon>PlayerListControl.xaml</DependentUpon> <DependentUpon>PlayerListControl.xaml</DependentUpon>
</Compile> </Compile>
@@ -155,9 +155,17 @@
<AppDesigner Include="Properties\" /> <AppDesigner Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Piston\Piston.csproj"> <ProjectReference Include="..\Torch.API\Torch.API.csproj">
<Project>{fba5d932-6254-4a1e-baf4-e229fa94e3c2}</Project>
<Name>Torch.API</Name>
</ProjectReference>
<ProjectReference Include="..\Torch.Launcher\Torch.Launcher.csproj">
<Project>{19292801-5B9C-4EE0-961F-0FA37B3A6C3D}</Project>
<Name>Torch.Launcher</Name>
</ProjectReference>
<ProjectReference Include="..\Torch\Torch.csproj">
<Project>{7e01635c-3b67-472e-bcd6-c5539564f214}</Project> <Project>{7e01635c-3b67-472e-bcd6-c5539564f214}</Project>
<Name>Piston</Name> <Name>Torch</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -4,38 +4,52 @@ using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Piston; using Torch;
using Piston.Server.Properties;
using Sandbox; using Sandbox;
using Sandbox.Game; using Sandbox.Game;
using SpaceEngineers.Game; using SpaceEngineers.Game;
using Torch.API;
using Torch.Launcher;
using VRage.Dedicated; using VRage.Dedicated;
using VRage.Game; using VRage.Game;
using VRage.Game.SessionComponents; using VRage.Game.SessionComponents;
namespace Piston.Server namespace Torch.Server
{ {
/// <summary> /// <summary>
/// Entry point for all Piston server functionality. /// Entry point for all Piston server functionality.
/// </summary> /// </summary>
public static class PistonServer public class TorchServer : ITorchServer
{ {
public static ServerManager Server { get; private set; } public ServerManager Server { get; private set; }
public static MultiplayerManager Multiplayer { get; private set; } public MultiplayerManager Multiplayer { get; private set; }
public static PluginManager Plugins { get; private set; } public PluginManager Plugins { get; private set; }
public static PistonUI UI { get; private set; } public PistonUI UI { get; private set; }
private static bool _init; private bool _init;
public static void Init() public void Start()
{
if (!_init)
Init();
Server.StartServer();
}
public void Stop()
{
Server.StopServer();
}
public void Init()
{ {
if (_init) if (_init)
return; return;
Logger.Write("Initializing Piston"); Logger.Write("Initializing Torch");
_init = true; _init = true;
Server = new ServerManager(); Server = new ServerManager();
Multiplayer = new MultiplayerManager(Server); Multiplayer = new MultiplayerManager(this);
Plugins = new PluginManager(); Plugins = new PluginManager();
UI = new PistonUI(); UI = new PistonUI();
@@ -45,9 +59,9 @@ namespace Piston.Server
UI.PropGrid.SetObject(MySandboxGame.ConfigDedicated); UI.PropGrid.SetObject(MySandboxGame.ConfigDedicated);
} }
public static void Reset() public void Reset()
{ {
Logger.Write("Resetting Piston"); Logger.Write("Resetting Torch");
Server.Dispose(); Server.Dispose();
UI.Close(); UI.Close();

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Piston.Server.ViewModels namespace Torch.Server.ViewModels
{ {
public class ChatItemInfo : ViewModel public class ChatItemInfo : ViewModel
{ {

View File

@@ -7,7 +7,7 @@ using Sandbox.Engine.Utils;
using VRage.Game; using VRage.Game;
using VRage.Game.ModAPI; using VRage.Game.ModAPI;
namespace Piston.Server.ViewModels namespace Torch.Server.ViewModels
{ {
public class ConfigDedicatedViewModel : ViewModel public class ConfigDedicatedViewModel : ViewModel
{ {

View File

@@ -1,9 +1,9 @@
<Window x:Class="Piston.Server.AddModsDialog" <Window x:Class="Torch.Server.AddModsDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Piston.Server" xmlns:local="clr-namespace:Torch.Server"
mc:Ignorable="d" mc:Ignorable="d"
Title="Add Workshop Item" Height="200" Width="400"> Title="Add Workshop Item" Height="200" Width="400">
<DockPanel Background="LightGray"> <DockPanel Background="LightGray">

View File

@@ -13,7 +13,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace Piston.Server namespace Torch.Server
{ {
/// <summary> /// <summary>
/// Interaction logic for AddModsDialog.xaml /// Interaction logic for AddModsDialog.xaml

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Piston.Server.ChatControl" <UserControl x:Class="Torch.Server.ChatControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Piston.Server" xmlns:local="clr-namespace:Torch.Server"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel> <DockPanel>
<DockPanel DockPanel.Dock="Bottom"> <DockPanel DockPanel.Dock="Bottom">

View File

@@ -13,13 +13,13 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Windows.Threading; using System.Windows.Threading;
using Piston; using Torch;
using Sandbox; using Sandbox;
using Sandbox.Engine.Multiplayer; using Sandbox.Engine.Multiplayer;
using Sandbox.Game.World; using Sandbox.Game.World;
using SteamSDK; using SteamSDK;
namespace Piston.Server namespace Torch.Server
{ {
/// <summary> /// <summary>
/// Interaction logic for ChatControl.xaml /// Interaction logic for ChatControl.xaml
@@ -29,7 +29,7 @@ namespace Piston.Server
public ChatControl() public ChatControl()
{ {
InitializeComponent(); InitializeComponent();
ChatItems.ItemsSource = PistonServer.Multiplayer.ChatView; ChatItems.ItemsSource = TorchServer.Multiplayer.ChatView;
} }
private void SendButton_Click(object sender, RoutedEventArgs e) private void SendButton_Click(object sender, RoutedEventArgs e)
@@ -47,7 +47,7 @@ namespace Piston.Server
{ {
//Can't use Message.Text directly because of object ownership in WPF. //Can't use Message.Text directly because of object ownership in WPF.
var text = Message.Text; var text = Message.Text;
PistonServer.Multiplayer.SendMessage(text); TorchServer.Multiplayer.SendMessage(text);
Message.Text = ""; Message.Text = "";
} }
} }

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Piston.Server.ModsControl" <UserControl x:Class="Torch.Server.ModsControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Piston.Server" xmlns:local="clr-namespace:Torch.Server"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Margin="0,0,0,0" Orientation="Vertical"> <StackPanel Margin="0,0,0,0" Orientation="Vertical">
<Label Content="Mods" Margin="5,5,5,5"/> <Label Content="Mods" Margin="5,5,5,5"/>

View File

@@ -18,7 +18,7 @@ using Sandbox.Engine.Networking;
using SteamSDK; using SteamSDK;
using VRage.Game; using VRage.Game;
namespace Piston.Server namespace Torch.Server
{ {
/// <summary> /// <summary>
/// Interaction logic for ModsControl.xaml /// Interaction logic for ModsControl.xaml

View File

@@ -1,10 +1,10 @@
<Window x:Class="Piston.Server.PistonUI" <Window x:Class="Torch.Server.PistonUI"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Piston.Server" xmlns:local="clr-namespace:Torch.Server"
xmlns:views="clr-namespace:Piston.Server.Views" xmlns:views="clr-namespace:Torch.Server.Views"
mc:Ignorable="d" mc:Ignorable="d"
Title="Piston" Height="600" Width="900"> Title="Piston" Height="600" Width="900">
<DockPanel> <DockPanel>

View File

@@ -17,7 +17,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace Piston.Server namespace Torch.Server
{ {
/// <summary> /// <summary>
/// Interaction logic for PistonUI.xaml /// Interaction logic for PistonUI.xaml
@@ -61,7 +61,7 @@ namespace Piston.Server
((Button) sender).IsEnabled = false; ((Button) sender).IsEnabled = false;
BtnStop.IsEnabled = true; BtnStop.IsEnabled = true;
_uiUpdate.Start(); _uiUpdate.Start();
PistonServer.Server.StartServerThread(); TorchServer.Server.StartServerThread();
} }
private void BtnStop_Click(object sender, RoutedEventArgs e) private void BtnStop_Click(object sender, RoutedEventArgs e)
@@ -72,12 +72,12 @@ namespace Piston.Server
//HACK: Uncomment when restarting is possible. //HACK: Uncomment when restarting is possible.
//BtnStart.IsEnabled = true; //BtnStart.IsEnabled = true;
_uiUpdate.Stop(); _uiUpdate.Stop();
PistonServer.Server.StopServer(); TorchServer.Server.StopServer();
} }
protected override void OnClosing(CancelEventArgs e) protected override void OnClosing(CancelEventArgs e)
{ {
PistonServer.Reset(); TorchServer.Reset();
} }
private void BtnRestart_Click(object sender, RoutedEventArgs e) private void BtnRestart_Click(object sender, RoutedEventArgs e)

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Piston.Server.PlayerListControl" <UserControl x:Class="Torch.Server.PlayerListControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Piston.Server" xmlns:local="clr-namespace:Torch.Server"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel> <DockPanel>
<StackPanel DockPanel.Dock="Bottom"> <StackPanel DockPanel.Dock="Bottom">

View File

@@ -12,14 +12,14 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using Piston; using Torch;
using Sandbox; using Sandbox;
using Sandbox.Engine.Multiplayer; using Sandbox.Engine.Multiplayer;
using Sandbox.Game.Multiplayer; using Sandbox.Game.Multiplayer;
using Sandbox.Game.World; using Sandbox.Game.World;
using SteamSDK; using SteamSDK;
namespace Piston.Server namespace Torch.Server
{ {
/// <summary> /// <summary>
/// Interaction logic for PlayerListControl.xaml /// Interaction logic for PlayerListControl.xaml
@@ -29,7 +29,7 @@ namespace Piston.Server
public PlayerListControl() public PlayerListControl()
{ {
InitializeComponent(); InitializeComponent();
PlayerList.ItemsSource = PistonServer.Multiplayer.PlayersView; PlayerList.ItemsSource = TorchServer.Multiplayer.PlayersView;
} }
private void KickButton_Click(object sender, RoutedEventArgs e) private void KickButton_Click(object sender, RoutedEventArgs e)
@@ -37,7 +37,7 @@ namespace Piston.Server
var player = PlayerList.SelectedItem as PlayerInfo; var player = PlayerList.SelectedItem as PlayerInfo;
if (player != null) if (player != null)
{ {
PistonServer.Multiplayer.KickPlayer(player.SteamId); TorchServer.Multiplayer.KickPlayer(player.SteamId);
} }
} }
@@ -46,7 +46,7 @@ namespace Piston.Server
var player = PlayerList.SelectedItem as PlayerInfo; var player = PlayerList.SelectedItem as PlayerInfo;
if (player != null) if (player != null)
{ {
PistonServer.Multiplayer.BanPlayer(player.SteamId); TorchServer.Multiplayer.BanPlayer(player.SteamId);
} }
} }
} }

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Piston.Server.Views.PropertyGrid" <UserControl x:Class="Torch.Server.Views.PropertyGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Piston.Server.Views" xmlns:local="clr-namespace:Torch.Server.Views"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"> d:DesignHeight="300" d:DesignWidth="300">
<DataGrid x:Name="Grid" AutoGenerateColumns="False"> <DataGrid x:Name="Grid" AutoGenerateColumns="False">

View File

@@ -14,7 +14,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace Piston.Server.Views namespace Torch.Server.Views
{ {
/// <summary> /// <summary>
/// Interaction logic for PropertyGrid.xaml /// Interaction logic for PropertyGrid.xaml

View File

@@ -1,19 +1,17 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio 15
VisualStudioVersion = 15.0.25618.0 VisualStudioVersion = 15.0.25928.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Piston", "Piston\Piston.csproj", "{7E01635C-3B67-472E-BCD6-C5539564F214}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Torch", "Torch\Torch.csproj", "{7E01635C-3B67-472E-BCD6-C5539564F214}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Piston.API", "PistonAPI\Piston.API.csproj", "{FBA5D932-6254-4A1E-BAF4-E229FA94E3C2}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Torch.API", "Torch.API\Torch.API.csproj", "{FBA5D932-6254-4A1E-BAF4-E229FA94E3C2}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Piston.Client", "PistonClient\Piston.Client.csproj", "{E36DF745-260B-4956-A2E8-09F08B2E7161}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Torch.Client", "Torch.Client\Torch.Client.csproj", "{E36DF745-260B-4956-A2E8-09F08B2E7161}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Piston.Server", "PistonServer\Piston.Server.csproj", "{CA50886B-7B22-4CD8-93A0-C06F38D4F77D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Torch.Server", "Torch.Server\Torch.Server.csproj", "{CA50886B-7B22-4CD8-93A0-C06F38D4F77D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPlugin", "TestPlugin\TestPlugin.csproj", "{BF0D9941-B488-4880-B378-A9BF942D140D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Torch.Launcher", "Torch.Launcher\Torch.Launcher.csproj", "{19292801-5B9C-4EE0-961F-0FA37B3A6C3D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Piston.Launcher", "Piston.Launcher\Piston.Launcher.csproj", "{19292801-5B9C-4EE0-961F-0FA37B3A6C3D}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -37,10 +35,6 @@ Global
{CA50886B-7B22-4CD8-93A0-C06F38D4F77D}.Debug|x64.Build.0 = Debug|x64 {CA50886B-7B22-4CD8-93A0-C06F38D4F77D}.Debug|x64.Build.0 = Debug|x64
{CA50886B-7B22-4CD8-93A0-C06F38D4F77D}.Release|x64.ActiveCfg = Release|x64 {CA50886B-7B22-4CD8-93A0-C06F38D4F77D}.Release|x64.ActiveCfg = Release|x64
{CA50886B-7B22-4CD8-93A0-C06F38D4F77D}.Release|x64.Build.0 = Release|x64 {CA50886B-7B22-4CD8-93A0-C06F38D4F77D}.Release|x64.Build.0 = Release|x64
{BF0D9941-B488-4880-B378-A9BF942D140D}.Debug|x64.ActiveCfg = Debug|x64
{BF0D9941-B488-4880-B378-A9BF942D140D}.Debug|x64.Build.0 = Debug|x64
{BF0D9941-B488-4880-B378-A9BF942D140D}.Release|x64.ActiveCfg = Release|x64
{BF0D9941-B488-4880-B378-A9BF942D140D}.Release|x64.Build.0 = Release|x64
{19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Debug|x64.ActiveCfg = Debug|x64 {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Debug|x64.ActiveCfg = Debug|x64
{19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Debug|x64.Build.0 = Debug|x64 {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Debug|x64.Build.0 = Debug|x64
{19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Release|x64.ActiveCfg = Release|x64 {19292801-5B9C-4EE0-961F-0FA37B3A6C3D}.Release|x64.ActiveCfg = Release|x64

View File

@@ -7,7 +7,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Threading; using System.Windows.Threading;
namespace Piston namespace Torch
{ {
public class MTObservableCollection<T> : ObservableCollection<T> public class MTObservableCollection<T> : ObservableCollection<T>
{ {

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Piston namespace Torch
{ {
public static class PlayerInfoCache public static class PlayerInfoCache
{ {

View File

@@ -0,0 +1,11 @@
using System;
namespace Torch.Commands
{
public class ChatCommand
{
public ChatCommandModule Module;
public string Name;
public Action<CommandContext> Invoke;
}
}

View File

@@ -0,0 +1,13 @@
using System;
namespace Torch.Commands
{
public class ChatCommandAttribute : Attribute
{
public string Name { get; }
public ChatCommandAttribute(string name)
{
Name = name;
}
}
}

View File

@@ -0,0 +1,10 @@
using Torch.API;
namespace Torch.Commands
{
public class ChatCommandModule
{
public ITorchPlugin Plugin { get; set; }
public ITorchServer Server { get; set; }
}
}

View File

@@ -0,0 +1,8 @@
namespace Torch.Commands
{
public struct CommandContext
{
public string Argument;
public ulong SteamId;
}
}

View File

@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Torch.API;
namespace Torch.Commands
{
public class CommandSystem
{
public ITorchServer Server { get; }
public char Prefix { get; set; }
public Dictionary<string, ChatCommand> Commands { get; } = new Dictionary<string, ChatCommand>();
public CommandSystem(ITorchServer server, char prefix = '/')
{
Server = server;
Prefix = prefix;
}
public bool IsCommand(string command)
{
return command.Length > 1 && command[0] == Prefix;
}
public void RegisterPluginCommands(ITorchPlugin plugin)
{
var assembly = plugin.GetType().Assembly;
foreach (var type in assembly.ExportedTypes)
{
if (!type.IsSubclassOf(typeof(ChatCommandModule)))
continue;
var module = (ChatCommandModule)Activator.CreateInstance(type);
module.Server = Server;
module.Plugin = plugin;
foreach (var method in type.GetMethods())
{
var commandAttrib = method.GetCustomAttribute<ChatCommandAttribute>();
if (commandAttrib == null)
continue;
var parameters = method.GetParameters();
if (parameters.Length != 1 || parameters[0].ParameterType != typeof(CommandContext))
{
//TODO: log invalid command
Console.WriteLine($"[ERROR]: Command \"{method.Name}\" has the wrong signature! Must take one CommandContext parameter.");
continue;
}
var command = new ChatCommand
{
Module = module,
Name = commandAttrib.Name,
Invoke = c => method.Invoke(module, new object[] {c})
};
Commands.Add(command.Name, command);
}
}
}
public void HandleCommand(string command, ulong steamId = 0)
{
if (!IsCommand(command))
return;
var cmdNameEnd = command.Length - command.IndexOf(" ", StringComparison.InvariantCultureIgnoreCase);
var cmdName = command.Substring(1, cmdNameEnd);
if (!Commands.ContainsKey(cmdName))
return;
string arg = "";
if (command.Length > cmdNameEnd + 1)
arg = command.Substring(cmdNameEnd + 1);
var context = new CommandContext
{
Argument = arg,
SteamId = steamId
};
Commands[cmdName].Invoke(context);
//Regex.Matches(command, "(\"[^\"]+\"|\\S+)");
}
}
}

View File

@@ -1,6 +1,6 @@
using System; using System;
namespace Piston namespace Torch
{ {
/// <summary> /// <summary>
/// Identifies a player's current connection state. /// Identifies a player's current connection state.

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using Sandbox.Game.Multiplayer; using Sandbox.Game.Multiplayer;
using Sandbox.Game.World; using Sandbox.Game.World;
namespace Piston namespace Torch
{ {
public static class MyPlayerCollectionExtensions public static class MyPlayerCollectionExtensions
{ {

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Piston namespace Torch
{ {
public static class StringExtensions public static class StringExtensions
{ {

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using Sandbox; using Sandbox;
using VRage.Utils; using VRage.Utils;
namespace Piston namespace Torch
{ {
public static class Logger public static class Logger
{ {

View File

@@ -1,6 +1,6 @@
using Sandbox.Engine.Multiplayer; using Sandbox.Engine.Multiplayer;
namespace Piston namespace Torch
{ {
/// <summary> /// <summary>
/// Stores player information in an observable format. /// Stores player information in an observable format.

View File

@@ -6,14 +6,14 @@ using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Piston.API;
using PistonAPI; using PistonAPI;
using Sandbox; using Sandbox;
using Torch.API;
using VRage.Plugins; using VRage.Plugins;
using VRage.Collections; using VRage.Collections;
using VRage.Library.Collections; using VRage.Library.Collections;
namespace Piston namespace Torch
{ {
public class PluginManager public class PluginManager
{ {
@@ -135,7 +135,7 @@ namespace Piston
/// <param name="forceNonPiston">Reload a non-Piston plugin</param> /// <param name="forceNonPiston">Reload a non-Piston plugin</param>
public void ReloadPlugin(IPlugin plugin, bool forceNonPiston = false) public void ReloadPlugin(IPlugin plugin, bool forceNonPiston = false)
{ {
var p = plugin as IPistonPlugin; var p = plugin as ITorchPlugin;
if (p == null && forceNonPiston) if (p == null && forceNonPiston)
{ {
plugin.Dispose(); plugin.Dispose();
@@ -151,7 +151,7 @@ namespace Piston
{ {
foreach (var plugin in _plugins) foreach (var plugin in _plugins)
{ {
var p = plugin as IPistonPlugin; var p = plugin as ITorchPlugin;
p?.Reload(); p?.Reload();
} }
} }

View File

@@ -10,7 +10,7 @@ using Sandbox.Engine.Platform;
using SteamSDK; using SteamSDK;
using VRage.Game; using VRage.Game;
namespace Piston namespace Torch
{ {
public static class SteamHelper public static class SteamHelper
{ {

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Sandbox; using Sandbox;
namespace Piston namespace Torch
{ {
/// <summary> /// <summary>
/// SNAGGED FROM PHOENIX84'S SE WORKSHOP TOOL /// SNAGGED FROM PHOENIX84'S SE WORKSHOP TOOL

View File

@@ -7,8 +7,8 @@
<ProjectGuid>{7E01635C-3B67-472E-BCD6-C5539564F214}</ProjectGuid> <ProjectGuid>{7E01635C-3B67-472E-BCD6-C5539564F214}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Piston</RootNamespace> <RootNamespace>Torch</RootNamespace>
<AssemblyName>Piston</AssemblyName> <AssemblyName>Torch</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
@@ -121,9 +121,10 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CommandSystem.cs" />
<Compile Include="ConnectionState.cs" /> <Compile Include="ConnectionState.cs" />
<Compile Include="Logger.cs" /> <Compile Include="Logger.cs" />
<Compile Include="PistonPlugin.cs" /> <Compile Include="TorchPlugin.cs" />
<Compile Include="PlayerInfo.cs" /> <Compile Include="PlayerInfo.cs" />
<Compile Include="Collections\PlayerInfoCache.cs" /> <Compile Include="Collections\PlayerInfoCache.cs" />
<Compile Include="SteamService.cs" /> <Compile Include="SteamService.cs" />
@@ -138,9 +139,9 @@
<Compile Include="ViewModels\PluginViewModel.cs" /> <Compile Include="ViewModels\PluginViewModel.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\PistonAPI\Piston.API.csproj"> <ProjectReference Include="..\Torch.API\Torch.API.csproj">
<Project>{fba5d932-6254-4a1e-baf4-e229fa94e3c2}</Project> <Project>{fba5d932-6254-4a1e-baf4-e229fa94e3c2}</Project>
<Name>Piston.API</Name> <Name>Torch.API</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />

View File

@@ -4,9 +4,9 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Piston namespace Torch
{ {
public class PistonPlugin public class TorchPlugin
{ {
} }

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using VRage.Game; using VRage.Game;
namespace Piston namespace Torch
{ {
public class ModViewModel public class ModViewModel
{ {

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Piston.ViewModels namespace Torch.ViewModels
{ {
public class PluginViewModel : ViewModel public class PluginViewModel : ViewModel
{ {

View File

@@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Piston namespace Torch
{ {
/// <summary> /// <summary>
/// Provides a method to notify an observer of changes to an object's properties. /// Provides a method to notify an observer of changes to an object's properties.