mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
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:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
2120
KfChatDotNetBot/Services/KasinoShop.cs
Normal file
2120
KfChatDotNetBot/Services/KasinoShop.cs
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user