2022-01-26 11:32:16 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Concurrent;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading;
|
2018-04-08 14:48:40 -04:00
|
|
|
|
using System.Threading.Tasks;
|
2018-04-08 02:44:42 -04:00
|
|
|
|
using SharedLibraryCore.Configuration;
|
2018-11-05 22:01:29 -05:00
|
|
|
|
using SharedLibraryCore.Database.Models;
|
2022-01-26 11:32:16 -05:00
|
|
|
|
using SharedLibraryCore.Helpers;
|
|
|
|
|
using SharedLibraryCore.Services;
|
2017-05-26 18:49:27 -04:00
|
|
|
|
|
2018-04-08 02:44:42 -04:00
|
|
|
|
namespace SharedLibraryCore.Interfaces
|
2017-05-26 18:49:27 -04:00
|
|
|
|
{
|
|
|
|
|
public interface IManager
|
|
|
|
|
{
|
2022-01-26 11:32:16 -05:00
|
|
|
|
IReadOnlyList<IManagerCommand> Commands { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// enumerates the registered plugin instances
|
|
|
|
|
/// </summary>
|
|
|
|
|
IEnumerable<IPlugin> Plugins { get; }
|
|
|
|
|
|
|
|
|
|
IList<IRConParser> AdditionalRConParsers { get; }
|
|
|
|
|
IList<IEventParser> AdditionalEventParsers { get; }
|
|
|
|
|
IMiddlewareActionHandler MiddlewareActionHandler { get; }
|
|
|
|
|
string Version { get; }
|
|
|
|
|
ITokenAuthentication TokenAuthenticator { get; }
|
|
|
|
|
string ExternalIPAddress { get; }
|
|
|
|
|
CancellationToken CancellationToken { get; }
|
|
|
|
|
bool IsRestartRequested { get; }
|
|
|
|
|
bool IsRunning { get; }
|
|
|
|
|
ConcurrentDictionary<long, GameEvent> ProcessingEvents { get; }
|
2018-03-06 02:22:19 -05:00
|
|
|
|
Task Init();
|
2019-05-08 21:34:17 -04:00
|
|
|
|
Task Start();
|
2022-03-24 12:34:32 -04:00
|
|
|
|
Task Stop();
|
2019-05-08 21:34:17 -04:00
|
|
|
|
void Restart();
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2020-11-11 18:31:26 -05:00
|
|
|
|
[Obsolete]
|
2018-11-27 19:31:48 -05:00
|
|
|
|
ILogger GetLogger(long serverId);
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2017-09-29 22:42:24 -04:00
|
|
|
|
IList<Server> GetServers();
|
2020-01-31 21:15:07 -05:00
|
|
|
|
IList<IManagerCommand> GetCommands();
|
2022-01-26 11:32:16 -05:00
|
|
|
|
IList<MessageToken> GetMessageTokens();
|
2018-11-05 22:01:29 -05:00
|
|
|
|
IList<EFClient> GetActiveClients();
|
2021-10-31 12:57:32 -04:00
|
|
|
|
EFClient FindActiveClient(EFClient client);
|
2018-03-18 22:25:11 -04:00
|
|
|
|
IConfigurationHandler<ApplicationConfiguration> GetApplicationSettings();
|
2018-03-06 02:22:19 -05:00
|
|
|
|
ClientService GetClientService();
|
2017-11-25 20:29:58 -05:00
|
|
|
|
PenaltyService GetPenaltyService();
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2018-04-26 02:13:04 -04:00
|
|
|
|
/// <summary>
|
2022-01-26 11:32:16 -05:00
|
|
|
|
/// provides a page list to add and remove from
|
2018-08-03 18:10:20 -04:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
IPageList GetPageList();
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2019-07-16 16:27:19 -04:00
|
|
|
|
/// <summary>
|
2022-01-26 11:32:16 -05:00
|
|
|
|
/// provides a method to execute database operations by name without exposing the
|
|
|
|
|
/// service level methods
|
|
|
|
|
/// todo: this could be made obsolete by creating a seperate service library with more concrete definitions
|
2019-07-16 16:27:19 -04:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="operationName"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<IList<T>> ExecuteSharedDatabaseOperation<T>(string operationName);
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2019-07-16 16:27:19 -04:00
|
|
|
|
void RegisterSharedDatabaseOperation(Task<IList> operation, string operationName);
|
2020-01-21 19:08:18 -05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-01-26 11:32:16 -05:00
|
|
|
|
/// generates an rcon parser that can be configured by script plugins
|
2020-01-21 19:08:18 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">name of the RCon parser</param>
|
|
|
|
|
/// <returns>new rcon parser instance</returns>
|
|
|
|
|
IRConParser GenerateDynamicRConParser(string name);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-01-26 11:32:16 -05:00
|
|
|
|
/// Generates an event parser that can be configured by script plugins
|
2020-01-21 19:08:18 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">name of the event parser</param>
|
|
|
|
|
/// <returns>new event parser instance</returns>
|
|
|
|
|
IEventParser GenerateDynamicEventParser(string name);
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2019-11-15 15:50:20 -05:00
|
|
|
|
Task ExecuteEvent(GameEvent gameEvent);
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2020-05-04 17:50:02 -04:00
|
|
|
|
/// <summary>
|
2022-01-26 11:32:16 -05:00
|
|
|
|
/// queues an event for processing
|
2020-05-04 17:50:02 -04:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="gameEvent">event to be processed</param>
|
|
|
|
|
void AddEvent(GameEvent gameEvent);
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2020-05-11 17:10:43 -04:00
|
|
|
|
/// <summary>
|
2022-01-26 11:32:16 -05:00
|
|
|
|
/// adds an additional (script) command to the command list
|
2020-05-11 17:10:43 -04:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="command"></param>
|
|
|
|
|
void AddAdditionalCommand(IManagerCommand command);
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2020-05-11 17:10:43 -04:00
|
|
|
|
/// <summary>
|
2022-01-26 11:32:16 -05:00
|
|
|
|
/// removes a command by its name
|
2020-05-11 17:10:43 -04:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">name of command</param>
|
|
|
|
|
void RemoveCommandByName(string name);
|
2022-01-26 11:32:16 -05:00
|
|
|
|
|
2020-05-22 22:38:38 -04:00
|
|
|
|
/// <summary>
|
2022-01-26 11:32:16 -05:00
|
|
|
|
/// event executed when event has finished executing
|
2020-05-22 22:38:38 -04:00
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<GameEvent> OnGameEventExecuted;
|
2017-05-26 18:49:27 -04:00
|
|
|
|
}
|
2022-03-24 12:34:32 -04:00
|
|
|
|
}
|