Added new mechanic gift on profile create

This commit is contained in:
Chomp
2025-01-19 19:36:49 +00:00
parent e688f4d2f6
commit 35518f0eef
3 changed files with 42 additions and 1 deletions
@@ -129,6 +129,7 @@ public class GameController(
if (pmcProfile.Inventory is not null)
{
SendPraporGiftsToNewProfiles(pmcProfile);
SendMechanicGiftsToNewProfile(pmcProfile);
_profileFixerService.CheckForOrphanedModdedItems(sessionId, fullProfile);
}
@@ -457,6 +458,15 @@ public class GameController(
}
}
/**
* Mechanic sends players a measuring tape on profile start for some reason
* @param pmcProfile Player profile
*/
protected void SendMechanicGiftsToNewProfile(PmcData pmcProfile)
{
_giftService.SendGiftWithSilentReceivedCheck("MechanicGiftDay1", pmcProfile.SessionId, 1);
}
/// <summary>
/// Get a list of installed mods and save their details to the profile being used
/// </summary>
+14 -1
View File
@@ -238,11 +238,24 @@ public class GiftService(
if (giftId is not null)
{
//var giftData = GetGiftById(giftId);
if (!_profileHelper.PlayerHasRecievedMaxNumberOfGift(sessionId, giftId, 1))
{
SendGiftToPlayer(sessionId, giftId);
}
}
}
/**
* Send player a gift with silent received check
* @param giftId Id of gift to send
* @param sessionId Session id of player to send to
* @param giftCount OPTIONAL How many to send
*/
public void SendGiftWithSilentReceivedCheck(string giftId, string? sessionId, int giftCount)
{
if (!_profileHelper.PlayerHasRecievedMaxNumberOfGift(sessionId, giftId, giftCount))
{
SendGiftToPlayer(sessionId, giftId);
}
}
}