Skip to content
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

Make network servers configurable #487

Merged
merged 8 commits into from
Mar 15, 2024

Conversation

SadPencil
Copy link
Member

@SadPencil SadPencil commented Oct 3, 2023

Fixes #479 and #489

This PR removes all servers but irc.gamesurge.net --- the rest domains are (almost) duplicated. See #489 for more details.

This PR defines a new configuration file NetworkDefinitions.ini. This file is optional, so if it is missing everything goes well as if this PR were not merged -- except removing all servers but irc.gamesurge.net


The following urls are configurable:

Also, setting a url to empty means do not fetch these resources online. This is meaningful if either:

  • someone publishes a mod only focusing on solo mission
  • a user's Internet connection is partially unstable

Add an option DisableDiscordIntegration to enable Chinese players disabling discord integration even before the first client launch. (DiscordIntegration in UserINISettings defaults to true!)

Allow specifying IRC servers in [IRCServers] section.


Example NetworkDefinitions.ini file:

[Settings]
CnCNetTunnelListURL=http://cncnet.org/master-list
CnCNetPlayerCountURL=http://api.cncnet.org/status
CnCNetMapDBDownloadURL=http://mapdb.cncnet.org
CnCNetMapDBUploadURL=http://mapdb.cncnet.org/upload
DisableDiscordIntegration=False

[IRCServers]
1=irc.gamesurge.net|GameSurge|6667,6660,6666,6668,6669
2=Krypt.CA.US.GameSurge.net|GameSurge Santa Ana, CA|6667,6660,6666,6668,6669

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Nightly build for this pull request:

@SadPencil SadPencil force-pushed the feat-custom-master-list branch from 9188da5 to 8c4f3f4 Compare October 3, 2023 09:15
@SadPencil SadPencil force-pushed the feat-custom-master-list branch from 8c4f3f4 to 7b00124 Compare March 12, 2024 05:55
@SadPencil SadPencil marked this pull request as draft March 12, 2024 06:13
@SadPencil SadPencil force-pushed the feat-custom-master-list branch 3 times, most recently from 94a806e to f67e253 Compare March 12, 2024 07:36
@SadPencil SadPencil changed the title Make CnCNet URLs configurable Make network servers configurable Mar 12, 2024
@SadPencil SadPencil marked this pull request as ready for review March 12, 2024 07:50
@SadPencil SadPencil added this to the 2.11.0.0 milestone Mar 12, 2024
@SadPencil SadPencil force-pushed the feat-custom-master-list branch from f67e253 to 4115094 Compare March 14, 2024 15:47
ClientCore/ClientConfiguration.cs Outdated Show resolved Hide resolved
DXMainClient/Domain/Multiplayer/CnCNet/MapSharer.cs Outdated Show resolved Hide resolved
DXMainClient/Domain/Multiplayer/CnCNet/MapSharer.cs Outdated Show resolved Hide resolved
DXMainClient/Domain/Multiplayer/CnCNet/TunnelHandler.cs Outdated Show resolved Hide resolved
DXMainClient/Online/Connection.cs Show resolved Hide resolved
DXMainClient/Online/Server.cs Outdated Show resolved Hide resolved
DXMainClient/Online/Server.cs Outdated Show resolved Hide resolved
throw new FileNotFoundException($"Couldn't find {CLIENT_DEFS} at {baseResourceDirectory}. Please verify that you're running the client from the correct directory.");

clientDefinitionsIni = new IniFile(clientDefinitionsFile.FullName);

DTACnCNetClient_ini = new IniFile(SafePath.CombineFilePath(ProgramConstants.GetResourcePath(), CLIENT_SETTINGS));

gameOptions_ini = new IniFile(SafePath.CombineFilePath(baseResourceDirectory.FullName, GAME_OPTIONS));

networkDefinitionIni = new IniFile(SafePath.CombineFilePath(ProgramConstants.GetResourcePath(), NETWORK_DEFS));
Copy link
Member

@Metadorius Metadorius Mar 15, 2024

Choose a reason for hiding this comment

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

networkDefinitionsIni, forgot the s for consistency

@Metadorius Metadorius merged commit d3486ad into CnCNet:develop Mar 15, 2024
3 checks passed
@SadPencil SadPencil deleted the feat-custom-master-list branch March 15, 2024 10:04
SadPencil added a commit to SadPencil/xna-cncnet-client that referenced this pull request Oct 4, 2024
* Make network servers configurable

* Remove duplicated IRC servers

* Apply suggestions from code review

Co-authored-by: Kerbiter <crabiter@vivaldi.net>

* Make methods as properties

* Use Invariant culture in Server.Serialize()

* Log when Download URL is not configured

* networkDefinitionIni -> networkDefinitionsIni

---------

Co-authored-by: Kerbiter <crabiter@vivaldi.net>
SadPencil added a commit to SadPencil/xna-cncnet-client that referenced this pull request Oct 4, 2024
* Make network servers configurable

* Remove duplicated IRC servers

* Apply suggestions from code review

Co-authored-by: Kerbiter <crabiter@vivaldi.net>

* Make methods as properties

* Use Invariant culture in Server.Serialize()

* Log when Download URL is not configured

* networkDefinitionIni -> networkDefinitionsIni

---------

Co-authored-by: Kerbiter <crabiter@vivaldi.net>
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.

Make CNCNET_TUNNEL_LIST_URL configurable via configuration file
2 participants