Exemplo n.º 1
0
 public void Initialize(
     bool loadSave            = true,
     string saveFile          = "",
     bool allowOutOfDateSaves = false,
     bool skipInitialSpawn    = false)
 {
     if (!ConVar.Server.official)
     {
         ExceptionReporter.set_Disabled(true);
     }
     this.persistance = new UserPersistance(ConVar.Server.rootFolder);
     this.SpawnMapEntities();
     if (Object.op_Implicit((Object)SingletonComponent <SpawnHandler> .Instance))
     {
         using (TimeWarning.New("SpawnHandler.UpdateDistributions", 0.1f))
             ((SpawnHandler)SingletonComponent <SpawnHandler> .Instance).UpdateDistributions();
     }
     if (loadSave)
     {
         skipInitialSpawn = SaveRestore.Load(saveFile, allowOutOfDateSaves);
     }
     if (Object.op_Implicit((Object)SingletonComponent <SpawnHandler> .Instance))
     {
         if (!skipInitialSpawn)
         {
             using (TimeWarning.New("SpawnHandler.InitialSpawn", 200L))
                 ((SpawnHandler)SingletonComponent <SpawnHandler> .Instance).InitialSpawn();
         }
         using (TimeWarning.New("SpawnHandler.StartSpawnTick", 200L))
             ((SpawnHandler)SingletonComponent <SpawnHandler> .Instance).StartSpawnTick();
     }
     this.CreateImportantEntities();
     this.auth = (ConnectionAuth)((Component)this).GetComponent <ConnectionAuth>();
 }