mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
/ssl and /nossl args
This commit is contained in:
parent
9184938671
commit
dd2151b582
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user