Update GetProductList.cs

This commit is contained in:
Mikhail
2024-12-20 15:58:58 -05:00
parent 1e7de0ef8b
commit 5391a2da3a

View File

@@ -7,8 +7,6 @@ namespace EpinelPS.LobbyServer.Msgs.Shop
public class GetProductList : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
try
{
var x = await ReadData<ReqGetJupiterProductList>();
@@ -23,10 +21,17 @@ namespace EpinelPS.LobbyServer.Msgs.Shop
// Example:
// Midas RequestGetLocalPriceAsync res ProductId = com.proximabeta.nikke.costumegacha11_02, Price = 3.99, MicroPrice = 3990000, CurrencyCode = USD, CurrencySymbol = $
MidasProductRecord? record = product.FirstOrDefault().Value;
if (record != null)
{
if(!double.TryParse(record.cost, out double price))
{
Console.WriteLine("Failed to parse " + record.cost+" Cash shop will not work probably");
}
long microPrice = (long)(double.Parse(record.cost) * 1000000);
long microPrice = (long)(price * 1000000);
response.ProductInfoList.Add(new NetJupiterProductInfo() { CurrencyCode = "USD", CurrencySymbol = "$", MicroPrice = microPrice, Price = record.cost, ProductId = item });
}
}
else
{
Console.WriteLine("Missing!!!! " + item);
@@ -34,10 +39,5 @@ namespace EpinelPS.LobbyServer.Msgs.Shop
}
await WriteDataAsync(response);
}
catch (Exception ex)
{
Console.WriteLine("Error while handling GetProductList request. Have you replaced sodium library?" + ex);
}
}
}
}