-
-
Notifications
You must be signed in to change notification settings - Fork 138
[WIP] Support --quickPlayMultiplayer option for the instance with server #1020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: ci010 <[email protected]>
Co-authored-by: ci010 <[email protected]>
…enerate from server property Co-authored-by: ci010 <[email protected]>
xmcl-runtime-api/src/util/launch.ts
Outdated
side, | ||
resolution: inst.resolution ?? globalResolution, | ||
server: inst.server ?? undefined, | ||
quickPlayMultiplayer: inst.server ? `${inst.server.host}${inst.server.port ? `:${inst.server.port}` : ''}` : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this logic to LaunchServer.ts. You don't need to add an extra prop to here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Moved the quickPlayMultiplayer logic from launch utility to LaunchService.ts where the server handling is processed. The logic now generates quickPlayMultiplayer from the server property when not explicitly provided, and handles direct quickPlayMultiplayer options. (21430c4)
Co-authored-by: ci010 <[email protected]>
minMemory, | ||
maxMemory, | ||
version, | ||
server: options.server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored the server options in the launch options object. (85a3663)
* Quick play multiplayer server for Minecraft 1.20+ | ||
* Format: "server:port" or just "server" for default port 25565 | ||
*/ | ||
quickPlayMultiplayer?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed quickPlayMultiplayer property from the LaunchService interface. (85a3663)
xmcl-runtime/launch/LaunchService.ts
Outdated
|
||
// Handle direct quickPlayMultiplayer option | ||
if (options.quickPlayMultiplayer) { | ||
launchOptions.quickPlayMultiplayer = options.quickPlayMultiplayer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use options.server to generate, like
if (options.server) launchOptions.quickPlayMultiplayer = `${options.server.host}${options.server.port ? `:${options.server.port}` : ''}`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the logic to use options.server to generate quickPlayMultiplayer as suggested. (85a3663)
… from interface, use options.server to generate Co-authored-by: ci010 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build is failed. You need to update the xmcl submodule to its latest master branch to make the build pass.
Co-authored-by: ci010 <[email protected]>
Updated the xmcl submodule to the latest master branch (from 461a5d9 to f1cb1d5). The TypeScript compilation now passes successfully with Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Implementing support for --quickPlayMultiplayer option for instances with server property.
Summary of Changes
Backend Changes:
quickPlayMultiplayer?: string
to runtime-api LaunchService interfacequickPlayMultiplayer?: string
to LaunchOption interface and argument generationquickPlayMultiplayer?: string
to instance configurationgenerateLaunchOptionsWithGlobal
to include quickPlayMultiplayer from instancesFrontend Changes:
Testing:
The implementation follows the exact pattern described in PR #324, allowing both
quickPlayMultiplayer
andserver
options to work together for maximum compatibility. The feature is fully integrated from the UI down to the launch arguments, providing a complete solution for instances that need to use the newer quickPlayMultiplayer option alongside traditional server settings.Fixes #1019.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.