Moved collider position correction logic to the physicsbody class (so that it can be used for sub & item syncing), character position msg length is written in bytes instead of bits, misc cleanup/refactoring

This commit is contained in:
Regalis
2016-10-19 19:10:15 +03:00
parent b4389277aa
commit e2d0e7fe24
6 changed files with 98 additions and 105 deletions

View File

@@ -707,7 +707,20 @@ namespace Barotrauma.Networking
lastSentChatMsgID = inc.ReadUInt32();
break;
case ServerNetObject.CHARACTER_POSITION:
Character.ClientReadStatic(inc, sendingTime);
UInt16 id = inc.ReadUInt16();
byte msgLength = inc.ReadByte();
var character = Entity.FindEntityByID(id) as Character;
if (character == null)
{
//skip through the rest of the message
inc.Position += msgLength * 8;
}
else
{
character.ClientRead(inc, sendingTime);
}
inc.ReadPadBits();
break;
case ServerNetObject.CHAT_MESSAGE: