Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 1.39 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public static bool Initialize()
  2.         {
  3.             if (!Loaded)
  4.             {
  5.                 Loaded = true;
  6.                 s_instance.AddVariablesOfAsm<VariableAttribute>(typeof(TerrainDisplayConfig).Assembly);
  7.                
  8.                 try
  9.                 {
  10.                     if (!s_instance.Load())
  11.                     {
  12.                         s_instance.Save(true, false);
  13.                         log.Warn("Config-file \"{0}\" not found - Created new file.", Instance.FilePath);
  14.                         log.Warn("Please take a little time to configure your server and then restart the Application.");
  15.                         log.Warn("See http://wiki.wcell.org/index.php/Configuration for more information.");
  16.                         return false;
  17.                     }
  18.                     else
  19.                     {
  20.                         if (s_instance.AutoSave)
  21.                         {
  22.                             s_instance.Save(true, true);
  23.                         }
  24.                     }
  25.                 }
  26.                 catch (Exception e)
  27.                 {
  28.                     LogUtil.ErrorException(e, "Unable to load Configuration.");
  29.                     log.Error("Please correct the invalid values in your configuration file and restart the Applicaton.");
  30.                     return false;
  31.                 }
  32.             }
  33.             return true;
  34.         }