public void AcceptTrade(Player sender, AcceptTradePacket pkt)
        {
            if (sender == player1)
            {
                if (pkt.MyOffers.SequenceEqual(player1Trades) && pkt.YourOffers.SequenceEqual(player2Trades))
                {
                    player2.Client.SendPacket(new TradeAcceptedPacket
                    {
                        MyOffers = player2Trades,
                        YourOffers = player1Trades
                    });
                    player1Accept = true;
                }
            }
            else
            {
                if (pkt.MyOffers.SequenceEqual(player2Trades) && pkt.YourOffers.SequenceEqual(player1Trades))
                {
                    player1.Client.SendPacket(new TradeAcceptedPacket
                    {
                        MyOffers = player1Trades,
                        YourOffers = player2Trades
                    });
                    player2Accept = true;
                }
            }

            if (player1Accept && player2Accept)
                Trade();
        }
 public void AcceptTrade(RealmTime time, AcceptTradePacket pkt)
 {
     trade = pkt.MyOffers;
     if (tradeTarget.trade.SequenceEqual(pkt.YourOffers))
     {
         tradeTarget.trade = pkt.YourOffers;
         tradeAccepted = true;
         tradeTarget.client.SendPacket(new TradeAcceptedPacket
         {
             MyOffers = tradeTarget.trade,
             YourOffers = trade
         });
     }
 }
Esempio n. 3
0
 public void AcceptTrade(RealmTime time, AcceptTradePacket pkt)
 {
     this.trade = pkt.MyOffers;
     if (tradeTarget.trade.SequenceEqual(pkt.YourOffers))
     {
         tradeTarget.trade = pkt.YourOffers;
         this.tradeAccepted = true;
         tradeTarget.client.SendPacket(new TradeAcceptedPacket()
         {
             MyOffers = tradeTarget.trade,
             YourOffers = this.trade
         });
         logger.InfoFormat("Player {0} accepted trade with {1}", nName, tradeTarget.nName);
     }
 }
 public void AcceptTrade(RealmTime time, AcceptTradePacket pkt)
 {
     TradeHandler?.AcceptTrade(this, pkt);
 }