Added docker
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using DiscordBotCore;
|
||||
using DiscordBotCore;
|
||||
using DiscordBotCore.Interfaces.Modules;
|
||||
using DiscordBotCore.Others;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class Entry : IModule
|
||||
};
|
||||
|
||||
private ExternalApplicationManager? _ExternalApplicationManager;
|
||||
|
||||
|
||||
public Task Initialize()
|
||||
{
|
||||
_ExternalApplicationManager = new ExternalApplicationManager();
|
||||
@@ -26,50 +26,51 @@ public class Entry : IModule
|
||||
|
||||
public Guid CreateApplication(string dllFilePath)
|
||||
{
|
||||
if(_ExternalApplicationManager is null)
|
||||
|
||||
if (_ExternalApplicationManager is null)
|
||||
{
|
||||
Application.Logger.Log("Failed to create application because the manager is not initialized. This should have never happened in the first place !!!", this, LogType.Critical);
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
if(_ExternalApplicationManager.TryCreateApplication(dllFilePath, out Guid appId))
|
||||
|
||||
if (_ExternalApplicationManager.TryCreateApplication(dllFilePath, out Guid appId))
|
||||
{
|
||||
return appId;
|
||||
}
|
||||
|
||||
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
public void StopApplication(Guid applicationId)
|
||||
{
|
||||
if(_ExternalApplicationManager is null)
|
||||
if (_ExternalApplicationManager is null)
|
||||
{
|
||||
Application.Logger.Log("Failed to stop application because the manager is not initialized. This should have never happened in the first place!!!", this, LogType.Critical);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_ExternalApplicationManager.FreeApplication(applicationId);
|
||||
}
|
||||
|
||||
|
||||
public void CallFunctionWithParameter(Guid appId, string functionName, ref object parameter)
|
||||
{
|
||||
if(_ExternalApplicationManager is null)
|
||||
if (_ExternalApplicationManager is null)
|
||||
{
|
||||
Application.Logger.Log("Failed to call function because the manager is not initialized. This should have never happened in the first place!!!", this, LogType.Critical);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_ExternalApplicationManager.ExecuteApplicationFunctionWithParameter(appId, functionName, ref parameter);
|
||||
}
|
||||
|
||||
|
||||
public void CallFunctionWithoutParameter(Guid appId, string functionName)
|
||||
{
|
||||
if(_ExternalApplicationManager is null)
|
||||
if (_ExternalApplicationManager is null)
|
||||
{
|
||||
Application.Logger.Log("Failed to call function because the manager is not initialized. This should have never happened in the first place!!!", this, LogType.Critical);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_ExternalApplicationManager.ExecuteApplicationFunctionWithoutParameter(appId, functionName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user