Skip to content

Commit

Permalink
fix(EncryptionTransport): implement PortTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
miwarnec committed Oct 11, 2024
1 parent ed53e0a commit 4dd3f1e
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Assets/Mirror/Transports/Encryption/EncryptionTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4dd3f1e

Please sign in to comment.