Commit 8772f2e8 authored by Gianni's avatar Gianni

Amélioration de la synchro temporelle

parent 25625907
......@@ -66,9 +66,9 @@
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.FlightSimulator.SimConnect, Version=10.0.61259.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86">
<Reference Include="Microsoft.FlightSimulator.SimConnect, Version=10.0.62615.0, Culture=neutral, PublicKeyToken=5f523ae7e6e1b389, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Core Utilities Kit\SimConnect SDK\lib\managed\Microsoft.FlightSimulator.SimConnect.dll</HintPath>
<HintPath>.\Microsoft.FlightSimulator.SimConnect.dll</HintPath>
</Reference>
<Reference Include="Open.Nat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f22a6a4582336c76, processorArchitecture=MSIL">
<HintPath>..\packages\Open.NAT.2.1.0.0\lib\net45\Open.Nat.dll</HintPath>
......
This diff is collapsed.
......@@ -112,12 +112,12 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="logoPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAIMAAAECCAYAAADdBmSvAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAb
......
......@@ -160,7 +160,7 @@ namespace ffs2play
private void OnHeartBeat(object source, ElapsedEventArgs evt)
{
SendPing();
TimeSpan IntervalAI = DateTime.UtcNow - m_LastAIUpdate;
TimeSpan IntervalAI = Outils.Now - m_LastAIUpdate;
if ((m_Spawned >=6) && (IntervalAI.TotalSeconds > 20))
{
Spawn_AI(false);
......@@ -195,7 +195,7 @@ namespace ffs2play
m_ObjectID = e.Object_ID;
m_Spawned = 4;
//m_SC.Update_AI(m_ObjectID, DEFINITIONS_ID.AI_INIT, m_InitAI);
m_LastAIUpdate = DateTime.UtcNow;
m_LastAIUpdate = Outils.Now;
#if DEBUG
Log.LogMessage("Peer [" + CallSign + "] Reçu Object_ID = " + m_ObjectID.ToString(), Color.DarkBlue, 1);
#endif
......
......@@ -40,7 +40,7 @@ namespace ffs2play
private void SendPing()
{
m_LastPing = DateTime.UtcNow;
m_LastPing = Outils.Now;
MemoryStream Output = new MemoryStream();
BinaryWriter BOutput = new BinaryWriter(Output);
BOutput.Write((byte)Protocol.PING);
......
......@@ -186,8 +186,8 @@ namespace ffs2play
HeartBeat.Start();
m_TimerCreateAI = new System.Timers.Timer(5000);
m_TimerCreateAI.Elapsed += OnTimerCreateAI;
m_LastData = DateTime.UtcNow;
m_LastStateEvent = DateTime.UtcNow;
m_LastData = Outils.Now;
m_LastStateEvent = m_LastData;
m_Counter = 0;
m_Counter_In = 0;
m_Counter_Out = 0;
......@@ -683,7 +683,7 @@ namespace ffs2play
{
public AirData()
{
TimeStamp = DateTime.UtcNow;
TimeStamp = Outils.Now;
Title = "";
Model = "";
Type = "";
......
......@@ -252,7 +252,7 @@ namespace ffs2play
{
Client = p_Client;
Data = p_Data;
Time = DateTime.UtcNow;
Time = Outils.Now;
}
}
}
......@@ -219,7 +219,7 @@ namespace ffs2play
{
Client = p_Client;
Data = p_Data;
Time = DateTime.UtcNow;
Time = Outils.Now;
}
}
}
......
......@@ -387,7 +387,7 @@ public class AnalyseurStateEvent : EventArgs
{
public AircraftState()
{
TimeStamp = DateTime.UtcNow;
TimeStamp = Outils.Now;
Title = "";
Model = "";
Type = "";
......
......@@ -174,7 +174,7 @@ namespace ffs2play
Response.Close();
}
if (xmlDoc == null) return;
LastGoodUpdate = DateTime.UtcNow;
LastGoodUpdate = Outils.Now;
CheckError(xmlDoc);
// On charge la liste des joueurs depuis le wazzup
XmlNode Wazzup = GetFirstElement(ref xmlDoc, "whazzup");
......
......@@ -95,7 +95,7 @@ namespace ffs2play
AutoExit = false;
m_SyncAIDone = false;
Log = Logger.Instance;
LastGoodUpdate = DateTime.UtcNow;
LastGoodUpdate = Outils.Now;
Mapping = AIMapping.Instance;
try
{
......
......@@ -288,7 +288,7 @@ namespace ffs2play
m_scConnection = null;
m_SimStart = false;
m_VariableRate = TimeSpan.FromMilliseconds(100);
m_LastVariable = DateTime.UtcNow;
m_LastVariable = Outils.Now;
//m_Thread.IsBackground = true;
AIProcess = new Dictionary<uint, string>();
Log = Logger.Instance;
......@@ -762,8 +762,8 @@ namespace ffs2play
switch ((REQUESTS_ID)data.dwRequestID)
{
case REQUESTS_ID.PERIODIQUE:
m_SimRate = DateTime.UtcNow - m_LastSim;
m_LastSim = DateTime.UtcNow;
m_LastSim = Outils.Now;
m_SimRate = m_LastSim - m_LastSim;
if (m_LastSim >= (m_LastVariable+m_VariableRate))
{
m_LastVariable = m_LastSim;
......@@ -1047,7 +1047,7 @@ namespace ffs2play
{
FrameRate = pFrameRate;
SimSpeed = pSimSpeed;
Time = DateTime.UtcNow;
Time = Outils.Now;
}
public float FrameRate;
public float SimSpeed;
......@@ -1080,13 +1080,13 @@ namespace ffs2play
{
public SCManagerEventSCEvent()
{
Time = DateTime.UtcNow;
Time = Outils.Now;
}
public SCManagerEventSCEvent (EVENT_ID pEvt_ID, uint pData)
{
Evt_Id = pEvt_ID;
Data = (int)pData;
Time = DateTime.UtcNow;
Time = Outils.Now;
}
public EVENT_ID Evt_Id;
public int Data;
......@@ -1098,7 +1098,7 @@ namespace ffs2play
public SCManagerEventSCVariable (DonneesAvion pData)
{
Data = pData;
Time = DateTime.UtcNow;
Time = Outils.Now;
}
public DonneesAvion Data;
public DateTime Time;
......@@ -1108,13 +1108,13 @@ namespace ffs2play
{
public SCManagerEventAIUpdate()
{
Time = DateTime.UtcNow;
Time = Outils.Now;
}
public SCManagerEventAIUpdate(AIMoveStruct pData, uint pObjectID)
{
Data = pData;
ObjectID = pObjectID;
Time = DateTime.UtcNow;
Time = Outils.Now;
}
public AIMoveStruct Data;
public uint ObjectID;
......
......@@ -20,6 +20,20 @@ namespace ffs2play
}
class Outils
{
static private DateTime Last_UTC_Now=DateTime.UtcNow;
static private long LastTicks= Last_UTC_Now.Ticks;
static public DateTime Now
{
get
{
if (DateTime.UtcNow.Ticks != Last_UTC_Now.Ticks)
{
Last_UTC_Now = DateTime.UtcNow;
}
return Last_UTC_Now;
}
}
static public sVersion GetVersion()
{
sVersion resultat;
......
......@@ -23,4 +23,6 @@ Ce logiciel utilise également les technologies open-source suivantes :
Notes de révision:
1.0.0 : Portage de FFSTracker en version Light FFS2Play
\ No newline at end of file
1.0.0 : Portage de FFSTracker en version Light FFS2Play
1.0.1 : Amélioration de la synchronisation temporelle (Stabilité des AI en vol)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment