More security checks
This actually looks pretty bad, not gonna lie.
This commit is contained in:
@@ -487,6 +487,10 @@ namespace Barotrauma.Items.Components
|
||||
public override void ReadNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetIncomingMessage message, float sendingTime)
|
||||
{
|
||||
if (sendingTime < lastReceivedMessage) return;
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lastReceivedMessage = sendingTime;
|
||||
|
||||
|
||||
@@ -1732,13 +1732,22 @@ namespace Barotrauma
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Drop(sender.Character, false);
|
||||
if (body != null)
|
||||
{
|
||||
body.TargetPosition = sender.Character.SimPosition;
|
||||
body.MoveToTargetPosition();
|
||||
}
|
||||
}
|
||||
|
||||
Drop(null, false);
|
||||
if (body != null)
|
||||
else
|
||||
{
|
||||
body.ReadNetworkData(message, sendingTime);
|
||||
body.MoveToTargetPosition();
|
||||
//client should not tell the server where the item should drop
|
||||
Drop(null, false);
|
||||
if (body != null)
|
||||
{
|
||||
body.ReadNetworkData(message, sendingTime);
|
||||
body.MoveToTargetPosition();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NetworkEventType.PhysicsBodyPosition:
|
||||
|
||||
Reference in New Issue
Block a user