Ejemplo n.º 1
0
Archivo: MstArgs.cs Proyecto: poup/MST
        public MstArgs()
        {
            ParseArguments();

            Names = new MstArgNames();

            StartMaster           = AsBool(Names.StartMaster, false);
            StartSpawner          = AsBool(Names.StartSpawner, false);
            StartClientConnection = AsBool(Names.StartClientConnection, false);

            MasterPort = AsInt(Names.MasterPort, 5000);
            MasterIp   = AsString(Names.MasterIp, "127.0.0.1");

            WebPort    = AsInt(Names.WebPort, 8080);
            WebRootDir = AsString(Names.WebRootDir, "wwwroot");

            RoomName           = AsString(Names.RoomName, "Room_" + Mst.Helper.CreateID_16());
            RoomIp             = AsString(Names.RoomIp, "127.0.0.1");
            RoomPort           = AsInt(Names.RoomPort, 7777);
            RoomDefaultPort    = AsInt(Names.RoomDefaultPort, 1500);
            RoomExecutablePath = AsString(Names.RoomExecutablePath);
            RoomRegion         = AsString(Names.RoomRegion);
            RoomMaxConnections = AsInt(Names.RoomMaxConnections, 10);
            RoomIsPrivate      = AsBool(Names.RoomIsPrivate, false);
            RoomPassword       = AsString(Names.RoomPassword);

            SpawnTaskId         = AsInt(Names.SpawnTaskId, -1);
            SpawnTaskUniqueCode = AsString(Names.SpawnTaskUniqueCode);
            MaxProcesses        = AsInt(Names.MaxProcesses, 0);

            LoadScene = AsString(Names.LoadScene);

            DbConnectionString = AsString(Names.DbConnectionString);

            LobbyId       = AsInt(Names.LobbyId);
            UseWebSockets = AsBool(Names.UseWebSockets, false);

            UseSecure           = AsBool(Names.UseSecure, false);
            CertificatePath     = AsString(Names.CertificatePath);
            CertificatePassword = AsString(Names.CertificatePassword);

            UseDevMode = AsBool(Names.UseDevMode, false);

            TargetFrameRate = AsInt(Names.TargetFrameRate, 60);
        }
Ejemplo n.º 2
0
        public MstArgs()
        {
            _args = Environment.GetCommandLineArgs();

            // Android fix
            if (_args == null)
            {
                _args = Array.Empty <string>();
            }

            Names = new MstArgNames();

            StartMaster           = IsProvided(Names.StartMaster);
            StartSpawner          = IsProvided(Names.StartSpawner);
            StartClientConnection = IsProvided(Names.StartClientConnection);

            MasterPort = ExtractValueInt(Names.MasterPort, 5000);
            MasterIp   = ExtractValue(Names.MasterIp, "127.0.0.1");

            RoomName           = ExtractValue(Names.RoomName, "Room_" + Mst.Helper.CreateRandomString(5));
            RoomIp             = ExtractValue(Names.RoomIp, "127.0.0.1");
            RoomPort           = ExtractValueInt(Names.RoomPort, 7777);
            RoomDefaultPort    = ExtractValueInt(Names.RoomDefaultPort, 1500);
            RoomExecutablePath = ExtractValue(Names.RoomExecutablePath);
            RoomRegion         = ExtractValue(Names.RoomRegion, string.Empty);
            RoomMaxConnections = ExtractValueInt(Names.RoomMaxConnections, 10);
            RoomIsPrivate      = !IsProvided(Names.RoomIsPrivate);
            RoomPassword       = ExtractValue(Names.RoomPassword, string.Empty);

            SpawnTaskId         = ExtractValueInt(Names.SpawnTaskId, -1);
            SpawnTaskUniqueCode = ExtractValue(Names.SpawnTaskUniqueCode);
            MaxProcesses        = ExtractValueInt(Names.MaxProcesses, 0);

            LoadScene = ExtractValue(Names.LoadScene);

            DbConnectionString = ExtractValue(Names.DbConnectionString);

            LobbyId = ExtractValueInt(Names.LobbyId);
            WebGl   = IsProvided(Names.UseWebSockets);

            UseSsl              = IsProvided(Names.UseSsl);
            CertificatePath     = ExtractValue(Names.CertificatePath);
            CertificatePassword = ExtractValue(Names.CertificatePassword);
        }