Ejemplo n.º 1
0
        public static void HandleProposeTrade(IRealmClient client, RealmPacketIn packet)
        {
            Character character = World.GetCharacter(packet.ReadEntityId().Low);

            if (!TradeMgr.MayProposeTrade(client.ActiveCharacter, character))
            {
                return;
            }
            TradeMgr.Propose(client.ActiveCharacter, character);
        }
Ejemplo n.º 2
0
        //[ClientPacketHandler((RealmServerOpCode.CMSG_INITIATE_TRADE)]
        public static void HandleProposeTrade(IRealmClient client, RealmPacketIn packet)
        {
            var targetGuid = packet.ReadEntityId();
            var targetChr  = World.GetCharacter(targetGuid.Low);

            if (TradeMgr.MayProposeTrade(client.ActiveCharacter, targetChr))
            {
                TradeMgr.Propose(client.ActiveCharacter, targetChr);
            }
        }
Ejemplo n.º 3
0
        private void StartTrade()
        {
            TradeMgr.Propose(chr1, chr2);

            //var proposalPacket = chr1.FakeClient.DequeueSMSG(RealmServerOpCode.SMSG_TRADE_STATUS);
            //var proposersEntityId = proposalPacket["Proposer"].EntityIdValue;
            //Assert.AreEqual(proposersEntityId, chr2.EntityId);

            //var beginTradePacket = new RealmPacketOut(RealmServerOpCode.CMSG_BEGIN_TRADE);

            //chr2.FakeClient.ReceiveCMSG(beginTradePacket);

            Assert.IsNotNull(chr2.TradeWindow);

            chr2.TradeWindow.AcceptTradeProposal();

            CheckTrade();
        }