Build 0.18.0.0
This commit is contained in:
@@ -107,10 +107,25 @@ namespace Barotrauma.Networking
|
||||
return -1;
|
||||
}
|
||||
|
||||
//FIXME workaround for crash when closing the server under .NET 6.0, not sure if this is the proper way to fix it but it prevents it from crashing the client. - Markus
|
||||
#if NET6_0
|
||||
try
|
||||
{
|
||||
if (readTask.IsCompleted || readTask.Wait(100, readCancellationToken.Token))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
if (readTask.IsCompleted || readTask.Wait(timeOut))
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (readTask.Status != TaskStatus.RanToCompletion)
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace Barotrauma.Networking
|
||||
private readonly NetworkMember networkMember;
|
||||
private readonly Steering shuttleSteering;
|
||||
private readonly List<Door> shuttleDoors;
|
||||
private const string RespawnContainerTag = "respawncontainer";
|
||||
private readonly ItemContainer respawnContainer;
|
||||
|
||||
//items created during respawn
|
||||
//any respawn items left in the shuttle are removed when the shuttle despawns
|
||||
@@ -100,13 +102,18 @@ namespace Barotrauma.Networking
|
||||
shuttleDoors = new List<Door>();
|
||||
foreach (Item item in Item.ItemList)
|
||||
{
|
||||
if (item.Submarine != RespawnShuttle) continue;
|
||||
if (item.Submarine != RespawnShuttle) { continue; }
|
||||
|
||||
if (item.HasTag(RespawnContainerTag))
|
||||
{
|
||||
respawnContainer = item.GetComponent<ItemContainer>();
|
||||
}
|
||||
|
||||
var steering = item.GetComponent<Steering>();
|
||||
if (steering != null) shuttleSteering = steering;
|
||||
if (steering != null) { shuttleSteering = steering; }
|
||||
|
||||
var door = item.GetComponent<Door>();
|
||||
if (door != null) shuttleDoors.Add(door);
|
||||
if (door != null) { shuttleDoors.Add(door); }
|
||||
|
||||
//lock all wires to prevent the players from messing up the electronics
|
||||
var connectionPanel = item.GetComponent<ConnectionPanel>();
|
||||
@@ -227,14 +234,14 @@ namespace Barotrauma.Networking
|
||||
despawnTime = ReturnTime + new TimeSpan(0, 0, seconds: 30);
|
||||
#endif
|
||||
|
||||
if (RespawnShuttle == null) return;
|
||||
if (RespawnShuttle == null) { return; }
|
||||
|
||||
foreach (Item item in Item.ItemList)
|
||||
{
|
||||
if (item.Submarine != RespawnShuttle) { continue; }
|
||||
|
||||
//remove respawn items that have been left in the shuttle
|
||||
if (respawnItems.Contains(item))
|
||||
if (respawnItems.Contains(item) || respawnContainer?.Item != null && item.IsOwnedBy(respawnContainer.Item))
|
||||
{
|
||||
Spawner.AddItemToRemoveQueue(item);
|
||||
continue;
|
||||
|
||||
@@ -39,6 +39,12 @@ namespace Barotrauma.Networking
|
||||
SomethingDifferent = 4
|
||||
}
|
||||
|
||||
internal enum LootedMoneyDestination
|
||||
{
|
||||
Bank,
|
||||
Wallet
|
||||
}
|
||||
|
||||
partial class ServerSettings : ISerializableEntity
|
||||
{
|
||||
public const string SettingsFile = "serversettings.xml";
|
||||
@@ -901,10 +907,16 @@ namespace Barotrauma.Networking
|
||||
set;
|
||||
}
|
||||
|
||||
[Serialize(LootedMoneyDestination.Bank, IsPropertySaveable.Yes)]
|
||||
public LootedMoneyDestination LootedMoneyDestination { get; set; }
|
||||
|
||||
[Serialize(999999, IsPropertySaveable.Yes)]
|
||||
public int MaximumTransferRequest { get; set; }
|
||||
|
||||
private int maxMissionCount = CampaignSettings.DefaultMaxMissionCount;
|
||||
|
||||
[Serialize(CampaignSettings.DefaultMaxMissionCount, IsPropertySaveable.Yes)]
|
||||
public int MaxMissionCount
|
||||
public int MaxMissionCount
|
||||
{
|
||||
get { return maxMissionCount; }
|
||||
set { maxMissionCount = MathHelper.Clamp(value, CampaignSettings.MinMissionCountLimit, CampaignSettings.MaxMissionCountLimit); }
|
||||
|
||||
Reference in New Issue
Block a user