예제 #1
0
        private static void GameLoop()
        {
            float tsClient = 1.0f / ScriptingInterface.GetCvarValue <int>("cl_fps");
            float tsServer = 1.0f / ScriptingInterface.GetCvarValue <int>("sv_fps");
            float tsDebug  = 1.0f;

            clientTimer = new DeltaTimer(Timer, tsClient);
            serverTimer = new DeltaTimer(Timer, tsServer);
            debugTimer  = new DeltaTimer(Timer, tsDebug);

            while (!ShutdownRequested)
            {
                if (HasServer)
                {
                    ServerFrame();
                }

                if (HasClient)
                {
                    ClientFrame();
                }

                DebugFrame();
            }
        }
예제 #2
0
        private static T LoadDLL <T>(string pathCvar)
        {
            string dllPath = ScriptingInterface.GetCvarValue <string>(pathCvar);
            T      result;

            if (!AssemblyUtils.LoadType <T>(dllPath, out result))
            {
                throw new InitializeException("Failed to load dll {0}", dllPath);
            }

            return(result);
        }