mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 20:54:16 +01:00
chore: send strings instead of ulongs to Universalis
JavaScript does not play nice when deserializing ulongs. The only reason nobody's noticed until now is because it's taken this long for someone to actually try using them as IDs.
This commit is contained in:
parent
287cc0b84f
commit
d8a707e49c
6 changed files with 15 additions and 15 deletions
|
|
@ -18,10 +18,10 @@ namespace Dalamud.Game.Network.MarketBoardUploaders.Universalis {
|
||||||
public bool OnMannequin { get; set; }
|
public bool OnMannequin { get; set; }
|
||||||
|
|
||||||
[JsonProperty("sellerID")]
|
[JsonProperty("sellerID")]
|
||||||
public ulong SellerId { get; set; }
|
public string SellerId { get; set; }
|
||||||
|
|
||||||
[JsonProperty("buyerID")]
|
[JsonProperty("buyerID")]
|
||||||
public ulong BuyerId { get; set; }
|
public string BuyerId { get; set; }
|
||||||
|
|
||||||
[JsonProperty("timestamp")]
|
[JsonProperty("timestamp")]
|
||||||
public long Timestamp { get; set; }
|
public long Timestamp { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,6 @@ namespace Dalamud.Game.Network.MarketBoardUploaders.Universalis {
|
||||||
public List<UniversalisHistoryEntry> Entries { get; set; }
|
public List<UniversalisHistoryEntry> Entries { get; set; }
|
||||||
|
|
||||||
[JsonProperty("uploaderID")]
|
[JsonProperty("uploaderID")]
|
||||||
public ulong UploaderId { get; set; }
|
public string UploaderId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using Newtonsoft.Json;
|
||||||
namespace Dalamud.Game.Network.MarketBoardUploaders.Universalis {
|
namespace Dalamud.Game.Network.MarketBoardUploaders.Universalis {
|
||||||
internal class UniversalisItemListingsEntry {
|
internal class UniversalisItemListingsEntry {
|
||||||
[JsonProperty("listingID")]
|
[JsonProperty("listingID")]
|
||||||
public ulong ListingId { get; set; }
|
public string ListingId { get; set; }
|
||||||
|
|
||||||
[JsonProperty("hq")]
|
[JsonProperty("hq")]
|
||||||
public bool Hq { get; set; }
|
public bool Hq { get; set; }
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Dalamud.Game.Network.MarketBoardUploaders.Universalis {
|
||||||
public string RetainerName { get; set; }
|
public string RetainerName { get; set; }
|
||||||
|
|
||||||
[JsonProperty("retainerID")]
|
[JsonProperty("retainerID")]
|
||||||
public ulong RetainerId { get; set; }
|
public string RetainerId { get; set; }
|
||||||
|
|
||||||
[JsonProperty("creatorName")]
|
[JsonProperty("creatorName")]
|
||||||
public string CreatorName { get; set; }
|
public string CreatorName { get; set; }
|
||||||
|
|
@ -28,10 +28,10 @@ namespace Dalamud.Game.Network.MarketBoardUploaders.Universalis {
|
||||||
public bool OnMannequin { get; set; }
|
public bool OnMannequin { get; set; }
|
||||||
|
|
||||||
[JsonProperty("sellerID")]
|
[JsonProperty("sellerID")]
|
||||||
public ulong SellerId { get; set; }
|
public string SellerId { get; set; }
|
||||||
|
|
||||||
[JsonProperty("creatorID")]
|
[JsonProperty("creatorID")]
|
||||||
public ulong CreatorId { get; set; }
|
public string CreatorId { get; set; }
|
||||||
|
|
||||||
[JsonProperty("stainID")]
|
[JsonProperty("stainID")]
|
||||||
public int StainId { get; set; }
|
public int StainId { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,6 @@ namespace Dalamud.Game.Network.MarketBoardUploaders.Universalis {
|
||||||
public List<UniversalisItemListingsEntry> Listings { get; set; }
|
public List<UniversalisItemListingsEntry> Listings { get; set; }
|
||||||
|
|
||||||
[JsonProperty("uploaderID")]
|
[JsonProperty("uploaderID")]
|
||||||
public ulong UploaderId { get; set; }
|
public string UploaderId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,17 +29,17 @@ namespace Dalamud.Game.Network.Universalis.MarketBoardUploaders {
|
||||||
|
|
||||||
var listingsRequestObject = new UniversalisItemListingsUploadRequest();
|
var listingsRequestObject = new UniversalisItemListingsUploadRequest();
|
||||||
listingsRequestObject.WorldId = this.dalamud.ClientState.LocalPlayer?.CurrentWorld.Id ?? 0;
|
listingsRequestObject.WorldId = this.dalamud.ClientState.LocalPlayer?.CurrentWorld.Id ?? 0;
|
||||||
listingsRequestObject.UploaderId = uploader;
|
listingsRequestObject.UploaderId = uploader.ToString();
|
||||||
listingsRequestObject.ItemId = request.CatalogId;
|
listingsRequestObject.ItemId = request.CatalogId;
|
||||||
|
|
||||||
listingsRequestObject.Listings = new List<UniversalisItemListingsEntry>();
|
listingsRequestObject.Listings = new List<UniversalisItemListingsEntry>();
|
||||||
foreach (var marketBoardItemListing in request.Listings) {
|
foreach (var marketBoardItemListing in request.Listings) {
|
||||||
var universalisListing = new UniversalisItemListingsEntry {
|
var universalisListing = new UniversalisItemListingsEntry {
|
||||||
Hq = marketBoardItemListing.IsHq,
|
Hq = marketBoardItemListing.IsHq,
|
||||||
SellerId = marketBoardItemListing.RetainerOwnerId,
|
SellerId = marketBoardItemListing.RetainerOwnerId.ToString(),
|
||||||
RetainerName = marketBoardItemListing.RetainerName,
|
RetainerName = marketBoardItemListing.RetainerName,
|
||||||
RetainerId = marketBoardItemListing.RetainerId,
|
RetainerId = marketBoardItemListing.RetainerId.ToString(),
|
||||||
CreatorId = marketBoardItemListing.ArtisanId,
|
CreatorId = marketBoardItemListing.ArtisanId.ToString(),
|
||||||
CreatorName = marketBoardItemListing.PlayerName,
|
CreatorName = marketBoardItemListing.PlayerName,
|
||||||
OnMannequin = marketBoardItemListing.OnMannequin,
|
OnMannequin = marketBoardItemListing.OnMannequin,
|
||||||
LastReviewTime = ((DateTimeOffset) marketBoardItemListing.LastReviewTime).ToUnixTimeSeconds(),
|
LastReviewTime = ((DateTimeOffset) marketBoardItemListing.LastReviewTime).ToUnixTimeSeconds(),
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Dalamud.Game.Network.Universalis.MarketBoardUploaders {
|
||||||
|
|
||||||
var historyRequestObject = new UniversalisHistoryUploadRequest();
|
var historyRequestObject = new UniversalisHistoryUploadRequest();
|
||||||
historyRequestObject.WorldId = this.dalamud.ClientState.LocalPlayer?.CurrentWorld.Id ?? 0;
|
historyRequestObject.WorldId = this.dalamud.ClientState.LocalPlayer?.CurrentWorld.Id ?? 0;
|
||||||
historyRequestObject.UploaderId = uploader;
|
historyRequestObject.UploaderId = uploader.ToString();
|
||||||
historyRequestObject.ItemId = request.CatalogId;
|
historyRequestObject.ItemId = request.CatalogId;
|
||||||
|
|
||||||
historyRequestObject.Entries = new List<UniversalisHistoryEntry>();
|
historyRequestObject.Entries = new List<UniversalisHistoryEntry>();
|
||||||
|
|
@ -93,7 +93,7 @@ namespace Dalamud.Game.Network.Universalis.MarketBoardUploaders {
|
||||||
{
|
{
|
||||||
var taxRatesRequest = new UniversalisTaxUploadRequest();
|
var taxRatesRequest = new UniversalisTaxUploadRequest();
|
||||||
taxRatesRequest.WorldId = this.dalamud.ClientState.LocalPlayer?.CurrentWorld.Id ?? 0;
|
taxRatesRequest.WorldId = this.dalamud.ClientState.LocalPlayer?.CurrentWorld.Id ?? 0;
|
||||||
taxRatesRequest.UploaderId = this.dalamud.ClientState.LocalContentId;
|
taxRatesRequest.UploaderId = this.dalamud.ClientState.LocalContentId.ToString();
|
||||||
|
|
||||||
taxRatesRequest.TaxData = new UniversalisTaxData {
|
taxRatesRequest.TaxData = new UniversalisTaxData {
|
||||||
LimsaLominsa = taxRates.LimsaLominsaTax,
|
LimsaLominsa = taxRates.LimsaLominsaTax,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ namespace Dalamud.Game.Network.MarketBoardUploaders.Universalis
|
||||||
class UniversalisTaxUploadRequest
|
class UniversalisTaxUploadRequest
|
||||||
{
|
{
|
||||||
[JsonProperty("uploaderID")]
|
[JsonProperty("uploaderID")]
|
||||||
public ulong UploaderId { get; set; }
|
public string UploaderId { get; set; }
|
||||||
|
|
||||||
[JsonProperty("worldID")]
|
[JsonProperty("worldID")]
|
||||||
public uint WorldId { get; set; }
|
public uint WorldId { get; set; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue