Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Assets/Scripts/ConnectionManagement/ConnectionMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public abstract class ConnectionMethodBase
protected ConnectionManager m_ConnectionManager;
readonly ProfileManager m_ProfileManager;
protected readonly string m_PlayerName;
protected const string k_DtlsConnType = "dtls";

public abstract Task SetupHostConnectionAsync();

Expand Down Expand Up @@ -128,7 +129,7 @@ public override async Task SetupClientConnectionAsync()

// Configure UTP with allocation
var utp = (UnityTransport)m_ConnectionManager.NetworkManager.NetworkConfig.NetworkTransport;
utp.SetRelayServerData(new RelayServerData(joinedAllocation, OnlineState.k_DtlsConnType));
utp.SetRelayServerData(new RelayServerData(joinedAllocation, k_DtlsConnType));
}

public override async Task SetupHostConnectionAsync()
Expand All @@ -152,7 +153,7 @@ public override async Task SetupHostConnectionAsync()

// Setup UTP with relay connection info
var utp = (UnityTransport)m_ConnectionManager.NetworkManager.NetworkConfig.NetworkTransport;
utp.SetRelayServerData(new RelayServerData(hostAllocation, OnlineState.k_DtlsConnType)); // This is with DTLS enabled for a secure connection
utp.SetRelayServerData(new RelayServerData(hostAllocation, k_DtlsConnType)); // This is with DTLS enabled for a secure connection
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Unity.BossRoom.ConnectionManagement
/// Connection state corresponding to a connected client. When being disconnected, transitions to the
/// ClientReconnecting state if no reason is given, or to the Offline state.
/// </summary>
class ClientConnectedState : ConnectionState
class ClientConnectedState : OnlineState
{
[Inject]
protected LobbyServiceFacade m_LobbyServiceFacade;
Expand Down Expand Up @@ -39,11 +39,5 @@ public override void OnClientDisconnect(ulong _)
m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline);
}
}

public override void OnUserRequestedShutdown()
{
m_ConnectStatusPublisher.Publish(ConnectStatus.UserRequestedDisconnect);
m_ConnectionManager.ChangeState(m_ConnectionManager.m_Offline);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ namespace Unity.BossRoom.ConnectionManagement
/// </summary>
abstract class OnlineState : ConnectionState
{
public const string k_DtlsConnType = "dtls";

public override void OnUserRequestedShutdown()
{
// This behaviour will be the same for every online state
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
### Fixed
* EnemyPortals' VFX get disabled and re-enabled once the breakable crystals are broken (#784)
* Elements inside the Tank's and Rogue's AnimatorTriggeredSpecialFX list have been revised to not loop AudioSource clips, ending the logging of multiple warnings to the console (#785)
* ClientConnectedState now inherits from OnlineState instead of the base ConnectionState (#801)

## [2.0.4] - 2022-12-13
### Changed
Expand Down