Merge branch 'master' into master

This commit is contained in:
Alexander Qvist-Hellum
2017-07-07 00:39:00 +02:00
committed by GitHub
31 changed files with 597 additions and 319 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -8,37 +8,105 @@ using VRage.Game.ModAPI;
namespace Torch.API
{
/// <summary>
/// API for Torch functions shared between client and server.
/// </summary>
public interface ITorchBase
{
/// <summary>
/// Fired when the session begins loading.
/// </summary>
event Action SessionLoading;
/// <summary>
/// Fired when the session finishes loading.
/// </summary>
event Action SessionLoaded;
/// <summary>
/// Fires when the session begins unloading.
/// </summary>
event Action SessionUnloading;
/// <summary>
/// Fired when the session finishes unloading.
/// </summary>
event Action SessionUnloaded;
/// <summary>
/// Configuration for the current instance.
/// </summary>
ITorchConfig Config { get; }
/// <inheritdoc cref="IMultiplayerManager"/>
IMultiplayerManager Multiplayer { get; }
/// <inheritdoc cref="IPluginManager"/>
IPluginManager Plugins { get; }
/// <summary>
/// The binary version of the current instance.
/// </summary>
Version TorchVersion { get; }
/// <summary>
/// Invoke an action on the game thread.
/// </summary>
void Invoke(Action action);
/// <summary>
/// Invoke an action on the game thread and block until it has completed.
/// If this is called on the game thread the action will execute immediately.
/// </summary>
void InvokeBlocking(Action action);
/// <summary>
/// Invoke an action on the game thread asynchronously.
/// </summary>
Task InvokeAsync(Action action);
string[] RunArgs { get; set; }
bool IsOnGameThread();
/// <summary>
/// Start the Torch instance.
/// </summary>
void Start();
/// <summary>
/// Stop the Torch instance.
/// </summary>
void Stop();
/// <summary>
/// Initializes a save of the game.
/// </summary>
/// <param name="callerId">Id of the player who initiated the save.</param>
void Save(long callerId);
/// <summary>
/// Initialize the Torch instance.
/// </summary>
void Init();
/// <summary>
/// Get an <see cref="IManager"/> that is part of the Torch instance.
/// </summary>
/// <typeparam name="T">Manager type</typeparam>
T GetManager<T>() where T : class, IManager;
}
/// <summary>
/// API for the Torch server.
/// </summary>
public interface ITorchServer : ITorchBase
{
/// <summary>
/// Path of the dedicated instance folder.
/// </summary>
string InstancePath { get; }
}
/// <summary>
/// API for the Torch client.
/// </summary>
public interface ITorchClient : ITorchBase
{