2022-01-26 10:32:16 -06:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Concurrent;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading;
|
2018-04-08 13:48:40 -05:00
|
|
|
|
using System.Threading.Tasks;
|
2018-04-08 01:44:42 -05:00
|
|
|
|
using SharedLibraryCore.Configuration;
|
2018-11-05 21:01:29 -06:00
|
|
|
|
using SharedLibraryCore.Database.Models;
|
2022-01-26 10:32:16 -06:00
|
|
|
|
using SharedLibraryCore.Helpers;
|
|
|
|
|
using SharedLibraryCore.Services;
|
2017-05-26 17:49:27 -05:00
|
|
|
|
|
2018-04-08 01:44:42 -05:00
|
|
|
|
namespace SharedLibraryCore.Interfaces
|
2017-05-26 17:49:27 -05:00
|
|
|
|
{
|
|
|
|
|
public interface IManager
|
|
|
|
|
{
|
2022-01-26 10:32:16 -06: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 01:22:19 -06:00
|
|
|
|
Task Init();
|
2019-05-08 20:34:17 -05:00
|
|
|
|
Task Start();
|
2022-03-24 11:34:32 -05:00
|
|
|
|
Task Stop();
|
2019-05-08 20:34:17 -05:00
|
|
|
|
void Restart();
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2020-11-11 17:31:26 -06:00
|
|
|
|
[Obsolete]
|
2018-11-27 18:31:48 -06:00
|
|
|
|
ILogger GetLogger(long serverId);
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2017-09-29 21:42:24 -05:00
|
|
|
|
IList<Server> GetServers();
|
2020-01-31 20:15:07 -06:00
|
|
|
|
IList<IManagerCommand> GetCommands();
|
2022-01-26 10:32:16 -06:00
|
|
|
|
IList<MessageToken> GetMessageTokens();
|
2018-11-05 21:01:29 -06:00
|
|
|
|
IList<EFClient> GetActiveClients();
|
2021-10-31 11:57:32 -05:00
|
|
|
|
EFClient FindActiveClient(EFClient client);
|
2018-03-18 21:25:11 -05:00
|
|
|
|
IConfigurationHandler<ApplicationConfiguration> GetApplicationSettings();
|
2018-03-06 01:22:19 -06:00
|
|
|
|
ClientService GetClientService();
|
2017-11-25 19:29:58 -06:00
|
|
|
|
PenaltyService GetPenaltyService();
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2018-04-26 01:13:04 -05:00
|
|
|
|
/// <summary>
|
2022-01-26 10:32:16 -06:00
|
|
|
|
/// provides a page list to add and remove from
|
2018-08-03 17:10:20 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
IPageList GetPageList();
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2019-07-16 15:27:19 -05:00
|
|
|
|
/// <summary>
|
2022-01-26 10:32:16 -06: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 15:27:19 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="operationName"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<IList<T>> ExecuteSharedDatabaseOperation<T>(string operationName);
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2019-07-16 15:27:19 -05:00
|
|
|
|
void RegisterSharedDatabaseOperation(Task<IList> operation, string operationName);
|
2020-01-21 18:08:18 -06:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-01-26 10:32:16 -06:00
|
|
|
|
/// generates an rcon parser that can be configured by script plugins
|
2020-01-21 18:08:18 -06: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 10:32:16 -06:00
|
|
|
|
/// Generates an event parser that can be configured by script plugins
|
2020-01-21 18:08:18 -06:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">name of the event parser</param>
|
|
|
|
|
/// <returns>new event parser instance</returns>
|
|
|
|
|
IEventParser GenerateDynamicEventParser(string name);
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2019-11-15 14:50:20 -06:00
|
|
|
|
Task ExecuteEvent(GameEvent gameEvent);
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2020-05-04 16:50:02 -05:00
|
|
|
|
/// <summary>
|
2022-01-26 10:32:16 -06:00
|
|
|
|
/// queues an event for processing
|
2020-05-04 16:50:02 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="gameEvent">event to be processed</param>
|
|
|
|
|
void AddEvent(GameEvent gameEvent);
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2020-05-11 16:10:43 -05:00
|
|
|
|
/// <summary>
|
2022-01-26 10:32:16 -06:00
|
|
|
|
/// adds an additional (script) command to the command list
|
2020-05-11 16:10:43 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="command"></param>
|
|
|
|
|
void AddAdditionalCommand(IManagerCommand command);
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2020-05-11 16:10:43 -05:00
|
|
|
|
/// <summary>
|
2022-01-26 10:32:16 -06:00
|
|
|
|
/// removes a command by its name
|
2020-05-11 16:10:43 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">name of command</param>
|
|
|
|
|
void RemoveCommandByName(string name);
|
2022-01-26 10:32:16 -06:00
|
|
|
|
|
2020-05-22 21:38:38 -05:00
|
|
|
|
/// <summary>
|
2022-01-26 10:32:16 -06:00
|
|
|
|
/// event executed when event has finished executing
|
2020-05-22 21:38:38 -05:00
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<GameEvent> OnGameEventExecuted;
|
2022-06-11 11:34:00 -05:00
|
|
|
|
|
|
|
|
|
IAlertManager AlertManager { get; }
|
2017-05-26 17:49:27 -05:00
|
|
|
|
}
|
2022-03-24 11:34:32 -05:00
|
|
|
|
}
|