Unstable 0.1500.0.0
This commit is contained in:
@@ -89,7 +89,7 @@ namespace Barotrauma.Networking
|
||||
private static int ReadIncomingMsgs()
|
||||
{
|
||||
Task<int> readTask = readStream?.ReadAsync(tempBytes, 0, tempBytes.Length, readCancellationToken.Token);
|
||||
TimeSpan ts = TimeSpan.FromMilliseconds(100);
|
||||
TimeSpan timeOut = TimeSpan.FromMilliseconds(100);
|
||||
for (int i = 0; i < 150; i++)
|
||||
{
|
||||
if (shutDown)
|
||||
@@ -99,7 +99,7 @@ namespace Barotrauma.Networking
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((readTask?.IsCompleted ?? true) || (readTask?.Wait(ts) ?? true))
|
||||
if ((readTask?.IsCompleted ?? true) || (readTask?.Wait(timeOut) ?? true))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ namespace Barotrauma.Networking
|
||||
TeamChange,
|
||||
ObjectiveManagerState,
|
||||
AddToCrew,
|
||||
UpdateExperience,
|
||||
UpdateTalents,
|
||||
UpdateMoney,
|
||||
}
|
||||
|
||||
public readonly Entity Entity;
|
||||
|
||||
@@ -23,9 +23,12 @@ namespace Barotrauma.Networking
|
||||
/// </summary>
|
||||
public int? WallSectionIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Same as calling <see cref="OrderChatMessage.OrderChatMessage(Order, string, int, string, ISpatialEntity, Character, Character)"/>, but the text parameter is set using <see cref="Order.GetChatMessage(string, string, bool, string)"/>
|
||||
/// </summary>
|
||||
public OrderChatMessage(Order order, string orderOption, int priority, ISpatialEntity targetEntity, Character targetCharacter, Character sender)
|
||||
: this(order, orderOption, priority,
|
||||
order?.GetChatMessage(targetCharacter?.Name, sender?.CurrentHull?.DisplayName, givingOrderToSelf: targetCharacter == sender, orderOption: orderOption),
|
||||
order?.GetChatMessage(targetCharacter?.Name, sender?.CurrentHull?.DisplayName, givingOrderToSelf: targetCharacter == sender, orderOption: orderOption, priority: priority),
|
||||
targetEntity, targetCharacter, sender)
|
||||
{
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace Barotrauma.Networking
|
||||
//any respawn items left in the shuttle are removed when the shuttle despawns
|
||||
private readonly List<Item> respawnItems = new List<Item>();
|
||||
|
||||
//characters who spawned during the last respawn
|
||||
private readonly List<Character> respawnedCharacters = new List<Character>();
|
||||
|
||||
public bool UsingShuttle
|
||||
{
|
||||
get { return RespawnShuttle != null; }
|
||||
@@ -277,11 +280,17 @@ namespace Barotrauma.Networking
|
||||
hull.BallastFlora?.Kill();
|
||||
}
|
||||
|
||||
Dictionary<Character, Vector2> characterPositions = new Dictionary<Character, Vector2>();
|
||||
foreach (Character c in Character.CharacterList)
|
||||
{
|
||||
if (c.Submarine != RespawnShuttle) { continue; }
|
||||
if (!respawnedCharacters.Contains(c))
|
||||
{
|
||||
characterPositions.Add(c, c.WorldPosition);
|
||||
continue;
|
||||
}
|
||||
#if CLIENT
|
||||
if (Character.Controlled == c) Character.Controlled = null;
|
||||
if (Character.Controlled == c) { Character.Controlled = null; }
|
||||
#endif
|
||||
c.Kill(CauseOfDeathType.Unknown, null, true);
|
||||
c.Enabled = false;
|
||||
@@ -298,6 +307,11 @@ namespace Barotrauma.Networking
|
||||
|
||||
RespawnShuttle.SetPosition(new Vector2(Level.Loaded.StartPosition.X, Level.Loaded.Size.Y + RespawnShuttle.Borders.Height));
|
||||
RespawnShuttle.Velocity = Vector2.Zero;
|
||||
|
||||
foreach (var characterPosition in characterPositions)
|
||||
{
|
||||
characterPosition.Key.TeleportTo(characterPosition.Value);
|
||||
}
|
||||
}
|
||||
|
||||
partial void RespawnCharactersProjSpecific(Vector2? shuttlePos);
|
||||
|
||||
@@ -507,7 +507,7 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
|
||||
[Serialize(800, true)]
|
||||
private int LinesPerLogFile
|
||||
public int LinesPerLogFile
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user