Skip to content

Commit 5aecefb

Browse files
authored
Merge pull request #154 from TheNexusAvenger/enhancement/auth-port-setting
Add Authorization Port Configuration
2 parents 2af347f + 0633c19 commit 5aecefb

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Uchu.Core/Config/UchuConfiguration.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ public class Networking
158158
/// </summary>
159159
[XmlElement] public string Hostname { get; set; } = "";
160160

161+
/// <summary>
162+
/// The port to run the authentication server at
163+
/// </summary>
164+
[XmlElement] public int AuthenticationPort { get; set; } = 21836;
165+
161166
/// <summary>
162167
/// The port to run the character server at
163168
/// </summary>

Uchu.Core/Handlers/General/GeneralHandler.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ public void Handshake(HandshakePacket packet, IRakConnection connection)
1717
{
1818
Logger.Warning($"Handshake attempted with client of Game version: {packet.GameVersion}");
1919
}
20-
21-
// TODO: Use resource / setting
22-
const int port = 21836;
2320

2421
connection.Send(new HandshakePacket
2522
{
26-
ConnectionType = UchuServer.Port == port ? 0x01u : 0x04u,
23+
ConnectionType = UchuServer.Port == UchuServer.Config.Networking.AuthenticationPort ? 0x01u : 0x04u,
2724
Address = UchuServer.Host
2825
});
2926
}

Uchu.Master/MasterServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private static async Task StartDefaultInstances()
163163

164164
if (hostAuthentication)
165165
{
166-
await StartInstanceAsync(ServerType.Authentication, 21836);
166+
await StartInstanceAsync(ServerType.Authentication, Config.Networking.AuthenticationPort);
167167
}
168168

169169
if (hostCharacter)

0 commit comments

Comments
 (0)