private void debugPrint() { string dText = ""; dText += "In game: " + Local.InGame + "\n"; var m = Local.MapFile; if (m != null) { dText += "Map name: " + Local.MapName + "\n"; dText += "Map file: " + m + "\n"; } else { dText += "Map name: " + "N/A" + "\n"; dText += "Map file: N/A\n"; } dText += "Weapon: " + Local.ActiveWeapon.WeaponName + "\n"; dText += "Pos: " + Local.Position + "\n"; dText += "Fov: " + Local.Fov + "\n"; dText += "Viewangle: " + Local.ViewAngle + "\n"; dText += "Punch: " + Local.PunchAngle + "\n"; dText += "BSP: " + BspLoader.LoadedMapName() + "\n"; foreach (Entity e in Entity.EntityArray) { dText += e.print() + "\n"; } mainWindow.setDebugText(dText); }
public static bool checkBsp(int intervalms) { double elapsed = (DateTime.Now - lastChecked).TotalMilliseconds; if (elapsed < intervalms) { return(false); } lastChecked = DateTime.Now; if (Local.InGame && Local.MapFile != null && !BspLoader.IsCorrectMapLoaded()) { BspLoader.LoadMap(Local.MapFile); return(true); } return(false); }
public void MainLoop(CancellationToken cancelToken) { while (true) { if (cancelToken.IsCancellationRequested) { Debugging.Log("Stopping mainloop due to canceltoken request."); return; } RefreshCheck.refreshId += 1; debugPrint(); if (BspLoader.checkBsp(2000)) { Debugging.Log("Loaded BSP for map " + Local.MapName); } Thread.Sleep(50); } }