(3a5d98b) v0.9.6.0

This commit is contained in:
Regalis
2019-12-17 14:38:24 +01:00
parent 5c95c53118
commit a3569b8bf0
95 changed files with 1579 additions and 728 deletions
@@ -18,7 +18,17 @@ namespace Barotrauma.Networking
public UInt64 OwnerID;
public bool OwnerVerified;
public string ServerName;
private string serverName;
public string ServerName
{
get { return serverName; }
set
{
serverName = value;
if (serverName.Length > NetConfig.ServerNameMaxLength) { ServerName = ServerName.Substring(0, NetConfig.ServerNameMaxLength); }
}
}
public string ServerMessage;
public bool GameStarted;
public int PlayerCount;
@@ -455,38 +465,7 @@ namespace Barotrauma.Networking
if (SteamFriend.IsPlayingThisGame && SteamFriend.ServerLobbyId != 0)
{
LobbyID = SteamFriend.ServerLobbyId;
SteamManager.Instance.LobbyList.SetManualLobbyDataCallback(LobbyID, (lobby) =>
{
SteamManager.Instance.LobbyList.SetManualLobbyDataCallback(LobbyID, null);
if (string.IsNullOrWhiteSpace(lobby.GetData("haspassword"))) { return; }
bool.TryParse(lobby.GetData("haspassword"), out bool hasPassword);
int.TryParse(lobby.GetData("playercount"), out int currPlayers);
int.TryParse(lobby.GetData("maxplayernum"), out int maxPlayers);
//UInt64.TryParse(lobby.GetData("connectsteamid"), out ulong connectSteamId);
string ip = lobby.GetData("hostipaddress");
UInt64 ownerId = SteamManager.SteamIDStringToUInt64(lobby.GetData("lobbyowner"));
if (OwnerID != ownerId) { return; }
if (string.IsNullOrWhiteSpace(ip)) { ip = ""; }
ServerName = lobby.Name;
Port = "";
QueryPort = "";
IP = ip;
PlayerCount = currPlayers;
MaxPlayers = maxPlayers;
HasPassword = hasPassword;
RespondedToSteamQuery = true;
LobbyID = lobby.LobbyID;
OwnerID = ownerId;
PingChecked = false;
OwnerVerified = true;
SteamManager.AssignLobbyDataToServerInfo(lobby, this);
onServerRulesReceived?.Invoke(this);
});
SteamManager.Instance.LobbyList.RequestLobbyData(LobbyID);
}
else