Get command system working, permissions system and ModAPI extensions in progress
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using VRage.Game;
|
||||
using VRage.Game.ModAPI;
|
||||
|
||||
namespace Torch.API
|
||||
{
|
||||
@@ -12,7 +14,9 @@ namespace Torch.API
|
||||
Dictionary<ulong, IPlayer> Players { get; }
|
||||
List<IChatItem> Chat { get; }
|
||||
void SendMessage(string message);
|
||||
void SendMessage(string message, long playerId, string author = "Server", string font = MyFontEnum.Blue);
|
||||
void KickPlayer(ulong id);
|
||||
void BanPlayer(ulong id, bool banned = true);
|
||||
IMyPlayer GetPlayerBySteamId(ulong id);
|
||||
}
|
||||
}
|
@@ -8,7 +8,7 @@ namespace Torch.API
|
||||
public interface IPluginManager : IEnumerable<ITorchPlugin>
|
||||
{
|
||||
void UpdatePlugins();
|
||||
void LoadPlugins();
|
||||
void Init();
|
||||
void UnloadPlugins();
|
||||
}
|
||||
}
|
@@ -11,6 +11,7 @@ namespace Torch.API
|
||||
event Action SessionLoaded;
|
||||
IMultiplayer Multiplayer { get; }
|
||||
IPluginManager Plugins { get; }
|
||||
Version Version { get; }
|
||||
void Invoke(Action action);
|
||||
void InvokeBlocking(Action action);
|
||||
Task InvokeAsync(Action action);
|
||||
|
39
Torch.API/ModAPI/Ingame/GridExtensions.cs
Normal file
39
Torch.API/ModAPI/Ingame/GridExtensions.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Sandbox.Game.Entities.Blocks;
|
||||
using Sandbox.ModAPI.Ingame;
|
||||
using VRage.Game.ModAPI.Ingame;
|
||||
|
||||
namespace Torch.API.ModAPI.Ingame
|
||||
{
|
||||
public static class GridExtensions
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static class PistonExtensions
|
||||
{
|
||||
public static IMyCubeGrid GetConnectedGrid(this IMyPistonBase pistonBase)
|
||||
{
|
||||
if (!pistonBase.IsAttached)
|
||||
return null;
|
||||
|
||||
return ((Sandbox.ModAPI.IMyPistonBase)pistonBase).TopGrid;
|
||||
}
|
||||
}
|
||||
|
||||
public static class RotorExtensions
|
||||
{
|
||||
public static IMyCubeGrid GetConnectedGrid(this IMyMotorStator rotorBase)
|
||||
{
|
||||
if (!rotorBase.IsAttached)
|
||||
return null;
|
||||
|
||||
return ((Sandbox.ModAPI.IMyMotorStator)rotorBase).RotorGrid;
|
||||
}
|
||||
}
|
||||
}
|
13
Torch.API/ModAPI/TorchAPI.cs
Normal file
13
Torch.API/ModAPI/TorchAPI.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Torch.API.ModAPI
|
||||
{
|
||||
public static class TorchAPI
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@@ -38,6 +38,24 @@
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Sandbox.Common">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Game">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Game.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sandbox.Graphics">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\Sandbox.Graphics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SpaceEngineers.Game">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.Game.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SpaceEngineers.ObjectBuilders">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.ObjectBuilders.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SpaceEngineers.ObjectBuilders.XmlSerializers">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\SpaceEngineers.ObjectBuilders.XmlSerializers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -55,11 +73,41 @@
|
||||
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Audio">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Audio.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Game">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Game.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Game.XmlSerializers">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Game.XmlSerializers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Input">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Input.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Library, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Library.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Math">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Math.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Native">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Native.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage.OpenVRWrapper">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.OpenVRWrapper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Render">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Render11">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Render11.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VRage.Scripting">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64\VRage.Scripting.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ConnectionState.cs" />
|
||||
@@ -70,6 +118,8 @@
|
||||
<Compile Include="ITorchPlugin.cs" />
|
||||
<Compile Include="IServerControls.cs" />
|
||||
<Compile Include="ITorchBase.cs" />
|
||||
<Compile Include="ModAPI\Ingame\GridExtensions.cs" />
|
||||
<Compile Include="ModAPI\TorchAPI.cs" />
|
||||
<Compile Include="PluginAttribute.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
|
Reference in New Issue
Block a user