Merge branch 'multiple-callbacks' into 20-11-13-merges
This commit is contained in:
@@ -82,9 +82,9 @@ namespace Content.Client
|
|||||||
|
|
||||||
ClientContentIoC.Register();
|
ClientContentIoC.Register();
|
||||||
|
|
||||||
if (TestingCallbacks != null)
|
foreach (var callback in TestingCallbacks)
|
||||||
{
|
{
|
||||||
var cast = (ClientModuleTestingCallbacks) TestingCallbacks;
|
var cast = (ClientModuleTestingCallbacks) callback;
|
||||||
cast.ClientBeforeIoC?.Invoke();
|
cast.ClientBeforeIoC?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,20 @@ namespace Content.IntegrationTests
|
|||||||
options ??= new ServerIntegrationOptions();
|
options ??= new ServerIntegrationOptions();
|
||||||
options.ServerContentAssembly = typeof(Server.EntryPoint).Assembly;
|
options.ServerContentAssembly = typeof(Server.EntryPoint).Assembly;
|
||||||
options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly;
|
options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly;
|
||||||
|
options.BeforeStart += () =>
|
||||||
|
{
|
||||||
|
IoCManager.Resolve<IModLoader>().SetModuleBaseCallbacks(new ServerModuleTestingCallbacks
|
||||||
|
{
|
||||||
|
ServerBeforeIoC = () =>
|
||||||
|
{
|
||||||
|
if (options is ServerContentIntegrationOption contentOptions)
|
||||||
|
{
|
||||||
|
contentOptions.ContentBeforeIoC?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return base.StartServer(options);
|
return base.StartServer(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,11 +81,6 @@ namespace Content.IntegrationTests
|
|||||||
{
|
{
|
||||||
ServerBeforeIoC = () =>
|
ServerBeforeIoC = () =>
|
||||||
{
|
{
|
||||||
if (options is ServerContentIntegrationOption contentOptions)
|
|
||||||
{
|
|
||||||
contentOptions.ContentBeforeIoC?.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
IoCManager.Register<IGameTicker, DummyGameTicker>(true);
|
IoCManager.Register<IGameTicker, DummyGameTicker>(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ namespace Content.Server
|
|||||||
|
|
||||||
ServerContentIoC.Register();
|
ServerContentIoC.Register();
|
||||||
|
|
||||||
if (TestingCallbacks != null)
|
foreach (var callback in TestingCallbacks)
|
||||||
{
|
{
|
||||||
var cast = (ServerModuleTestingCallbacks) TestingCallbacks;
|
var cast = (ServerModuleTestingCallbacks) callback;
|
||||||
cast.ServerBeforeIoC?.Invoke();
|
cast.ServerBeforeIoC?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user