mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-17 18:40:33 +00:00
fix(EncryptionTransport): implement PortTransport
This commit is contained in:
parent
ed53e0a5a9
commit
4dd3f1e71d
@ -7,12 +7,35 @@
|
||||
namespace Mirror.Transports.Encryption
|
||||
{
|
||||
[HelpURL("https://mirror-networking.gitbook.io/docs/manual/transports/encryption-transport")]
|
||||
public class EncryptionTransport : Transport
|
||||
public class EncryptionTransport : Transport, PortTransport
|
||||
{
|
||||
public override bool IsEncrypted => true;
|
||||
public override string EncryptionCipher => "AES256-GCM";
|
||||
public Transport inner;
|
||||
|
||||
public ushort Port
|
||||
{
|
||||
get
|
||||
{
|
||||
if (inner is PortTransport portTransport)
|
||||
{
|
||||
return portTransport.Port;
|
||||
}
|
||||
|
||||
Debug.LogError($"EncryptionTransport can't get Port because {inner} is not a PortTransport");
|
||||
return 0;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (inner is PortTransport portTransport)
|
||||
{
|
||||
portTransport.Port = value;
|
||||
return;
|
||||
}
|
||||
Debug.LogError($"EncryptionTransport can't set Port because {inner} is not a PortTransport");
|
||||
}
|
||||
}
|
||||
|
||||
public enum ValidationMode
|
||||
{
|
||||
Off,
|
||||
|
Loading…
Reference in New Issue
Block a user