Fix DS loading, add NLog for logging
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Torch.API
|
||||
{
|
||||
public interface ILogger
|
||||
{
|
||||
void Write(string message);
|
||||
void WriteException(Exception e);
|
||||
}
|
||||
}
|
@@ -9,5 +9,6 @@ namespace Torch.API
|
||||
{
|
||||
void UpdatePlugins();
|
||||
void LoadPlugins();
|
||||
void UnloadPlugins();
|
||||
}
|
||||
}
|
@@ -11,7 +11,6 @@ namespace Torch.API
|
||||
event Action SessionLoaded;
|
||||
IMultiplayer Multiplayer { get; }
|
||||
IPluginManager Plugins { get; }
|
||||
ILogger Log { get; set; }
|
||||
void Invoke(Action action);
|
||||
void InvokeBlocking(Action action);
|
||||
Task InvokeAsync(Action action);
|
||||
|
@@ -13,8 +13,20 @@ namespace Torch.API
|
||||
Version Version { get; }
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Called when the game is initialized.
|
||||
/// </summary>
|
||||
/// <param name="torchBase"></param>
|
||||
void Init(ITorchBase torchBase);
|
||||
|
||||
/// <summary>
|
||||
/// Called after each game tick. Not thread safe, use invocation methods in <see cref="ITorchBase"/>.
|
||||
/// </summary>
|
||||
void Update();
|
||||
|
||||
/// <summary>
|
||||
/// Called when the game exits.
|
||||
/// </summary>
|
||||
void Unload();
|
||||
}
|
||||
}
|
||||
|
@@ -32,10 +32,18 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="NLog">
|
||||
<HintPath>..\packages\NLog.4.4.1\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -53,7 +61,6 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="ConnectionState.cs" />
|
||||
<Compile Include="IChatItem.cs" />
|
||||
<Compile Include="ILogger.cs" />
|
||||
<Compile Include="IMultiplayer.cs" />
|
||||
<Compile Include="IPlayer.cs" />
|
||||
<Compile Include="IPluginManager.cs" />
|
||||
@@ -63,6 +70,9 @@
|
||||
<Compile Include="PluginAttribute.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</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.
|
||||
|
4
Torch.API/packages.config
Normal file
4
Torch.API/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NLog" version="4.4.1" targetFramework="net461" />
|
||||
</packages>
|
Reference in New Issue
Block a user