Exemplo n.º 1
0
 public override void Callback(string[] args, EventArgs e)
 {
     if (base.CallFunction(args) == true)
     {
         ParcelObjectOwnersReplyEventArgs ObjectOwners = (ParcelObjectOwnersReplyEventArgs)e;
         List <UUID> owner_uuids = new List <UUID>();
         foreach (ParcelManager.ParcelPrimOwners owner in ObjectOwners.PrimOwners)
         {
             owner_uuids.Add(owner.OwnerID);
         }
         if (owner_uuids.Count > 0)
         {
             bot.GetClient.Parcels.ReturnObjects(bot.GetClient.Network.CurrentSim, targetparcel.LocalID, ObjectReturnType.List, owner_uuids);
         }
         int.TryParse(args[0], out int price);
         bot.GetClient.Parcels.ReleaseParcel(bot.GetClient.Network.CurrentSim, targetparcel.LocalID);
         targetparcel.SalePrice   = price;
         targetparcel.AuthBuyerID = UUID.Zero;
         targetparcel.OwnerID     = UUID.Zero;
         parcel_static.ParcelSetFlag(ParcelFlags.ForSale, targetparcel, true);
         parcel_static.ParcelSetFlag(ParcelFlags.ForSaleObjects, targetparcel, false);
         targetparcel.Update(bot.GetClient.Network.CurrentSim, false);
         base.Callback(args, e, true);
     }
     else
     {
         base.Callback(args, e, false);
     }
 }
Exemplo n.º 2
0
        public override void Callback(string[] args, EventArgs e)
        {
            ParcelObjectOwnersReplyEventArgs ObjectOwners = (ParcelObjectOwnersReplyEventArgs)e;
            List <UUID> owner_uuids = new List <UUID>();

            foreach (ParcelManager.ParcelPrimOwners owner in ObjectOwners.PrimOwners)
            {
                owner_uuids.Add(owner.OwnerID);
            }
            if (owner_uuids.Count > 0)
            {
                int    localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
                Parcel p       = bot.GetClient.Network.CurrentSim.Parcels[localid];
                if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
                {
                    if (parcel_static.has_parcel_perm(p, bot) == true)
                    {
                        bot.GetClient.Parcels.ReturnObjects(bot.GetClient.Network.CurrentSim, localid, ObjectReturnType.List, owner_uuids);
                        base.Callback(args, e, true);
                    }
                    else
                    {
                        base.Callback(args, e, false);
                    }
                }
                else
                {
                    base.Callback(args, e, false);
                }
            }
            else
            {
                base.Callback(args, e, false);
            }
        }
Exemplo n.º 3
0
        private void Parcel_ObjectOwners(object sender, ParcelObjectOwnersReplyEventArgs ea)
        {
            BeginInvoke(new MethodInvoker(delegate()
            {
                lvwPrimOwners.BeginUpdate();
                lvwPrimOwners.Items.Clear();
                lvwPrimOwners.Enabled = true;

                List <ParcelManager.ParcelPrimOwners> primOwners = ea.PrimOwners;

                for (int i = 0; i < primOwners.Count; i++)
                {
                    if (primOwners[i].OwnerID != UUID.Zero)
                    {
                        try
                        {
                            ListViewItem item = lvwPrimOwners.Items.Add(primOwners[i].OwnerID.ToString());
                            item.Tag          = primOwners[i].OwnerID;
                            item.SubItems.Add(primOwners[i].Count.ToString(CultureInfo.CurrentCulture));

                            //if (!instance.avnames.ContainsKey(primOwners[i].OwnerID))
                            //{
                            //    //foundItem.Text = primOwners[i].OwnerID.ToString();
                            //    client.Avatars.RequestAvatarName(primOwners[i].OwnerID);
                            //}
                            //else
                            //{
                            //    ListViewItem foundItem = lvwPrimOwners.FindItemWithText(instance.avnames[primOwners[i].OwnerID].ToString());

                            //    if (foundItem != null)
                            //    {
                            //        foundItem.Text = instance.avnames[primOwners[i].OwnerID].ToString();
                            //    }
                            //}

                            client.Avatars.RequestAvatarName(primOwners[i].OwnerID);
                        }
                        catch (Exception ex)
                        {
                            Logger.Log("About Land (object owners) error: " + ex.Message, Helpers.LogLevel.Error);
                        }
                    }
                }

                //button2.Enabled = true;

                lvwPrimOwners.EndUpdate();
                //lvwPrimOwners.Sort();
            }));

            //client.Parcels.ParcelObjectOwnersReply -= new EventHandler<ParcelObjectOwnersReplyEventArgs>(Parcel_ObjectOwners);
        }
Exemplo n.º 4
0
        public override void Callback(string[] args, EventArgs e)
        {
            ParcelObjectOwnersReplyEventArgs ObjectOwners = (ParcelObjectOwnersReplyEventArgs)e;
            int total_count = 0;

            foreach (ParcelManager.ParcelPrimOwners owner in ObjectOwners.PrimOwners)
            {
                total_count += owner.Count;
            }
            int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);

            collection.Add("sim", bot.GetClient.Network.CurrentSim.Name);
            collection.Add("parcelid", localid.ToString());
            collection.Add("count", total_count.ToString());
            base.Callback(args, e, bot.GetCommandsInterface.SmartCommandReply(true, args[0], "ok", CommandName, collection));
        }
Exemplo n.º 5
0
 protected virtual void ObjectOwnersHandler(object sender, ParcelObjectOwnersReplyEventArgs e)
 {
     if (await_events.ContainsKey("parcelobjectowners") == true)
     {
         List <string> PurgeAwaiters = new List <string>();
         foreach (KeyValuePair <string, KeyValuePair <CoreCommand, string[]> > await_reply in await_events["parcelobjectowners"])
         {
             PurgeAwaiters.Add(await_reply.Key);
             await_reply.Value.Key.Callback(await_reply.Value.Value, e);
         }
         foreach (string eventid in PurgeAwaiters)
         {
             await_event_ages.Remove(eventid);
             await_event_idtolistener.Remove(eventid);
             await_events["parcelobjectowners"].Remove(eventid);
         }
     }
 }
Exemplo n.º 6
0
        public override void Callback(string[] args, EventArgs e)
        {
            ParcelObjectOwnersReplyEventArgs ObjectOwners = (ParcelObjectOwnersReplyEventArgs)e;
            List <UUID> owner_uuids  = new List <UUID>();
            List <int>  owner_counts = new List <int>();

            foreach (ParcelManager.ParcelPrimOwners owner in ObjectOwners.PrimOwners)
            {
                owner_uuids.Add(owner.OwnerID);
                owner_counts.Add(owner.Count);
            }
            if (owner_uuids.Count > 0)
            {
                if (UUID.TryParse(args[1], out UUID avatar) == true)
                {
                    int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
                    collection.Add("sim", bot.GetClient.Network.CurrentSim.Name);
                    if (owner_uuids.Contains(avatar) == true)
                    {
                        int owner_count = owner_counts[owner_uuids.IndexOf(avatar)];
                        collection.Add("count", owner_count.ToString());
                    }
                    else
                    {
                        collection.Add("count", "0");
                    }
                    base.Callback(args, e, bot.GetCommandsInterface.SmartCommandReply(true, args[0], "avatar=" + avatar.ToString(), CommandName, collection));
                }
                else
                {
                    base.Callback(args, e, false);
                }
            }
            else
            {
                base.Callback(args, e, false);
            }
        }
Exemplo n.º 7
0
 protected virtual void ObjectOwnersHandler(object sender, ParcelObjectOwnersReplyEventArgs e)
 {
 }