コード例 #1
0
ファイル: Application.cs プロジェクト: habb0/RevEmu
        private static void Initialize()
        {
            Console.Title = "Initializing Revolution Emulator....";
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(
             @"
             ______              _______
            (_____ \            (_______)
             _____) )_____ _   _ _____   ____  _   _
            |  __  /| ___ | | | |  ___) |    \| | | |
            | |  \ \| ____|\ V /| |_____| | | | |_| |
            |_|   |_|_____) \_/ |_______)_|_|_|____/
            Written by Zak & Adil, with contributions from
            Matty13, Quackster, Joopie, and DevBest.
            Licensed under the Ms-Pl. Copyright <C> 2012.
            NO WARRANTY IS GUARANTEED WITH USE OF THIS PROGRAM.");
            Console.WriteLine(@"");
            Console.ResetColor();

            var time = new Stopwatch();

            Process ram = Process.GetCurrentProcess();

            Console.WriteLine("Loading Information for " + ram.ProcessName);

            var sb = new MySqlConnectionStringBuilder
                         {
                             Server = "localhost",
                             Port = 3306,
                             UserID = "root",
                             Password = "******",
                             Database = "revdb",
                             MinimumPoolSize = 5,
                             MaximumPoolSize = 10
                         };

            string ConnectionString = String.Format(
                "@Server={0}; Port={1}; Uid={2}; Password={3}; Database={4}; MinimumPoolSize={5}; MaximumPoolSize={6}",
                "localhost",3306,"root","adil123","revdb","5","10");

            Console.WriteLine(string.Format("Retrived MySql Details within <{0} ms> ", time.ElapsedMilliseconds));

            time.Start();

               // DbManager = new NHibernateManager(ConnectionString);

            Console.WriteLine(string.Format("Started up NHibernate Engine, with MySql Details within <{0} seconds>",
                                            time.Elapsed.Seconds));

            time.Stop();

            Console.WriteLine("");

            MessageHandler.Initialize();
            Revolution.Application.ScriptEngine.Manager manager = new ScriptEngine.Manager();
            manager.Init();
            manager.Start();

            Console.Title = "Revolution Emulator";

            settings.MaxConnections = 1024;
            settings.Endpoint = new IPEndPoint(IPAddress.Any, 91);
            settings.Backlog = 2;
            settings.MaxSimultaneousAcceptOps = 512;
            settings.NumOfSaeaForRec = 24;
            settings.NumOfSaeaForSend = 24;

            Server = new ServerSocket(settings);

            Server.Init();
            Server.StartListen();
            Console.WriteLine("Server now running.");
            Console.WriteLine("${0}@Revolution~>", System.Environment.UserName);
            Console.Read();
        }
コード例 #2
0
ファイル: Application.cs プロジェクト: habb0/RevEmu
        private static void Initialize()
        {
            Console.Title           = "Initializing Revolution Emulator....";
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(
                @"
             ______              _______                  
            (_____ \            (_______)                 
             _____) )_____ _   _ _____   ____  _   _      
            |  __  /| ___ | | | |  ___) |    \| | | |     
            | |  \ \| ____|\ V /| |_____| | | | |_| |    
            |_|   |_|_____) \_/ |_______)_|_|_|____/ 
            Written by Zak & Adil, with contributions from 
            Matty13, Quackster, Joopie, and DevBest.
            Licensed under the Ms-Pl. Copyright <C> 2012.
            NO WARRANTY IS GUARANTEED WITH USE OF THIS PROGRAM.");
            Console.WriteLine(@"");
            Console.ResetColor();

            var time = new Stopwatch();

            Process ram = Process.GetCurrentProcess();

            Console.WriteLine("Loading Information for " + ram.ProcessName);

            var sb = new MySqlConnectionStringBuilder
            {
                Server          = "localhost",
                Port            = 3306,
                UserID          = "root",
                Password        = "******",
                Database        = "revdb",
                MinimumPoolSize = 5,
                MaximumPoolSize = 10
            };

            string ConnectionString = String.Format(
                "@Server={0}; Port={1}; Uid={2}; Password={3}; Database={4}; MinimumPoolSize={5}; MaximumPoolSize={6}",
                "localhost", 3306, "root", "adil123", "revdb", "5", "10");

            Console.WriteLine(string.Format("Retrived MySql Details within <{0} ms> ", time.ElapsedMilliseconds));

            time.Start();

            // DbManager = new NHibernateManager(ConnectionString);


            Console.WriteLine(string.Format("Started up NHibernate Engine, with MySql Details within <{0} seconds>",
                                            time.Elapsed.Seconds));

            time.Stop();

            Console.WriteLine("");

            MessageHandler.Initialize();
            Revolution.Application.ScriptEngine.Manager manager = new ScriptEngine.Manager();
            manager.Init();
            manager.Start();

            Console.Title = "Revolution Emulator";


            settings.MaxConnections           = 1024;
            settings.Endpoint                 = new IPEndPoint(IPAddress.Any, 91);
            settings.Backlog                  = 2;
            settings.MaxSimultaneousAcceptOps = 512;
            settings.NumOfSaeaForRec          = 24;
            settings.NumOfSaeaForSend         = 24;

            Server = new ServerSocket(settings);


            Server.Init();
            Server.StartListen();
            Console.WriteLine("Server now running.");
            Console.WriteLine("${0}@Revolution~>", System.Environment.UserName);
            Console.Read();
        }