Exemplo n.º 1
0
    private IEnumerator DoGameSetup()
    {
        GameSetup gameSetup = this;

        Application.isLoading = (__Null)1;
        TerrainMeta.InitNoTerrain();
        ItemManager.Initialize();
        Scene activeScene = SceneManager.GetActiveScene();

        LevelManager.CurrentLevelName = ((Scene) ref activeScene).get_name();
        if (gameSetup.loadLevel && !string.IsNullOrEmpty(gameSetup.loadLevelScene))
        {
            ((Network.Server)Net.sv).Reset();
            ConVar.Server.level = gameSetup.loadLevelScene;
            LoadingScreen.Update("LOADING SCENE");
            Application.LoadLevelAdditive(gameSetup.loadLevelScene);
            LoadingScreen.Update(gameSetup.loadLevelScene.ToUpper() + " LOADED");
        }
        if (gameSetup.startServer)
        {
            yield return((object)gameSetup.StartCoroutine(gameSetup.StartServer()));
        }
        yield return((object)null);

        Application.isLoading = (__Null)0;
    }
Exemplo n.º 2
0
    private IEnumerator DoGameSetup()
    {
        Rust.Application.isLoading = true;
        TerrainMeta.InitNoTerrain();
        ItemManager.Initialize();
        LevelManager.CurrentLevelName = SceneManager.GetActiveScene().name;
        if (loadLevel && !string.IsNullOrEmpty(loadLevelScene))
        {
            Network.Net.sv.Reset();
            ConVar.Server.level = loadLevelScene;
            LoadingScreen.Update("LOADING SCENE");
            UnityEngine.Application.LoadLevelAdditive(loadLevelScene);
            LoadingScreen.Update(loadLevelScene.ToUpper() + " LOADED");
        }
        if (startServer)
        {
            yield return(StartCoroutine(StartServer()));
        }
        yield return(null);

        Rust.Application.isLoading = false;
    }