(f417b026f) Fetched: Changes for playing video tutorial from local branch
This commit is contained in:
@@ -129,10 +129,10 @@ namespace Barotrauma.Networking
|
||||
if (listener.WorldPosition == sender.WorldPosition) { return 0.0f; }
|
||||
|
||||
float dist = Vector2.Distance(listener.WorldPosition, sender.WorldPosition);
|
||||
if (dist > range) { return 1.0f; }
|
||||
if (dist > range) { return 0.0f; }
|
||||
|
||||
if (Submarine.CheckVisibility(listener.SimPosition, sender.SimPosition) != null) dist = (dist + 100f) * obstructionmult;
|
||||
if (dist > range) { return 1.0f; }
|
||||
if (dist > range) { return 0.0f; }
|
||||
|
||||
return dist / range;
|
||||
}
|
||||
@@ -152,7 +152,7 @@ namespace Barotrauma.Networking
|
||||
public static string ApplyDistanceEffect(string text, float garbleAmount)
|
||||
{
|
||||
if (garbleAmount < 0.3f) return text;
|
||||
if (garbleAmount >= 1.0f) return "";
|
||||
if (garbleAmount > 1.0f) return "";
|
||||
|
||||
int startIndex = Math.Max(text.IndexOf(':') + 1, 1);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
enum FileTransferMessageType
|
||||
{
|
||||
Unknown, Initiate, Data, TransferOnSameMachine, Cancel
|
||||
Unknown, Initiate, Data, Cancel
|
||||
}
|
||||
|
||||
enum FileTransferType
|
||||
|
||||
@@ -32,14 +32,11 @@ namespace Barotrauma.Networking
|
||||
public const float HighPrioCharacterPositionUpdateInterval = 0.0f;
|
||||
public const float LowPrioCharacterPositionUpdateInterval = 1.0f;
|
||||
|
||||
public const float DeleteDisconnectedTime = 20.0f;
|
||||
|
||||
public const float ItemConditionUpdateInterval = 0.15f;
|
||||
public const float LevelObjectUpdateInterval = 0.5f;
|
||||
public const float HullUpdateInterval = 0.5f;
|
||||
public const float HullUpdateDistance = 20000.0f;
|
||||
|
||||
public const int MaxEventPacketsPerUpdate = 4;
|
||||
//how much the physics body of an item has to move until the server
|
||||
//send a position update to clients (in sim units)
|
||||
public const float ItemPosUpdateDistance = 2.0f;
|
||||
|
||||
public const float DeleteDisconnectedTime = 10.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Interpolates the positional error of a physics body towards zero.
|
||||
|
||||
+9
-2
@@ -58,8 +58,15 @@ namespace Barotrauma.Networking
|
||||
eventCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (msg.LengthBytes + tempBuffer.LengthBytes + tempEventBuffer.LengthBytes > MaxEventBufferLength)
|
||||
//the ID has been taken by another entity (the original entity has been removed) -> write an empty event
|
||||
/*else if (Entity.FindEntityByID(e.Entity.ID) != e.Entity || e.Entity.IdFreed)
|
||||
{
|
||||
//technically the clients don't have any use for these, but removing events and shifting the IDs of all
|
||||
//consecutive ones is so error-prone that I think this is a safer option
|
||||
tempBuffer.Write(Entity.NullEntityID);
|
||||
tempBuffer.WritePadBits();
|
||||
}*/
|
||||
else
|
||||
{
|
||||
//no more room in this packet
|
||||
break;
|
||||
|
||||
@@ -513,29 +513,11 @@ namespace Barotrauma.Networking
|
||||
set;
|
||||
}
|
||||
|
||||
private SelectionMode subSelectionMode;
|
||||
[Serialize(SelectionMode.Manual, true)]
|
||||
public SelectionMode SubSelectionMode
|
||||
{
|
||||
get { return subSelectionMode; }
|
||||
set
|
||||
{
|
||||
subSelectionMode = value;
|
||||
Voting.AllowSubVoting = subSelectionMode == SelectionMode.Vote;
|
||||
}
|
||||
}
|
||||
public SelectionMode SubSelectionMode { get; private set; }
|
||||
|
||||
private SelectionMode modeSelectionMode;
|
||||
[Serialize(SelectionMode.Manual, true)]
|
||||
public SelectionMode ModeSelectionMode
|
||||
{
|
||||
get { return modeSelectionMode; }
|
||||
set
|
||||
{
|
||||
modeSelectionMode = value;
|
||||
Voting.AllowModeVoting = modeSelectionMode == SelectionMode.Vote;
|
||||
}
|
||||
}
|
||||
public SelectionMode ModeSelectionMode { get; private set; }
|
||||
|
||||
public BanList BanList { get; private set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user