static void Main(string[] args)
        {
            Ini    ini;
            string sqlConnect  = @"Data Source=(local)\SQLEXPRESS;Initial Catalog=silk;Integrated Security=True;MultipleActiveResultSets=True;";
            string sIpIPC      = "";
            string sIpServer   = "";
            ushort iPortIPC    = 15780;
            ushort iPortServer = 15780;
            ushort iPortCmd    = 10101;

            if (File.Exists("./Settings/Settings.ini"))
            {
                //Load our ini file
                ini = new Ini(Environment.CurrentDirectory + @"\Settings\Settings.ini");
                //Read line below given value.
                sqlConnect = ini.GetValue("Database", "connectionstring", @"Data Source=(local)\SQLEXPRESS;Initial Catalog=silk;Integrated Security=True;MultipleActiveResultSets=True;").ToString();
                //Load our rates.
                Helpers.Settings.Rate.Gold         = Convert.ToByte(ini.GetValue("Rates", "Goldrate", 1));
                Helpers.Settings.Rate.Item         = Convert.ToByte(ini.GetValue("Rates", "Droprate", 1));
                Helpers.Settings.Rate.Experience   = Convert.ToByte(ini.GetValue("Rates", "XPrate", 1));
                Helpers.Settings.Rate.SkillPoint   = Convert.ToByte(ini.GetValue("Rates", "SPrate", 1));
                Helpers.Settings.Rate.ItemSox      = Convert.ToByte(ini.GetValue("Rates", "Sealrate", 1));
                Helpers.Settings.Rate.Elixir       = Convert.ToByte(ini.GetValue("Rates", "Elixirsrate", 1));
                Helpers.Settings.Rate.Alchemy      = Convert.ToByte(ini.GetValue("Rates", "Alchemyrate", 1));
                Helpers.Settings.Rate.ETC          = Convert.ToByte(ini.GetValue("Rates", "ETCrate", 1));
                Helpers.Settings.Rate.MonsterSpawn = Convert.ToByte(ini.GetValue("Rates", "Spawnrate", 1));
                iPortIPC    = Convert.ToUInt16(ini.GetValue("IPC", "port", 15780));
                sIpIPC      = ini.GetValue("IPC", "ip", "");
                iPortServer = Convert.ToUInt16(ini.GetValue("Server", "port", 15780));
                sIpServer   = ini.GetValue("Server", "ip", "");
                iPortCmd    = Convert.ToUInt16(ini.GetValue("CMD", "port", 10101));
                Helpers.Manager.maxSlots = Convert.ToInt32(ini.GetValue("Server", "MaxSlots", 100));
            }
            else
            {
                Log.Exception("Settings Error");
            }
            DB.Connection(sqlConnect);
            // create servers
            try
            {
                net = new Server();

                net.OnConnect += new Server.dConnect(_OnClientConnect);

                Helpers.Manager.ServerStartedTime = DateTime.Now;

                SRClient.OnReceiveData += new SRClient.dReceive(_OnReceiveData);
                SRClient.OnDisconnect  += new SRClient.dDisconnect(_OnClientDisconnect);

                #region IPC Server StartUp
                Helpers.Manager.IPC            = new Servers.IPCServer();
                Helpers.Manager.IPC.OnReceive += new Servers.IPCServer.dOnReceive(_OnIPC);
                Helpers.Settings.LoadServers("LoginServers.ini", 15779);
                #endregion
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
            }


            #region Check Directories
            string cur_path = Environment.CurrentDirectory + @"\PlayerData\";
            Directory.CreateDirectory(cur_path + "HotKey");
            Directory.CreateDirectory(cur_path + "AutoPotion");
            Directory.CreateDirectory(cur_path + "Log");
            cur_path = null;
            #endregion
            FileDB.Load();
            //Update serverlist info
            Helpers.Manager.clients.update += new EventHandler(Brain.ServerMgr.UpdateServerInfo);
            Helpers.Manager.IPC.Start(sIpIPC, iPortIPC);
            net.Start(sIpServer, iPortServer);
            Brain.ServerMgr.UpdateServerInfo();
            // main loop
            lastPromote = DateTime.Now;
            Console.ReadLine();
            Brain.ServerMgr.UpdateServerInfo(0);
        }