| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.IO; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | namespace DCL |
| | 7 | | { |
| | 8 | | public static class CommandLineParserUtils |
| | 9 | | { |
| 0 | 10 | | public static int startPort = 7666; |
| 0 | 11 | | public static bool withSSL = true; |
| | 12 | |
|
| | 13 | | public static void ParseArguments() |
| | 14 | | { |
| 0 | 15 | | var arguments = System.Environment.GetCommandLineArgs(); |
| | 16 | |
|
| 0 | 17 | | for (var i = 0; i < arguments.Length; ++i) |
| | 18 | | { |
| 0 | 19 | | var argumentsLeft = arguments.Length - i - 1; |
| 0 | 20 | | var argument = arguments[i]; |
| | 21 | |
|
| 0 | 22 | | if (argumentsLeft >= 1) // Arguments with at least 1 parameter |
| | 23 | | { |
| | 24 | | switch (argument) |
| | 25 | | { |
| | 26 | | case "--port": |
| 0 | 27 | | i++; // shift |
| 0 | 28 | | startPort = int.Parse(arguments[i]); |
| 0 | 29 | | break; |
| | 30 | | case "--no-ssl": |
| 0 | 31 | | withSSL = false; |
| | 32 | | break; |
| | 33 | | } |
| | 34 | | } |
| | 35 | | } |
| 0 | 36 | | } |
| | 37 | | } |
| | 38 | | } |