Files
RobustToolbox/Robust.Server/IBaseServer.cs
Vera Aguilera Puerto c06707d519 Adds ServerOptions, improve GameControllerOptions, fix engine integration tests (#1844)
* Adds ServerOptions, improve GameControllerOptions, fix engine integration tests

* Do component auto-registration in engine integration tests by default

* Fix integration tests on content, register components ONLY if not contentstarted or options are null

* Add integration test for engine integration tests working correctly

* Move cvar overrides out of content and into engine.
2021-07-03 15:19:46 +02:00

54 lines
1.6 KiB
C#

using System;
using Robust.Shared.Log;
using Robust.Shared.Timing;
namespace Robust.Server
{
/// <summary>
/// Top level class that controls the game logic of the server.
/// </summary>
public interface IBaseServer
{
/// <summary>
/// The maximum number of players allowed in the server.
/// </summary>
int MaxPlayers { get; }
/// <summary>
/// The displayed name of our server.
/// </summary>
string ServerName { get; }
/// <summary>
/// Sets up the server, loads the game, gets ready for client connections.
/// </summary>
/// <returns></returns>
bool Start(ServerOptions options, Func<ILogHandler>? logHandler = null);
/// <summary>
/// Hard restarts the server, shutting it down, kicking all players, and starting the server again.
/// </summary>
void Restart();
/// <summary>
/// Shuts down the server, and ends the process.
/// </summary>
/// <param name="reason">Reason why the server was shut down.</param>
void Shutdown(string? reason);
/// <summary>
/// Enters the main loop of the server. This functions blocks until the server is shut down.
/// </summary>
void MainLoop();
}
internal interface IBaseServerInternal : IBaseServer
{
ServerOptions Options { get; }
bool ContentStart { set; }
void OverrideMainLoop(IGameLoop gameLoop);
void SetCommandLineArgs(CommandLineArgs args);
}
}