From dd2151b582050c8466cd8380f7b46685a90c5a01 Mon Sep 17 00:00:00 2001 From: Robin Rolf Date: Tue, 14 Feb 2023 19:40:42 +0100 Subject: [PATCH] /ssl and /nossl args --- .../TestNT/Scripts/TestNTNetworkManager.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkManager.cs b/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkManager.cs index 3c157b43f..2116296cd 100644 --- a/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkManager.cs +++ b/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkManager.cs @@ -67,10 +67,10 @@ public override void Start() { // set default sendRate, then let CmdLineArgs override Application.targetFrameRate = 60; - ProcessCmdLineArgs(); ((TestNTNetworkAuthenticator)authenticator).SetPlayername($"Bot[{sendRate}] ", true); ((SimpleWebTransport)Transport.active).sslEnabled = true; ((SimpleWebTransport)Transport.active).clientUseWss = true; + ProcessCmdLineArgs(); StartClient(); } } @@ -85,9 +85,21 @@ void ProcessCmdLineArgs() if (ushort.TryParse(arg.Remove(0, 3), out ushort port)) ((SimpleWebTransport)Transport.active).port = port; + if (arg.Equals("/ssl", StringComparison.InvariantCultureIgnoreCase)) + { + ((SimpleWebTransport)Transport.active).clientUseWss = true; + ((SimpleWebTransport)Transport.active).sslEnabled = true; + } + + if (arg.Equals("/nossl", StringComparison.InvariantCultureIgnoreCase)) + { + ((SimpleWebTransport)Transport.active).sslEnabled = false; + ((SimpleWebTransport)Transport.active).clientUseWss = false; + } if (arg.StartsWith("/r:", StringComparison.InvariantCultureIgnoreCase)) if (int.TryParse(arg.Remove(0, 3), out sendRate)) Application.targetFrameRate = sendRate; + } } #endif