mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-03 10:37:05 +02:00
* Fix client-side input system not sending sequence numbers for input messages. This caused message ordering issues and keys getting stuck down. * Make sure EyeUpdateSystem runs after physics. * IGameTiming.TickFraction helper. * Subtick data for input commands. * Literally a unit test to verify that I wasn't going insane while debugging input message ordering issues. * More prediction logs behind net.predict. * Move physics to shared and run it on the client. * Synchronize grid gravity. * Fix ResetPredictedEntities crash when entities get deleted server-side. * Fix CollidableComponent setters not calling Dirty() * Fix going into space while predicting. * Watch window uses history line edit. * Fix unpredicted objects stuck-jittering. * VV tags for interp vars on transform. * Fix 0 mass objects on client. * Fix friction calculations being TPS dependent. * Reset predict flag on handelComponentState
45 lines
1.8 KiB
C#
45 lines
1.8 KiB
C#
using Moq;
|
|
using NUnit.Framework;
|
|
using Robust.Server.GameObjects;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Interfaces.Network;
|
|
using Robust.Shared.Network.Messages;
|
|
using Robust.Shared.Timing;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Robust.UnitTesting.Server.GameObjects
|
|
{
|
|
public class ServerEntityNetworkManagerTest
|
|
{
|
|
[Test]
|
|
public void TestMessageSort()
|
|
{
|
|
var tickA = new GameTick(5);
|
|
var tickB = new GameTick(3);
|
|
var channel = new Mock<INetChannel>().Object;
|
|
var msgA = new MsgEntity(channel) {Type = EntityMessageType.SystemMessage, SourceTick = tickA, Sequence = 10};
|
|
var msgB = new MsgEntity(channel) {Type = EntityMessageType.SystemMessage, SourceTick = tickA, Sequence = 13};
|
|
var msgC = new MsgEntity(channel) {Type = EntityMessageType.SystemMessage, SourceTick = tickA, Sequence = 12};
|
|
var msgD = new MsgEntity(channel) {Type = EntityMessageType.SystemMessage, SourceTick = tickA, Sequence = 14};
|
|
var msgE = new MsgEntity(channel) {Type = EntityMessageType.SystemMessage, SourceTick = tickB, Sequence = 7};
|
|
var msgF = new MsgEntity(channel) {Type = EntityMessageType.SystemMessage, SourceTick = tickB, Sequence = 4};
|
|
|
|
var pq = new PriorityQueue<MsgEntity>(new ServerEntityNetworkManager.MessageSequenceComparer());
|
|
|
|
pq.Add(msgA);
|
|
pq.Add(msgB);
|
|
pq.Add(msgC);
|
|
pq.Add(msgD);
|
|
pq.Add(msgE);
|
|
pq.Add(msgF);
|
|
|
|
Assert.AreEqual(pq.Take(), msgF);
|
|
Assert.AreEqual(pq.Take(), msgE);
|
|
Assert.AreEqual(pq.Take(), msgA);
|
|
Assert.AreEqual(pq.Take(), msgC);
|
|
Assert.AreEqual(pq.Take(), msgB);
|
|
Assert.AreEqual(pq.Take(), msgD);
|
|
}
|
|
}
|
|
}
|