Unstable 0.1300.0.5

This commit is contained in:
Markus Isberg
2021-04-01 16:09:18 +03:00
parent 862221635c
commit 96b2184811
54 changed files with 429 additions and 122 deletions
@@ -56,6 +56,11 @@ namespace Barotrauma.Networking
public readonly NetStats NetStats;
protected GUITickBox cameraFollowsSub;
public GUITickBox FollowSubTickBox => cameraFollowsSub;
public bool IsFollowSubTickBoxVisible =>
gameStarted && Screen.Selected == GameMain.GameScreen &&
cameraFollowsSub != null && cameraFollowsSub.Visible;
public CameraTransition EndCinematic;
@@ -2095,7 +2100,7 @@ namespace Barotrauma.Networking
serverSettings.ClientRead(settingsBuf);
if (!IsServerOwner)
{
ServerInfo info = GameMain.ServerListScreen.UpdateServerInfoWithServerSettings(serverEndpoint, serverSettings);
ServerInfo info = serverSettings.GetServerListInfo();
GameMain.ServerListScreen.AddToRecentServers(info);
GameMain.NetLobbyScreen.Favorite.Visible = true;
GameMain.NetLobbyScreen.Favorite.Selected = GameMain.ServerListScreen.IsFavorite(info);
@@ -567,5 +567,10 @@ namespace Barotrauma.Networking
(other.LobbyID == LobbyID || other.LobbyID == 0 || LobbyID == 0) &&
((OwnerID == 0) ? (other.IP == IP && other.Port == Port) : true);
}
public bool MatchesByEndpoint(ServerInfo other)
{
return OwnerID == other.OwnerID && (OwnerID != 0 ? true : (IP == other.IP && Port == other.Port));
}
}
}
@@ -126,6 +126,8 @@ namespace Barotrauma.Networking
public void ClientRead(IReadMessage incMsg)
{
cachedServerListInfo = null;
ServerName = incMsg.ReadString();
ServerMessageText = incMsg.ReadString();
MaxPlayers = incMsg.ReadByte();
@@ -928,6 +930,7 @@ namespace Barotrauma.Networking
public bool ToggleSettingsFrame(GUIButton button, object obj)
{
if (GameMain.NetworkMember == null) { return false; }
if (settingsFrame == null)
{
CreateSettingsFrame();
@@ -949,5 +952,12 @@ namespace Barotrauma.Networking
return false;
}
private ServerInfo cachedServerListInfo = null;
public ServerInfo GetServerListInfo()
{
cachedServerListInfo ??= GameMain.ServerListScreen.UpdateServerInfoWithServerSettings(GameMain.Client.ClientPeer.ServerConnection, this);
return cachedServerListInfo;
}
}
}