(ae643deeb) Added alive checks to a couple of diving gear status effects (don't consume tanks when dead)
This commit is contained in:
@@ -141,8 +141,23 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
OnClicked = (btn, userdata) =>
|
||||
{
|
||||
if (!permissions.HasFlag(ClientPermissions.ManageRound)) return false;
|
||||
RequestRoundEnd();
|
||||
if (!permissions.HasFlag(ClientPermissions.ManageRound)) { return false; }
|
||||
if (!Submarine.MainSub.AtStartPosition && !Submarine.MainSub.AtEndPosition)
|
||||
{
|
||||
var msgBox = new GUIMessageBox("", TextManager.Get("EndRoundSubNotAtLevelEnd"),
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("No") });
|
||||
msgBox.Buttons[0].OnClicked = (_, __) =>
|
||||
{
|
||||
GameMain.Client.RequestRoundEnd();
|
||||
return true;
|
||||
};
|
||||
msgBox.Buttons[0].OnClicked += msgBox.Close;
|
||||
msgBox.Buttons[1].OnClicked += msgBox.Close;
|
||||
}
|
||||
else
|
||||
{
|
||||
RequestRoundEnd();
|
||||
}
|
||||
return true;
|
||||
},
|
||||
Visible = false
|
||||
@@ -622,7 +637,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
if (gameStarted) SetRadioButtonColor();
|
||||
|
||||
if (ShowNetStats)
|
||||
if (ShowNetStats && client?.ServerConnection != null)
|
||||
{
|
||||
netStats.AddValue(NetStats.NetStatType.ReceivedBytes, client.ServerConnection.Statistics.ReceivedBytes);
|
||||
netStats.AddValue(NetStats.NetStatType.SentBytes, client.ServerConnection.Statistics.SentBytes);
|
||||
@@ -1109,7 +1124,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
string errorMsg = "Level equality check failed. The level generated at your end doesn't match the level generated by the server (seed " + Level.Loaded.Seed + ").";
|
||||
DebugConsole.ThrowError(errorMsg, createMessageBox: true);
|
||||
GameAnalyticsManager.AddErrorEventOnce("GameClient.StartGame:LevelsDontMatch"+levelSeed, GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
|
||||
GameAnalyticsManager.AddErrorEventOnce("GameClient.StartGame:LevelsDontMatch" + levelSeed, GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
|
||||
CoroutineManager.StartCoroutine(EndGame(""));
|
||||
yield return CoroutineStatus.Failure;
|
||||
}
|
||||
@@ -1381,9 +1396,6 @@ namespace Barotrauma.Networking
|
||||
case ServerNetObject.CLIENT_LIST:
|
||||
ReadClientList(inc);
|
||||
break;
|
||||
case ServerNetObject.CLIENT_LIST:
|
||||
ReadClientList(inc);
|
||||
break;
|
||||
case ServerNetObject.CHAT_MESSAGE:
|
||||
ChatMessage.ClientRead(inc);
|
||||
break;
|
||||
@@ -1439,7 +1451,11 @@ namespace Barotrauma.Networking
|
||||
break;
|
||||
case ServerNetObject.ENTITY_EVENT:
|
||||
case ServerNetObject.ENTITY_EVENT_INITIAL:
|
||||
if (!entityEventManager.Read(objHeader, inc, sendingTime, entities)) { break; }
|
||||
if (!entityEventManager.Read(objHeader, inc, sendingTime, entities))
|
||||
{
|
||||
eventReadFailed = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ServerNetObject.CHAT_MESSAGE:
|
||||
ChatMessage.ClientRead(inc);
|
||||
@@ -1703,6 +1719,8 @@ namespace Barotrauma.Networking
|
||||
|
||||
SaveUtil.LoadGame(GameMain.GameSession.SavePath, GameMain.GameSession);
|
||||
campaign.LastSaveID = campaign.PendingSaveID;
|
||||
|
||||
DebugConsole.Log("Campaign save received, save ID " + campaign.LastSaveID);
|
||||
//decrement campaign update ID so the server will send us the latest data
|
||||
//(as there may have been campaign updates after the save file was created)
|
||||
campaign.LastUpdateID--;
|
||||
@@ -1720,7 +1738,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
public override void CreateEntityEvent(INetSerializable entity, object[] extraData)
|
||||
{
|
||||
if (!(entity is IClientSerializable)) throw new InvalidCastException("entity is not IClientSerializable");
|
||||
if (!(entity is IClientSerializable)) throw new InvalidCastException("Entity is not IClientSerializable");
|
||||
entityEventManager.CreateEvent(entity as IClientSerializable, extraData);
|
||||
}
|
||||
|
||||
@@ -1989,7 +2007,8 @@ namespace Barotrauma.Networking
|
||||
msg.Write(true); msg.WritePadBits();
|
||||
msg.Write(savePath);
|
||||
msg.Write(mapSeed);
|
||||
msg.Write(sub.FilePath);
|
||||
msg.Write(sub.Name);
|
||||
msg.Write(sub.MD5Hash.Hash);
|
||||
|
||||
client.SendMessage(msg, NetDeliveryMethod.ReliableUnordered);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user