partial void ResetInfo() { CurrMap = ""; CurrGameState = QuakeState.Playing; TotalTime = 0; savedTotalTime = 0; }
partial void UpdateInfo() { UpdateMap(); int currGameState; if (gameProcess.ReadValue(baseAddress + gameStateAddress, out currGameState)) { CurrGameState = (QuakeState)currGameState; } if (CurrGameState != QuakeState.Playing) { // we are in an intermission, so total time should be available now. float qdqTotalTime; if (qdqTotalTimeAddress.Deref(gameProcess, out qdqTotalTime) && qdqTotalTime > 0) { // set time to the one that qdqstats says + an eventually saved one that isn't included // in the qdqTotalTime because there was a reset TotalTime = qdqTotalTime + savedTotalTime; } MapTime = 0; GameTime = TotalTime; } else { // // in game, so don't have to deal with intermission stuff. // float mapTime; if (gameProcess.ReadValue(baseAddress + mapTimeAddress, out mapTime)) { if (MapTime > mapTime) { // new map time is smaller than old map time? This means that there was a reset, so // qdqstats' total time will be reset. Therefore update savedTotalTime TotalTime += MapTime - mapTime; savedTotalTime = TotalTime; } if (MapTime != 0 || mapTime < 3) { // hack to not update when map time hasn't been reset yet MapTime = mapTime; } } if (CurrMap == "start") { // timing according to rules doesnt include the time spent on the start map. // literally cheating if you ask me... MapTime = 0; } GameTime = MapTime + TotalTime; } }