mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Put together a workaround for Clash.gg being such an awful site that mines always reports as a win no matter what
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Humanizer;
|
using System.Text.Json;
|
||||||
|
using Humanizer;
|
||||||
using KfChatDotNetBot.Models;
|
using KfChatDotNetBot.Models;
|
||||||
using KfChatDotNetBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using KfChatDotNetBot.Settings;
|
using KfChatDotNetBot.Settings;
|
||||||
@@ -440,7 +441,7 @@ public class BotServices
|
|||||||
$"[color={payoutColor}]{bet.Payout} {bet.Currency}[/color] ({bet.Multiplier}x) on {bet.GameName} 💰💰", true);
|
$"[color={payoutColor}]{bet.Payout} {bet.Currency}[/color] ({bet.Multiplier}x) on {bet.GameName} 💰💰", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClashggBet(object sender, ClashggBetModel bet)
|
private void OnClashggBet(object sender, ClashggBetModel bet, JsonElement jsonElement)
|
||||||
{
|
{
|
||||||
var settings = Helpers
|
var settings = Helpers
|
||||||
.GetMultipleValues([
|
.GetMultipleValues([
|
||||||
@@ -457,6 +458,21 @@ public class BotServices
|
|||||||
|
|
||||||
var payoutColor = settings[BuiltIn.Keys.KiwiFarmsGreenColor].Value;
|
var payoutColor = settings[BuiltIn.Keys.KiwiFarmsGreenColor].Value;
|
||||||
if (bet.Payout < bet.Bet) payoutColor = settings[BuiltIn.Keys.KiwiFarmsRedColor].Value;
|
if (bet.Payout < bet.Bet) payoutColor = settings[BuiltIn.Keys.KiwiFarmsRedColor].Value;
|
||||||
|
if (bet is { Game: ClashggGame.Mines, Multiplier: <= 1 })
|
||||||
|
{
|
||||||
|
var mineCount = jsonElement.GetProperty("mineCount").GetInt32();
|
||||||
|
_chatBot.SendChatMessage(
|
||||||
|
$"🚨🚨 CLASH.GG BETTING 🚨🚨 austingambles just bet {bet.Bet / 100.0:N2} {bet.Currency.Humanize()} Money on {bet.Game.Humanize()} but instantly lost with {mineCount} mines on the board. RIP 💰💰",
|
||||||
|
true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bet.Game == ClashggGame.Mines)
|
||||||
|
{
|
||||||
|
_chatBot.SendChatMessage($"🚨🚨 CLASH.GG BETTING 🚨🚨 austingambles just bet {bet.Bet / 100.0:N2} {bet.Currency.Humanize()} Money which [b]maybe[/b] paid out " +
|
||||||
|
$"{bet.Payout / 100.0:N2} {bet.Currency.Humanize()} Money ({bet.Multiplier}x) on {bet.Game.Humanize()} 💰💰", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
_chatBot.SendChatMessage($"🚨🚨 CLASH.GG BETTING 🚨🚨 austingambles just bet {bet.Bet / 100.0:N2} {bet.Currency.Humanize()} Money which paid out " +
|
_chatBot.SendChatMessage($"🚨🚨 CLASH.GG BETTING 🚨🚨 austingambles just bet {bet.Bet / 100.0:N2} {bet.Currency.Humanize()} Money which paid out " +
|
||||||
$"[color={payoutColor}]{bet.Payout / 100.0:N2} {bet.Currency.Humanize()} Money[/color] ({bet.Multiplier}x) on {bet.Game.Humanize()} 💰💰", true);
|
$"[color={payoutColor}]{bet.Payout / 100.0:N2} {bet.Currency.Humanize()} Money[/color] ({bet.Multiplier}x) on {bet.Game.Humanize()} 💰💰", true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public class Clashgg : IDisposable
|
|||||||
// Ping interval is 30 seconds
|
// Ping interval is 30 seconds
|
||||||
private int _reconnectTimeout = 60;
|
private int _reconnectTimeout = 60;
|
||||||
private string? _proxy;
|
private string? _proxy;
|
||||||
public delegate void OnClashBetEventHandler(object sender, ClashggBetModel data);
|
public delegate void OnClashBetEventHandler(object sender, ClashggBetModel data, JsonElement jsonElement);
|
||||||
public delegate void OnWsDisconnectionEventHandler(object sender, DisconnectionInfo e);
|
public delegate void OnWsDisconnectionEventHandler(object sender, DisconnectionInfo e);
|
||||||
public event OnClashBetEventHandler OnClashBet;
|
public event OnClashBetEventHandler OnClashBet;
|
||||||
public event OnWsDisconnectionEventHandler OnWsDisconnection;
|
public event OnWsDisconnectionEventHandler OnWsDisconnection;
|
||||||
@@ -159,7 +159,7 @@ public class Clashgg : IDisposable
|
|||||||
Multiplier = betPacket.Multiplier,
|
Multiplier = betPacket.Multiplier,
|
||||||
Payout = betPacket.BetAmount * betPacket.Multiplier
|
Payout = betPacket.BetAmount * betPacket.Multiplier
|
||||||
};
|
};
|
||||||
OnClashBet?.Invoke(this, betData);
|
OnClashBet?.Invoke(this, betData, packet[1]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ public class Clashgg : IDisposable
|
|||||||
Multiplier = (float)betPacket.Payout / betPacket.BetAmount,
|
Multiplier = (float)betPacket.Payout / betPacket.BetAmount,
|
||||||
Payout = betPacket.Payout
|
Payout = betPacket.Payout
|
||||||
};
|
};
|
||||||
OnClashBet?.Invoke(this, betData);
|
OnClashBet?.Invoke(this, betData, packet[1]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,11 +200,10 @@ public class Clashgg : IDisposable
|
|||||||
Username = betPacket.User.Name,
|
Username = betPacket.User.Name,
|
||||||
Bet = betPacket.BetAmount,
|
Bet = betPacket.BetAmount,
|
||||||
Currency = betPacket.Currency == "REAL" ? ClashggCurrency.Real : ClashggCurrency.Fake,
|
Currency = betPacket.Currency == "REAL" ? ClashggCurrency.Real : ClashggCurrency.Fake,
|
||||||
// ReSharper disable once PossibleLossOfFraction
|
|
||||||
Multiplier = betPacket.Multiplier,
|
Multiplier = betPacket.Multiplier,
|
||||||
Payout = betPacket.Payout
|
Payout = betPacket.Payout
|
||||||
};
|
};
|
||||||
OnClashBet?.Invoke(this, betData);
|
OnClashBet?.Invoke(this, betData, packet[1]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user