Add the ability to disable matchmaking in configuration

This commit is contained in:
sudokoko 2024-03-17 18:51:43 -04:00
parent b4d67d4016
commit 5035dbb63d
No known key found for this signature in database
GPG key ID: 248D68C664937395
3 changed files with 12 additions and 1 deletions

View file

@ -1,5 +1,6 @@
#nullable enable
using System.Text.Json;
using LBPUnion.ProjectLighthouse.Configuration;
using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Extensions;
using LBPUnion.ProjectLighthouse.Helpers;
@ -42,6 +43,9 @@ public class MatchController : ControllerBase
UserEntity? user = await this.database.UserFromGameToken(token);
if (user == null) return this.Forbid();
// Do not allow matchmaking if it has been disabled
if (!ServerConfiguration.Instance.Matchmaking.MatchmakingEnabled) return this.Forbid();
#region Parse match data
// Example POST /match: [UpdateMyPlayerData,["Player":"FireGamer9872"]]