コード例 #1
0
 private void btnStart2_Click(object sender, EventArgs e)
 {
     if (config.MinecraftPath.Length > 0 && config.MinecraftJar.Length > 0 && config.MemorySize > 0)
     {
         MinecraftServer.RemoteConsolePort         = 26665;
         MinecraftServer.UseRandomizedRConPassword = true;
         MinecraftServer.ConfigureServer(config.MinecraftPath, config.MinecraftJar, config.MemorySize);
         if (!MinecraftServer.Start())
         {
             MessageBox.Show(
                 "Some configuration mismatch prevented the server from starting!\n\nPlease check the configuration and try again.",
                 "Unable to start Minecraft server!",
                 MessageBoxButtons.OK,
                 MessageBoxIcon.Exclamation
                 );
         }
     }
 }