Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop
This commit is contained in:
@@ -686,6 +686,7 @@ namespace Barotrauma
|
||||
|
||||
private void OnInvitedToSteamGame(string connectCommand)
|
||||
{
|
||||
DebugConsole.NewMessage($"Invited to Steam game, connect command: {connectCommand}", Color.Lime);
|
||||
try
|
||||
{
|
||||
ConnectCommand = Barotrauma.Networking.ConnectCommand.Parse(ToolBox.SplitCommand(connectCommand));
|
||||
@@ -825,6 +826,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (ConnectCommand.TryUnwrap(out var connectCommand))
|
||||
{
|
||||
DebugConsole.NewMessage($"Processing connect command: {connectCommand}...", Color.Lime);
|
||||
if (Client != null)
|
||||
{
|
||||
Client.Quit();
|
||||
@@ -836,6 +838,7 @@ namespace Barotrauma
|
||||
|
||||
if (connectCommand.SteamLobbyIdOption.TryUnwrap(out var lobbyId))
|
||||
{
|
||||
DebugConsole.NewMessage($"Connecting to lobby ID {lobbyId}...", Color.Lime);
|
||||
SteamManager.JoinLobby(lobbyId.Value, joinServer: true);
|
||||
}
|
||||
else if ((connectCommand.NameAndP2PEndpointsOption.TryUnwrap(out var nameAndEndpoint) && nameAndEndpoint is { ServerName: var serverName, Endpoints: var endpoints }))
|
||||
@@ -844,6 +847,7 @@ namespace Barotrauma
|
||||
endpoints.Cast<Endpoint>().ToImmutableArray(),
|
||||
string.IsNullOrWhiteSpace(serverName) ? endpoints.First().StringRepresentation : serverName,
|
||||
Option<int>.None());
|
||||
DebugConsole.NewMessage($"Connecting to endpoint {endpoints.First().StringRepresentation}...", Color.Lime);
|
||||
}
|
||||
else if ((connectCommand.NameAndLidgrenEndpointOption.TryUnwrap(out var nameAndLidgrenEndpoint) && nameAndLidgrenEndpoint is { ServerName: var lidgrenServerName, Endpoint: var endpoint }))
|
||||
{
|
||||
@@ -853,6 +857,10 @@ namespace Barotrauma
|
||||
string.IsNullOrWhiteSpace(lidgrenServerName) ? endpoint.StringRepresentation : lidgrenServerName,
|
||||
Option<int>.None());
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugConsole.NewMessage($"Cannot connect: unrecognized connect command.", Color.Lime);
|
||||
}
|
||||
|
||||
ConnectCommand = Option<ConnectCommand>.None();
|
||||
}
|
||||
@@ -1197,8 +1205,9 @@ namespace Barotrauma
|
||||
|
||||
CoroutineManager.StopCoroutines("EndCinematic");
|
||||
|
||||
if (GameSession != null)
|
||||
if (GameSession != null && GameSession.IsRunning)
|
||||
{
|
||||
AchievementManager.OnRoundEnded(GameSession, roundInterrupted: true);
|
||||
GameAnalyticsManager.AddProgressionEvent(GameAnalyticsManager.ProgressionStatus.Fail,
|
||||
GameSession.GameMode?.Preset.Identifier.Value ?? "none",
|
||||
GameSession.RoundDuration);
|
||||
|
||||
Reference in New Issue
Block a user