public override CmdResult ExecuteRequest(CmdRequest args)
        {
            if (args.Length < 1)
            {
                return(ShowUsage());
            }
            if (args.ContainsFlag("--all"))
            {
                List <uint> ids = new List <uint>();
                foreach (SimObject o in TheSimAvatar.Children)
                {
                    Success("Detatching " + o);
                    ids.Add(o.LocalID);
                }
                Client.Objects.DetachObjects(TheSimAvatar.GetSimulator(), ids);
                return(Success("detatched all " + ids.Count));
            }

            int argsUsed;

            string[]         keyargs = args.GetProperty("targets");
            List <SimObject> PS      = WorldSystem.GetPrimitives(keyargs, out argsUsed);
            List <uint>      idz     = new List <uint>();

            foreach (var o in PS)
            {
                Success("Detatching " + o);
                idz.Add(o.LocalID);
            }
            Client.Objects.DetachObjects(TheSimAvatar.GetSimulator(), idz);
            return(Success("detatched  " + args.str + " " + idz.Count));
        }
        public override void Network_OnCurrentSimChanged(object sender, SimChangedEventArgs e)
        {
            var PreviousSimulator = e.PreviousSimulator;

            if (TheSimAvatar.GetSimulator() == PreviousSimulator)
            {
                Debug("TheSimAvatar._CurrentRegion.TheSimulator == PreviousSimulator " + PreviousSimulator);
            }
            On_ChangeSims(PreviousSimulator, client.Network.CurrentSim);
        }
 private void LeaveSimulator(Simulator simulator)
 {
     if (IsMaster(simulator))
     {
         Debug("SIM LOOSING ITS MASTER!" + this + " " + simulator);
         MasteringRegions.Remove(simulator.Handle);
         FindNewMaster(simulator.Handle);
     }
     if (TheSimAvatar.GetSimulator() == simulator)
     {
         Debug("TheSimAvatar._CurrentRegion.TheSimulator == simulator " + simulator);
     }
 }