1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

Webfront renabled, ready for live testing!

This commit is contained in:
raidmax@live.com
2015-07-06 14:51:08 -05:00
parent 6b381a214d
commit c148ca8f4a
6 changed files with 96 additions and 63 deletions

View File

@ -15,6 +15,7 @@ namespace IW4MAdmin
private SortedDictionary<int, Thread> ThreadList;
private List<int> activePIDs;
private Log mainLog;
private bool initialized = false;
public Manager()
{
@ -47,6 +48,8 @@ namespace IW4MAdmin
//mainLog.Write("Now monitoring the server running on port " + IW4MServer.getPort(), Log.Level.All);
}
initialized = true;
while (true)
{
List<Server> defunctServers = new List<Server>();
@ -178,20 +181,24 @@ namespace IW4MAdmin
IntPtr Handle = OpenProcess(0x10, false, pID);
if (Handle != null)
{
int timeWaiting = 0;
int timeWaiting = 0;
bool sv_running = false;
int sv_runningPtr = Utilities.getIntFromPointer(0x1AD7934, (int)Handle) + 0x10; // where the dvar_t struct is stored + the offset for current value
while(!sv_running) // server is still booting up
{
int sv_runningPtr = Utilities.getIntFromPointer(0x1AD7934, (int)Handle) + 0x10; // where the dvar_t struct is stored + the offset for current value
sv_running = Utilities.getBoolFromPointer(sv_runningPtr, (int)Handle);
Utilities.Wait(1);
timeWaiting++;
if (timeWaiting > 60) // don't want to get stuck waiting forever if the server is frozen
if (timeWaiting > 30) // don't want to get stuck waiting forever if the server is frozen
return null;
}
Utilities.Wait(5);
dvar net_ip = Utilities.getDvar(0x64A1DF8, (int)Handle);
dvar net_port = Utilities.getDvar(0x64A3004, (int)Handle);
@ -202,5 +209,10 @@ namespace IW4MAdmin
}
return null;
}
public bool isReady()
{
return initialized;
}
}
}