예제 #1
0
파일: Program.cs 프로젝트: lyginne/Chat
 static void Main(string[] args)
 {
     try {
         XmlSettings xmlSettings = new XmlSettings("settings.xml");
         DataBaseManager.InitializeDatabaseManager();
         Broadcaster.Initialize();
         new Server(xmlSettings.IpAddress, xmlSettings.Port);
     }
     catch (Exception e) {
         Console.WriteLine("Невозможно запустить сервер: " + e.Message);
         Console.ReadLine();
     }
 }
예제 #2
0
        public async Task OnLoad(IServer server)
        {
            server.RegisterCommandClass <MainModule>();
            Globals.Logger     = Logger;
            Globals.FileWriter = FileWriter;
            Globals.FileReader = FileReader;
            Globals.Server     = server;
            Broadcaster.Initialize();
            try
            {
                Globals.Config = await ConfigManager.LoadConfig();

                await Broadcaster.StartBroadcasting();
            }
            catch (Exception e)
            {
                Logger.LogError(e.Message);
            }
            Logger.Log($"Loaded {Info.Name}");
            await Task.CompletedTask;
        }