From 2709b3054c13ec35b81b714572140ab25351d913 Mon Sep 17 00:00:00 2001 From: cohlexyz <142505474+cohlexyz@users.noreply.github.com> Date: Fri, 16 Jan 2026 22:26:00 +0100 Subject: [PATCH] Append unix timestamp to coinflip images to bypass caching (#51) * Append unix timestamp to coinflip image urls to prevent browser cache from spoiling the result * Extend result delay a bit --- KfChatDotNetBot/Commands/Kasino/CoinflipCommand.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/KfChatDotNetBot/Commands/Kasino/CoinflipCommand.cs b/KfChatDotNetBot/Commands/Kasino/CoinflipCommand.cs index 2ef95a0..be59c5b 100644 --- a/KfChatDotNetBot/Commands/Kasino/CoinflipCommand.cs +++ b/KfChatDotNetBot/Commands/Kasino/CoinflipCommand.cs @@ -103,7 +103,7 @@ public class CoinflipCommand : ICommand var coinflipAnimation = GetCoinFlipAnimationUrl(choiceStr); await botInstance.SendChatMessageAsync($"[IMG]{coinflipAnimation}[/IMG]", true, autoDeleteAfter: cleanupDelay); - await Task.Delay(1200, ctx); + await Task.Delay(1500, ctx); var effect = wager; newBalance = await Money.NewWagerAsync(gambler.Id, wager, effect, WagerGame.CoinFlip, ct: ctx); @@ -119,7 +119,7 @@ public class CoinflipCommand : ICommand var coinflipAnimationURL = GetCoinFlipAnimationUrl("heads" == choiceStr ? "tails" : "heads", isJacky); await botInstance.SendChatMessageAsync($"[IMG]{coinflipAnimationURL}[/IMG]", true, autoDeleteAfter: cleanupDelay); - await Task.Delay(1200, ctx); + await Task.Delay(1500, ctx); newBalance = await Money.NewWagerAsync(gambler.Id, wager, -wager, WagerGame.CoinFlip, ct: ctx); await botInstance.SendChatMessageAsync( @@ -132,11 +132,12 @@ public class CoinflipCommand : ICommand private static string GetCoinFlipAnimationUrl(string choiceStr, bool isJacky = false) { var baseUrl = "https://i.ddos.lgbt/u"; + var unixTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); if (isJacky) { - return $"{baseUrl}/bossmancoin-{choiceStr}-jacky.webp"; + return $"{baseUrl}/bossmancoin-{choiceStr}-jacky.webp?{unixTime}"; } - return $"{baseUrl}/bossmancoin-{choiceStr}.webp"; + return $"{baseUrl}/bossmancoin-{choiceStr}.webp?{unixTime}"; } } \ No newline at end of file