Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Starting Minecraft Classic server on port 25565");
            server                 = new ClassicServer();
            server.MaxPlayers      = 25;
            server.MessageOfTheDay = "Welcome to the Classic6 test server!";
            server.ServerName      = "Classic6 Test Server";
            server.Start(25565);

            string url    = server.ServerUrl.ToString();
            bool   hasSet = false;

            while (true)
            {
                if (url != "" && !hasSet)
                {
                    Clipboard.SetText(server.ServerUrl.ToString());
                    hasSet = true;
                }
            }
        }
        /// <summary>
        /// Starts MCForge
        /// </summary>
        public static void Start()
        {
            Logger.OnRecieveLog += OnLog;


            //TODO init all the things
            Logger.Init();
            ServerSettings.Init();
            FileUtils.Init();
            Manager.Init();
            ClassicServer = new ClassicServer();
            McServer      = new MinecraftClassicServer();



            Logger.Log("Starting MCForge");

            McServer.MaxPlayers = ServerSettings.GetSettingInt("MaxPlayers");
            McServer.MotD       = ServerSettings.GetSetting("MOTD");
            McServer.Name       = ServerSettings.GetSetting("ServerName");
            McServer.Port       = ServerSettings.GetSettingInt("Port");
            McServer.Private    = !ServerSettings.GetSettingBoolean("Public");

            Logger.Log(ClassicServer.Start(McServer));
            Console.WriteLine("Testing event system..");
            System.IO.File.WriteAllLines("url.txt", new[] { ClassicServer.ServerUrl });
            if (ServerSettings.GetSettingBoolean("UsingConsole"))
            {
                Logger.OnRecieveLog -= OnLog;
                MCForgeConsole.Start();
            }
            else
            {
                //new gui stuff
            }
        }