Skip to content

Commit

Permalink
Crash client if server mod is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Jul 16, 2024
1 parent 38ff48c commit cc0ed89
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Fika.Core/Utils/FikaModHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using LiteNetLib.Utils;
using Newtonsoft.Json;
using SPT.Common.Http;
using SPT.Custom.Utils;
using System.Collections;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -46,8 +47,14 @@ public void VerifyMods()
string validationJson = RequestHandler.PostJson("/fika/client/check/mods", modValidationRequestJson);
logger.LogDebug(validationJson);

ModValidationResponse validationResult =
JsonConvert.DeserializeObject<ModValidationResponse>(validationJson);
ModValidationResponse validationResult = JsonConvert.DeserializeObject<ModValidationResponse>(validationJson);
if (validationResult.Forbidden == null || validationResult.MissingRequired == null || validationResult.HashMismatch == null)
{
FikaPlugin.Instance.FikaLogger.LogError("FikaModHandler::VerifyMods: Response was invalid!");
MessageBoxHelper.Show($"Failed to verify mods with server.\nMake sure that the server mod is installed!", "FIKA ERROR", MessageBoxHelper.MessageBoxType.OK);
Application.Quit();
return;
}

// If any errors were detected we will print what has happened
bool installationError =
Expand Down

0 comments on commit cc0ed89

Please sign in to comment.