mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Ignore some null warnings and fix compiler errors related to the shop
This commit is contained in:
@@ -245,7 +245,8 @@ public class KasinoShop
|
|||||||
{
|
{
|
||||||
int cc = Gambler_Profiles[gambler.User.KfId].CrackCounter;
|
int cc = Gambler_Profiles[gambler.User.KfId].CrackCounter;
|
||||||
List<string> drugs = new();
|
List<string> drugs = new();
|
||||||
drugs.Add($"1. Crack: {await (CrackPrice * cc).FormatKasinoCurrencyAsync()} per dose");
|
var crackPrice = CrackPrice * cc;
|
||||||
|
drugs.Add($"1. Crack: {await crackPrice.FormatKasinoCurrencyAsync()} per dose");
|
||||||
drugs.Add($"2. Weed: {await WeedPricePerHour.FormatKasinoCurrencyAsync()} per hour");
|
drugs.Add($"2. Weed: {await WeedPricePerHour.FormatKasinoCurrencyAsync()} per hour");
|
||||||
if (Gambler_Profiles[gambler.User.KfId].FloorNugs > 0)
|
if (Gambler_Profiles[gambler.User.KfId].FloorNugs > 0)
|
||||||
{
|
{
|
||||||
@@ -1140,7 +1141,8 @@ public class KasinoShop
|
|||||||
}
|
}
|
||||||
public async Task<string> FormatBalanceAsync()
|
public async Task<string> FormatBalanceAsync()
|
||||||
{
|
{
|
||||||
string str = OutstandingLoanBalance > 0 ? $"| Net Balance: {await (CryptoBalance-OutstandingLoanBalance).FormatKasinoCurrencyAsync()}":"";
|
var netBalance = CryptoBalance - OutstandingLoanBalance;
|
||||||
|
string str = OutstandingLoanBalance > 0 ? $"| Net Balance: {await netBalance.FormatKasinoCurrencyAsync()}":"";
|
||||||
return $"Balance: {await CryptoBalance.FormatKasinoCurrencyAsync()}{str}";
|
return $"Balance: {await CryptoBalance.FormatKasinoCurrencyAsync()}{str}";
|
||||||
}
|
}
|
||||||
public decimal[] Balance()
|
public decimal[] Balance()
|
||||||
|
|||||||
@@ -418,13 +418,13 @@ public class ChatClient
|
|||||||
|
|
||||||
private void WsWhisper(ResponseMessage message)
|
private void WsWhisper(ResponseMessage message)
|
||||||
{
|
{
|
||||||
var data = JsonSerializer.Deserialize<JsonElement>(message.Text).GetProperty("whisper")
|
var data = JsonSerializer.Deserialize<JsonElement>(message.Text!).GetProperty("whisper")
|
||||||
.Deserialize<WhisperJsonModel>();
|
.Deserialize<WhisperJsonModel>();
|
||||||
var model = new WhisperModel
|
var model = new WhisperModel
|
||||||
{
|
{
|
||||||
Author = new UserModel
|
Author = new UserModel
|
||||||
{
|
{
|
||||||
Id = data.Author.Id,
|
Id = data!.Author.Id,
|
||||||
Username = data.Author.Username,
|
Username = data.Author.Username,
|
||||||
AvatarUrl = data.Author.AvatarUrl
|
AvatarUrl = data.Author.AvatarUrl
|
||||||
},
|
},
|
||||||
@@ -452,14 +452,14 @@ public class ChatClient
|
|||||||
|
|
||||||
private void WsMotd(ResponseMessage message)
|
private void WsMotd(ResponseMessage message)
|
||||||
{
|
{
|
||||||
var msg = JsonSerializer.Deserialize<JsonElement>(message.Text).GetProperty("motd")
|
var msg = JsonSerializer.Deserialize<JsonElement>(message.Text!).GetProperty("motd")
|
||||||
.Deserialize<MessagesJsonModel.MessageModel>();
|
.Deserialize<MessagesJsonModel.MessageModel>();
|
||||||
|
|
||||||
var model = new MessageModel
|
var model = new MessageModel
|
||||||
{
|
{
|
||||||
Author = new UserModel
|
Author = new UserModel
|
||||||
{
|
{
|
||||||
Id = msg.Author.Id,
|
Id = msg!.Author.Id,
|
||||||
Username = msg.Author.Username,
|
Username = msg.Author.Username,
|
||||||
AvatarUrl = msg.Author.AvatarUrl,
|
AvatarUrl = msg.Author.AvatarUrl,
|
||||||
// It isn't sent on chat messages
|
// It isn't sent on chat messages
|
||||||
|
|||||||
Reference in New Issue
Block a user