Skip to content

Commit

Permalink
Heartbeat should link to AuthService directly instead of having a cop…
Browse files Browse the repository at this point in the history
…y of the salt
  • Loading branch information
UnknownShadow200 committed Jun 8, 2024
1 parent 012fa57 commit 01fb28e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MCGalaxy/Network/Heartbeat/ClassiCube.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public sealed class ClassiCubeBeat : Heartbeat
"&name=" + Uri.EscapeDataString(name) +
"&public=" + Server.Config.Public +
"&version=7" +
"&salt=" + Salt +
"&salt=" + Auth.Salt +
"&users=" + PlayerInfo.NonHiddenUniqueIPCount() +
"&software=" + Uri.EscapeDataString(Server.SoftwareNameVersioned) +
"&web=" + Server.Config.WebClient;
Expand Down
7 changes: 4 additions & 3 deletions MCGalaxy/Network/Heartbeat/Heartbeat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public abstract class Heartbeat

/// <summary> The URL this heartbeat is sent to </summary
public string URL;
/// <summary> Salt used for verifying player names </summary>
public string Salt = "";
/// <summary> Authentication service potentially associated with the heartbeat </summary>
/// <example> ClassiCube beats use the Salt of the service for name authentication </example>
public AuthService Auth;

public string GetHost() {
try {
Expand Down Expand Up @@ -130,7 +131,7 @@ public abstract class Heartbeat
AuthService service = AuthService.GetOrCreate(url);

Heartbeat beat = new ClassiCubeBeat() { URL = url };
beat.Salt = service.Salt; // TODO: Just reference Service instead of copying salt?
beat.Auth = service;
Register(beat);
}
}
Expand Down

0 comments on commit 01fb28e

Please sign in to comment.