Exemplo n.º 1
0
        private void ParseArgsAndServerSetup()
        {
            string[]        args            = System.Environment.GetCommandLineArgs();
            ServerSetupData serverSetupData = ParseCommandLine(args);

            region = serverSetupData.region;
            serverSetup.provider     = serverSetupData.provider;
            serverSetup.game_version = serverSetupData.gameVersion;
        }
Exemplo n.º 2
0
        public static ServerSetupData ParseCommandLine(string[] args)
        {
            bool            isProviderFound    = false;
            bool            isGameVersionFound = false;
            bool            isRegionFound      = false;
            string          region             = "";
            string          provider           = "";
            string          game_version       = "";
            ServerSetupData serverSetupData    = new ServerSetupData();

            foreach (string arg in args)
            {
                AccelByteDebug.Log("arg: " + arg);
                if (arg.Contains("provider"))
                {
                    string[] split = arg.Split('=');
                    provider        = split[1];
                    isProviderFound = true;
                }

                if (arg.Contains("game_version"))
                {
                    string[] split = arg.Split('=');
                    game_version       = split[1];
                    isGameVersionFound = true;
                }

                if (arg.Contains("region"))
                {
                    string[] split = arg.Split('=');
                    region        = split[1];
                    isRegionFound = true;
                }

                if (isProviderFound && isGameVersionFound && isRegionFound)
                {
                    serverSetupData = new ServerSetupData()
                    {
                        region      = region,
                        provider    = provider,
                        gameVersion = game_version
                    };
                    break;
                }
            }
            return(serverSetupData);
        }