private void Init() { Logger.Log("Init RconManager", Category.Rcon); DontDestroyOnLoad(rconManager.gameObject); fpsMonitor = GetComponent <FPSMonitor>(); if (ServerData.ServerConfig == null) { Logger.Log("No server config found: rcon", Category.Rcon); Destroy(gameObject); } else { config = ServerData.ServerConfig; if (string.IsNullOrEmpty(config.RconPass) || config.RconPort == 0) { Logger.Log("Invalid Rcon config, please check your RconPass and RconPort values", Category.Rcon); Destroy(gameObject); } else { StartServer(); } } }
private void Init() { Logger.Log("Init RconManager", Category.Rcon); DontDestroyOnLoad(rconManager.gameObject); fpsMonitor = GetComponent <FPSMonitor>(); string filePath = Application.streamingAssetsPath + "/config/config.json"; try { string result = System.IO.File.ReadAllText(filePath); if (string.IsNullOrEmpty(result)) { Logger.Log("No server config found: rcon", Category.Rcon); Destroy(gameObject); } config = JsonUtility.FromJson <ServerConfig>(result); StartServer(); } catch { Logger.Log("config failed to load", Category.Rcon); Destroy(gameObject); } }
private void glControl1_Load(object sender, EventArgs e) { /* OpenGL stuff */ OpenGLHelpers.Initialization.SetDefaults(); /* QuickFont stuff */ GLText = new QuickFontWrapper(new Font("Verdana", 10.0f, FontStyle.Bold)); /* Program stuff */ Cam = new Camera(); TexCache = new TextureCache(); FPSMonitor = new FPSMonitor(); /* Ready */ GLReady = true; }
public FPSAvgMonitor() { // FPS监测报警 m_fpsAlert = new FPSMonitor(GameLogicAPI.getFPSInterVal()); FpsList = new Queue <float>(); }