Skip to content

Commit e9a7b49

Browse files
committed
adding reconnect message
1 parent 2340556 commit e9a7b49

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Assets/BossRoom/Scripts/Shared/ApplicationController.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ private void Awake()
5353
//this message channel is essential and persists for the lifetime of the lobby and relay services
5454
scope.BindMessageChannelInstance<ConnectStatus>();
5555

56+
//this message channel is essential and persists for the lifetime of the lobby and relay services
57+
scope.BindMessageChannelInstance<ReconnectMessage>();
58+
5659
//buffered message channels hold the latest received message in buffer and pass to any new subscribers
5760
scope.BindBufferedMessageChannelInstance<LobbyListFetchedMessage>();
5861

Assets/BossRoom/Scripts/Shared/Net/ConnectionManagement/ClientGameNetPortal.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ public class ClientGameNetPortal : MonoBehaviour
4040
LobbyServiceFacade m_LobbyServiceFacade;
4141
LocalLobby m_LocalLobby;
4242
IPublisher<ConnectStatus> m_ConnectStatusPub;
43+
IPublisher<ReconnectMessage> m_ReconnectMessagePub;
4344

4445
[Inject]
4546
private void InjectDependencies(ApplicationController applicationController, LobbyServiceFacade lobbyServiceFacade,
46-
LocalLobby localLobby, IPublisher<ConnectStatus> connectStatusPub)
47+
LocalLobby localLobby, IPublisher<ConnectStatus> connectStatusPub, IPublisher<ReconnectMessage> reconnectMessagePub)
4748
{
4849
m_ApplicationController = applicationController;
4950
m_LobbyServiceFacade = lobbyServiceFacade;
5051
m_LocalLobby = localLobby;
5152
m_ConnectStatusPub = connectStatusPub;
53+
m_ReconnectMessagePub = reconnectMessagePub;
5254
}
5355

5456
private void Awake()

Assets/BossRoom/Scripts/Shared/Net/ConnectionManagement/GameNetPortal.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ public enum ConnectStatus
2626
HostEndedSession, //host intentionally ended the session.
2727
}
2828

29+
public struct ReconnectMessage
30+
{
31+
public int CurrentAttempt;
32+
public int MaxAttempt;
33+
}
34+
2935
public enum OnlineMode
3036
{
3137
IpHost = 0, // The server is hosted directly and clients can join by ip address.

0 commit comments

Comments
 (0)