(2402e736e) Tester's build, January 25th 2020

This commit is contained in:
Joonas Rikkonen
2020-01-25 12:48:13 +02:00
parent 4a58987eae
commit eaa18a20a3
57 changed files with 710 additions and 139 deletions
@@ -66,7 +66,7 @@ namespace Barotrauma.Networking
}
txt = order.GetChatMessage(targetCharacter?.Name, senderCharacter?.CurrentHull?.DisplayName, givingOrderToSelf: targetCharacter == senderCharacter, orderOption: orderOption);
if (GameMain.Client.GameStarted)
if (GameMain.Client.GameStarted && Screen.Selected == GameMain.GameScreen)
{
if (order.TargetAllCharacters)
{
@@ -401,6 +401,7 @@ namespace Barotrauma.Networking
// Before main looping starts, we loop here and wait for approval message
private IEnumerable<object> WaitForStartingInfo()
{
GUI.SetCursorWaiting();
requiresPw = false;
pwRetries = -1;
@@ -503,6 +504,7 @@ namespace Barotrauma.Networking
reconnectBox?.Close(); reconnectBox = null;
GUI.ClearCursorWait();
if (connectCancelled) { yield return CoroutineStatus.Success; }
yield return CoroutineStatus.Success;
@@ -1435,6 +1437,11 @@ namespace Barotrauma.Networking
if (clientPeer is SteamP2POwnerPeer)
{
TaskPool.Add(Steamworks.SteamNetworkingUtils.WaitForPingDataAsync(), (task) =>
{
Steam.SteamManager.UpdateLobby(serverSettings);
});
Steam.SteamManager.UpdateLobby(serverSettings);
}
}
@@ -1978,7 +1985,7 @@ namespace Barotrauma.Networking
if (ChildServerRelay.Process != null)
{
int checks = 0;
while (!ChildServerRelay.Process.HasExited)
while (ChildServerRelay.Process != null && !ChildServerRelay.Process.HasExited)
{
if (checks > 10)
{
@@ -509,11 +509,6 @@ namespace Barotrauma.Networking
IP = "";
Port = "";
QueryPort = "";
string pingLocation = lobby.GetData("pinglocation");
if (!string.IsNullOrEmpty(pingLocation))
{
PingLocation = Steamworks.Data.PingLocation.TryParseFromString(pingLocation);
}
PlayerCount = currPlayers;
MaxPlayers = maxPlayers;
HasPassword = hasPassword;
@@ -118,6 +118,8 @@ namespace Barotrauma.Steam
TaskPool.Add(Steamworks.SteamMatchmaking.CreateLobbyAsync(serverSettings.MaxPlayers + 10),
(lobby) =>
{
currentLobby = lobby.Result;
if (currentLobby == null)
{
DebugConsole.ThrowError("Failed to create Steam lobby");
@@ -125,8 +127,6 @@ namespace Barotrauma.Steam
return;
}
currentLobby = lobby.Result;
DebugConsole.NewMessage("Lobby created!", Microsoft.Xna.Framework.Color.Lime);
lobbyState = LobbyState.Owner;
@@ -169,7 +169,8 @@ namespace Barotrauma.Steam
currentLobby?.SetData("playercount", (GameMain.Client?.ConnectedClients?.Count ?? 0).ToString());
currentLobby?.SetData("maxplayernum", serverSettings.MaxPlayers.ToString());
//currentLobby?.SetData("hostipaddress", lobbyIP);
currentLobby?.SetData("pinglocation", Steamworks.SteamNetworkingUtils.LocalPingLocation.ToString() ?? "");
string pingLocation = Steamworks.SteamNetworkingUtils.LocalPingLocation.ToString();
currentLobby?.SetData("pinglocation", pingLocation ?? "");
currentLobby?.SetData("lobbyowner", SteamIDUInt64ToString(GetSteamID()));
currentLobby?.SetData("haspassword", serverSettings.HasPassword.ToString());
@@ -254,6 +255,7 @@ namespace Barotrauma.Steam
ServerInfo serverInfo = new ServerInfo();
serverInfo.ServerName = lobby.GetData("name");
serverInfo.OwnerID = SteamIDStringToUInt64(lobby.GetData("lobbyowner"));
serverInfo.LobbyID = lobby.Id;
serverInfo.PlayerCount = int.TryParse(lobby.GetData("playercount"), out int playerCount) ? playerCount : 0;
serverInfo.MaxPlayers = int.TryParse(lobby.GetData("maxplayernum"), out int maxPlayers) ? maxPlayers : 1;
@@ -371,6 +373,12 @@ namespace Barotrauma.Steam
serverInfo.ContentPackageHashes.Clear();
}
string pingLocation = lobby.GetData("pinglocation");
if (!string.IsNullOrEmpty(pingLocation))
{
serverInfo.PingLocation = Steamworks.Data.PingLocation.TryParseFromString(pingLocation);
}
bool? getLobbyBool(string key)
{
string data = lobby.GetData(key);