mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-23 16:27:44 +01:00
More 5.1 fixes or maybe not who knows
This commit is contained in:
parent
dfec31d89c
commit
799f5ef634
10 changed files with 169 additions and 25 deletions
|
|
@ -3,22 +3,28 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Dalamud.Game.Network.Structures {
|
||||
public class MarketBoardCurrentOfferings {
|
||||
namespace Dalamud.Game.Network.Structures
|
||||
{
|
||||
public class MarketBoardCurrentOfferings
|
||||
{
|
||||
public List<MarketBoardItemListing> ItemListings;
|
||||
|
||||
public int ListingIndexEnd;
|
||||
public int ListingIndexStart;
|
||||
public int RequestId;
|
||||
|
||||
public static unsafe MarketBoardCurrentOfferings Read(IntPtr dataPtr) {
|
||||
public static unsafe MarketBoardCurrentOfferings Read(IntPtr dataPtr)
|
||||
{
|
||||
var output = new MarketBoardCurrentOfferings();
|
||||
|
||||
using (var stream = new UnmanagedMemoryStream((byte*) dataPtr.ToPointer(), 1544)) {
|
||||
using (var reader = new BinaryReader(stream)) {
|
||||
using (var stream = new UnmanagedMemoryStream((byte*)dataPtr.ToPointer(), 1544))
|
||||
{
|
||||
using (var reader = new BinaryReader(stream))
|
||||
{
|
||||
output.ItemListings = new List<MarketBoardItemListing>();
|
||||
|
||||
for (var i = 0; i < 10; i++) {
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
var listingEntry = new MarketBoardItemListing();
|
||||
|
||||
listingEntry.ListingId = reader.ReadUInt64();
|
||||
|
|
@ -38,7 +44,8 @@ namespace Dalamud.Game.Network.Structures {
|
|||
|
||||
listingEntry.Materia = new List<MarketBoardItemListing.ItemMateria>();
|
||||
|
||||
for (var materiaIndex = 0; materiaIndex < 5; materiaIndex++) {
|
||||
for (var materiaIndex = 0; materiaIndex < 5; materiaIndex++)
|
||||
{
|
||||
var materiaVal = reader.ReadUInt16();
|
||||
|
||||
var materiaEntry = new MarketBoardItemListing.ItemMateria();
|
||||
|
|
@ -76,7 +83,8 @@ namespace Dalamud.Game.Network.Structures {
|
|||
return output;
|
||||
}
|
||||
|
||||
public class MarketBoardItemListing {
|
||||
public class MarketBoardItemListing
|
||||
{
|
||||
public ulong ArtisanId;
|
||||
public uint CatalogId;
|
||||
public bool IsHq;
|
||||
|
|
@ -97,7 +105,8 @@ namespace Dalamud.Game.Network.Structures {
|
|||
public int StainId;
|
||||
public uint TotalTax;
|
||||
|
||||
public class ItemMateria {
|
||||
public class ItemMateria
|
||||
{
|
||||
public int Index;
|
||||
public int MateriaId;
|
||||
}
|
||||
|
|
|
|||
41
Dalamud/Game/Network/Structures/MarketTaxRate.cs
Normal file
41
Dalamud/Game/Network/Structures/MarketTaxRate.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Dalamud.Game.Network.Structures
|
||||
{
|
||||
public class MarketTaxRates
|
||||
{
|
||||
public uint LimsaLominsaTax;
|
||||
public uint GridaniaTax;
|
||||
public uint UldahTax;
|
||||
public uint IshgardTax;
|
||||
public uint KuganeTax;
|
||||
public uint CrystariumTax;
|
||||
|
||||
|
||||
public static unsafe MarketTaxRates Read(IntPtr dataPtr)
|
||||
{
|
||||
var output = new MarketTaxRates();
|
||||
|
||||
using (var stream = new UnmanagedMemoryStream((byte*)dataPtr.ToPointer(), 1544))
|
||||
{
|
||||
using (var reader = new BinaryReader(stream))
|
||||
{
|
||||
stream.Position += 8;
|
||||
|
||||
output.LimsaLominsaTax = reader.ReadUInt32();
|
||||
output.GridaniaTax = reader.ReadUInt32();
|
||||
output.UldahTax = reader.ReadUInt32();
|
||||
output.IshgardTax = reader.ReadUInt32();
|
||||
output.KuganeTax = reader.ReadUInt32();
|
||||
output.CrystariumTax = reader.ReadUInt32();
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue