mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-20 03:37:48 +00:00
More trade work.
This commit is contained in:
parent
c7e38b8b00
commit
94491903f7
5 changed files with 93 additions and 2 deletions
|
@ -111,6 +111,7 @@
|
||||||
<Compile Include="actors\StaticActors.cs" />
|
<Compile Include="actors\StaticActors.cs" />
|
||||||
<Compile Include="actors\world\WorldMaster.cs" />
|
<Compile Include="actors\world\WorldMaster.cs" />
|
||||||
<Compile Include="dataobjects\GuildleveData.cs" />
|
<Compile Include="dataobjects\GuildleveData.cs" />
|
||||||
|
<Compile Include="dataobjects\TradeTransaction.cs" />
|
||||||
<Compile Include="dataobjects\ZoneConnection.cs" />
|
<Compile Include="dataobjects\ZoneConnection.cs" />
|
||||||
<Compile Include="CommandProcessor.cs" />
|
<Compile Include="CommandProcessor.cs" />
|
||||||
<Compile Include="ConfigConstants.cs" />
|
<Compile Include="ConfigConstants.cs" />
|
||||||
|
|
|
@ -959,6 +959,12 @@ namespace FFXIVClassic_Map_Server
|
||||||
Player inviter = (Player)invitee.GetZone().FindActorInArea(group.GetHost());
|
Player inviter = (Player)invitee.GetZone().FindActorInArea(group.GetHost());
|
||||||
|
|
||||||
DeleteTradeGroup(group.groupIndex);
|
DeleteTradeGroup(group.groupIndex);
|
||||||
|
|
||||||
|
inviter.StartTradeTransaction(invitee);
|
||||||
|
invitee.StartTradeTransaction(inviter);
|
||||||
|
|
||||||
|
inviter.KickEvent(Server.GetStaticActors("TradeExecuteCommand"), "commandContent", null, null, null, 16, null, null, null, null, null);
|
||||||
|
invitee.KickEvent(Server.GetStaticActors("TradeExecuteCommand"), "commandContent", null, null, null, 16, null, null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CancelTradeTooFar(Player inviter)
|
public void CancelTradeTooFar(Player inviter)
|
||||||
|
|
|
@ -14,13 +14,14 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||||
class Inventory
|
class Inventory
|
||||||
{
|
{
|
||||||
public const ushort NORMAL = 0; //Max 0xC8
|
public const ushort NORMAL = 0; //Max 0xC8
|
||||||
public const ushort TRADE = 1; //Max 0x96
|
public const ushort UNKNOWN = 1; //Max 0x96
|
||||||
public const ushort LOOT = 4; //Max 0xA
|
public const ushort LOOT = 4; //Max 0xA
|
||||||
public const ushort MELDREQUEST = 5; //Max 0x04
|
public const ushort MELDREQUEST = 5; //Max 0x04
|
||||||
public const ushort BAZAAR = 7; //Max 0x0A
|
public const ushort BAZAAR = 7; //Max 0x0A
|
||||||
public const ushort CURRENCY_CRYSTALS = 99; //Max 0x140
|
public const ushort CURRENCY_CRYSTALS = 99; //Max 0x140
|
||||||
public const ushort KEYITEMS = 100; //Max 0x500
|
public const ushort KEYITEMS = 100; //Max 0x500
|
||||||
public const ushort EQUIPMENT = 0x00FE; //Max 0x23
|
public const ushort EQUIPMENT = 0x00FE; //Max 0x23
|
||||||
|
public const ushort TRADE = 0x00FD; //Max 0x04
|
||||||
public const ushort EQUIPMENT_OTHERPLAYER = 0x00F9; //Max 0x23
|
public const ushort EQUIPMENT_OTHERPLAYER = 0x00F9; //Max 0x23
|
||||||
|
|
||||||
public enum INV_ERROR {
|
public enum INV_ERROR {
|
||||||
|
@ -293,6 +294,18 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < endOfListIndex; i++)
|
||||||
|
{
|
||||||
|
list[i] = null;
|
||||||
|
isDirty[i] = true;
|
||||||
|
}
|
||||||
|
endOfListIndex = 0;
|
||||||
|
|
||||||
|
SendUpdatePackets();
|
||||||
|
}
|
||||||
|
|
||||||
public void ChangeDurability(uint slot, uint durabilityChange)
|
public void ChangeDurability(uint slot, uint durabilityChange)
|
||||||
{
|
{
|
||||||
isDirty[slot] = true;
|
isDirty[slot] = true;
|
||||||
|
|
|
@ -108,6 +108,10 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
private Dictionary<ushort, Inventory> inventories = new Dictionary<ushort, Inventory>();
|
private Dictionary<ushort, Inventory> inventories = new Dictionary<ushort, Inventory>();
|
||||||
private Equipment equipment;
|
private Equipment equipment;
|
||||||
|
|
||||||
|
//Trading
|
||||||
|
private Player otherTrader = null;
|
||||||
|
private Inventory myOfferings;
|
||||||
|
|
||||||
//GC Related
|
//GC Related
|
||||||
public byte gcCurrent;
|
public byte gcCurrent;
|
||||||
public byte gcRankLimsa;
|
public byte gcRankLimsa;
|
||||||
|
@ -257,6 +261,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
|
|
||||||
Database.LoadPlayerCharacter(this);
|
Database.LoadPlayerCharacter(this);
|
||||||
lastPlayTimeUpdate = Utils.UnixTimeStampUTC();
|
lastPlayTimeUpdate = Utils.UnixTimeStampUTC();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SubPacket> Create0x132Packets()
|
public List<SubPacket> Create0x132Packets()
|
||||||
|
@ -1775,5 +1781,61 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void StartTradeTransaction(Player otherPlayer)
|
||||||
|
{
|
||||||
|
myOfferings = new Inventory(this, 4, Inventory.TRADE, true);
|
||||||
|
Inventory otherPlayerOfferings = new Inventory(otherPlayer, 4, Inventory.TRADE, true);
|
||||||
|
|
||||||
|
QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId));
|
||||||
|
QueuePacket(InventorySetBeginPacket.BuildPacket(actorId, 4, Inventory.TRADE));
|
||||||
|
|
||||||
|
QueuePacket(EquipmentListX01Packet.BuildPacket(actorId, 1, 1));
|
||||||
|
|
||||||
|
QueuePacket(InventorySetEndPacket.BuildPacket(actorId));
|
||||||
|
QueuePacket(InventoryEndChangePacket.BuildPacket(actorId));
|
||||||
|
|
||||||
|
myOfferings.SendFullInventory(this);
|
||||||
|
|
||||||
|
otherTrader = otherPlayer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId));
|
||||||
|
QueuePacket(InventorySetBeginPacket.BuildPacket(actorId, 4, Inventory.TRADE));
|
||||||
|
|
||||||
|
QueuePacket(InventoryRemoveX01Packet.BuildPacket(actorId, 1));
|
||||||
|
|
||||||
|
QueuePacket(InventorySetEndPacket.BuildPacket(actorId));
|
||||||
|
QueuePacket(InventoryEndChangePacket.BuildPacket(actorId));
|
||||||
|
}
|
||||||
|
public void Test2()
|
||||||
|
{
|
||||||
|
QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId));
|
||||||
|
QueuePacket(InventorySetBeginPacket.BuildPacket(actorId, 4, Inventory.TRADE));
|
||||||
|
|
||||||
|
QueuePacket(EquipmentListX01Packet.BuildPacket(actorId, 1, 1));
|
||||||
|
|
||||||
|
QueuePacket(InventorySetEndPacket.BuildPacket(actorId));
|
||||||
|
QueuePacket(InventoryEndChangePacket.BuildPacket(actorId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Inventory GetTradeOfferings()
|
||||||
|
{
|
||||||
|
return myOfferings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FinishTradeTransaction()
|
||||||
|
{
|
||||||
|
myOfferings = null;
|
||||||
|
otherTrader = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CancelTradeTransaction()
|
||||||
|
{
|
||||||
|
myOfferings = null;
|
||||||
|
otherTrader = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
9
FFXIVClassic Map Server/dataobjects/TradeTransaction.cs
Normal file
9
FFXIVClassic Map Server/dataobjects/TradeTransaction.cs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.dataobjects
|
||||||
|
{
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue