Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            var conf = new Configuration("SharpIM", "SharpIM.Server.Config.xml");

            if (!conf.Check())
            {
                conf.LoadDefaults();
            }
            else
            {
                ConfigAccessor.Initialize(conf);

                var connString = (string) ConfigAccessor.GetValue("ConnectionString");
                var port = (int) ConfigAccessor.GetValue("Port");

                var db = new Database(connString);
                DataAccessor.Initialize(db);

                var server = new Core.Server(port);
                server.StartServer();

                Console.WriteLine("SharpIM Server initialized on TCP Port {0:d}", port);
                Console.WriteLine("Waiting for connections...");
                Console.WriteLine();

                while (true)
                {
                    Thread.Sleep(1024);
                }
            }
        }
Exemplo n.º 2
0
 public static void Initialize(Database database)
 {
     m_database = database;
 }