Add GitHub plugin updater, refactor game update hook to TorchBase instead of PluginManager, fix world config not applying

This commit is contained in:
John Gross
2017-04-29 13:28:24 -07:00
parent 03a22851af
commit 135d1f4be8
28 changed files with 419 additions and 189 deletions

View File

@@ -13,6 +13,7 @@ namespace Torch.API
event Action SessionLoaded;
event Action SessionUnloading;
event Action SessionUnloaded;
ITorchConfig Config { get; }
IMultiplayer Multiplayer { get; }
IPluginManager Plugins { get; }
Version TorchVersion { get; }
@@ -28,9 +29,7 @@ namespace Torch.API
public interface ITorchServer : ITorchBase
{
bool IsRunning { get; }
string InstancePath { get; }
void Start(IMyConfigDedicated config);
}
public interface ITorchClient : ITorchBase

15
Torch.API/ITorchConfig.cs Normal file
View File

@@ -0,0 +1,15 @@
namespace Torch
{
public interface ITorchConfig
{
//bool AutoRestart { get; set; }
//int Autosave { get; set; }
string InstanceName { get; set; }
string InstancePath { get; set; }
//bool LogChat { get; set; }
bool RedownloadPlugins { get; set; }
bool EnableAutomaticUpdates { get; set; }
bool Save(string path = null);
}
}

16
Torch.API/ServerState.cs Normal file
View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Torch.API
{
public enum ServerState
{
Stopped,
Starting,
Running,
Error
}
}

View File

@@ -141,6 +141,7 @@
<Compile Include="IChatMessage.cs" />
<Compile Include="IMultiplayer.cs" />
<Compile Include="IPluginManager.cs" />
<Compile Include="ITorchConfig.cs" />
<Compile Include="Plugins\ITorchPlugin.cs" />
<Compile Include="IServerControls.cs" />
<Compile Include="ITorchBase.cs" />
@@ -149,6 +150,7 @@
<Compile Include="ModAPI\TorchAPI.cs" />
<Compile Include="Plugins\PluginAttribute.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServerState.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />