コード例 #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>();
 }
コード例 #2
0
 private void CloseConnection()
 {
     if (this.persistance != null)
     {
         this.persistance.Dispose();
         this.persistance = (UserPersistance)null;
     }
     EACServer.DoShutdown();
     ((Network.Server)Network.Net.sv).callbackHandler = null;
     using (TimeWarning.New("sv.Stop", 0.1f))
         ((Network.Server)Network.Net.sv).Stop("Shutting Down");
     using (TimeWarning.New("RCon.Shutdown", 0.1f))
         RCon.Shutdown();
     using (TimeWarning.New("Steamworks.GameServer.Shutdown", 0.1f))
     {
         if (Global.get_SteamServer() == null)
         {
             return;
         }
         Debug.Log((object)"Steamworks Shutting Down");
         ((BaseSteamworks)Global.get_SteamServer()).Dispose();
         Global.set_SteamServer((Facepunch.Steamworks.Server)null);
         Debug.Log((object)"Okay");
     }
 }
コード例 #3
0
 private void CloseConnection()
 {
     if (this.persistance != null)
     {
         this.persistance.Dispose();
         this.persistance = null;
     }
     EACServer.DoShutdown();
     Network.Net.sv.callbackHandler = null;
     using (TimeWarning timeWarning = TimeWarning.New("sv.Stop", 0.1f))
     {
         Network.Net.sv.Stop("Shutting Down");
     }
     using (timeWarning = TimeWarning.New("RCon.Shutdown", 0.1f))
     {
         RCon.Shutdown();
     }
     using (timeWarning = TimeWarning.New("Steamworks.GameServer.Shutdown", 0.1f))
     {
         if (SteamServer.IsValid)
         {
             UnityEngine.Debug.Log("Steamworks Shutting Down");
             SteamServer.Shutdown();
             UnityEngine.Debug.Log("Okay");
         }
     }
 }
コード例 #4
0
 public void Initialize(bool loadSave = true, string saveFile = "", bool allowOutOfDateSaves = false, bool skipInitialSpawn = false)
 {
     this.persistance = new UserPersistance(ConVar.Server.rootFolder);
     this.SpawnMapEntities();
     if (SingletonComponent <SpawnHandler> .Instance)
     {
         using (TimeWarning timeWarning = TimeWarning.New("SpawnHandler.UpdateDistributions", 0.1f))
         {
             SingletonComponent <SpawnHandler> .Instance.UpdateDistributions();
         }
     }
     if (loadSave)
     {
         skipInitialSpawn = SaveRestore.Load(saveFile, allowOutOfDateSaves);
     }
     if (SingletonComponent <SpawnHandler> .Instance)
     {
         if (!skipInitialSpawn)
         {
             using (timeWarning = TimeWarning.New("SpawnHandler.InitialSpawn", (long)200))
             {
                 SingletonComponent <SpawnHandler> .Instance.InitialSpawn();
             }
         }
         using (timeWarning = TimeWarning.New("SpawnHandler.StartSpawnTick", (long)200))
         {
             SingletonComponent <SpawnHandler> .Instance.StartSpawnTick();
         }
     }
     this.CreateImportantEntities();
     this.auth = base.GetComponent <ConnectionAuth>();
 }
コード例 #5
0
        public Usuario buscarUsuario(string username)
        {
            Usuario selectedUser = UserPersistance.getUserById(username);

            return(selectedUser);
        }