public override CmdResult ExecuteRequest(CmdRequest args) { RadegastInstance instance = TheBotClient.TheRadegastInstance; foreach (var set in BeamInfos) { set.UnSetPointing(); } BeamInfos.Clear(); int used; if (args.Length == 0) { if (instance != null) { instance.State.UnSetPointing(); } TheSimAvatar.SelectedBeam = !TheSimAvatar.SelectedBeam; return(Success("SelectedBeam = " + TheSimAvatar.SelectedBeam)); } var targets = args.GetProperty("targets"); List <SimObject> PS = WorldSystem.GetPrimitives(targets, out used); GridClient grc = TheBotClient; if (PS.Count == 0) { SimPosition pos = WorldSystem.GetVector(targets, out used); if (pos != null) { EffectBeamInfo info = new EffectBeamInfo(grc); info.SetPointing(pos, 3); BeamInfos.AddTo(info); return(Success(Name + " on " + pos)); } return(Failure(string.Format("Cant find {0}", string.Join(" ", args)))); } foreach (var o in PS) { EffectBeamInfo info = new EffectBeamInfo(grc); info.SetPointing(o, 3); BeamInfos.AddTo(info); Primitive p = o.Prim; if (p != null && instance != null) { instance.State.SetPointing(p, 3); } } return(Success(Name + " on " + PS.Count)); }
public bool IsMaster(Simulator simulator) { lock (MasteringRegions) { if (simulator == null) { return(client.Network.CurrentSim == null || MasteringRegions.Count == 0); } if (MasteringRegions.Contains(simulator.Handle)) { return(true); } lock (SimMaster) { if (!SimMaster.ContainsKey(simulator.Handle)) { SimMaster[simulator.Handle] = this; MasteringRegions.AddTo(simulator.Handle); return(true); } } return(false); } }
public void SelectedAdd(SimPosition o) { if (!SelectedObjects.AddTo(o) || !_SelectedBeam) { return; } if (true) { _SelectedBeam = false; SelectedBeam = true; return; } EffectBeamInfo info = new EffectBeamInfo(GetGridClient()); info.SetPointing(o, 3); BeamInfos.AddTo(info); }