Skip to content

Conversation

@noellie-velez
Copy link
Collaborator

@noellie-velez noellie-velez commented Oct 29, 2025

Purpose of this PR

fix: #3490

Jira ticket

MTTB-1557

Changelog

  • Added: A flag to override command-line arguments (port and ip) in SetConnectionData.
  • Added: A command-line singleton to parse environment command-line arguments.
  • Fixed: Issue where using the dedicated server package would override all attempts to change the port by code.

Documentation

  • Includes new documentation for CommandLineOptions.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done
    • Install the dedicated server package, add script that uses the override parameter and override the port or ip address.

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

If any boxes above are checked the QA team will be automatically added as a PR reviewer.

Backports

No back port required.

Copy link
Collaborator

@EmandM EmandM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 🚀

@EmandM EmandM marked this pull request as ready for review November 4, 2025 16:07
@EmandM EmandM requested review from a team and NoelStephensUnity as code owners November 4, 2025 16:07
…override

# Conflicts:
#	com.unity.netcode.gameobjects/Documentation~/TableOfContents.md
#	com.unity.netcode.gameobjects/Documentation~/configuration.md
@noellie-velez noellie-velez marked this pull request as ready for review November 17, 2025 17:45
noellie-velez and others added 2 commits November 17, 2025 18:46
…com:Unity-Technologies/com.unity.netcode.gameobjects into fix/v2.x/add-flag-dedicated-server-override
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good Noellie!
👍

Convert the string to ushort.
Simplify the ushort conversion using ushort.
Copy link
Contributor

@jabbacakes jabbacakes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content is good, suggestions are mostly for consistency/formatting. Tl;dr:

  • Command-line arguments needs a hyphen, so added that for all instances
  • Headers should be in sentence case (capitalise only the first letter)
  • Removed section breaks, we don't use those in the docs generally
  • Added note formatting so that it'll render in the package docs properly

/// <param name="listenAddress">The address the server is going to listen on.</param>
public void SetConnectionData(string ipv4Address, ushort port, string listenAddress = null)
/// <param name="forceOverrideCommandLineArgs">When true, any command line arguments will be ignored.</param>
public void SetConnectionData(string ipv4Address, ushort port, string listenAddress = null, bool forceOverrideCommandLineArgs = false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. Example: Precompiled assemblies will fail when querying the old method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forceOverrideCommandLineArgs has a default value so when using SetConnectionData method as before (without the added bool) I guess it should not fail.
That said, there is a failure in the API validation vetting job, is it related @NoelStephensUnity?
image

noellie-velez and others added 11 commits November 18, 2025 11:46
Co-authored-by: Amy Reeve <[email protected]>
Co-authored-by: Amy Reeve <[email protected]>
Titles in sentence case, adding a hyphen to `command-line arguments` and styling

Co-authored-by: Amy Reeve <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dedicated Server package overrides all attemps to change the port by code

6 participants