Merged branch new-netcode into new-netcode
This commit is contained in:
@@ -322,7 +322,9 @@ namespace Barotrauma.Networking
|
||||
// Update current time
|
||||
updateTimer = DateTime.Now + updateInterval;
|
||||
}
|
||||
|
||||
|
||||
private CoroutineHandle startGameCoroutine;
|
||||
|
||||
/// <summary>
|
||||
/// Check for new incoming messages from server
|
||||
/// </summary>
|
||||
@@ -330,7 +332,9 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
// Create new incoming message holder
|
||||
NetIncomingMessage inc;
|
||||
|
||||
|
||||
if (startGameCoroutine != null && CoroutineManager.IsCoroutineRunning(startGameCoroutine)) return;
|
||||
|
||||
while ((inc = client.ReadMessage()) != null)
|
||||
{
|
||||
//TODO: read message data
|
||||
|
||||
@@ -486,6 +486,30 @@ namespace Barotrauma.Networking
|
||||
client.inGame = false;
|
||||
}
|
||||
}
|
||||
|
||||
CoroutineManager.StartCoroutine(EndCinematic());
|
||||
}
|
||||
|
||||
public IEnumerable<object> EndCinematic()
|
||||
{
|
||||
float endPreviewLength = 10.0f;
|
||||
|
||||
var cinematic = new TransitionCinematic(Submarine.MainSub, GameMain.GameScreen.Cam, endPreviewLength);
|
||||
|
||||
float secondsLeft = endPreviewLength;
|
||||
|
||||
do
|
||||
{
|
||||
secondsLeft -= CoroutineManager.UnscaledDeltaTime;
|
||||
|
||||
yield return CoroutineStatus.Running;
|
||||
} while (secondsLeft > 0.0f);
|
||||
|
||||
Submarine.Unload();
|
||||
|
||||
GameMain.NetLobbyScreen.Select();
|
||||
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
private void UpdateCrewFrame()
|
||||
|
||||
Reference in New Issue
Block a user