Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
A lot of changes for the 0.6 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntINFINAit authored and AntINFINAit committed Nov 26, 2020
1 parent cea9a3a commit 5e637af
Show file tree
Hide file tree
Showing 20 changed files with 720 additions and 54 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -345,3 +345,5 @@ Server.Test
Server.Test/
/ImpostorHQ.Command/ImpostorHQ.TestPlugins.antiSync
/ImpostorHQ.Command/SupremeSyncServer
/ImpostorHQ.Command/ImpostorHQ.GameMode.Timeframe
/ImpostorHQ.Command/Optimization
47 changes: 46 additions & 1 deletion ImpostorHQ.Command/Impostor.Command.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImpostorHQ.Plugin.Fashionab
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImpostorHQ.Plugin.Fashionable.Designer", "ImpostorHQ.Plugin.Fashionable.Designer\ImpostorHQ.Plugin.Fashionable.Designer.csproj", "{76E59656-C45F-4F28-A184-9CB15EE5AF73}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImpostorHQ.Plugin.HallOfShame", "ImpostorHQ.Plugin.HallOfShame\ImpostorHQ.Plugin.HallOfShame.csproj", "{6E531144-02F5-46A3-9758-D660A09EE7C0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImpostorHQ.Plugin.HallOfShame", "ImpostorHQ.Plugin.HallOfShame\ImpostorHQ.Plugin.HallOfShame.csproj", "{6E531144-02F5-46A3-9758-D660A09EE7C0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Game Modes", "Game Modes", "{74E1796B-1ECB-415E-906A-BBF1C7FFB31F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImpostorHQ.GameMode.Timeframe", "ImpostorHQ.GameMode.Timeframe\ImpostorHQ.GameMode.Timeframe.csproj", "{45F86E59-A175-48AD-BB42-D8D961139094}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Optimization", "Optimization\Optimization.csproj", "{66D3D3C3-EE1C-4486-BB42-F76150E5213F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImpostorHQ.Plugin.DDoSInfo", "ImpostorHQ.Plugin.DDoSInfo\ImpostorHQ.Plugin.DDoSInfo.csproj", "{5C3E0DD4-DA0C-454C-8200-B82A344D2D56}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImpostorHQ.Plugin.DiskStatus", "ImpostorHQ.Plugin.DiskStatus\ImpostorHQ.Plugin.DiskStatus.csproj", "{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -83,6 +93,38 @@ Global
{6E531144-02F5-46A3-9758-D660A09EE7C0}.Release_Ubuntu|Any CPU.Build.0 = Release|Any CPU
{6E531144-02F5-46A3-9758-D660A09EE7C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E531144-02F5-46A3-9758-D660A09EE7C0}.Release|Any CPU.Build.0 = Release|Any CPU
{45F86E59-A175-48AD-BB42-D8D961139094}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{45F86E59-A175-48AD-BB42-D8D961139094}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
{45F86E59-A175-48AD-BB42-D8D961139094}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{45F86E59-A175-48AD-BB42-D8D961139094}.Debug|Any CPU.Build.0 = Debug|Any CPU
{45F86E59-A175-48AD-BB42-D8D961139094}.Release_Ubuntu|Any CPU.ActiveCfg = Release|Any CPU
{45F86E59-A175-48AD-BB42-D8D961139094}.Release_Ubuntu|Any CPU.Build.0 = Release|Any CPU
{45F86E59-A175-48AD-BB42-D8D961139094}.Release|Any CPU.ActiveCfg = Release|Any CPU
{45F86E59-A175-48AD-BB42-D8D961139094}.Release|Any CPU.Build.0 = Release|Any CPU
{66D3D3C3-EE1C-4486-BB42-F76150E5213F}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{66D3D3C3-EE1C-4486-BB42-F76150E5213F}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
{66D3D3C3-EE1C-4486-BB42-F76150E5213F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66D3D3C3-EE1C-4486-BB42-F76150E5213F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66D3D3C3-EE1C-4486-BB42-F76150E5213F}.Release_Ubuntu|Any CPU.ActiveCfg = Release|Any CPU
{66D3D3C3-EE1C-4486-BB42-F76150E5213F}.Release_Ubuntu|Any CPU.Build.0 = Release|Any CPU
{66D3D3C3-EE1C-4486-BB42-F76150E5213F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66D3D3C3-EE1C-4486-BB42-F76150E5213F}.Release|Any CPU.Build.0 = Release|Any CPU
{5C3E0DD4-DA0C-454C-8200-B82A344D2D56}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{5C3E0DD4-DA0C-454C-8200-B82A344D2D56}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
{5C3E0DD4-DA0C-454C-8200-B82A344D2D56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C3E0DD4-DA0C-454C-8200-B82A344D2D56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C3E0DD4-DA0C-454C-8200-B82A344D2D56}.Release_Ubuntu|Any CPU.ActiveCfg = Release|Any CPU
{5C3E0DD4-DA0C-454C-8200-B82A344D2D56}.Release_Ubuntu|Any CPU.Build.0 = Release|Any CPU
{5C3E0DD4-DA0C-454C-8200-B82A344D2D56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C3E0DD4-DA0C-454C-8200-B82A344D2D56}.Release|Any CPU.Build.0 = Release|Any CPU
{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A}.Release_Ubuntu|Any CPU.ActiveCfg = Release|Any CPU
{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A}.Release_Ubuntu|Any CPU.Build.0 = Release|Any CPU
{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -91,6 +133,9 @@ Global
{F4D0DB97-AEE8-49B8-A568-0D5B2F714AA0} = {591D8590-F104-4D3A-AD0B-B8C825AA66B7}
{76E59656-C45F-4F28-A184-9CB15EE5AF73} = {591D8590-F104-4D3A-AD0B-B8C825AA66B7}
{6E531144-02F5-46A3-9758-D660A09EE7C0} = {591D8590-F104-4D3A-AD0B-B8C825AA66B7}
{45F86E59-A175-48AD-BB42-D8D961139094} = {74E1796B-1ECB-415E-906A-BBF1C7FFB31F}
{5C3E0DD4-DA0C-454C-8200-B82A344D2D56} = {591D8590-F104-4D3A-AD0B-B8C825AA66B7}
{92B1CBAF-43CC-4FEA-BC66-F89C72EBD84A} = {591D8590-F104-4D3A-AD0B-B8C825AA66B7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {362CA084-8ED3-49DF-91CA-BF06EE4A969C}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Hazel.Udp;
using System.IO;
using System.Net;
using System.Runtime.CompilerServices;
using Impostor.Commands.Core.SELF;

namespace Impostor.Commands.Core
Expand Down
23 changes: 18 additions & 5 deletions ImpostorHQ.Command/Impostor.Commands.Core/Class.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Impostor.Commands.Core
[ImpostorPlugin("ImpostorHQ","Impostor HeadQuarters API","anti, Dimaguy","0.0.4 beta")]
public class Class : PluginBase
{
public const int PluginApiVersion = 1;
public const int PluginApiVersion = 3;

#region Members
//indicates that the plugin is active.
Expand Down Expand Up @@ -74,6 +74,7 @@ public class Class : PluginBase
public QuodEratDemonstrandum.QuiteElegantDirectory QED{ get; private set; }
public PluginLoader PluginLoader { get; private set; }
public QuiteExtendableDirectInterface QEDi { get; set; }
public QuiteEffectiveDetector QEDetector { get; private set; }
#endregion
/// <summary>
/// This constructor will be 'injected' with the required references by the plugin API.
Expand Down Expand Up @@ -124,6 +125,7 @@ public override ValueTask DisableAsync()
AnnouncementManager.Shutdown();
QED.Shutdown();
PluginLoader.Shutdown();
QEDetector.Shutdown();
return default;
}
#endregion
Expand Down Expand Up @@ -166,12 +168,13 @@ public void Main()
}

this.LogManager = new SpatiallyEfficientLogFileManager("hqlogs");
QEDetector = new QuiteEffectiveDetector(250);
InitializeInterfaces();
InitializeServers();
HighCourt = new JusticeSystem(BanFolder,ChatCommandCfg.ReportsRequiredForBan,Logger,ChatInterface,this);
HighCourt.OnPlayerBanned += PlayerBanned;
//after we initialize everything, we can load the plugins.
QEDi = new QuiteExtendableDirectInterface()
QEDi = new QuiteExtendableDirectInterface(this)
{
Logger = Logger,
MainThread = MainThread,
Expand All @@ -189,11 +192,11 @@ public void Main()
LogManager = LogManager,
AnnouncementServer = AnnouncementManager,
QED = QED,
QEDetector = QEDetector,
UnsafeDirectReference = this
};
this.PluginLoader = new PluginLoader(PluginFolderPath, QEDi, PluginApiVersion);
PluginLoader.LoadPlugins();

}

private void InitializeInterfaces()
Expand All @@ -219,8 +222,8 @@ private void InitializeServers()
var error404Html = File.ReadAllText(Path.Combine("dashboard", "404.html"));
var errorMimeHtml = File.ReadAllText(Path.Combine("dashboard", "mime.html"));
//we initialize our servers and set up the events.
this.ApiServer = new WebApiServer(Configuration.APIPort, Configuration.ListenInterface, Configuration.APIKeys.ToArray(), Logger,GameManager,this);
this.DashboardServer = new HttpServer(Configuration.ListenInterface, Configuration.WebsitePort, ClientHTML, error404Html, errorMimeHtml,this,ApiServer);
this.ApiServer = new WebApiServer(Configuration.APIPort, Configuration.ListenInterface, Configuration.APIKeys.ToArray(), Logger,GameManager,this,QEDetector);
this.DashboardServer = new HttpServer(Configuration.ListenInterface, Configuration.WebsitePort, ClientHTML, error404Html, errorMimeHtml,this,ApiServer,QEDetector);
Logger.LogInformation($"ImpostorHQ : API Server listening on: {Configuration.ListenInterface}:{Configuration.APIPort}. Dashboard listening on: {Configuration.ListenInterface}:{Configuration.WebsitePort}/client.html");
this.AnnouncementManager = new AnnouncementServer(this,"configs");
ApiServer.OnMessageReceived += DashboardCommandReceived;
Expand Down Expand Up @@ -887,6 +890,11 @@ private void DashboardCommandReceived(Structures.BaseMessage message,IWebSocketC
break;

}
default:
OnExternalCommandInvoked?.Invoke(cmd,message.Text,isSingle,client);
isSingle = true; //inhibit 'Command executed successfully'.
break;

}

if (commandHandled)
Expand Down Expand Up @@ -1048,5 +1056,10 @@ public void ConsolePluginStatus(string message)
{
Logger.LogInformation("ImpostorHQ Plugin System : " + message);
}

public delegate void DelDashboardCommandInvoked(string command, string data, bool single,
IWebSocketConnection source);

public event DelDashboardCommandInvoked OnExternalCommandInvoked;
}
}
Loading

0 comments on commit 5e637af

Please sign in to comment.