mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-11 07:40:54 -05:00
Probably should have included the files ;)
This commit is contained in:
37
Webfront Plugin/Main.cs
Normal file
37
Webfront Plugin/Main.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using SharedLibrary;
|
||||
using System.Threading;
|
||||
|
||||
namespace Webfront_Plugin
|
||||
{
|
||||
public class Webfront : Notify
|
||||
{
|
||||
private static Manager webManager;
|
||||
|
||||
public override void onEvent(Event E)
|
||||
{
|
||||
if (webManager != null)
|
||||
{
|
||||
if (E.Type == Event.GType.Start)
|
||||
{
|
||||
Manager.webFront.addServer(E.Owner);
|
||||
E.Owner.Log.Write("Webfront now has access to server on port " + E.Owner.getPort(), Log.Level.Production);
|
||||
}
|
||||
if (E.Type == Event.GType.Stop)
|
||||
{
|
||||
Manager.webFront.removeServer(E.Owner);
|
||||
E.Owner.Log.Write("Webfront has lost access to server on port " + E.Owner.getPort(), Log.Level.Production);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void onLoad()
|
||||
{
|
||||
webManager = new Manager();
|
||||
Thread webManagerThread = new Thread(new ThreadStart(webManager.Init));
|
||||
webManagerThread.Name = "Webfront";
|
||||
|
||||
webManagerThread.Start();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user