Added new mechanic gift on profile create
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user