kasino shop updated all chat message id to uuid (#95)

* Update KasinoMines.cs

* Update SlotsCommand.cs

* Update MinesCommand.cs

* Update PlinkoCommand.cs

* Update PlinkoCommand.cs

* Update PlinkoCommand.cs

* Update PlanesCommand.cs

* Update LimboCommand.cs

* Update KenoCommand.cs

* Update KasinoUserCommands.cs

* Update KasinoRain.cs

* Create KasinoShop.cs

* Create ShopCommands.cs

* Update BotServices.cs

* Update MoneyDbModels.cs
This commit is contained in:
alogindtractor
2026-03-14 15:09:48 -07:00
committed by GitHub
parent af7b5e027b
commit 377603ca35
13 changed files with 3624 additions and 16 deletions

View File

@@ -41,6 +41,7 @@ public class BotServices
private ShuffleDotUs? _shuffleDotUs;
private YouTubePubSub? _youTubePubSub;
public KasinoRain? KasinoRain;
public KasinoShop? KasinoShop;
private Task? _websocketWatchdog;
private Task? _howlggGetUserTimer;
@@ -93,7 +94,8 @@ public class BotServices
BuildOwncastLiveStatusCheck(),
BuildShuffleDotUs(),
BuildYouTubePubSub(),
BuildKasinoRain()
BuildKasinoRain(),
BuildKasinoShop()
];
try
{
@@ -115,6 +117,12 @@ public class BotServices
_logger.Debug("Building the Kasino Rain thingy");
KasinoRain = new KasinoRain(_chatBot, _cancellationToken);
}
private async Task BuildKasinoShop()
{
_logger.Debug("Building the kasino shop");
KasinoShop = new KasinoShop(_chatBot);
}
private async Task BuildShuffle()
{

View File

@@ -6,6 +6,7 @@ using KfChatDotNetBot.Settings;
using NLog;
using StackExchange.Redis;
using System.Text.Json.Serialization;
using KfChatDotNetBot.Commands.Kasino;
namespace KfChatDotNetBot.Services;
@@ -340,8 +341,9 @@ public class KasinoMines
await RemoveGame(game.Creator.Id);
}
public async Task<bool> Bet(int gamblerId, int count, SentMessageTrackerModel msg, bool cashOut) //returns false if you hit a bomb, true if you didn't
public async Task<bool> Bet(GamblerDbModel gambler, int count, SentMessageTrackerModel msg, bool cashOut) //returns false if you hit a bomb, true if you didn't
{
int gamblerId = gambler.Id;
await GetSavedGames(gamblerId);
var game = ActiveGames[gamblerId];
game.LastInteracted = DateTimeOffset.UtcNow;
@@ -396,12 +398,19 @@ public class KasinoMines
validBets.RemoveAt(rand);
}
return await Bet(gamblerId, betCoords, msg, cashOut, true);
return await Bet(gambler, betCoords, msg, cashOut, true);
}
public async Task<bool> Bet(int gamblerId, List<(int r, int c)> coords, SentMessageTrackerModel msg, bool cashOut, bool calledFromBet = false)
public async Task<bool> Bet(GamblerDbModel gambler, List<(int r, int c)> coords, SentMessageTrackerModel msg, bool cashOut, bool calledFromBet = false)
{
//KasinoShop stuff -------------------------------------------------------------------------
if (_kfChatBot.BotServices.KasinoShop != null)
{
await GlobalShopFunctions.CheckProfile(_kfChatBot, gambler.User, gambler);
HOUSE_EDGE += _kfChatBot.BotServices.KasinoShop.Gambler_Profiles[gambler.User.KfId].HouseEdgeModifier;
}
//------------------------------------------------------------------------------------------
int gamblerId = gambler.Id;
await GetSavedGames(gamblerId);
var game = ActiveGames[gamblerId];
game.LastInteracted = DateTimeOffset.UtcNow;

View File

@@ -1,4 +1,5 @@
using System.Text.Json;
using KfChatDotNetBot.Commands.Kasino;
using KfChatDotNetBot.Extensions;
using KfChatDotNetBot.Models.DbModels;
using KfChatDotNetBot.Settings;
@@ -119,6 +120,16 @@ public class KasinoRain : IDisposable
participantNames.Add(gambler.User.FormatUsername());
await Money.ModifyBalanceAsync(gambler.Id, payout, TransactionSourceEventType.Rain,
"Payout from rain event", creator.Id, _ct);
//KasinoShop stuff -------------------------------------------------------------------------
if (_kfChatBot.BotServices.KasinoShop != null)
{
await GlobalShopFunctions.CheckProfile(_kfChatBot, gambler.User, gambler);
await using var db = new ApplicationDbContext();
var creatorGambler = await db.Gamblers.FirstOrDefaultAsync(x => x.Id == creator.Id, _ct);
await _kfChatBot.BotServices.KasinoShop.ProcessJuicerOrRainTracking(creatorGambler!, gambler,
payout);
}
//-----------------------------------------------------------------------------------------
}
await Money.ModifyBalanceAsync(creator.Id, -rain.RainAmount + failedPayoutAmount, TransactionSourceEventType.Rain,

File diff suppressed because it is too large Load Diff