Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@Marc477

Description

@Marc477
Issue body actions

In Unity 6 (and probably other versions)

When you have the Dedicated Server package (com.unity.dedicated-server) in your project, it's impossible to set the port by code.

transport.SetConnectionData(listen_address, port);

Will not work on the server. (I call this from inside a Start function, not awake)

I think this is wrong as scripts should have the "final word".

The Dedicated Server package (and the -port command line) should override Prefab/Inspector settings, but it should not override scripts if you have custom logic to determine the port and want to use Dedicated Server package for other things than determining the port.

In my opinion the priority for determining port should be
1 Scripts
2 -port command line
3 inspector settings

If a project wants to use the -port command, they will not set it by script, there is no reason to. But if a project wants to set it by script, its not possible right now if you need the dedicated server package for something else.

I have not tested it but it should be the same logic for the target framerate if you set it by code with Application.targetFrameRate it should have final authority.

At minimum the dedicated server package should have option to disable each CLI argument individually and they should all be unset by default, as this causes a lot of confusion why the scripts aren't working and those param aren't easy to find. It's a big problem right now for myTcg Engine asset on the unity store as it doesn't use this package but it gets added automatically for some users and they have no idea why the script to set port aren't working.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumThis issue has medium priority and may take some time to be resolvedThis issue has medium priority and may take some time to be resolvedstat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Reporttype:supportQuestions or other supportQuestions or other support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.