Remove items in dummycharacter inventory in editmapscreen, important character updates a separate networkeventtype

This commit is contained in:
Regalis
2015-10-23 19:28:21 +03:00
parent b3462b24b4
commit 6736f1dd82
17 changed files with 545 additions and 475 deletions
+4 -3
View File
@@ -266,8 +266,9 @@ namespace Barotrauma.Networking
}
}
catch
{
catch (Exception e)
{
DebugConsole.ThrowError("Error while connecting to server", e);
break;
}
}
@@ -354,7 +355,7 @@ namespace Barotrauma.Networking
}
else if (gameStarted)
{
new NetworkEvent(myCharacter.ID, true);
myCharacter.CreateUpdateNetworkEvent(true);
}
}
+4 -5
View File
@@ -302,16 +302,15 @@ namespace Barotrauma.Networking
{
if (gameStarted)
{
if (myCharacter != null) new NetworkEvent(myCharacter.ID, true);
if (myCharacter != null) myCharacter.CreateUpdateNetworkEvent(false);
foreach (Character c in Character.CharacterList)
{
if (c as AICharacter == null) continue;
if (c.SimPosition == Vector2.Zero || c.SimPosition.Length() < 100.0f)
{
new NetworkEvent(c.ID, false);
}
if (c.SimPosition.Length() > 100.0f) continue;
c.CreateUpdateNetworkEvent(false);
}
}
@@ -21,6 +21,8 @@ namespace Barotrauma.Networking
//if the ragdoll is closer than this, don't try to correct its position
public const float AllowedRagdollDistance = 0.1f;
public const float LargeCharacterUpdateInterval = 5.0f;
public const float DeleteDisconnectedTime = 10.0f;
public const float AckInterval = 0.2f;
+1 -2
View File
@@ -18,8 +18,7 @@ namespace Barotrauma.Networking
PickItem = 6,
DropItem = 7,
InventoryUpdate = 8,
UpdateProperty = 9,
WallDamage = 10,