Provides updates sit position data
Inheritance: System.EventArgs
Beispiel #1
0
 ///<summary>Raises the AvatarSitChanged Event</summary>
 /// <param name="e">A AvatarSitChangedEventArgs object containing
 /// the data sent from the simulator</param>
 protected virtual void OnAvatarSitChanged(AvatarSitChangedEventArgs e)
 {
     EventHandler<AvatarSitChangedEventArgs> handler = m_AvatarSitChanged;
     if (handler != null)
         handler(this, e);
 }
Beispiel #2
0
        void Objects_AvatarSitChanged(object sender, AvatarSitChangedEventArgs e)
        {
            if (e.Avatar.LocalID != client.Self.LocalID) return;

            sitting = e.SittingOn != 0;

            if (client.Self.SittingOn != 0 && !client.Network.CurrentSim.ObjectsPrimitives.ContainsKey(client.Self.SittingOn))
            {
                client.Objects.RequestObject(client.Network.CurrentSim, client.Self.SittingOn);
            }

            if (SitStateChanged != null)
            {
                SitStateChanged(this, new SitEventArgs(this.sitting));
            }
        }
Beispiel #3
0
        /*
             * TODO
             On-Avatar-Sit-Changed
            simulator: "OpenSim Test"
            avatar: '(avatar "Nephrael Rae")
            sittingOn: 3135593693
            oldSeat: 0
             */
        public override void Objects_OnAvatarSitChanged(object sender, AvatarSitChangedEventArgs e)
        {
            var simulator = e.Simulator;
            if (!IsMaster(simulator))
            {
                return;
            }
            var avatar = e.Avatar;
            var sittingOn = e.SittingOn;
            var oldSeat = e.OldSeat;
            if (avatar != null) DeclareAvatar(avatar.ID);
            if (!MaintainActions) return;
            EventQueue.Enqueue("Objects_OnAvatarSitChanged", () =>
                {
                    SimObject user = GetSimObject(avatar, simulator);
                    SimObject newSit = GetSimObject(sittingOn, simulator);
                    SimObject oldSit = GetSimObject(oldSeat, simulator);
                    string newSitName = null;
                    string oldSitName = null;
                    if (newSit != null)
                    {
                        newSitName = newSit.SitName;
                    }
                    if (newSitName == null) newSitName = "SitOnObject";
                    if (oldSit != null)
                    {
                        oldSitName = oldSit.SitName;
                    }
                    if (oldSitName == null) oldSitName = "SitOnObject";

                    //if (SendAllEvents)
                    // SendNewEvent("On-Avatar-Sit-Changed", user, newSit, oldSit);
                    if (user != null)
                    {
                        if (oldSeat != 0)
                            LogSitEvent(user, SimEventType.Stop, oldSitName,
                                        ToParameter("doneBy", user),
                                        ToParameter("objectActedOn", oldSit));
                        if (sittingOn != 0)
                            LogSitEvent(user, SimEventType.Start, newSitName,
                                        ToParameter("doneBy", user),
                                        ToParameter("objectActedOn", newSit));
                        if (sittingOn + oldSeat == 0)
                            LogSitEvent(user, SimEventType.Once, "SitChangedUnknown", ToParameter("doneBy", user));
                    }
                    else
                    {
                        //object[] eventArgs = new object[] { user, newSit, oldSit };
                        if (oldSit != null)
                            oldSit.AddCanBeTargetOf(1, SendPipelineEvent(
                                                           ACogbotEvent.CreateEvent(sender, SimEventType.Stop, newSitName,
                                                                              SimEventType.SIT | SimEventType.REGIONAL,
                                                                              ToParameter("doneBy", avatar),
                                                                              ToParameter("objectActedOn", oldSit))));
                        if (newSit != null)
                            newSit.AddCanBeTargetOf(1, SendPipelineEvent(
                                                           ACogbotEvent.CreateEvent(sender, SimEventType.Start, newSitName,
                                                                              SimEventType.SIT | SimEventType.REGIONAL,
                                                                              ToParameter("doneBy", avatar),
                                                                              ToParameter("objectActedOn", newSit))));
                    }
                });
        }
Beispiel #4
0
        void Objects_AvatarSitChanged(object sender, AvatarSitChangedEventArgs e)
        {
            if (e.Avatar.LocalID != client.Self.LocalID) return;

            this.sitting = e.SittingOn != 0;
            if (SitStateChanged != null)
            {
                SitStateChanged(this, new SitEventArgs(this.sitting));
            }
        }
Beispiel #5
0
 public virtual void Objects_OnAvatarSitChanged(object sender, AvatarSitChangedEventArgs e) { OnEvent("On-Avatar-Sit-Changed", paramNamesOnAvatarSitChanged, paramTypesOnAvatarSitChanged, e); }