Exemple #1
0
        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       = Helpers.FieldToUTF8String(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); }
            }
        }
Exemple #2
0
        //private void ParcelInfoTimerEvent(object source, System.Timers.ElapsedEventArgs ea)
        //{
        //    ParcelInfoTimeout = true;
        //}

        private void DirLandReplyHandler(Packet packet, Simulator simulator)
        {
            if (!DirLandTimeout)
            {
                // Reset the timer
                DirLandTimer.Stop();
                DirLandTimer.Start();

                DirLandReplyPacket reply = (DirLandReplyPacket)packet;

                foreach (DirLandReplyPacket.QueryRepliesBlock block in reply.QueryReplies)
                {
//                    if (block.ReservedNewbie == ReservedNewbie &&
//                        block.Auction == Auction &&
//                        block.ForSale == ForSale) // FIXME FIXME FIXME
                    {
                        DirectoryParcel parcel = new DirectoryParcel();

                        parcel.ActualArea = block.ActualArea;
                        parcel.ID         = block.ParcelID;
                        parcel.Name       = Helpers.FieldToString(block.Name);
                        parcel.SalePrice  = block.SalePrice;

                        ParcelsForSale.Add(parcel);
                    }
                }
            }
            else
            {
                Client.Log("Received a DirLandReply after the timeout, ignoring", Helpers.LogLevel.Warning);
            }
        }