mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-25 06:30:21 -05:00
Sql syntax fix and onelog fix
This commit is contained in:
@ -10,6 +10,7 @@ namespace IW4MAdmin
|
||||
{
|
||||
public static List<Command> potentialCommands = new List<Command>();
|
||||
public static List<Plugin> potentialPlugins = new List<Plugin>();
|
||||
public static Plugin webFront = null;
|
||||
|
||||
public static bool Load()
|
||||
{
|
||||
@ -50,23 +51,26 @@ namespace IW4MAdmin
|
||||
{
|
||||
Object notifyObject = Activator.CreateInstance(assemblyType);
|
||||
Plugin newNotify = (Plugin)notifyObject;
|
||||
potentialPlugins.Add(newNotify);
|
||||
|
||||
try
|
||||
if (potentialPlugins.Find(x => x.Name == newNotify.Name) == null)
|
||||
{
|
||||
newNotify.onLoad();
|
||||
}
|
||||
potentialPlugins.Add(newNotify);
|
||||
|
||||
catch (Exception E)
|
||||
{
|
||||
Program.getManager().mainLog.Write("There was an error starting \"" + newNotify.Name + "\" plugin", Log.Level.Debug);
|
||||
Program.getManager().mainLog.Write("Error Message: " + E.Message, Log.Level.Debug);
|
||||
Program.getManager().mainLog.Write("Error Trace: " + E.StackTrace, Log.Level.Debug);
|
||||
continue;
|
||||
try
|
||||
{
|
||||
newNotify.onLoad();
|
||||
}
|
||||
|
||||
catch (Exception E)
|
||||
{
|
||||
Program.getManager().mainLog.Write("There was an error starting \"" + newNotify.Name + "\" plugin", Log.Level.Debug);
|
||||
Program.getManager().mainLog.Write("Error Message: " + E.Message, Log.Level.Debug);
|
||||
Program.getManager().mainLog.Write("Error Trace: " + E.StackTrace, Log.Level.Debug);
|
||||
continue;
|
||||
}
|
||||
|
||||
Program.getManager().mainLog.Write("Loaded plugin \"" + newNotify.Name + "\"" + " [" + newNotify.Version + "]", Log.Level.Debug);
|
||||
totalLoaded++;
|
||||
}
|
||||
|
||||
Program.getManager().mainLog.Write("Loaded plugin \"" + newNotify.Name + "\"" + " [" + newNotify.Version + "]", Log.Level.Debug);
|
||||
totalLoaded++;
|
||||
}
|
||||
|
||||
else if (assemblyType.IsClass && assemblyType.BaseType.Name == "Command")
|
||||
@ -91,7 +95,10 @@ namespace IW4MAdmin
|
||||
{
|
||||
try
|
||||
{
|
||||
P.onUnload();
|
||||
if (P.Name != "Webfront")
|
||||
P.onUnload();
|
||||
else
|
||||
webFront = P;
|
||||
}
|
||||
|
||||
catch (Exception E)
|
||||
@ -105,6 +112,8 @@ namespace IW4MAdmin
|
||||
|
||||
potentialCommands = new List<Command>();
|
||||
potentialPlugins = new List<Plugin>();
|
||||
if (webFront != null)
|
||||
potentialPlugins.Add(webFront);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -574,7 +574,9 @@ namespace IW4MAdmin
|
||||
|
||||
override public bool intializeBasics()
|
||||
{
|
||||
#if DEBUG == false
|
||||
try
|
||||
#endif
|
||||
{
|
||||
// clear out any lingering instances
|
||||
Utilities.shutdownInterface(PID);
|
||||
@ -587,8 +589,12 @@ namespace IW4MAdmin
|
||||
}
|
||||
|
||||
// basic info dvars
|
||||
hostname = SharedLibrary.Utilities.stripColors(getDvar("sv_hostname").current);
|
||||
mapname = getDvar("mapname").current;
|
||||
do
|
||||
{
|
||||
hostname = SharedLibrary.Utilities.stripColors(getDvar("sv_hostname").current);
|
||||
mapname = getDvar("mapname").current;
|
||||
} while (hostname == "0" || mapname == "0");
|
||||
|
||||
Map localizedMapName = maps.Find(x => x.Name.Equals(mapname));
|
||||
|
||||
if (localizedMapName != null)
|
||||
@ -608,11 +614,25 @@ namespace IW4MAdmin
|
||||
Gametype = getDvar("g_gametype").current;
|
||||
|
||||
// important log variables
|
||||
Basepath = getDvar("fs_basepath").current;
|
||||
Mod = getDvar("fs_game").current;
|
||||
logPath = getDvar("g_log").current;
|
||||
do
|
||||
{
|
||||
Basepath = getDvar("fs_basepath").current;
|
||||
Mod = getDvar("fs_game").current;
|
||||
logPath = getDvar("g_log").current;
|
||||
} while (Basepath == "0" || Mod == "0" || logPath == "0");
|
||||
int oneLog = -1;
|
||||
Int32.TryParse(getDvar("iw4m_onelog").current, out oneLog);
|
||||
logPath = logPath.Replace("/", "\\");
|
||||
Mod = Mod.Replace("/", "\\");
|
||||
|
||||
int count = 0;
|
||||
|
||||
while(count < 15)
|
||||
{
|
||||
Int32.TryParse(getDvar("iw4m_onelog").current, out oneLog);
|
||||
if (oneLog == 1)
|
||||
break;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (oneLog == -1)
|
||||
{
|
||||
@ -626,7 +646,7 @@ namespace IW4MAdmin
|
||||
|
||||
if (Website == "0" || Website == null)
|
||||
Website = "this server's website";
|
||||
|
||||
|
||||
int logSync = -1;
|
||||
Int32.TryParse(getDvar("g_logSync").current, out oneLog);
|
||||
|
||||
@ -657,12 +677,13 @@ namespace IW4MAdmin
|
||||
Bans = clientDB.getBans();
|
||||
return true;
|
||||
}
|
||||
|
||||
#if DEBUG == false
|
||||
catch (Exception E)
|
||||
{
|
||||
Log.Write("Error during initialization - " + E.Message + "--" + E.StackTrace, Log.Level.All);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//Process any server event
|
||||
|
@ -27,5 +27,6 @@ mp_fuel2:Fuel
|
||||
mp_storm:Storm
|
||||
mp_complex:Bailout
|
||||
mp_compact:Salvage
|
||||
mp_nuked:Nuketown
|
||||
iw4_credits:IW4 Credits
|
||||
mp_raidmax:^1L^23^33^4T^5M^6A^75^8T^93^0R
|
Binary file not shown.
Binary file not shown.
@ -1,4 +1,10 @@
|
||||
VERSION 0.9.5
|
||||
VERSION 0.9.6
|
||||
CHANGELOG:
|
||||
-fixed issue with log path sometimes not reading properly
|
||||
-webfront no long crashes on reload
|
||||
-
|
||||
|
||||
VERSION 0.9.5
|
||||
-Major refactoring to support plugins
|
||||
-*web front redux*
|
||||
-lots of little fixes and stability improvements
|
||||
|
Reference in New Issue
Block a user