Merged branch new-netcode into new-netcode
This commit is contained in:
@@ -323,6 +323,8 @@ namespace Barotrauma.Networking
|
|||||||
updateTimer = DateTime.Now + updateInterval;
|
updateTimer = DateTime.Now + updateInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CoroutineHandle startGameCoroutine;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check for new incoming messages from server
|
/// Check for new incoming messages from server
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -331,6 +333,8 @@ namespace Barotrauma.Networking
|
|||||||
// Create new incoming message holder
|
// Create new incoming message holder
|
||||||
NetIncomingMessage inc;
|
NetIncomingMessage inc;
|
||||||
|
|
||||||
|
if (startGameCoroutine != null && CoroutineManager.IsCoroutineRunning(startGameCoroutine)) return;
|
||||||
|
|
||||||
while ((inc = client.ReadMessage()) != null)
|
while ((inc = client.ReadMessage()) != null)
|
||||||
{
|
{
|
||||||
//TODO: read message data
|
//TODO: read message data
|
||||||
|
|||||||
@@ -486,6 +486,30 @@ namespace Barotrauma.Networking
|
|||||||
client.inGame = false;
|
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()
|
private void UpdateCrewFrame()
|
||||||
|
|||||||
Reference in New Issue
Block a user