mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-12 23:14:34 +01:00
Update GetProductList.cs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user