示例#1
0
 /// <summary>
 ///     Starts this instance.
 /// </summary>
 public void Start()
 {
     Log.Info("Starting RaNET as user " + Environment.UserName);
     _server = new MiNetServer();
     //_server.LevelManager = new SpreadLevelManager(Environment.ProcessorCount * 4);
     _server.StartServer();
 }
示例#2
0
        /// <summary>
        ///     The programs entry point.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void Main(string[] args)
        {
            XmlConfigurator.Configure();

            NodeNetworkHandler.FastThreadPool = new DedicatedThreadPool(new DedicatedThreadPoolSettings(Environment.ProcessorCount));

            var server = new MiNetServer();

            int threads;
            int iothreads;

            ThreadPool.GetMinThreads(out threads, out iothreads);
            ThreadPool.SetMinThreads(4000, iothreads);

            var localServerManager = new NodeServerManager(server, 51234);

            server.ServerManager = localServerManager;
            server.ServerRole    = ServerRole.Node;
            server.LevelManager  = new SpreadLevelManager(60);

            server.StartServer();

            Console.WriteLine("MiNET running...");
            Console.ReadLine();
        }
示例#3
0
        static void Main(string[] args)
        {
            var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "log4net.xml")));

            Log.Info(MiNetServer.MiNET);
            System.Console.WriteLine(MiNetServer.MiNET);

            var currentProcess = Process.GetCurrentProcess();

            currentProcess.ProcessorAffinity = (IntPtr)Config.GetProperty("ProcessorAffinity", (int)currentProcess.ProcessorAffinity);

            var service = new MiNetServer();

            Log.Info("Starting...");

            if (Config.GetProperty("UserBedrockGenerator", false))
            {
                service.LevelManager           = new LevelManager();
                service.LevelManager.Generator = new BedrockGenerator();
            }

            service.StartServer();

            System.Console.WriteLine("MiNET running. Press <enter> to stop service.");
            System.Console.ReadLine();
            service.StopServer();
        }
示例#4
0
 /// <summary>
 ///     Starts this instance.
 /// </summary>
 private void Start()
 {
     Log.Info("Starting MiNET");
     _server = new MiNetServer();
     //_server.LevelManager = new SpreadLevelManager(Environment.ProcessorCount * 4);
     _server.StartServer();
 }
示例#5
0
        /// <summary>
        ///     Starts this instance.
        /// </summary>
        private void Start()
        {
            var assembly = Assembly.GetExecutingAssembly().GetName().CodeBase;

            //string rawPath = Path.GetDirectoryName(assembly);
            Log.Info(assembly);

            Log.Info("Starting MiNET as user " + Environment.UserName);
            _server = new MiNetServer();
            //_server.LevelManager = new SpreadLevelManager(Environment.ProcessorCount * 4);
            _server.StartServer();
        }
示例#6
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Starting MiNET Server...");

            MiNetServer server = new MiNetServer();

            server.StartServer();

            Console.WriteLine("MiNET Server started! Press <Enter> to exit");
            Console.ReadLine();
            Console.WriteLine("Stopping MiNET Server...");

            server.StopServer();
        }
示例#7
0
文件: Startup.cs 项目: sccGg/MiNET
        static void Main(string[] args)
        {
            if (args.Length > 0 && args[0] == "listener")
            {
                // This is a brutal hack to block BDS to use the ports we are using. So we start this, and basically block BDS
                // while it is starting. Then we close down this process again, and continue on our way.
                var reset = new ManualResetEvent(false);
                using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
                      {
                          ExclusiveAddressUse = true
                      };
                socket.Bind(new IPEndPoint(IPAddress.Any, 19132));
                System.Console.WriteLine("LISTENING!");
                reset.WaitOne();
                System.Console.WriteLine("EXIT!");
                return;
            }

            var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "log4net.xml")));

            Log.Info(MiNetServer.MiNET);
            System.Console.WriteLine(MiNetServer.MiNET);

            var currentProcess = Process.GetCurrentProcess();

            currentProcess.ProcessorAffinity = (IntPtr)Config.GetProperty("ProcessorAffinity", (int)currentProcess.ProcessorAffinity);

            var service = new MiNetServer();

            Log.Info("Starting...");

            if (Config.GetProperty("UserBedrockGenerator", false))
            {
                service.LevelManager           = new LevelManager();
                service.LevelManager.Generator = new BedrockGenerator();
            }

            service.StartServer();

            System.Console.WriteLine("MiNET running. Press <enter> to stop service.");
            System.Console.ReadLine();
            service.StopServer();
        }
示例#8
0
        static void Main(string[] args)
        {
            var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo("log4net.xml"));

            System.Console.WriteLine(MiNetServer.MiNET);
            Log.Info(MiNetServer.MiNET);

            var service = new MiNetServer();

            Log.Info("Starting...");
            service.StartServer();

            System.Console.WriteLine("MiNET running. Press <enter> to stop service.");
            System.Console.ReadLine();
            service.StopServer();
        }
示例#9
0
        static void Main(string[] args)
        {
            var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo("log4net.xml"));

            int threads;
            int portThreads;

            ThreadPool.GetMinThreads(out threads, out portThreads);
            Log.Info($"Threads: {threads}, Port Threads: {portThreads}");

            var service = new MiNetServer();

            Log.Info("Starting MiNET");
            service.StartServer();

            System.Console.WriteLine("MiNET running. Press <enter> to stop service.");
            System.Console.ReadLine();
            service.StopServer();
        }
示例#10
0
 public void StartServer()
 {
     _server.StartServer();
 }
示例#11
0
 /// <summary>
 ///     Starts this instance.
 /// </summary>
 private void Start()
 {
     Log.Info("Starting MiNET");
     _server = new MiNetServer();
     _server.StartServer();
 }
示例#12
0
 /// <summary>
 ///     Starts this instance.
 /// </summary>
 private void Start()
 {
     Log.Info("Starting MiNET");
     _server = new MiNetServer();
     _server.StartServer();
 }