Ejemplo n.º 1
0
 public static bool Run(bool silent)
 {
     // yeah eh redo
     if (!silent)
     {
         Debug.Log("Downloading newest ID list's and reloading them...");
     }
     GetWebsiteContent.WriteToFile(IdListItemsFile, "http://www.UserR00T.com/dev/BPEssentials/idlist_items.txt", new Action <bool>((success) =>
     {
         if (success)
         {
             ReadFile.Run(IdListItemsFile);
         }
         GetWebsiteContent.WriteToFile(IdListVehicleFile, "http://www.UserR00T.com/dev/BPEssentials/idlist_vehicles.txt", new Action <bool>((success2) =>
         {
             if (success2)
             {
                 ReadFile.Run(IdListVehicleFile);
             }
             if (!silent && success && success2)
             {
                 Debug.Log($"[OK] Downloaded newest ID list's and reloaded them! ({IDs_Items.Length}(items) {IDs_Vehicles.Length}(vehicles) entries loaded in.)");
             }
         }));
     }));
     return(true);
 }
Ejemplo n.º 2
0
 public static void Run(bool silentExecution, SvPlayer player = null, bool IsFirstReload = false)
 {
     try
     {
         if (!silentExecution && player != null)
         {
             player.SendChatMessage("[WAIT] Reloading all files..");
         }
         CheckFiles.Run();
         ReadFile.Run(SettingsFile);
         ReadStream.Run(LanguageBlockFile, LanguageBlockWords);
         ReadStream.Run(ChatBlockFile, ChatBlockWords);
         ReadStream.Run(AdminListFile, AdminsListPlayers);
         ReadCustomCommands.Run();
         ReadGroups.Run();
         LanguageBlockWords = LanguageBlockWords.ConvertAll(d => d.ToLower());
         ChatBlockWords     = ChatBlockWords.ConvertAll(d => d.ToLower());
         if (DownloadIdList && player == null) // do not download every time a player /reloads
         {
             GetIdList.Run(false);
         }
         else
         {
             ReadFile.Run(IdListItemsFile);
             ReadFile.Run(IdListVehicleFile);
         }
         ReadFile.Run(AnnouncementsFile);
         ReadFile.Run(GodListFile);
         ReadFile.Run(MuteListFile);
         ReadFile.Run(AfkListFile);
         ReadFile.Run(RulesFile);
         if (!silentExecution && player != null)
         {
             player.SendChatMessage("[OK] Critical config files reloaded");
         }
     }
     catch (Exception ex)
     {
         ErrorLogging.Run(ex);
     }
 }