ddon-server/Arrowgene.Ddon.Server/ServerScriptManager.cs
Paul Campbell e6e5073737 refactor: Refactor code and show different scripting example
- Refactored code so implementation can be shared between Server and
  DdonGameServer.
- Moved settings into settings module and implemented an example using a
  less structured scripting module interface.
- Created new ScriptableSettings class to assist with interacting with
  non-structured settings module.
- Created README.md files for suggestions and guidelines for module
  implementation.
2024-12-26 10:38:17 -05:00

36 lines
1.1 KiB
C#

using Arrowgene.Ddon.Server.Scripting.interfaces;
using Arrowgene.Ddon.Server.Scripting.modules;
using Arrowgene.Ddon.Shared.Scripting;
using Arrowgene.Logging;
namespace Arrowgene.Ddon.Server
{
public class Globals
{
// Currently no script globals are required
// but leave this class as a way to introduce
// globals if needed.
}
public class ServerScriptManager : ScriptManager<Globals>
{
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(ServerScriptManager));
private Globals Globals { get; set; }
public GameServerSettingsModule GameServerSettings { get; private set; } = new GameServerSettingsModule();
public ServerScriptManager(string assetsPath) : base(assetsPath)
{
Globals = new Globals();
// Add modules to the list so the generic logic can iterate over all scripting modules
ScriptModules[GameServerSettings.ModuleRoot] = GameServerSettings;
}
public override void Initialize()
{
base.Initialize(Globals);
}
}
}