Пример #1
0
        public void AddTradeRequest(ZoneClient pClient, ushort MapObjectIDto)
        {
            Log.WriteLine(LogLevel.Debug, "{0} AddTradeReqest {1}", pClient.Character.Character.Name, MapObjectIDto);
            TradeReqest pRequest = new TradeReqest(pClient.Character, MapObjectIDto);

            this.TradeReqests.Add(pRequest);
            SendTradeRequest(pRequest);
        }
Пример #2
0
 private void SendTradeRequest(TradeReqest pRequest)
 {
     using (var pPacket = new Packet(SH19Type.SendTradeReqest))
     {
         pPacket.WriteUShort(pRequest.pFromTradeClient.MapObjectID);
         pRequest.pToTradeClient.Client.SendPacket(pPacket);
     }
 }
Пример #3
0
        public void RemoveReqest(ZoneClient pClient)
        {
            TradeReqest Request = TradeReqests.Find(r => r.MapID == pClient.Character.MapID && r.pToTradeClient.MapObjectID == pClient.Character.MapObjectID);

            if (TradeReqests.Contains(Request))
            {
                TradeReqests.Remove(Request);
            }
        }
Пример #4
0
        public void AcceptTrade(ZoneClient pClient)
        {
            TradeReqest Request = GetTradeRquestByChar(pClient.Character);

            if (Request != null)
            {
                TradeReqests.Remove(Request);
                Trade pTrade = new Trade(Request.pFromTradeClient, pClient.Character);
            }
        }
Пример #5
0
        private TradeReqest GetTradeRquestByChar(ZoneCharacter pChar)
        {
            TradeReqest Request = TradeReqests.Find(r => r.MapID == pChar.MapID && r.pToTradeClient.MapObjectID == pChar.MapObjectID);

            return(Request);
        }