private void DirLandReplyHandler(Packet packet, Simulator simulator) { if (OnDirLandReply != null) { List <DirectoryParcel> parcelsForSale = new List <DirectoryParcel>(); DirLandReplyPacket reply = (DirLandReplyPacket)packet; foreach (DirLandReplyPacket.QueryRepliesBlock block in reply.QueryReplies) { DirectoryParcel dirParcel = new DirectoryParcel(); dirParcel.ActualArea = block.ActualArea; dirParcel.ID = block.ParcelID; dirParcel.Name = Utils.BytesToString(block.Name); dirParcel.SalePrice = block.SalePrice; dirParcel.Auction = block.Auction; dirParcel.ForSale = block.ForSale; parcelsForSale.Add(dirParcel); } try { OnDirLandReply(parcelsForSale); } catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); } } }
/// <summary>Process an incoming packet and raise the appropriate events</summary> /// <param name="sender">The sender</param> /// <param name="e">The EventArgs object containing the packet data</param> protected void DirPlacesReplyHandler(object sender, PacketReceivedEventArgs e) { if (m_DirPlaces != null) { Packet packet = e.Packet; DirPlacesReplyPacket reply = (DirPlacesReplyPacket)packet; List<DirectoryParcel> result = new List<DirectoryParcel>(); for (int i = 0; i < reply.QueryReplies.Length; i++) { DirectoryParcel p = new DirectoryParcel(); p.ID = reply.QueryReplies[i].ParcelID; p.Name = Utils.BytesToString(reply.QueryReplies[i].Name); p.Dwell = reply.QueryReplies[i].Dwell; p.Auction = reply.QueryReplies[i].Auction; p.ForSale = reply.QueryReplies[i].ForSale; result.Add(p); } OnDirPlaces(new DirPlacesReplyEventArgs(reply.QueryData[0].QueryID, result)); } }
/// <summary>Process an incoming packet and raise the appropriate events</summary> /// <param name="sender">The sender</param> /// <param name="e">The EventArgs object containing the packet data</param> protected void DirLandReplyHandler(object sender, PacketReceivedEventArgs e) { if (m_DirLandReply != null) { List<DirectoryParcel> parcelsForSale = new List<DirectoryParcel>(); DirLandReplyPacket reply = (DirLandReplyPacket)e.Packet; foreach (DirLandReplyPacket.QueryRepliesBlock block in reply.QueryReplies) { DirectoryParcel dirParcel = new DirectoryParcel(); dirParcel.ActualArea = block.ActualArea; dirParcel.ID = block.ParcelID; dirParcel.Name = Utils.BytesToString(block.Name); dirParcel.SalePrice = block.SalePrice; dirParcel.Auction = block.Auction; dirParcel.ForSale = block.ForSale; parcelsForSale.Add(dirParcel); } OnDirLand(new DirLandReplyEventArgs(parcelsForSale)); } }
/// <summary>Process an incoming <see cref="DirLandReplyMessage"/> event message</summary> /// <param name="capsKey">The Unique Capabilities Key</param> /// <param name="message">The <see cref="DirLandReplyMessage"/> event message containing the data</param> /// <param name="simulator">The simulator the message originated from</param> protected void DirLandReplyEventHandler(string capsKey, IMessage message, Simulator simulator) { if (m_DirLandReply != null) { List<DirectoryParcel> parcelsForSale = new List<DirectoryParcel>(); DirLandReplyMessage reply = (DirLandReplyMessage)message; foreach (DirLandReplyMessage.QueryReply block in reply.QueryReplies) { DirectoryParcel dirParcel = new DirectoryParcel(); dirParcel.ActualArea = block.ActualArea; dirParcel.ID = block.ParcelID; dirParcel.Name = block.Name; dirParcel.SalePrice = block.SalePrice; dirParcel.Auction = block.Auction; dirParcel.ForSale = block.ForSale; parcelsForSale.Add(dirParcel); } OnDirLand(new DirLandReplyEventArgs(parcelsForSale)); } }
private void DirLandReplyHandler(Packet packet, Simulator simulator) { if (OnDirLandReply != null) { List<DirectoryParcel> parcelsForSale = new List<DirectoryParcel>(); DirLandReplyPacket reply = (DirLandReplyPacket)packet; foreach (DirLandReplyPacket.QueryRepliesBlock block in reply.QueryReplies) { DirectoryParcel dirParcel = new DirectoryParcel(); dirParcel.ActualArea = block.ActualArea; dirParcel.ID = block.ParcelID; dirParcel.Name = Utils.BytesToString(block.Name); dirParcel.SalePrice = block.SalePrice; dirParcel.Auction = block.Auction; dirParcel.ForSale = block.ForSale; parcelsForSale.Add(dirParcel); } try { OnDirLandReply(parcelsForSale); } catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); } } }