Inheritance: Craft.Net.Server.RemoteClient
コード例 #1
0
ファイル: Program.cs プロジェクト: Jorch72/CS-PartyCraft
        public static void Main(string[] args)
        {
            CheckEnvironment();
            // TODO: Load certain plugins earlier
            if (PreStartup != null)
            {
                PreStartup(null, null);
            }
            if (SettingsProvider == null)
            {
                // Select a settings provider based on the enviornment
                if (File.Exists("server.properties"))
                {
                    SettingsProvider = new VanillaSettingsProvider("server.properties");
                }
                else
                {
                    // TODO: Create a better settings provider than vanilla
                    SettingsProvider = new VanillaSettingsProvider("server.properties");
                    SetUpDefaultPermissions(SettingsProvider);
                }
            }

            var server = new Server(SettingsProvider);

            LoadPlugins(server);
            Command.LoadCommands(server);
            // TODO
            //var consoleLog = new ConsoleLogWriter(LogImportance.Medium);
            //LogProvider.RegisterProvider(consoleLog);

            server.Start();

            Console.WriteLine("Use /stop to kill the server.");
            ConsoleClient = new ConsoleClient(server.MinecraftServer);
            while (true)
            {
                var command = Console.ReadLine();
                try
                {
                    if (!String.IsNullOrWhiteSpace(command))
                    {
                        Command.ExecuteCommand(server, ConsoleClient, command);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }

            server.Stop();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: SirCmpwn/PartyCraft
        public static void Main(string[] args)
        {
            CheckEnvironment();
            // TODO: Load certain plugins earlier
            if (PreStartup != null)
                PreStartup(null, null);
            if (SettingsProvider == null)
            {
                // Select a settings provider based on the enviornment
                if (File.Exists("server.properties"))
                    SettingsProvider = new VanillaSettingsProvider("server.properties");
                else
                {
                    // TODO: Create a better settings provider than vanilla
                    SettingsProvider = new VanillaSettingsProvider("server.properties");
                    SetUpDefaultPermissions(SettingsProvider);
                }
            }

            var server = new Server(SettingsProvider);
            LoadPlugins(server);
            Command.LoadCommands(server);
            // TODO
            //var consoleLog = new ConsoleLogWriter(LogImportance.Medium);
            //LogProvider.RegisterProvider(consoleLog);

            server.Start();

            Console.WriteLine("Use /stop to kill the server.");
            ConsoleClient = new ConsoleClient(server.MinecraftServer);
            while (true)
            {
                var command = Console.ReadLine();
                try
                {
                    if (!String.IsNullOrWhiteSpace(command))
                        Command.ExecuteCommand(server, ConsoleClient, command);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }

            server.Stop();
        }