Property changes on: . ___________________________________________________________________ Added: svn:ignore + bin obj Index: LFSClient/lfsclient.cs =================================================================== --- LFSClient/lfsclient.cs (revision 7) +++ LFSClient/lfsclient.cs (working copy) @@ -76,6 +76,7 @@ public int raceLaps = 0; public int raceLapsLeft = 0; public int qualMins = 0; + public int raceMins = 0; } raceInfo currRace = new raceInfo(); Index: LFSClient/managePacket.cs =================================================================== --- LFSClient/managePacket.cs (revision 7) +++ LFSClient/managePacket.cs (working copy) @@ -289,25 +289,30 @@ if (currInfoPlayer == null) return; - if (currRace.inRace == true && lapDec.LapsDone > currRace.lapsDone) + if (currRace.inRace == true) { - currRace.lapsDone = lapDec.LapsDone; - // Set raceLapsLeft based on LAP.RaceLaps - if (currRace.raceLaps < 100 ) { - // Short race - less than 100 laps - currRace.raceLapsLeft = currRace.raceLaps - lapDec.LapsDone; - } else if (currRace.raceLaps < 191 ) { - // Long race - between 100 and 1000 laps - currRace.raceLapsLeft = (((currRace.raceLaps - 100) * 10) + 100) - lapDec.LapsDone; - } else { - // Timed race - between 1 and 48 hours - currRace.qualMins = (int)(((currRace.raceLaps - 190) * 60) - (lapDec.ETime / 60000)); + // Calculate reminaing race time each time a racer passes the start/finish line if this is a timed race - between 1 and 48 hours + if (currRace.raceLaps >= 191 ) { + currRace.raceMins = (int)(((currRace.raceLaps - 190) * 60) - (lapDec.ETime / 60000)); // Set RaceLapsLeft to 1 if there is less than 5 mins of the race remaining - if (currRace.qualMins <= 5) { + if (currRace.raceMins <= 5) { currRace.raceLapsLeft = 1; } - } - } + } + // If this racer is the race leader... + if ( lapDec.LapsDone > currRace.lapsDone) + { + currRace.lapsDone = lapDec.LapsDone; + // Set raceLapsLeft based on LAP.RaceLaps + if (currRace.raceLaps < 100 ) { + // Short race - less than 100 laps + currRace.raceLapsLeft = currRace.raceLaps - lapDec.LapsDone; + } else if (currRace.raceLaps < 191 ) { + // Long race - between 100 and 1000 laps + currRace.raceLapsLeft = (((currRace.raceLaps - 100) * 10) + 100) - lapDec.LapsDone; + } + } + } #region test flags for this player actionPlayerFlags(lapDec.Flags, currInfoPlayer, false); @@ -485,6 +490,7 @@ string[] par = new string[1]; currRace.raceLaps = 0; + currRace.raceMins = 0; currRace.qualMins = 0; if (rst.QualMins == 0) { @@ -499,7 +505,7 @@ currRace.raceLapsLeft = (((currRace.raceLaps - 100) * 10) + 100); } else { // Timed race - 1 to 48 hours - currRace.qualMins = ((currRace.raceLaps - 190) * 60); // Use qualMins to store race time + currRace.raceMins = ((currRace.raceLaps - 190) * 60); // Use raceMins to store race time currRace.raceLapsLeft = 99; } newCfg.executeFunction("OnRaceStart", null, par); @@ -988,6 +994,7 @@ currInfoPlayer.OnPit = false; currInfoPlayer.totalPitTime += psf.STime; currInfoPlayer.pitTime = psf.STime; + currInfoPlayer.pitStops++; newCfg.executeFunction("OnEndPit", currInfoPlayer, null); } Index: LFSClient/parseEvent.cs =================================================================== --- LFSClient/parseEvent.cs (revision 7) +++ LFSClient/parseEvent.cs (working copy) @@ -143,9 +143,20 @@ return; case "racemins": val.typVal = GLScript.typVal.num; + val.fval = currRace.raceMins; + return; + case "qualmins": + val.typVal = GLScript.typVal.num; val.fval = currRace.qualMins; return; - + case "numconns": + val.typVal = GLScript.typVal.num; + val.fval = currState.NumConns; + return; + case "numplayers": + val.typVal = GLScript.typVal.num; + val.fval = currState.NumP; + return; default: val.typVal = GLScript.typVal.str; val.sval = quote(""); @@ -364,6 +389,10 @@ val.typVal = GLScript.typVal.num; val.fval = currInfoPlayer.pitTime; break; + case "pitstops": + val.typVal = GLScript.typVal.num; + val.fval = currInfoPlayer.pitStops; + break; case "swearwordsrem": val.typVal = GLScript.typVal.num; val.fval = newCfg.varsLapper.SwearWordsMax - currInfoPlayer.swearWordsCount; Index: Players/infoPlayer.cs =================================================================== --- Players/infoPlayer.cs (revision 7) +++ Players/infoPlayer.cs (working copy) @@ -159,6 +159,7 @@ public long totalPitTime; public long pitTime; + public long pitStops; public int showButton = 0; // Config for the curr player @@ -225,6 +226,7 @@ this.showSplitPB = true; this.totalPitTime = 0; + this.pitStops = 0; playerBox = new ISMB.msgBox(IC); Index: Players/ListPlayers.cs =================================================================== --- Players/ListPlayers.cs (revision 7) +++ Players/ListPlayers.cs (working copy) @@ -282,6 +282,7 @@ (currInfoPlayer as infoPlayer).currPos = 0; (currInfoPlayer as infoPlayer).currElapsedInfo = new infoPlayer.elpasedInfo(); ; (currInfoPlayer as infoPlayer).totalPitTime = 0; + (currInfoPlayer as infoPlayer).pitStops = 0; (currInfoPlayer as infoPlayer).splitLast = 0; (currInfoPlayer as infoPlayer).lastIdxSplit = -1; (currInfoPlayer as infoPlayer).LastCrossedFinishLine = DateTime.Now; @@ -291,6 +292,7 @@ (currInfoPlayer as infoPlayer).NbFastDriveOnPit = 0; (currInfoPlayer as infoPlayer).NumCarResets = 0; (currInfoPlayer as infoPlayer).PenaltyNew = (int)InSim.pen.PENALTY_NONE; + (currInfoPlayer as infoPlayer).PenaltyOld = (int)InSim.pen.PENALTY_NONE; (currInfoPlayer as infoPlayer).currVote = (int)InSim.vtn.VOTE_NONE; } }