When dumping the sync report, log all the orders issued in the frame that desynced.
This commit is contained in:
@@ -19,6 +19,11 @@ namespace OpenRA.Network
|
|||||||
{
|
{
|
||||||
public int Client;
|
public int Client;
|
||||||
public Order Order;
|
public Order Order;
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return "ClientId: {0} {1}".F(Client, Order);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly Dictionary<int, int> clientQuitTimes = new Dictionary<int, int>();
|
readonly Dictionary<int, int> clientQuitTimes = new Dictionary<int, int>();
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ namespace OpenRA.Network
|
|||||||
|
|
||||||
bool disposed;
|
bool disposed;
|
||||||
|
|
||||||
static void OutOfSync(int frame)
|
void OutOfSync(int frame)
|
||||||
{
|
{
|
||||||
syncReport.DumpSyncReport(frame);
|
syncReport.DumpSyncReport(frame, frameData.OrdersForFrame(World, frame));
|
||||||
throw new InvalidOperationException("Out of sync in frame {0}.\n Compare syncreport.log with other players.".F(frame));
|
throw new InvalidOperationException("Out of sync in frame {0}.\n Compare syncreport.log with other players.".F(frame));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace OpenRA.Network
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void DumpSyncReport(int frame)
|
internal void DumpSyncReport(int frame, IEnumerable<FrameData.ClientOrder> orders)
|
||||||
{
|
{
|
||||||
foreach (var r in syncReports)
|
foreach (var r in syncReports)
|
||||||
{
|
{
|
||||||
@@ -128,6 +128,10 @@ namespace OpenRA.Network
|
|||||||
Log.Write("sync", "\t\t {0}: {1}".F(nvp.First[i], nvp.Second[i]));
|
Log.Write("sync", "\t\t {0}: {1}".F(nvp.First[i], nvp.Second[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.Write("sync", "Orders Issued:");
|
||||||
|
foreach (var o in orders)
|
||||||
|
Log.Write("sync", "\t {0}", o.ToString());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user