-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
783 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("e6f07cf4-2b80-4134-8d0d-52562fa16b8f")] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* This file is part of SWBF2Admin (https://github.com/jweigelt/swbf2admin). | ||
* This file is part of SWBF2Admin (https://github.com/jweigelt/swbf2admin). | ||
* Copyright(C) 2017, 2018 Jan Weigelt <[email protected]> | ||
* | ||
* SWBF2Admin is free software: you can redistribute it and/or modify | ||
|
@@ -15,25 +15,23 @@ | |
* You should have received a copy of the GNU General Public License | ||
* along with SWBF2Admin. If not, see<http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
using SWBF2Admin.Utility; | ||
using SWBF2Admin.Config; | ||
using SWBF2Admin.Web; | ||
using SWBF2Admin.Database; | ||
using SWBF2Admin.Gameserver; | ||
using SWBF2Admin.Scheduler; | ||
using SWBF2Admin.Structures; | ||
|
||
using SWBF2Admin.Runtime.Players; | ||
using SWBF2Admin.Runtime.Rcon; | ||
using SWBF2Admin.Runtime.Game; | ||
using SWBF2Admin.Runtime.Announce; | ||
using SWBF2Admin.Runtime.Commands; | ||
using SWBF2Admin.Runtime.ApplyMods; | ||
using SWBF2Admin.Runtime.Watchdog; | ||
|
||
using SWBF2Admin.Plugins; | ||
|
||
namespace SWBF2Admin | ||
|
@@ -43,7 +41,12 @@ public class AdminCore | |
private const string ARG_RESET_WEBUSER = "--reset-webcredentials"; | ||
|
||
private CoreConfiguration config; | ||
public CoreConfiguration Config { get { return config; } } | ||
|
||
public CoreConfiguration Config | ||
{ | ||
get { return config; } | ||
} | ||
|
||
public FileHandler Files { get; } = new FileHandler(); | ||
public TaskScheduler Scheduler { get; } = new TaskScheduler(); | ||
|
||
|
@@ -168,6 +171,11 @@ public void Run(string[] args) | |
|
||
while ((cmd = Console.ReadLine()) != "quit") | ||
{ | ||
if (string.IsNullOrEmpty(cmd)) | ||
{ | ||
continue; | ||
} | ||
|
||
if (cmd == "import maps") | ||
{ | ||
Database.ImportMaps(ServerMap.ReadServerMapConfig(this)); | ||
|
@@ -185,9 +193,9 @@ public void Run(string[] args) | |
|
||
|
||
#region "Events" | ||
|
||
private void Server_Started(object sender, EventArgs e) | ||
{ | ||
|
||
Logger.Log(LogLevel.Verbose, "Starting runtime management..."); | ||
Scheduler.PushDelayedTask(() => | ||
{ | ||
|
@@ -214,7 +222,7 @@ private void Server_Stopped(object sender, EventArgs e) | |
Logger.Log(LogLevel.Verbose, "Restarting server..."); | ||
Server.Start(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
private void Server_Crashed(object sender, EventArgs e) | ||
|
@@ -223,24 +231,23 @@ private void Server_Crashed(object sender, EventArgs e) | |
if (Config.AutoRestartServer) | ||
{ | ||
Logger.Log(LogLevel.Info, "Automatic restart is enabled. Restarting server..."); | ||
Scheduler.PushDelayedTask(() => Server.Start(), 90000); | ||
Scheduler.PushDelayedTask(() => Server.Start(), Config.AutoRestartDelay); | ||
} | ||
} | ||
|
||
private void Rcon_Disconnected(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void Rcon_Chat(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void Announce_Broadcast(object sender, EventArgs e) | ||
{ | ||
Rcon.Say(((AnnounceEventArgs)e).Announce.ParseMessage(this)); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.