mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
fix: update MarketTaxRates, check category, add sharlayan
This commit is contained in:
parent
e4bb7a83f0
commit
a44e7210bc
3 changed files with 27 additions and 4 deletions
|
|
@ -42,5 +42,11 @@ namespace Dalamud.Game.Network.Internal.MarketBoardUploaders.Universalis.Types
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("crystarium")]
|
[JsonProperty("crystarium")]
|
||||||
public uint Crystarium { get; set; }
|
public uint Crystarium { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets The Crystarium's current tax rate.
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("sharlayan")]
|
||||||
|
public uint Sharlayan { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,14 +191,18 @@ namespace Dalamud.Game.Network.Internal
|
||||||
|
|
||||||
var taxes = MarketTaxRates.Read(dataPtr);
|
var taxes = MarketTaxRates.Read(dataPtr);
|
||||||
|
|
||||||
|
if (taxes.Category != 0xb0009)
|
||||||
|
return;
|
||||||
|
|
||||||
Log.Verbose(
|
Log.Verbose(
|
||||||
"MarketTaxRates: limsa#{0} grid#{1} uldah#{2} ish#{3} kugane#{4} cr#{5}",
|
"MarketTaxRates: limsa#{0} grid#{1} uldah#{2} ish#{3} kugane#{4} cr#{5} sh#{6}",
|
||||||
taxes.LimsaLominsaTax,
|
taxes.LimsaLominsaTax,
|
||||||
taxes.GridaniaTax,
|
taxes.GridaniaTax,
|
||||||
taxes.UldahTax,
|
taxes.UldahTax,
|
||||||
taxes.IshgardTax,
|
taxes.IshgardTax,
|
||||||
taxes.KuganeTax,
|
taxes.KuganeTax,
|
||||||
taxes.CrystariumTax);
|
taxes.CrystariumTax,
|
||||||
|
taxes.SharlayanTax);
|
||||||
|
|
||||||
Task.Run(() => this.uploader.UploadTax(taxes))
|
Task.Run(() => this.uploader.UploadTax(taxes))
|
||||||
.ContinueWith((task) => Log.Error(task.Exception, "Market Board tax data upload failed."), TaskContinuationOptions.OnlyOnFaulted);
|
.ContinueWith((task) => Log.Error(task.Exception, "Market Board tax data upload failed."), TaskContinuationOptions.OnlyOnFaulted);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ using System.IO;
|
||||||
namespace Dalamud.Game.Network.Structures
|
namespace Dalamud.Game.Network.Structures
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This class represents the market tax rates from a game network packet.
|
/// This class represents the "Result Dialog" packet. This is also used e.g. for reduction results, but we only care about tax rates.
|
||||||
|
/// We can do that by checking the "Category" field.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MarketTaxRates
|
public class MarketTaxRates
|
||||||
{
|
{
|
||||||
|
|
@ -12,6 +13,11 @@ namespace Dalamud.Game.Network.Structures
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Category of this ResultDialog packet.
|
||||||
|
/// </summary>
|
||||||
|
public uint Category { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the tax rate in Limsa Lominsa.
|
/// Gets the tax rate in Limsa Lominsa.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -42,6 +48,11 @@ namespace Dalamud.Game.Network.Structures
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint CrystariumTax { get; private set; }
|
public uint CrystariumTax { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the tax rate in the Crystarium.
|
||||||
|
/// </summary>
|
||||||
|
public uint SharlayanTax { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Read a <see cref="MarketTaxRates"/> object from memory.
|
/// Read a <see cref="MarketTaxRates"/> object from memory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -54,13 +65,15 @@ namespace Dalamud.Game.Network.Structures
|
||||||
|
|
||||||
var output = new MarketTaxRates();
|
var output = new MarketTaxRates();
|
||||||
|
|
||||||
stream.Position += 8;
|
output.Category = reader.ReadUInt32();
|
||||||
|
stream.Position += 4;
|
||||||
output.LimsaLominsaTax = reader.ReadUInt32();
|
output.LimsaLominsaTax = reader.ReadUInt32();
|
||||||
output.GridaniaTax = reader.ReadUInt32();
|
output.GridaniaTax = reader.ReadUInt32();
|
||||||
output.UldahTax = reader.ReadUInt32();
|
output.UldahTax = reader.ReadUInt32();
|
||||||
output.IshgardTax = reader.ReadUInt32();
|
output.IshgardTax = reader.ReadUInt32();
|
||||||
output.KuganeTax = reader.ReadUInt32();
|
output.KuganeTax = reader.ReadUInt32();
|
||||||
output.CrystariumTax = reader.ReadUInt32();
|
output.CrystariumTax = reader.ReadUInt32();
|
||||||
|
output.SharlayanTax = reader.ReadUInt32();
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue