public static void Debug(string Text)
 {
     if (Logger != null)
     {
         Logger.Debug(Text);
     }
 }
예제 #2
0
        public static void LoadProgram(ContainerLogger logger)
        {
            int time = Environment.TickCount;

            ConsoleManager.InitLogger(logger);
            logger.Info("#Démarrage de la solution...");

            if (!ConfigurationManager.IsFileExists() || ConfigurationManager.GetEntryByName("GamePath") == null)
            {
                logger.Warning("Aucun fichier de configuration trouvé.");

                ConfigurationManager.SerializeConfig();

                Application.Run(new PathForm());

                if (ConfigurationManager.GetEntryByName("GamePath") == null)
                {
                    System.Environment.Exit(1);
                    return;
                }

                logger.Debug("Configuration définie.");
            }
            else
            {
                ConfigurationManager.DeserializeConfig();
                logger.Debug("Fichier de configuration chargé.");
            }

            ProtocolTypeManager.Initialize();
            MessageReceiver.Initialize();

            try
            {
                NetworkManager.StartServers();
                logger.Debug("Serveurs démarrés.");
            }
            catch (Exception ex)
            {
                logger.Error("[SERVERS] " + ex.Message);
                logger.Error("SERVERS - OFF");
            }

            logger.Debug(string.Format("{0}ms", Environment.TickCount - time));

            OnProgramLoaded(null);
        }