Merge branch 'master' of https://github.com/Regalis11/Barotrauma.git
This commit is contained in:
@@ -112,6 +112,8 @@ namespace Barotrauma.Networking
|
||||
set;
|
||||
}
|
||||
|
||||
public ChatMode ChatMode { get; set; } = ChatMode.None;
|
||||
|
||||
protected ChatMessage(string senderName, string text, ChatMessageType type, Character sender, Client client, PlayerConnectionChangeType changeType = PlayerConnectionChangeType.None, Color? textColor = null)
|
||||
{
|
||||
Text = text;
|
||||
|
||||
@@ -107,10 +107,25 @@ namespace Barotrauma.Networking
|
||||
return -1;
|
||||
}
|
||||
|
||||
// BUG 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)
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace Barotrauma.Networking
|
||||
|
||||
REQUEST_STARTGAMEFINALIZE, //tell the server you're ready to finalize round initialization
|
||||
|
||||
UPDATE_CHARACTERINFO,
|
||||
|
||||
ERROR, //tell the server that an error occurred
|
||||
CREW, //hiring UI
|
||||
MEDICAL, //medical clinic
|
||||
|
||||
@@ -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>();
|
||||
@@ -243,14 +250,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";
|
||||
@@ -897,21 +903,13 @@ namespace Barotrauma.Networking
|
||||
private set;
|
||||
}
|
||||
|
||||
[Serialize(true, IsPropertySaveable.Yes)]
|
||||
public bool RadiationEnabled
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
[Serialize(LootedMoneyDestination.Bank, IsPropertySaveable.Yes)]
|
||||
public LootedMoneyDestination LootedMoneyDestination { get; set; }
|
||||
|
||||
private int maxMissionCount = CampaignSettings.DefaultMaxMissionCount;
|
||||
[Serialize(999999, IsPropertySaveable.Yes)]
|
||||
public int MaximumMoneyTransferRequest { get; set; }
|
||||
|
||||
[Serialize(CampaignSettings.DefaultMaxMissionCount, IsPropertySaveable.Yes)]
|
||||
public int MaxMissionCount
|
||||
{
|
||||
get { return maxMissionCount; }
|
||||
set { maxMissionCount = MathHelper.Clamp(value, CampaignSettings.MinMissionCountLimit, CampaignSettings.MaxMissionCountLimit); }
|
||||
}
|
||||
public CampaignSettings CampaignSettings { get; set; } = CampaignSettings.Empty;
|
||||
|
||||
private bool allowSubVoting;
|
||||
//Don't serialize: the value is set based on SubSelectionMode
|
||||
|
||||
Reference in New Issue
Block a user