@@ -9,7 +9,7 @@ namespace Unity.Multiplayer.Samples.BossRoom
9
9
{
10
10
public static class UnityRelayUtilities
11
11
{
12
- private const string kDtlsConnType = "dtls" ;
12
+ const string k_KDtlsConnType = "dtls" ;
13
13
14
14
public static async
15
15
Task < ( string ipv4address , ushort port , byte [ ] allocationIdBytes , byte [ ] connectionData , byte [ ] key , string
@@ -20,7 +20,7 @@ public static async
20
20
21
21
try
22
22
{
23
- allocation = await Relay . Instance . CreateAllocationAsync ( maxConnections , region ) ;
23
+ allocation = await RelayService . Instance . CreateAllocationAsync ( maxConnections , region ) ;
24
24
}
25
25
catch ( Exception exception )
26
26
{
@@ -31,14 +31,14 @@ public static async
31
31
32
32
try
33
33
{
34
- joinCode = await Relay . Instance . GetJoinCodeAsync ( allocation . AllocationId ) ;
34
+ joinCode = await RelayService . Instance . GetJoinCodeAsync ( allocation . AllocationId ) ;
35
35
}
36
36
catch ( Exception exception )
37
37
{
38
38
throw new Exception ( $ "Creating join code request has failed: \n { exception . Message } ") ;
39
39
}
40
40
41
- var dtlsEndpoint = allocation . ServerEndpoints . First ( e => e . ConnectionType == kDtlsConnType ) ;
41
+ var dtlsEndpoint = allocation . ServerEndpoints . First ( e => e . ConnectionType == k_KDtlsConnType ) ;
42
42
return ( dtlsEndpoint . Host , ( ushort ) dtlsEndpoint . Port , allocation . AllocationIdBytes ,
43
43
allocation . ConnectionData , allocation . Key , joinCode ) ;
44
44
}
@@ -50,7 +50,7 @@ public static async
50
50
JoinAllocation allocation ;
51
51
try
52
52
{
53
- allocation = await Relay . Instance . JoinAllocationAsync ( joinCode ) ;
53
+ allocation = await RelayService . Instance . JoinAllocationAsync ( joinCode ) ;
54
54
}
55
55
catch ( Exception exception )
56
56
{
@@ -61,7 +61,7 @@ public static async
61
61
Debug . Log ( $ "host: { allocation . HostConnectionData [ 0 ] } { allocation . HostConnectionData [ 1 ] } ") ;
62
62
Debug . Log ( $ "client: { allocation . AllocationId } ") ;
63
63
64
- var dtlsEndpoint = allocation . ServerEndpoints . First ( e => e . ConnectionType == kDtlsConnType ) ;
64
+ var dtlsEndpoint = allocation . ServerEndpoints . First ( e => e . ConnectionType == k_KDtlsConnType ) ;
65
65
return ( dtlsEndpoint . Host , ( ushort ) dtlsEndpoint . Port , allocation . AllocationIdBytes ,
66
66
allocation . ConnectionData , allocation . HostConnectionData , allocation . Key ) ;
67
67
}
0 commit comments