Example #1
0
    //private void Start()
    //{
    //    DisableSimulationEntitiesWarning();
    //}

    void OnServicesReady()
    {
        if (!string.IsNullOrEmpty(ExtraCommands))
        {
            GameConsole.ExecuteCommandLineStyleInvokables(ExtraCommands);
        }

        if (QuickStart.HasEverQuickStarted == false)
        {
            if (StartFromScratch || EditorLaunchData.playFromScratch)
            {
                QuickStart.StartFromScratch(EditorLaunchData.profileLocalId);
            }
            else
            {
                QuickStartSettings settings = new QuickStartSettings()
                {
                    localProfileId = EditorLaunchData.profileLocalId,
                    level          = EditorLaunchData.level,
                    serverName     = EditorLaunchData.serverName
                };

                if (EditorLaunchData.playOnline)
                {
                    settings.playMode = EditorLaunchData.whoIsServerId == EditorLaunchData.profileLocalId ?
                                        QuickStartSettings.PlayMode.OnlineServer :
                                        QuickStartSettings.PlayMode.OnlineClient;
                }
                else
                {
                    settings.playMode = QuickStartSettings.PlayMode.Local;
                }

                if (OverridePlayMode)
                {
                    settings.playMode = PlayMode;
                }

                if (OverrideServerName)
                {
                    settings.serverName = ServerName;
                }

                if (OverrideLevel)
                {
                    settings.level = Level ? Level.name : "";
                }

                QuickStart.Start(settings);
            }
        }
    }
Example #2
0
    void OnCoreServicesReady()
    {
        // read the command line arguments
        Log.Info("CommandLine: " + CommandLine.CompleteCommandLine);

        QuickStartSettings quickStartSettings = new QuickStartSettings();

        CommandLine.TryGetInt("-profileId", out quickStartSettings.localProfileId);

        if (CommandLine.TryGetInt("-playmode", out int playModeValue))
        {
            CommandLine.TryGetString("-servername", out quickStartSettings.serverName);
            CommandLine.TryGetString("-level", out quickStartSettings.level);
            quickStartSettings.playMode = (QuickStartSettings.PlayMode)playModeValue;


            QuickStart.Start(quickStartSettings);
        }
        else
        {
            QuickStart.StartFromScratch(quickStartSettings.localProfileId);
        }
    }