Skip to content

Add Authorization Port Configuration #154

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

Merged
merged 2 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Uchu.Core/Config/UchuConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ public class Networking
/// </summary>
[XmlElement] public string Hostname { get; set; } = "";

/// <summary>
/// The port to run the authentication server at
/// </summary>
[XmlElement] public int AuthenticationPort { get; set; } = 21836;

/// <summary>
/// The port to run the character server at
/// </summary>
Expand Down
5 changes: 1 addition & 4 deletions Uchu.Core/Handlers/General/GeneralHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ public void Handshake(HandshakePacket packet, IRakConnection connection)
{
Logger.Warning($"Handshake attempted with client of Game version: {packet.GameVersion}");
}

// TODO: Use resource / setting
const int port = 21836;

connection.Send(new HandshakePacket
{
ConnectionType = UchuServer.Port == port ? 0x01u : 0x04u,
ConnectionType = UchuServer.Port == UchuServer.Config.Networking.AuthenticationPort ? 0x01u : 0x04u,
Address = UchuServer.Host
});
}
Expand Down
2 changes: 1 addition & 1 deletion Uchu.Master/MasterServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private static async Task StartDefaultInstances()

if (hostAuthentication)
{
await StartInstanceAsync(ServerType.Authentication, 21836);
await StartInstanceAsync(ServerType.Authentication, Config.Networking.AuthenticationPort);
}

if (hostCharacter)
Expand Down