Example #1
0
 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();
     }
 }
Example #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;
        }