Heartbeat should link to AuthService directly instead of having a copy of the salt

This commit is contained in:
UnknownShadow200 2024-06-09 09:54:04 +10:00
parent 012fa57346
commit 01fb28e998
2 changed files with 5 additions and 4 deletions

View File

@ -60,7 +60,7 @@ namespace MCGalaxy.Network
"&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;

View File

@ -38,8 +38,9 @@ namespace MCGalaxy.Network
/// <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 {
@ -130,7 +131,7 @@ namespace MCGalaxy.Network
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);
}
}