Unstable 1.8.4.0

This commit is contained in:
Markus Isberg
2025-03-12 12:56:27 +00:00
parent a4c3e868e4
commit a4a3427e4e
627 changed files with 29860 additions and 10018 deletions
@@ -549,6 +549,33 @@ namespace Barotrauma
}
public void ClientRead(IReadMessage msg)
{
if (GameMain.GameSession.IsRunning && !GameMain.Instance.LoadingScreenOpen)
{
ClientApplyNetworkMessage(msg);
}
else
{
//if the game session is not currently running (round still loading),
//we need to wait because the entities the status effect / conversation / etc targets may not exist yet
CoroutineManager.StartCoroutine(ApplyNetworkMessageWhenRoundLoaded(msg));
}
}
public IEnumerable<CoroutineStatus> ApplyNetworkMessageWhenRoundLoaded(IReadMessage msg)
{
while (GameMain.GameSession is { IsRunning: false } || GameMain.Instance.LoadingScreenOpen)
{
yield return new WaitForSeconds(1.0f);
}
if (GameMain.GameSession != null && GameMain.Client != null)
{
ClientApplyNetworkMessage(msg);
}
yield return CoroutineStatus.Success;
}
public void ClientApplyNetworkMessage(IReadMessage msg)
{
NetworkEventType eventType = (NetworkEventType)msg.ReadByte();
switch (eventType)