Add Challenges Support to LBP3 (#941)

* Adds Challenges and Promotions (No resources included for Promotions)

* Adds Challenges and Promotions (No resources included for Promotions)

* Adds Challenges and Promotions (No resources included for Promotions)

* Created GameChallenge Class.

Co-authored-by: koko <koko@sudokoko.xyz>

* Add serialization logic and official server challenge config

* Fix schema and simplify things

* Renammed some classes

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Types/Serialization/GameChallenge.cs

Co-authored-by: Josh <josh@slendy.pw>

* Fixed a simple coding error

* Update ProjectLighthouse.Servers.GameServer/Controllers/Login/ClientConfigurationController.cs

Co-authored-by: Zaprit <henry@vorax.org>

---------

Co-authored-by: koko <koko@sudokoko.xyz>
Co-authored-by: Josh <josh@slendy.pw>
Co-authored-by: Zaprit <henry@vorax.org>
This commit is contained in:
W0lf4llo 2023-11-05 11:49:16 -05:00 committed by GitHub
commit e593d5c957
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 289 additions and 3 deletions

View file

@ -43,9 +43,11 @@ public class ClientConfigurationController : ControllerBase
[Produces("text/xml")]
public IActionResult Conf() => this.Ok(new TelemetryConfigResponse());
// The challenge config here is currently based on the official server's config.
// We should probably make this configurable in the future.
[HttpGet("ChallengeConfig.xml")]
[Produces("text/xml")]
public IActionResult Challenges() => this.Ok();
public IActionResult Challenges() => this.Ok(GameChallengeResponse.ServerChallenges());
[HttpGet("farc_hashes")]
public IActionResult FarcHashes() => this.Ok();
@ -75,12 +77,12 @@ public class ClientConfigurationController : ControllerBase
PrivacySettings? settings = await this.DeserializeBody<PrivacySettings>();
if (settings == null) return this.BadRequest();
if (settings.LevelVisibility != null)
{
PrivacyType? type = PrivacyTypeExtensions.FromSerializedString(settings.LevelVisibility);
if (type == null) return this.BadRequest();
user.LevelVisibility = (PrivacyType)type;
}