fix(EncryptionTransport): implement PortTransport

This commit is contained in:
Michael W. 2024-10-11 15:21:02 +02:00
parent ed53e0a5a9
commit 4dd3f1e71d

View File

@ -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,