-
Notifications
You must be signed in to change notification settings - Fork 583
Expand file tree
/
Copy pathConnectionState.cs
More file actions
45 lines (31 loc) · 1.33 KB
/
ConnectionState.cs
File metadata and controls
45 lines (31 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using Unity.BossRoom.Infrastructure;
using Unity.Netcode;
using UnityEngine;
using VContainer;
namespace Unity.BossRoom.ConnectionManagement
{
/// <summary>
/// Base class representing a connection state.
/// </summary>
abstract class ConnectionState
{
[Inject]
protected ConnectionManager m_ConnectionManager;
[Inject]
protected IPublisher<ConnectStatus> m_ConnectStatusPublisher;
public abstract void Enter();
public abstract void Exit();
public virtual void OnClientConnected(ulong clientId) { }
public virtual void OnClientDisconnect(ulong clientId) { }
public virtual void OnServerStarted() { }
public virtual void StartClientIP(string playerName, string ipaddress, int port) { }
public virtual void StartClientSession(string playerName) { }
public virtual void StartHostIP(string playerName, string ipaddress, int port) { }
public virtual void StartHostSession(string playerName) { }
public virtual void OnUserRequestedShutdown() { }
public virtual void ApprovalCheck(NetworkManager.ConnectionApprovalRequest request, NetworkManager.ConnectionApprovalResponse response) { }
public virtual void OnTransportFailure() { }
public virtual void OnServerStopped() { }
}
}