From 87959464c9db8948bed89909913400bc2eb7524d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Dec 2009 22:21:24 -0600 Subject: Adds osKickUser and osSetSpeed Signed-off-by: Melanie --- .../Shared/Api/Implementation/OSSL_Api.cs | 77 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 4 ++ .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 16 +++++ 3 files changed, 97 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 9c7604b..5abe4b1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1983,5 +1983,82 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return (int)pws; } + public void osSetSpeed(string UUID, float SpeedModifier) + { + CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); + m_host.AddScriptLPS(1); + ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); + avatar.SpeedModifier = SpeedModifier; + } + public void osKickAvatar(string FirstName,string SurName,string alert) + { + CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); + if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) + { + foreach (ScenePresence presence in World.GetAvatars()) + { + if ((presence.Firstname == FirstName) && + presence.Lastname == SurName) + { + // kick client... + if (alert != null) + presence.ControllingClient.Kick(alert); + + // ...and close on our side + presence.Scene.IncomingCloseAgent(presence.UUID); + } + } + } + } + public void osCauseDamage(string avatar, double damage) + { + CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); + m_host.AddScriptLPS(1); + + UUID avatarId = new UUID(avatar); + Vector3 pos = m_host.GetWorldPosition(); + + ScenePresence presence = World.GetScenePresence(avatarId); + if (presence != null) + { + LandData land = World.GetLandData((float)pos.X, (float)pos.Y); + if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) + { + float health = presence.Health; + health -= (float)damage; + presence.setHealthWithUpdate(health); + if (health <= 0) + { + float healthliveagain = 100; + presence.ControllingClient.SendAgentAlertMessage("You died!", true); + presence.setHealthWithUpdate(healthliveagain); + presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient); + } + } + } + } + public void osCauseHealing(string avatar, double healing) + { + CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); + m_host.AddScriptLPS(1); + + UUID avatarId = new UUID(avatar); + ScenePresence presence = World.GetScenePresence(avatarId); + Vector3 pos = m_host.GetWorldPosition(); + bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z)); + if (result) + { + if (presence != null) + { + float health = presence.Health; + health += (float)healing; + if (health >= 100) + { + health = 100; + } + presence.setHealthWithUpdate(health); + } + } + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 580c354..ac9405e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -165,5 +165,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_List osGetRegionStats(); int osGetSimulatorMemory(); + void osKickAvatar(string FirstName,string SurName,string alert); + void osSetSpeed(string UUID, float SpeedModifier); + void osCauseHealing(string avatar, double healing); + void osCauseDamage(string avatar, double damage); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 2876ad6..2ec6226 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -647,5 +647,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_OSSL_Functions.osGetSimulatorMemory(); } + public void osKickAvatar(string FirstName,string SurName,string alert) + { + m_OSSL_Functions.osKickAvatar( FirstName, SurName, alert); + } + public void osSetSpeed(string UUID, float SpeedModifier) + { + m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); + } + public void osCauseDamage(string avatar, double damage) + { + m_OSSL_Functions.osCauseDamage(avatar, damage); + } + public void osCauseHealing(string avatar, double healing) + { + m_OSSL_Functions.osCauseHealing(avatar, healing); + } } } -- cgit v1.1 From eab2b4c6a96cd5b2a0f079f27a9c2ac15273d3f0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 31 Dec 2009 04:48:59 +0000 Subject: [PATCH] Adds llCollisionFilter Thank you, Revolution. Applied with minor changes. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 334 +++++++++++++++++---- .../Shared/Api/Implementation/LSL_Api.cs | 48 ++- 2 files changed, 315 insertions(+), 67 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index c0243a5..8ac4c37 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -107,6 +107,9 @@ namespace OpenSim.Region.Framework.Scenes [XmlIgnore] public bool DIE_AT_EDGE; + [XmlIgnore] + public Dictionary m_CollisionFilter; + // TODO: This needs to be persisted in next XML version update! [XmlIgnore] public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; @@ -451,6 +454,15 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.HasGroupChanged = true; } } + + public Dictionary CollisionFilter + { + get { return m_CollisionFilter; } + set + { + m_CollisionFilter = value; + } + } public ulong RegionHandle { @@ -1874,20 +1886,52 @@ namespace OpenSim.Region.Framework.Scenes if (m_parentGroup.Scene == null) return; - + #region collision Filter SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); if (obj != null) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object + if(data != "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this object + else + { + } + } + else + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work + if(data == "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + } } else { @@ -1899,19 +1943,52 @@ namespace OpenSim.Region.Framework.Scenes if (av.LocalId == localId) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.ControllingClient.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar + if(data != "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this avatar + else + { + } + } + else + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work + if(data == "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + } } } } + #endregion } if (colliding.Count > 0) { @@ -1945,41 +2022,105 @@ namespace OpenSim.Region.Framework.Scenes if (m_parentGroup.Scene == null) return; - + #region collision Filter SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); if (obj != null) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object + if(data != "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this object + else + { + } + } + else + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work + if(data == "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + } } else { ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); - + for (int i = 0; i < avlist.Length; i++) { ScenePresence av = avlist[i]; if (av.LocalId == localId) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar + if(data != "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this avatar + else + { + } + } + else + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work + if(data == "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + } } } } @@ -1997,6 +2138,7 @@ namespace OpenSim.Region.Framework.Scenes m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); } } + #endregion } if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) @@ -2015,19 +2157,52 @@ namespace OpenSim.Region.Framework.Scenes return; if (m_parentGroup.Scene == null) return; + #region collision Filter SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); if (obj != null) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object + if(data != "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this object + else + { + } + } + else + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work + if(data == "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + } } else { @@ -2039,19 +2214,52 @@ namespace OpenSim.Region.Framework.Scenes if (av.LocalId == localId) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar + if(data != "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this avatar + else + { + } + } + else + { + string data = ""; + m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work + if(data == "") + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + } } } } + #endregion } if (colliding.Count > 0) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6102504..43df4ab 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2752,7 +2752,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionFilter(string name, string id, int accept) { m_host.AddScriptLPS(1); - NotImplemented("llCollisionFilter"); + m_host.CollisionFilter.Clear(); + if(id != null) + { + m_host.CollisionFilter.Add(accept,id); + } + else + { + m_host.CollisionFilter.Add(accept,name); + } } public void llTakeControls(int controls, int accept, int pass_on) @@ -8204,11 +8212,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return -1; } - + public void llSetInventoryPermMask(string item, int mask, int value) { - m_host.AddScriptLPS(1); - NotImplemented("llSetInventoryPermMask"); + m_host.AddScriptLPS(1); + if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) + { + if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) + { + lock (m_host.TaskInventory) + { + foreach (KeyValuePair inv in m_host.TaskInventory) + { + if (inv.Value.Name == item) + { + switch (mask) + { + case 0: + inv.Value.BasePermissions = (uint)value; + break; + case 1: + inv.Value.CurrentPermissions = (uint)value; + break; + case 2: + inv.Value.GroupPermissions = (uint)value; + break; + case 3: + inv.Value.EveryonePermissions = (uint)value; + break; + case 4: + inv.Value.NextPermissions = (uint)value; + break; + } + } + } + } + } + } } public LSL_String llGetInventoryCreator(string item) -- cgit v1.1 From 9c4e6f060ad40fdc20b6b80a0e282f97e85fae75 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 31 Dec 2009 06:41:10 +0000 Subject: This patch caused serialization errors and needs to be reexamined Revert "[PATCH] Adds llCollisionFilter" This reverts commit eab2b4c6a96cd5b2a0f079f27a9c2ac15273d3f0. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 334 ++++----------------- .../Shared/Api/Implementation/LSL_Api.cs | 48 +-- 2 files changed, 67 insertions(+), 315 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8ac4c37..c0243a5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -107,9 +107,6 @@ namespace OpenSim.Region.Framework.Scenes [XmlIgnore] public bool DIE_AT_EDGE; - [XmlIgnore] - public Dictionary m_CollisionFilter; - // TODO: This needs to be persisted in next XML version update! [XmlIgnore] public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; @@ -454,15 +451,6 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.HasGroupChanged = true; } } - - public Dictionary CollisionFilter - { - get { return m_CollisionFilter; } - set - { - m_CollisionFilter = value; - } - } public ulong RegionHandle { @@ -1886,52 +1874,20 @@ namespace OpenSim.Region.Framework.Scenes if (m_parentGroup.Scene == null) return; - #region collision Filter + SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); if (obj != null) { - if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this object - if(data != "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); - } - //If it is 0, it is to not accept collisions from this object - else - { - } - } - else - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work - if(data == "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); - } - } + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); } else { @@ -1943,52 +1899,19 @@ namespace OpenSim.Region.Framework.Scenes if (av.LocalId == localId) { - if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this avatar - if(data != "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.ControllingClient.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); - } - //If it is 0, it is to not accept collisions from this avatar - else - { - } - } - else - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work - if(data == "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.ControllingClient.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); - } - } + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); } } } - #endregion } if (colliding.Count > 0) { @@ -2022,105 +1945,41 @@ namespace OpenSim.Region.Framework.Scenes if (m_parentGroup.Scene == null) return; - #region collision Filter + SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); if (obj != null) { - if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this object - if(data != "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); - } - //If it is 0, it is to not accept collisions from this object - else - { - } - } - else - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work - if(data == "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); - } - } + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); } else { ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); - + for (int i = 0; i < avlist.Length; i++) { ScenePresence av = avlist[i]; if (av.LocalId == localId) { - if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this avatar - if(data != "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.ControllingClient.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); - } - //If it is 0, it is to not accept collisions from this avatar - else - { - } - } - else - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work - if(data == "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.ControllingClient.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); - } - } + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); } } } @@ -2138,7 +1997,6 @@ namespace OpenSim.Region.Framework.Scenes m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); } } - #endregion } if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) @@ -2157,52 +2015,19 @@ namespace OpenSim.Region.Framework.Scenes return; if (m_parentGroup.Scene == null) return; - #region collision Filter SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); if (obj != null) { - if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this object - if(data != "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); - } - //If it is 0, it is to not accept collisions from this object - else - { - } - } - else - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work - if(data == "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); - } - } + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); } else { @@ -2214,52 +2039,19 @@ namespace OpenSim.Region.Framework.Scenes if (av.LocalId == localId) { - if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this avatar - if(data != "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.ControllingClient.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); - } - //If it is 0, it is to not accept collisions from this avatar - else - { - } - } - else - { - string data = ""; - m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); - //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work - if(data == "") - { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.ControllingClient.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); - } - } + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); } } } - #endregion } if (colliding.Count > 0) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 43df4ab..6102504 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2752,15 +2752,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionFilter(string name, string id, int accept) { m_host.AddScriptLPS(1); - m_host.CollisionFilter.Clear(); - if(id != null) - { - m_host.CollisionFilter.Add(accept,id); - } - else - { - m_host.CollisionFilter.Add(accept,name); - } + NotImplemented("llCollisionFilter"); } public void llTakeControls(int controls, int accept, int pass_on) @@ -8212,43 +8204,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return -1; } - + public void llSetInventoryPermMask(string item, int mask, int value) { - m_host.AddScriptLPS(1); - if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) - { - if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) - { - lock (m_host.TaskInventory) - { - foreach (KeyValuePair inv in m_host.TaskInventory) - { - if (inv.Value.Name == item) - { - switch (mask) - { - case 0: - inv.Value.BasePermissions = (uint)value; - break; - case 1: - inv.Value.CurrentPermissions = (uint)value; - break; - case 2: - inv.Value.GroupPermissions = (uint)value; - break; - case 3: - inv.Value.EveryonePermissions = (uint)value; - break; - case 4: - inv.Value.NextPermissions = (uint)value; - break; - } - } - } - } - } - } + m_host.AddScriptLPS(1); + NotImplemented("llSetInventoryPermMask"); } public LSL_String llGetInventoryCreator(string item) -- cgit v1.1 From 234d4e11059fb2e1fc9dbe879054bd84e95b502b Mon Sep 17 00:00:00 2001 From: Revolution Date: Wed, 30 Dec 2009 21:45:10 -0600 Subject: Adds tons of packets. Applied with change: Changed spelling to Summary (from Summery) Signed-off-by: Melanie --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 31 ++ .../Sirikata/ClientStack/SirikataClientView.cs | 31 ++ .../Client/VWoHTTP/ClientStack/VWHClientView.cs | 31 ++ OpenSim/Framework/IClientAPI.cs | 68 +++ .../Region/ClientStack/LindenUDP/LLClientView.cs | 522 ++++++++++++++++++++- .../Framework/EventQueue/EventQueueGetModule.cs | 5 + .../Framework/EventQueue/EventQueueHelper.cs | 42 ++ .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 32 ++ .../Server/IRCClientView.cs | 31 ++ .../Region/OptionalModules/World/NPC/NPCAvatar.cs | 32 ++ OpenSim/Tests/Common/Mock/TestClient.cs | 32 ++ 11 files changed, 854 insertions(+), 3 deletions(-) diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 0141718..b3582e9 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -756,6 +756,25 @@ namespace OpenSim.Client.MXP.ClientStack public event AvatarNotesUpdate OnAvatarNotesUpdate; public event MuteListRequest OnMuteListRequest; public event AvatarInterestUpdate OnAvatarInterestUpdate; + public event FindAgentUpdate OnFindAgentEvent; + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public event PlacesQuery OnPlacesQuery; @@ -1659,5 +1678,17 @@ namespace OpenSim.Client.MXP.ClientStack public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) { } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + } + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + { + } + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) + { + } } } diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index e8d1889..75b2347 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs @@ -374,6 +374,25 @@ namespace OpenSim.Client.Sirikata.ClientStack public event GrantUserFriendRights OnGrantUserRights; public event MuteListRequest OnMuteListRequest; public event PlacesQuery OnPlacesQuery; + public event FindAgentUpdate OnFindAgentEvent; + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; public void SetDebugPacketLevel(int newDebug) { throw new System.NotImplementedException(); @@ -1121,6 +1140,18 @@ namespace OpenSim.Client.Sirikata.ClientStack { throw new System.NotImplementedException(); } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + } + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + { + } + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) + { + } #endregion } diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index 74cecea..029e23f 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -405,6 +405,25 @@ namespace OpenSim.Client.VWoHTTP.ClientStack public event MuteListRequest OnMuteListRequest = delegate { }; public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { }; public event PlacesQuery OnPlacesQuery = delegate { }; + public event FindAgentUpdate OnFindAgentEvent = delegate { }; + public event TrackAgentUpdate OnTrackAgentEvent = delegate { }; + public event NewUserReport OnUserReportEvent = delegate { }; + public event SaveStateHandler OnSaveStateEvent = delegate { }; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest = delegate { }; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest = delegate { }; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest = delegate { }; + public event FreezeUserUpdate OnParcelFreezeUserEvent = delegate { }; + public event EjectUserUpdate OnParcelEjectUserEvent = delegate { }; + public event ParcelBuyPass OnParcelBuyPass = delegate { }; + public event ParcelGodMark OnParcelGodMark = delegate { }; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest = delegate { }; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest = delegate { }; + public event SimWideDeletesDelegate OnSimWideDeletes = delegate { }; + public event SendPostcard OnSendPostcard = delegate { }; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent = delegate { }; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent = delegate { }; + public event GodlikeMessage onGodlikeMessageEvent = delegate { }; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent = delegate { }; @@ -1165,5 +1184,17 @@ namespace OpenSim.Client.VWoHTTP.ClientStack public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) { } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + } + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + { + } + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) + { + } } } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index f83fea2..bbd9cf1 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -452,6 +452,47 @@ namespace OpenSim.Framework public delegate void AgentFOV(IClientAPI client, float verticalAngle); public delegate double UpdatePriorityHandler(UpdatePriorityData data); + + public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int Flags,UUID AgentID); + + public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name, UUID AgentID); + + public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); + + public delegate void FindAgentUpdate(IClientAPI client, UUID hunter, UUID target); + + public delegate void TrackAgentUpdate(IClientAPI client, UUID hunter, UUID target); + + public delegate void FreezeUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); + + public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); + + public delegate void NewUserReport(IClientAPI client, string regionName,UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType ,UUID screenshotID, string summery, UUID reporter); + + public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY); + + public delegate void GodlikeMessage(IClientAPI client, UUID requester, byte[] Method, byte[] Parameter); + + public delegate void SaveStateHandler(IClientAPI client,UUID agentID); + + public delegate void GroupAccountSummaryRequest(IClientAPI client,UUID agentID, UUID groupID); + + public delegate void GroupAccountDetailsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); + + public delegate void GroupAccountTransactionsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); + + public delegate void ParcelBuyPass(IClientAPI client, UUID agentID, int ParcelLocalID); + + public delegate void ParcelGodMark(IClientAPI client, UUID agentID, int ParcelLocalID); + + public delegate void GroupActiveProposalsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); + + public delegate void GroupVoteHistoryRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); + + + public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID); + + public delegate void SendPostcard(IClientAPI client); #endregion @@ -1028,6 +1069,26 @@ namespace OpenSim.Framework event PlacesQuery OnPlacesQuery; + event FindAgentUpdate OnFindAgentEvent; + event TrackAgentUpdate OnTrackAgentEvent; + event NewUserReport OnUserReportEvent; + event SaveStateHandler OnSaveStateEvent; + event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + event FreezeUserUpdate OnParcelFreezeUserEvent; + event EjectUserUpdate OnParcelEjectUserEvent; + event ParcelBuyPass OnParcelBuyPass; + event ParcelGodMark OnParcelGodMark; + event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + event SimWideDeletesDelegate OnSimWideDeletes; + event SendPostcard OnSendPostcard; + event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + event MuteListEntryRemove OnRemoveMuteListEntryEvent; + event GodlikeMessage onGodlikeMessageEvent; + event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; + /// /// Set the debug level at which packet output should be printed to console. /// @@ -1394,5 +1455,12 @@ namespace OpenSim.Framework void SendRebakeAvatarTextures(UUID textureID); void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages); + + void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt); + + void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier); + + void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt); + } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index f02c28b..a5139c1 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -298,6 +298,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event AvatarInterestUpdate OnAvatarInterestUpdate; public event PlacesQuery OnPlacesQuery; public event AgentFOV OnAgentFOV; + public event FindAgentUpdate OnFindAgentEvent; + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; + #endregion Events @@ -805,6 +825,189 @@ namespace OpenSim.Region.ClientStack.LindenUDP } OutPacket(gmp, ThrottleOutPacketType.Task); } + + public void SendGroupActiveProposals(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary VoteID, Dictionary VoteInitiator, Dictionary Majority, Dictionary Quorum, Dictionary TerseDateID, Dictionary StartDateTime, Dictionary EndDateTime, Dictionary ProposalText) + { + foreach(KeyValuePair Blank in VoteID) + { + GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); + + GAPIRP.AgentData.AgentID = agentID; + GAPIRP.AgentData.GroupID = groupID; + GAPIRP.TransactionData.TransactionID = transactionID; + GAPIRP.TransactionData.TotalNumItems = 1; + GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); + GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; + ProposalData.VoteCast = Utils.StringToBytes("false"); + ProposalData.VoteID = new UUID(VoteID[Blank.Key]); + ProposalData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); + ProposalData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); + ProposalData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); + ProposalData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); + ProposalData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); + ProposalData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); + ProposalData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); + ProposalData.AlreadyVoted = false; + GAPIRP.ProposalData[0] = ProposalData; + OutPacket(GAPIRP, ThrottleOutPacketType.Task); + } + if(VoteID.Count == 0) + { + GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); + + GAPIRP.AgentData.AgentID = agentID; + GAPIRP.AgentData.GroupID = groupID; + GAPIRP.TransactionData.TransactionID = transactionID; + GAPIRP.TransactionData.TotalNumItems = 1; + GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); + GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; + ProposalData.VoteCast = Utils.StringToBytes("false"); + ProposalData.VoteID = UUID.Zero; + ProposalData.VoteInitiator = UUID.Zero; + ProposalData.Majority = 0; + ProposalData.Quorum = 0; + ProposalData.TerseDateID = Utils.StringToBytes(""); + ProposalData.StartDateTime = Utils.StringToBytes(""); + ProposalData.EndDateTime = Utils.StringToBytes(""); + ProposalData.ProposalText = Utils.StringToBytes(""); + ProposalData.AlreadyVoted = false; + GAPIRP.ProposalData[0] = ProposalData; + OutPacket(GAPIRP, ThrottleOutPacketType.Task); + } + } + + public void SendGroupVoteHistory(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary VoteID, Dictionary VoteInitiator, Dictionary Majority, Dictionary Quorum, Dictionary TerseDateID, Dictionary StartDateTime, Dictionary EndDateTime, Dictionary VoteType, Dictionary VoteResult, Dictionary ProposalText) + { + foreach(KeyValuePair Blank in VoteID) + { + GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); + + GVHIRP.AgentData.AgentID = agentID; + GVHIRP.AgentData.GroupID = groupID; + GVHIRP.TransactionData.TransactionID = transactionID; + GVHIRP.TransactionData.TotalNumItems = 1; + GVHIRP.HistoryItemData.VoteID = new UUID(VoteID[Blank.Key]); + GVHIRP.HistoryItemData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); + GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); + GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); + GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); + GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); + GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); + GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(VoteType[Blank.Key]); + GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(VoteResult[Blank.Key]); + GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); + GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); + GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; + VoteItem.CandidateID = UUID.Zero; + VoteItem.NumVotes = 0; //TODO: FIX THIS!!! + VoteItem.VoteCast = Utils.StringToBytes("Yes"); + GVHIRP.VoteItem[0] = VoteItem; + OutPacket(GVHIRP, ThrottleOutPacketType.Task); + } + if(VoteID.Count == 0) + { + GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); + + GVHIRP.AgentData.AgentID = agentID; + GVHIRP.AgentData.GroupID = groupID; + GVHIRP.TransactionData.TransactionID = transactionID; + GVHIRP.TransactionData.TotalNumItems = 0; + GVHIRP.HistoryItemData.VoteID = UUID.Zero; + GVHIRP.HistoryItemData.VoteInitiator = UUID.Zero; + GVHIRP.HistoryItemData.Majority = 0; + GVHIRP.HistoryItemData.Quorum = 0; + GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(""); + GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); + GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; + VoteItem.CandidateID = UUID.Zero; + VoteItem.NumVotes = 0; //TODO: FIX THIS!!! + VoteItem.VoteCast = Utils.StringToBytes("No"); + GVHIRP.VoteItem[0] = VoteItem; + OutPacket(GVHIRP, ThrottleOutPacketType.Task); + } + } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + GroupAccountDetailsReplyPacket GADRP = new GroupAccountDetailsReplyPacket(); + GADRP.AgentData = new GroupAccountDetailsReplyPacket.AgentDataBlock(); + GADRP.AgentData.AgentID = sender.AgentId; + GADRP.AgentData.GroupID = groupID; + GADRP.HistoryData = new GroupAccountDetailsReplyPacket.HistoryDataBlock[1]; + GroupAccountDetailsReplyPacket.HistoryDataBlock History = new GroupAccountDetailsReplyPacket.HistoryDataBlock(); + GADRP.MoneyData = new GroupAccountDetailsReplyPacket.MoneyDataBlock(); + GADRP.MoneyData.CurrentInterval = 0; + GADRP.MoneyData.IntervalDays = 7; + GADRP.MoneyData.RequestID = transactionID; + GADRP.MoneyData.StartDate = Utils.StringToBytes(DateTime.Today.ToString()); + History.Amount = amt; + History.Description = Utils.StringToBytes(""); + GADRP.HistoryData[0] = History; + OutPacket(GADRP, ThrottleOutPacketType.Task); + } + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + { + GroupAccountSummaryReplyPacket GASRP = + (GroupAccountSummaryReplyPacket)PacketPool.Instance.GetPacket( + PacketType.GroupAccountSummaryReply); + + GASRP.AgentData = new GroupAccountSummaryReplyPacket.AgentDataBlock(); + GASRP.AgentData.AgentID = sender.AgentId; + GASRP.AgentData.GroupID = groupID; + GASRP.MoneyData = new GroupAccountSummaryReplyPacket.MoneyDataBlock(); + GASRP.MoneyData.Balance = (int)moneyAmt; + GASRP.MoneyData.TotalCredits = totalTier; + GASRP.MoneyData.TotalDebits = usedTier; + GASRP.MoneyData.StartDate = new byte[1]; + GASRP.MoneyData.CurrentInterval = 1; + GASRP.MoneyData.GroupTaxCurrent = 0; + GASRP.MoneyData.GroupTaxEstimate = 0; + GASRP.MoneyData.IntervalDays = 0; + GASRP.MoneyData.LandTaxCurrent = 0; + GASRP.MoneyData.LandTaxEstimate = 0; + GASRP.MoneyData.LastTaxDate = new byte[1]; + GASRP.MoneyData.LightTaxCurrent = 0; + GASRP.MoneyData.TaxDate = new byte[1]; + GASRP.MoneyData.RequestID = sender.AgentId; + GASRP.MoneyData.ParcelDirFeeEstimate = 0; + GASRP.MoneyData.ParcelDirFeeCurrent = 0; + GASRP.MoneyData.ObjectTaxEstimate = 0; + GASRP.MoneyData.NonExemptMembers = 0; + GASRP.MoneyData.ObjectTaxCurrent = 0; + GASRP.MoneyData.LightTaxEstimate = 0; + OutPacket(GASRP, ThrottleOutPacketType.Task); + } + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + GroupAccountTransactionsReplyPacket GATRP = + (GroupAccountTransactionsReplyPacket)PacketPool.Instance.GetPacket( + PacketType.GroupAccountTransactionsReply); + + GATRP.AgentData = new GroupAccountTransactionsReplyPacket.AgentDataBlock(); + GATRP.AgentData.AgentID = sender.AgentId; + GATRP.AgentData.GroupID = groupID; + GATRP.MoneyData = new GroupAccountTransactionsReplyPacket.MoneyDataBlock(); + GATRP.MoneyData.CurrentInterval = 0; + GATRP.MoneyData.IntervalDays = 7; + GATRP.MoneyData.RequestID = transactionID; + GATRP.MoneyData.StartDate = Utils.StringToBytes(DateTime.Today.ToString()); + GATRP.HistoryData = new GroupAccountTransactionsReplyPacket.HistoryDataBlock[1]; + GroupAccountTransactionsReplyPacket.HistoryDataBlock History = new GroupAccountTransactionsReplyPacket.HistoryDataBlock(); + History.Amount = 0; + History.Item = Utils.StringToBytes(""); + History.Time = Utils.StringToBytes(""); + History.Type = 0; + History.User = Utils.StringToBytes(""); + GATRP.HistoryData[0] = History; + OutPacket(GATRP, ThrottleOutPacketType.Task); + } /// /// Send the region heightmap to the client @@ -4554,6 +4757,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate); AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights); AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery); + AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry); + AddLocalPacketHandler(PacketType.RemoveMuteListEntry, HandleRemoveMuteListEntry); + AddLocalPacketHandler(PacketType.UserReport, HandleUserReport); + AddLocalPacketHandler(PacketType.FindAgent, HandleFindAgent); + AddLocalPacketHandler(PacketType.TrackAgent, HandleTrackAgent); + AddLocalPacketHandler(PacketType.GodUpdateRegionInfo, HandleGodUpdateRegionInfoUpdate); + AddLocalPacketHandler(PacketType.GodlikeMessage, HandleGodlikeMessage); + AddLocalPacketHandler(PacketType.StateSave, HandleSaveStatePacket); + AddLocalPacketHandler(PacketType.GroupAccountDetailsRequest, HandleGroupAccountDetailsRequest); + AddLocalPacketHandler(PacketType.GroupAccountSummaryRequest, HandleGroupAccountSummaryRequest); + AddLocalPacketHandler(PacketType.GroupAccountTransactionsRequest, HandleGroupTransactionsDetailsRequest); + AddLocalPacketHandler(PacketType.FreezeUser, HandleFreezeUser); + AddLocalPacketHandler(PacketType.EjectUser, HandleEjectUser); + AddLocalPacketHandler(PacketType.ParcelBuyPass, HandleParcelBuyPass); + AddLocalPacketHandler(PacketType.ParcelGodMarkAsContent, HandleParcelGodMarkAsContent); + AddLocalPacketHandler(PacketType.GroupActiveProposalsRequest, HandleGroupActiveProposalsRequest); + AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest); + AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes); + AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard); } #region Packet Handlers @@ -4649,7 +4871,72 @@ namespace OpenSim.Region.ClientStack.LindenUDP return false; } - + + private bool HandleParcelGodMarkAsContent(IClientAPI client, Packet Packet) + { + ParcelGodMarkAsContentPacket ParcelGodMarkAsContent = + (ParcelGodMarkAsContentPacket)Packet; + + ParcelGodMark ParcelGodMarkAsContentHandler = OnParcelGodMark; + if (ParcelGodMarkAsContentHandler != null) + { + ParcelGodMarkAsContentHandler(this, + ParcelGodMarkAsContent.AgentData.AgentID, + ParcelGodMarkAsContent.ParcelData.LocalID); + return true; + } + return false; + } + + private bool HandleFreezeUser(IClientAPI client, Packet Packet) + { + FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; + + FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUserEvent; + if (FreezeUserHandler != null) + { + FreezeUserHandler(this, + FreezeUser.AgentData.AgentID, + FreezeUser.Data.Flags, + FreezeUser.Data.TargetID); + return true; + } + return false; + } + + private bool HandleEjectUser(IClientAPI client, Packet Packet) + { + EjectUserPacket EjectUser = + (EjectUserPacket)Packet; + + EjectUserUpdate EjectUserHandler = OnParcelEjectUserEvent; + if (EjectUserHandler != null) + { + EjectUserHandler(this, + EjectUser.AgentData.AgentID, + EjectUser.Data.Flags, + EjectUser.Data.TargetID); + return true; + } + return false; + } + + private bool HandleParcelBuyPass(IClientAPI client, Packet Packet) + { + ParcelBuyPassPacket ParcelBuyPass = + (ParcelBuyPassPacket)Packet; + + ParcelBuyPass ParcelBuyPassHandler = OnParcelBuyPass; + if (ParcelBuyPassHandler != null) + { + ParcelBuyPassHandler(this, + ParcelBuyPass.AgentData.AgentID, + ParcelBuyPass.ParcelData.LocalID); + return true; + } + return false; + } + private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack) { ParcelBuyPacket parcel = (ParcelBuyPacket)Pack; @@ -5015,7 +5302,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return true; } - + + private bool HandleFindAgent(IClientAPI client, Packet Packet) + { + FindAgentPacket FindAgent = + (FindAgentPacket)Packet; + + FindAgentUpdate FindAgentHandler = OnFindAgentEvent; + if (FindAgentHandler != null) + { + FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey); + return true; + } + return false; + } + + private bool HandleTrackAgent(IClientAPI client, Packet Packet) + { + TrackAgentPacket TrackAgent = + (TrackAgentPacket)Packet; + + TrackAgentUpdate TrackAgentHandler = OnTrackAgentEvent; + if (TrackAgentHandler != null) + { + TrackAgentHandler(this, + TrackAgent.AgentData.AgentID, + TrackAgent.TargetData.PreyID); + return true; + } + return false; + } + private bool HandlerRezObject(IClientAPI sender, Packet Pack) { RezObjectPacket rezPacket = (RezObjectPacket)Pack; @@ -8285,6 +8602,70 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } + + private bool HandleGodUpdateRegionInfoUpdate(IClientAPI client, Packet Packet) + { + GodUpdateRegionInfoPacket GodUpdateRegionInfo = + (GodUpdateRegionInfoPacket)Packet; + + GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdateEvent; + if (handlerGodUpdateRegionInfo != null) + { + handlerGodUpdateRegionInfo(this, + GodUpdateRegionInfo.RegionInfo.BillableFactor, + GodUpdateRegionInfo.RegionInfo.EstateID, + GodUpdateRegionInfo.RegionInfo.RegionFlags, + GodUpdateRegionInfo.RegionInfo.SimName, + GodUpdateRegionInfo.RegionInfo.RedirectGridX, + GodUpdateRegionInfo.RegionInfo.RedirectGridY); + return true; + } + return false; + } + + private bool HandleSimWideDeletes(IClientAPI client, Packet Packet) + { + SimWideDeletesPacket SimWideDeletesRequest = + (SimWideDeletesPacket)Packet; + SimWideDeletesDelegate handlerSimWideDeletesRequest = OnSimWideDeletes; + if (handlerSimWideDeletesRequest != null) + { + handlerSimWideDeletesRequest(this, SimWideDeletesRequest.AgentData.AgentID,(int)SimWideDeletesRequest.DataBlock.Flags,SimWideDeletesRequest.DataBlock.TargetID); + return true; + } + return false; + } + + private bool HandleGodlikeMessage(IClientAPI client, Packet Packet) + { + GodlikeMessagePacket GodlikeMessage = + (GodlikeMessagePacket)Packet; + + GodlikeMessage handlerGodlikeMessage = onGodlikeMessageEvent; + if (handlerGodlikeMessage != null) + { + handlerGodlikeMessage(this, + GodlikeMessage.MethodData.Invoice, + GodlikeMessage.MethodData.Method, + GodlikeMessage.ParamList[0].Parameter); + return true; + } + return false; + } + + private bool HandleSaveStatePacket(IClientAPI client, Packet Packet) + { + StateSavePacket SaveStateMessage = + (StateSavePacket)Packet; + SaveStateHandler handlerSaveStatePacket = OnSaveStateEvent; + if (handlerSaveStatePacket != null) + { + handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID); + return true; + } + return false; + } + private bool HandleGodKickUser(IClientAPI sender, Packet Pack) { GodKickUserPacket gkupack = (GodKickUserPacket)Pack; @@ -8635,6 +9016,76 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return true; } + + private bool HandleUpdateMuteListEntry(IClientAPI client, Packet Packet) + { + UpdateMuteListEntryPacket UpdateMuteListEntry = + (UpdateMuteListEntryPacket)Packet; + MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntryEvent; + if (handlerUpdateMuteListEntry != null) + { + handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, + Utils.BytesToString(UpdateMuteListEntry.MuteData.MuteName), + UpdateMuteListEntry.MuteData.MuteType, + UpdateMuteListEntry.AgentData.AgentID); + return true; + } + return false; + } + + private bool HandleRemoveMuteListEntry(IClientAPI client, Packet Packet) + { + RemoveMuteListEntryPacket RemoveMuteListEntry = + (RemoveMuteListEntryPacket)Packet; + MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntryEvent; + if (handlerRemoveMuteListEntry != null) + { + handlerRemoveMuteListEntry(this, + RemoveMuteListEntry.MuteData.MuteID, + Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName), + RemoveMuteListEntry.AgentData.AgentID); + return true; + } + return false; + } + + private bool HandleUserReport(IClientAPI client, Packet Packet) + { + UserReportPacket UserReport = + (UserReportPacket)Packet; + + NewUserReport handlerUserReport = OnUserReportEvent; + if (handlerUserReport != null) + { + handlerUserReport(this, + Utils.BytesToString(UserReport.ReportData.AbuseRegionName), + UserReport.ReportData.AbuserID, + UserReport.ReportData.Category, + UserReport.ReportData.CheckFlags, + Utils.BytesToString(UserReport.ReportData.Details), + UserReport.ReportData.ObjectID, + UserReport.ReportData.Position, + UserReport.ReportData.ReportType, + UserReport.ReportData.ScreenshotID, + Utils.BytesToString(UserReport.ReportData.Summary), + UserReport.AgentData.AgentID); + return true; + } + return false; + } + + private bool HandleSendPostcard(IClientAPI client, Packet packet) + { + SendPostcardPacket SendPostcard = + (SendPostcardPacket)packet; + SendPostcard handlerSendPostcard = OnSendPostcard; + if (handlerSendPostcard != null) + { + handlerSendPostcard(this); + return true; + } + return false; + } private bool HandleUseCircuitCode(IClientAPI sender, Packet Pack) { @@ -8904,7 +9355,72 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } - + + private bool HandleGroupVoteHistoryRequest(IClientAPI client, Packet Packet) + { + GroupVoteHistoryRequestPacket GroupVoteHistoryRequest = + (GroupVoteHistoryRequestPacket)Packet; + GroupVoteHistoryRequest handlerGroupVoteHistoryRequest = OnGroupVoteHistoryRequest; + if (handlerGroupVoteHistoryRequest != null) + { + handlerGroupVoteHistoryRequest(this, GroupVoteHistoryRequest.AgentData.AgentID,GroupVoteHistoryRequest.AgentData.SessionID,GroupVoteHistoryRequest.GroupData.GroupID,GroupVoteHistoryRequest.TransactionData.TransactionID); + return true; + } + return false; + } + + private bool HandleGroupActiveProposalsRequest(IClientAPI client, Packet Packet) + { + GroupActiveProposalsRequestPacket GroupActiveProposalsRequest = + (GroupActiveProposalsRequestPacket)Packet; + GroupActiveProposalsRequest handlerGroupActiveProposalsRequest = OnGroupActiveProposalsRequest; + if (handlerGroupActiveProposalsRequest != null) + { + handlerGroupActiveProposalsRequest(this, GroupActiveProposalsRequest.AgentData.AgentID,GroupActiveProposalsRequest.AgentData.SessionID,GroupActiveProposalsRequest.GroupData.GroupID,GroupActiveProposalsRequest.TransactionData.TransactionID); + return true; + } + return false; + } + + private bool HandleGroupAccountDetailsRequest(IClientAPI client, Packet Packet) + { + GroupAccountDetailsRequestPacket GroupAccountDetailsRequest = + (GroupAccountDetailsRequestPacket)Packet; + GroupAccountDetailsRequest handlerGroupAccountDetailsRequest = OnGroupAccountDetailsRequest; + if (handlerGroupAccountDetailsRequest != null) + { + handlerGroupAccountDetailsRequest(this, GroupAccountDetailsRequest.AgentData.AgentID,GroupAccountDetailsRequest.AgentData.GroupID,GroupAccountDetailsRequest.MoneyData.RequestID,GroupAccountDetailsRequest.AgentData.SessionID); + return true; + } + return false; + } + + private bool HandleGroupAccountSummaryRequest(IClientAPI client, Packet Packet) + { + GroupAccountSummaryRequestPacket GroupAccountSummaryRequest = + (GroupAccountSummaryRequestPacket)Packet; + GroupAccountSummaryRequest handlerGroupAccountSummaryRequest = OnGroupAccountSummaryRequest; + if (handlerGroupAccountSummaryRequest != null) + { + handlerGroupAccountSummaryRequest(this, GroupAccountSummaryRequest.AgentData.AgentID,GroupAccountSummaryRequest.AgentData.GroupID); + return true; + } + return false; + } + + private bool HandleGroupTransactionsDetailsRequest(IClientAPI client, Packet Packet) + { + GroupAccountTransactionsRequestPacket GroupAccountTransactionsRequest = + (GroupAccountTransactionsRequestPacket)Packet; + GroupAccountTransactionsRequest handlerGroupAccountTransactionsRequest = OnGroupAccountTransactionsRequest; + if (handlerGroupAccountTransactionsRequest != null) + { + handlerGroupAccountTransactionsRequest(this, GroupAccountTransactionsRequest.AgentData.AgentID,GroupAccountTransactionsRequest.AgentData.GroupID,GroupAccountTransactionsRequest.MoneyData.RequestID,GroupAccountTransactionsRequest.AgentData.SessionID); + return true; + } + return false; + } + private bool HandleGroupTitlesRequest(IClientAPI sender, Packet Pack) { GroupTitlesRequestPacket groupTitlesRequest = diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 1b23d92..0c6cb1b 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs @@ -708,5 +708,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue OSD item = EventQueueHelper.GroupMembership(groupUpdate); Enqueue(item, avatarID); } + public void QueryReply(PlacesReplyPacket groupUpdate, UUID avatarID) + { + OSD item = EventQueueHelper.PlacesQuery(groupUpdate); + Enqueue(item, avatarID); + } } } diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs index c50318d..67fc8e6 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs @@ -454,6 +454,48 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue return groupUpdate; } + + public static OSD PlacesQuery(PlacesReplyPacket PlacesReply) + { + OSDMap placesReply = new OSDMap(); + placesReply.Add("message", OSD.FromString("PlacesReplyMessage")); + + OSDMap body = new OSDMap(); + OSDArray agentData = new OSDArray(); + OSDMap agentDataMap = new OSDMap(); + agentDataMap.Add("AgentID", OSD.FromUUID(PlacesReply.AgentData.AgentID)); + agentDataMap.Add("QueryID", OSD.FromUUID(PlacesReply.AgentData.QueryID)); + agentDataMap.Add("TransactionID", OSD.FromUUID(PlacesReply.TransactionData.TransactionID)); + agentData.Add(agentDataMap); + body.Add("AgentData", agentData); + + OSDArray QueryData = new OSDArray(); + + foreach (PlacesReplyPacket.QueryDataBlock groupDataBlock in PlacesReply.QueryData) + { + OSDMap QueryDataMap = new OSDMap(); + QueryDataMap.Add("ActualArea", OSD.FromInteger(groupDataBlock.ActualArea)); + QueryDataMap.Add("BillableArea", OSD.FromInteger(groupDataBlock.BillableArea)); + QueryDataMap.Add("Description", OSD.FromBinary(groupDataBlock.Desc)); + QueryDataMap.Add("Dwell", OSD.FromInteger((int)groupDataBlock.Dwell)); + QueryDataMap.Add("Flags", OSD.FromString(Convert.ToString(groupDataBlock.Flags))); + QueryDataMap.Add("GlobalX", OSD.FromInteger((int)groupDataBlock.GlobalX)); + QueryDataMap.Add("GlobalY", OSD.FromInteger((int)groupDataBlock.GlobalY)); + QueryDataMap.Add("GlobalZ", OSD.FromInteger((int)groupDataBlock.GlobalZ)); + QueryDataMap.Add("Name", OSD.FromBinary(groupDataBlock.Name)); + QueryDataMap.Add("OwnerID", OSD.FromUUID(groupDataBlock.OwnerID)); + QueryDataMap.Add("SimName", OSD.FromBinary(groupDataBlock.SimName)); + QueryDataMap.Add("SnapShotID", OSD.FromUUID(groupDataBlock.SnapshotID)); + QueryDataMap.Add("ProductSku", OSD.FromInteger(0)); + QueryDataMap.Add("Price", OSD.FromInteger(groupDataBlock.Price)); + + QueryData.Add(QueryDataMap); + } + body.Add("QueryData", QueryData); + placesReply.Add("QueryData[]", body); + + return placesReply; + } } } diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 89e7747..086103b 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -273,6 +273,26 @@ namespace OpenSim.Region.Examples.SimpleModule public event AvatarInterestUpdate OnAvatarInterestUpdate; public event PlacesQuery OnPlacesQuery; + + public event FindAgentUpdate OnFindAgentEvent; + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; #pragma warning restore 67 @@ -1103,5 +1123,17 @@ namespace OpenSim.Region.Examples.SimpleModule public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) { } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + } + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + { + } + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) + { + } } } diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 8b34396..6c2b94a 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -836,6 +836,25 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public event MuteListRequest OnMuteListRequest; public event AvatarInterestUpdate OnAvatarInterestUpdate; public event PlacesQuery OnPlacesQuery; + public event FindAgentUpdate OnFindAgentEvent; + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; #pragma warning restore 67 @@ -1628,5 +1647,17 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) { } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + } + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + { + } + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) + { + } } } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 1573c73..da7f018 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -379,6 +379,26 @@ namespace OpenSim.Region.OptionalModules.World.NPC public event AvatarInterestUpdate OnAvatarInterestUpdate; public event PlacesQuery OnPlacesQuery; + + public event FindAgentUpdate OnFindAgentEvent; + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; #pragma warning restore 67 @@ -1108,5 +1128,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) { } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + } + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + { + } + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) + { + } } } diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6265ab7..8da9209 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -287,6 +287,26 @@ namespace OpenSim.Tests.Common.Mock public event AvatarInterestUpdate OnAvatarInterestUpdate; public event PlacesQuery OnPlacesQuery; + + public event FindAgentUpdate OnFindAgentEvent; + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; #pragma warning restore 67 @@ -1163,5 +1183,17 @@ namespace OpenSim.Tests.Common.Mock public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) { } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + { + } + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + { + } + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) + { + } } } -- cgit v1.1 From 8ca37dbefadc9b2d31b76786051d0ed8e1342121 Mon Sep 17 00:00:00 2001 From: Revolution Date: Wed, 30 Dec 2009 22:00:58 -0600 Subject: Adds Friend Finding functionality. Signed-off-by: Melanie --- .../CoreModules/Avatar/Friends/FriendsModule.cs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index d6a82ef..580e06f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -395,7 +395,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // if it leaves, we want to know, too client.OnLogout += OnLogout; + client.OnGrantUserRights += GrantUserFriendRights; + client.OnTrackAgentEvent += FindAgent; + client.OnFindAgentEvent += FindAgent; } @@ -1114,6 +1117,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends { ((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights); } + public void FindAgent(IClientAPI remoteClient, UUID hunter, UUID target) + { + List friendList = GetUserFriends(hunter); + foreach (FriendListItem item in friendList) + { + if(item.onlinestatus == true) + { + if(item.Friend == target && (item.FriendPerms & (uint)FriendRights.CanSeeOnMap) != 0) + { + ScenePresence SPTarget = ((Scene)remoteClient.Scene).GetScenePresence(target); + string regionname = SPTarget.Scene.RegionInfo.RegionName; + remoteClient.SendScriptTeleportRequest("FindAgent", regionname,new Vector3(SPTarget.AbsolutePosition),new Vector3(SPTarget.Lookat)); + } + } + else + { + remoteClient.SendAgentAlertMessage("The agent you are looking for is not online.", false); + } + } + } public List GetUserFriends(UUID agentID) { -- cgit v1.1 From 004c751a1b03e5b4635aef153c6b440ef5755739 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 31 Dec 2009 21:36:04 +0000 Subject: Whitespace cleanup (changed hard tabs to 4 spaces) --- OpenSim/Framework/IClientAPI.cs | 122 +-- .../Region/ClientStack/LindenUDP/LLClientView.cs | 850 ++++++++++----------- 2 files changed, 486 insertions(+), 486 deletions(-) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index bbd9cf1..9f2a0ae 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -455,44 +455,44 @@ namespace OpenSim.Framework public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int Flags,UUID AgentID); - public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name, UUID AgentID); - - public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); - - public delegate void FindAgentUpdate(IClientAPI client, UUID hunter, UUID target); - - public delegate void TrackAgentUpdate(IClientAPI client, UUID hunter, UUID target); - - public delegate void FreezeUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); - - public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); - - public delegate void NewUserReport(IClientAPI client, string regionName,UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType ,UUID screenshotID, string summery, UUID reporter); - - public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY); - - public delegate void GodlikeMessage(IClientAPI client, UUID requester, byte[] Method, byte[] Parameter); - - public delegate void SaveStateHandler(IClientAPI client,UUID agentID); - - public delegate void GroupAccountSummaryRequest(IClientAPI client,UUID agentID, UUID groupID); - - public delegate void GroupAccountDetailsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); - - public delegate void GroupAccountTransactionsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); - - public delegate void ParcelBuyPass(IClientAPI client, UUID agentID, int ParcelLocalID); - - public delegate void ParcelGodMark(IClientAPI client, UUID agentID, int ParcelLocalID); - - public delegate void GroupActiveProposalsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); - - public delegate void GroupVoteHistoryRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); - - - public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID); - - public delegate void SendPostcard(IClientAPI client); + public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name, UUID AgentID); + + public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); + + public delegate void FindAgentUpdate(IClientAPI client, UUID hunter, UUID target); + + public delegate void TrackAgentUpdate(IClientAPI client, UUID hunter, UUID target); + + public delegate void FreezeUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); + + public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target); + + public delegate void NewUserReport(IClientAPI client, string regionName,UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType ,UUID screenshotID, string summery, UUID reporter); + + public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY); + + public delegate void GodlikeMessage(IClientAPI client, UUID requester, byte[] Method, byte[] Parameter); + + public delegate void SaveStateHandler(IClientAPI client,UUID agentID); + + public delegate void GroupAccountSummaryRequest(IClientAPI client,UUID agentID, UUID groupID); + + public delegate void GroupAccountDetailsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); + + public delegate void GroupAccountTransactionsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); + + public delegate void ParcelBuyPass(IClientAPI client, UUID agentID, int ParcelLocalID); + + public delegate void ParcelGodMark(IClientAPI client, UUID agentID, int ParcelLocalID); + + public delegate void GroupActiveProposalsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); + + public delegate void GroupVoteHistoryRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID); + + + public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID); + + public delegate void SendPostcard(IClientAPI client); #endregion @@ -1070,24 +1070,24 @@ namespace OpenSim.Framework event PlacesQuery OnPlacesQuery; event FindAgentUpdate OnFindAgentEvent; - event TrackAgentUpdate OnTrackAgentEvent; - event NewUserReport OnUserReportEvent; - event SaveStateHandler OnSaveStateEvent; - event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; - event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; - event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; - event FreezeUserUpdate OnParcelFreezeUserEvent; - event EjectUserUpdate OnParcelEjectUserEvent; - event ParcelBuyPass OnParcelBuyPass; - event ParcelGodMark OnParcelGodMark; - event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; - event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; - event SimWideDeletesDelegate OnSimWideDeletes; - event SendPostcard OnSendPostcard; - event MuteListEntryUpdate OnUpdateMuteListEntryEvent; - event MuteListEntryRemove OnRemoveMuteListEntryEvent; - event GodlikeMessage onGodlikeMessageEvent; - event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; + event TrackAgentUpdate OnTrackAgentEvent; + event NewUserReport OnUserReportEvent; + event SaveStateHandler OnSaveStateEvent; + event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + event FreezeUserUpdate OnParcelFreezeUserEvent; + event EjectUserUpdate OnParcelEjectUserEvent; + event ParcelBuyPass OnParcelBuyPass; + event ParcelGodMark OnParcelGodMark; + event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + event SimWideDeletesDelegate OnSimWideDeletes; + event SendPostcard OnSendPostcard; + event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + event MuteListEntryRemove OnRemoveMuteListEntryEvent; + event GodlikeMessage onGodlikeMessageEvent; + event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; /// /// Set the debug level at which packet output should be printed to console. @@ -1455,12 +1455,12 @@ namespace OpenSim.Framework void SendRebakeAvatarTextures(UUID textureID); void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages); - + void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt); - void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier); - - void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt); - + void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier); + + void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt); + } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index a5139c1..0ec2ed5 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -299,25 +299,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event PlacesQuery OnPlacesQuery; public event AgentFOV OnAgentFOV; public event FindAgentUpdate OnFindAgentEvent; - public event TrackAgentUpdate OnTrackAgentEvent; - public event NewUserReport OnUserReportEvent; - public event SaveStateHandler OnSaveStateEvent; - public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; - public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; - public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; - public event FreezeUserUpdate OnParcelFreezeUserEvent; - public event EjectUserUpdate OnParcelEjectUserEvent; - public event ParcelBuyPass OnParcelBuyPass; - public event ParcelGodMark OnParcelGodMark; - public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; - public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; - public event SimWideDeletesDelegate OnSimWideDeletes; - public event SendPostcard OnSendPostcard; - public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; - public event MuteListEntryRemove OnRemoveMuteListEntryEvent; - public event GodlikeMessage onGodlikeMessageEvent; - public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; - + public event TrackAgentUpdate OnTrackAgentEvent; + public event NewUserReport OnUserReportEvent; + public event SaveStateHandler OnSaveStateEvent; + public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; + public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; + public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; + public event FreezeUserUpdate OnParcelFreezeUserEvent; + public event EjectUserUpdate OnParcelEjectUserEvent; + public event ParcelBuyPass OnParcelBuyPass; + public event ParcelGodMark OnParcelGodMark; + public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; + public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; + public event SimWideDeletesDelegate OnSimWideDeletes; + public event SendPostcard OnSendPostcard; + public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; + public event MuteListEntryRemove OnRemoveMuteListEntryEvent; + public event GodlikeMessage onGodlikeMessageEvent; + public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; + #endregion Events @@ -826,113 +826,113 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(gmp, ThrottleOutPacketType.Task); } - public void SendGroupActiveProposals(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary VoteID, Dictionary VoteInitiator, Dictionary Majority, Dictionary Quorum, Dictionary TerseDateID, Dictionary StartDateTime, Dictionary EndDateTime, Dictionary ProposalText) - { - foreach(KeyValuePair Blank in VoteID) - { - GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); - - GAPIRP.AgentData.AgentID = agentID; - GAPIRP.AgentData.GroupID = groupID; - GAPIRP.TransactionData.TransactionID = transactionID; - GAPIRP.TransactionData.TotalNumItems = 1; - GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); - GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; - ProposalData.VoteCast = Utils.StringToBytes("false"); - ProposalData.VoteID = new UUID(VoteID[Blank.Key]); - ProposalData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); - ProposalData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); - ProposalData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); - ProposalData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); - ProposalData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); - ProposalData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); - ProposalData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); - ProposalData.AlreadyVoted = false; - GAPIRP.ProposalData[0] = ProposalData; - OutPacket(GAPIRP, ThrottleOutPacketType.Task); - } - if(VoteID.Count == 0) - { - GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); - - GAPIRP.AgentData.AgentID = agentID; - GAPIRP.AgentData.GroupID = groupID; - GAPIRP.TransactionData.TransactionID = transactionID; - GAPIRP.TransactionData.TotalNumItems = 1; - GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); - GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; - ProposalData.VoteCast = Utils.StringToBytes("false"); - ProposalData.VoteID = UUID.Zero; - ProposalData.VoteInitiator = UUID.Zero; - ProposalData.Majority = 0; - ProposalData.Quorum = 0; - ProposalData.TerseDateID = Utils.StringToBytes(""); - ProposalData.StartDateTime = Utils.StringToBytes(""); - ProposalData.EndDateTime = Utils.StringToBytes(""); - ProposalData.ProposalText = Utils.StringToBytes(""); - ProposalData.AlreadyVoted = false; - GAPIRP.ProposalData[0] = ProposalData; - OutPacket(GAPIRP, ThrottleOutPacketType.Task); - } - } - - public void SendGroupVoteHistory(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary VoteID, Dictionary VoteInitiator, Dictionary Majority, Dictionary Quorum, Dictionary TerseDateID, Dictionary StartDateTime, Dictionary EndDateTime, Dictionary VoteType, Dictionary VoteResult, Dictionary ProposalText) - { - foreach(KeyValuePair Blank in VoteID) - { - GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); - - GVHIRP.AgentData.AgentID = agentID; - GVHIRP.AgentData.GroupID = groupID; - GVHIRP.TransactionData.TransactionID = transactionID; - GVHIRP.TransactionData.TotalNumItems = 1; - GVHIRP.HistoryItemData.VoteID = new UUID(VoteID[Blank.Key]); - GVHIRP.HistoryItemData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); - GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); - GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); - GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); - GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); - GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); - GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(VoteType[Blank.Key]); - GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(VoteResult[Blank.Key]); - GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); - GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); - GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; + public void SendGroupActiveProposals(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary VoteID, Dictionary VoteInitiator, Dictionary Majority, Dictionary Quorum, Dictionary TerseDateID, Dictionary StartDateTime, Dictionary EndDateTime, Dictionary ProposalText) + { + foreach(KeyValuePair Blank in VoteID) + { + GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); + + GAPIRP.AgentData.AgentID = agentID; + GAPIRP.AgentData.GroupID = groupID; + GAPIRP.TransactionData.TransactionID = transactionID; + GAPIRP.TransactionData.TotalNumItems = 1; + GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); + GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; + ProposalData.VoteCast = Utils.StringToBytes("false"); + ProposalData.VoteID = new UUID(VoteID[Blank.Key]); + ProposalData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); + ProposalData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); + ProposalData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); + ProposalData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); + ProposalData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); + ProposalData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); + ProposalData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); + ProposalData.AlreadyVoted = false; + GAPIRP.ProposalData[0] = ProposalData; + OutPacket(GAPIRP, ThrottleOutPacketType.Task); + } + if(VoteID.Count == 0) + { + GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); + + GAPIRP.AgentData.AgentID = agentID; + GAPIRP.AgentData.GroupID = groupID; + GAPIRP.TransactionData.TransactionID = transactionID; + GAPIRP.TransactionData.TotalNumItems = 1; + GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); + GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; + ProposalData.VoteCast = Utils.StringToBytes("false"); + ProposalData.VoteID = UUID.Zero; + ProposalData.VoteInitiator = UUID.Zero; + ProposalData.Majority = 0; + ProposalData.Quorum = 0; + ProposalData.TerseDateID = Utils.StringToBytes(""); + ProposalData.StartDateTime = Utils.StringToBytes(""); + ProposalData.EndDateTime = Utils.StringToBytes(""); + ProposalData.ProposalText = Utils.StringToBytes(""); + ProposalData.AlreadyVoted = false; + GAPIRP.ProposalData[0] = ProposalData; + OutPacket(GAPIRP, ThrottleOutPacketType.Task); + } + } + + public void SendGroupVoteHistory(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary VoteID, Dictionary VoteInitiator, Dictionary Majority, Dictionary Quorum, Dictionary TerseDateID, Dictionary StartDateTime, Dictionary EndDateTime, Dictionary VoteType, Dictionary VoteResult, Dictionary ProposalText) + { + foreach(KeyValuePair Blank in VoteID) + { + GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); + + GVHIRP.AgentData.AgentID = agentID; + GVHIRP.AgentData.GroupID = groupID; + GVHIRP.TransactionData.TransactionID = transactionID; + GVHIRP.TransactionData.TotalNumItems = 1; + GVHIRP.HistoryItemData.VoteID = new UUID(VoteID[Blank.Key]); + GVHIRP.HistoryItemData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); + GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); + GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); + GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); + GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); + GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); + GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(VoteType[Blank.Key]); + GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(VoteResult[Blank.Key]); + GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); + GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); + GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; VoteItem.CandidateID = UUID.Zero; VoteItem.NumVotes = 0; //TODO: FIX THIS!!! VoteItem.VoteCast = Utils.StringToBytes("Yes"); GVHIRP.VoteItem[0] = VoteItem; OutPacket(GVHIRP, ThrottleOutPacketType.Task); - } - if(VoteID.Count == 0) - { - GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); - - GVHIRP.AgentData.AgentID = agentID; - GVHIRP.AgentData.GroupID = groupID; - GVHIRP.TransactionData.TransactionID = transactionID; - GVHIRP.TransactionData.TotalNumItems = 0; - GVHIRP.HistoryItemData.VoteID = UUID.Zero; - GVHIRP.HistoryItemData.VoteInitiator = UUID.Zero; - GVHIRP.HistoryItemData.Majority = 0; - GVHIRP.HistoryItemData.Quorum = 0; - GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(""); - GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(""); - GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(""); - GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(""); - GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(""); - GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(""); - GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); - GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; - VoteItem.CandidateID = UUID.Zero; - VoteItem.NumVotes = 0; //TODO: FIX THIS!!! - VoteItem.VoteCast = Utils.StringToBytes("No"); - GVHIRP.VoteItem[0] = VoteItem; - OutPacket(GVHIRP, ThrottleOutPacketType.Task); - } - } - - public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + } + if(VoteID.Count == 0) + { + GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); + + GVHIRP.AgentData.AgentID = agentID; + GVHIRP.AgentData.GroupID = groupID; + GVHIRP.TransactionData.TransactionID = transactionID; + GVHIRP.TransactionData.TotalNumItems = 0; + GVHIRP.HistoryItemData.VoteID = UUID.Zero; + GVHIRP.HistoryItemData.VoteInitiator = UUID.Zero; + GVHIRP.HistoryItemData.Majority = 0; + GVHIRP.HistoryItemData.Quorum = 0; + GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(""); + GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(""); + GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); + GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; + VoteItem.CandidateID = UUID.Zero; + VoteItem.NumVotes = 0; //TODO: FIX THIS!!! + VoteItem.VoteCast = Utils.StringToBytes("No"); + GVHIRP.VoteItem[0] = VoteItem; + OutPacket(GVHIRP, ThrottleOutPacketType.Task); + } + } + + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) { GroupAccountDetailsReplyPacket GADRP = new GroupAccountDetailsReplyPacket(); GADRP.AgentData = new GroupAccountDetailsReplyPacket.AgentDataBlock(); @@ -950,10 +950,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP GADRP.HistoryData[0] = History; OutPacket(GADRP, ThrottleOutPacketType.Task); } - - public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) + + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) { - GroupAccountSummaryReplyPacket GASRP = + GroupAccountSummaryReplyPacket GASRP = (GroupAccountSummaryReplyPacket)PacketPool.Instance.GetPacket( PacketType.GroupAccountSummaryReply); @@ -983,8 +983,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP GASRP.MoneyData.LightTaxEstimate = 0; OutPacket(GASRP, ThrottleOutPacketType.Task); } - - public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) + + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) { GroupAccountTransactionsReplyPacket GATRP = (GroupAccountTransactionsReplyPacket)PacketPool.Instance.GetPacket( @@ -1007,7 +1007,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP History.User = Utils.StringToBytes(""); GATRP.HistoryData[0] = History; OutPacket(GATRP, ThrottleOutPacketType.Task); - } + } /// /// Send the region heightmap to the client @@ -4758,24 +4758,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights); AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery); AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry); - AddLocalPacketHandler(PacketType.RemoveMuteListEntry, HandleRemoveMuteListEntry); - AddLocalPacketHandler(PacketType.UserReport, HandleUserReport); - AddLocalPacketHandler(PacketType.FindAgent, HandleFindAgent); - AddLocalPacketHandler(PacketType.TrackAgent, HandleTrackAgent); - AddLocalPacketHandler(PacketType.GodUpdateRegionInfo, HandleGodUpdateRegionInfoUpdate); - AddLocalPacketHandler(PacketType.GodlikeMessage, HandleGodlikeMessage); - AddLocalPacketHandler(PacketType.StateSave, HandleSaveStatePacket); - AddLocalPacketHandler(PacketType.GroupAccountDetailsRequest, HandleGroupAccountDetailsRequest); - AddLocalPacketHandler(PacketType.GroupAccountSummaryRequest, HandleGroupAccountSummaryRequest); - AddLocalPacketHandler(PacketType.GroupAccountTransactionsRequest, HandleGroupTransactionsDetailsRequest); - AddLocalPacketHandler(PacketType.FreezeUser, HandleFreezeUser); - AddLocalPacketHandler(PacketType.EjectUser, HandleEjectUser); - AddLocalPacketHandler(PacketType.ParcelBuyPass, HandleParcelBuyPass); - AddLocalPacketHandler(PacketType.ParcelGodMarkAsContent, HandleParcelGodMarkAsContent); - AddLocalPacketHandler(PacketType.GroupActiveProposalsRequest, HandleGroupActiveProposalsRequest); - AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest); - AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes); - AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard); + AddLocalPacketHandler(PacketType.RemoveMuteListEntry, HandleRemoveMuteListEntry); + AddLocalPacketHandler(PacketType.UserReport, HandleUserReport); + AddLocalPacketHandler(PacketType.FindAgent, HandleFindAgent); + AddLocalPacketHandler(PacketType.TrackAgent, HandleTrackAgent); + AddLocalPacketHandler(PacketType.GodUpdateRegionInfo, HandleGodUpdateRegionInfoUpdate); + AddLocalPacketHandler(PacketType.GodlikeMessage, HandleGodlikeMessage); + AddLocalPacketHandler(PacketType.StateSave, HandleSaveStatePacket); + AddLocalPacketHandler(PacketType.GroupAccountDetailsRequest, HandleGroupAccountDetailsRequest); + AddLocalPacketHandler(PacketType.GroupAccountSummaryRequest, HandleGroupAccountSummaryRequest); + AddLocalPacketHandler(PacketType.GroupAccountTransactionsRequest, HandleGroupTransactionsDetailsRequest); + AddLocalPacketHandler(PacketType.FreezeUser, HandleFreezeUser); + AddLocalPacketHandler(PacketType.EjectUser, HandleEjectUser); + AddLocalPacketHandler(PacketType.ParcelBuyPass, HandleParcelBuyPass); + AddLocalPacketHandler(PacketType.ParcelGodMarkAsContent, HandleParcelGodMarkAsContent); + AddLocalPacketHandler(PacketType.GroupActiveProposalsRequest, HandleGroupActiveProposalsRequest); + AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest); + AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes); + AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard); } #region Packet Handlers @@ -4873,70 +4873,70 @@ namespace OpenSim.Region.ClientStack.LindenUDP } private bool HandleParcelGodMarkAsContent(IClientAPI client, Packet Packet) - { - ParcelGodMarkAsContentPacket ParcelGodMarkAsContent = - (ParcelGodMarkAsContentPacket)Packet; - - ParcelGodMark ParcelGodMarkAsContentHandler = OnParcelGodMark; - if (ParcelGodMarkAsContentHandler != null) - { - ParcelGodMarkAsContentHandler(this, - ParcelGodMarkAsContent.AgentData.AgentID, - ParcelGodMarkAsContent.ParcelData.LocalID); - return true; - } - return false; - } + { + ParcelGodMarkAsContentPacket ParcelGodMarkAsContent = + (ParcelGodMarkAsContentPacket)Packet; + + ParcelGodMark ParcelGodMarkAsContentHandler = OnParcelGodMark; + if (ParcelGodMarkAsContentHandler != null) + { + ParcelGodMarkAsContentHandler(this, + ParcelGodMarkAsContent.AgentData.AgentID, + ParcelGodMarkAsContent.ParcelData.LocalID); + return true; + } + return false; + } + + private bool HandleFreezeUser(IClientAPI client, Packet Packet) + { + FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; + + FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUserEvent; + if (FreezeUserHandler != null) + { + FreezeUserHandler(this, + FreezeUser.AgentData.AgentID, + FreezeUser.Data.Flags, + FreezeUser.Data.TargetID); + return true; + } + return false; + } + + private bool HandleEjectUser(IClientAPI client, Packet Packet) + { + EjectUserPacket EjectUser = + (EjectUserPacket)Packet; + + EjectUserUpdate EjectUserHandler = OnParcelEjectUserEvent; + if (EjectUserHandler != null) + { + EjectUserHandler(this, + EjectUser.AgentData.AgentID, + EjectUser.Data.Flags, + EjectUser.Data.TargetID); + return true; + } + return false; + } + + private bool HandleParcelBuyPass(IClientAPI client, Packet Packet) + { + ParcelBuyPassPacket ParcelBuyPass = + (ParcelBuyPassPacket)Packet; + + ParcelBuyPass ParcelBuyPassHandler = OnParcelBuyPass; + if (ParcelBuyPassHandler != null) + { + ParcelBuyPassHandler(this, + ParcelBuyPass.AgentData.AgentID, + ParcelBuyPass.ParcelData.LocalID); + return true; + } + return false; + } - private bool HandleFreezeUser(IClientAPI client, Packet Packet) - { - FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; - - FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUserEvent; - if (FreezeUserHandler != null) - { - FreezeUserHandler(this, - FreezeUser.AgentData.AgentID, - FreezeUser.Data.Flags, - FreezeUser.Data.TargetID); - return true; - } - return false; - } - - private bool HandleEjectUser(IClientAPI client, Packet Packet) - { - EjectUserPacket EjectUser = - (EjectUserPacket)Packet; - - EjectUserUpdate EjectUserHandler = OnParcelEjectUserEvent; - if (EjectUserHandler != null) - { - EjectUserHandler(this, - EjectUser.AgentData.AgentID, - EjectUser.Data.Flags, - EjectUser.Data.TargetID); - return true; - } - return false; - } - - private bool HandleParcelBuyPass(IClientAPI client, Packet Packet) - { - ParcelBuyPassPacket ParcelBuyPass = - (ParcelBuyPassPacket)Packet; - - ParcelBuyPass ParcelBuyPassHandler = OnParcelBuyPass; - if (ParcelBuyPassHandler != null) - { - ParcelBuyPassHandler(this, - ParcelBuyPass.AgentData.AgentID, - ParcelBuyPass.ParcelData.LocalID); - return true; - } - return false; - } - private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack) { ParcelBuyPacket parcel = (ParcelBuyPacket)Pack; @@ -5304,34 +5304,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP } private bool HandleFindAgent(IClientAPI client, Packet Packet) - { - FindAgentPacket FindAgent = - (FindAgentPacket)Packet; - - FindAgentUpdate FindAgentHandler = OnFindAgentEvent; - if (FindAgentHandler != null) - { - FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey); - return true; - } - return false; - } + { + FindAgentPacket FindAgent = + (FindAgentPacket)Packet; + + FindAgentUpdate FindAgentHandler = OnFindAgentEvent; + if (FindAgentHandler != null) + { + FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey); + return true; + } + return false; + } private bool HandleTrackAgent(IClientAPI client, Packet Packet) - { - TrackAgentPacket TrackAgent = - (TrackAgentPacket)Packet; - - TrackAgentUpdate TrackAgentHandler = OnTrackAgentEvent; - if (TrackAgentHandler != null) - { - TrackAgentHandler(this, - TrackAgent.AgentData.AgentID, - TrackAgent.TargetData.PreyID); - return true; - } - return false; - } + { + TrackAgentPacket TrackAgent = + (TrackAgentPacket)Packet; + + TrackAgentUpdate TrackAgentHandler = OnTrackAgentEvent; + if (TrackAgentHandler != null) + { + TrackAgentHandler(this, + TrackAgent.AgentData.AgentID, + TrackAgent.TargetData.PreyID); + return true; + } + return false; + } private bool HandlerRezObject(IClientAPI sender, Packet Pack) { @@ -8604,68 +8604,68 @@ namespace OpenSim.Region.ClientStack.LindenUDP } private bool HandleGodUpdateRegionInfoUpdate(IClientAPI client, Packet Packet) - { - GodUpdateRegionInfoPacket GodUpdateRegionInfo = - (GodUpdateRegionInfoPacket)Packet; - - GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdateEvent; - if (handlerGodUpdateRegionInfo != null) - { - handlerGodUpdateRegionInfo(this, - GodUpdateRegionInfo.RegionInfo.BillableFactor, - GodUpdateRegionInfo.RegionInfo.EstateID, - GodUpdateRegionInfo.RegionInfo.RegionFlags, - GodUpdateRegionInfo.RegionInfo.SimName, - GodUpdateRegionInfo.RegionInfo.RedirectGridX, - GodUpdateRegionInfo.RegionInfo.RedirectGridY); - return true; - } - return false; - } + { + GodUpdateRegionInfoPacket GodUpdateRegionInfo = + (GodUpdateRegionInfoPacket)Packet; + + GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdateEvent; + if (handlerGodUpdateRegionInfo != null) + { + handlerGodUpdateRegionInfo(this, + GodUpdateRegionInfo.RegionInfo.BillableFactor, + GodUpdateRegionInfo.RegionInfo.EstateID, + GodUpdateRegionInfo.RegionInfo.RegionFlags, + GodUpdateRegionInfo.RegionInfo.SimName, + GodUpdateRegionInfo.RegionInfo.RedirectGridX, + GodUpdateRegionInfo.RegionInfo.RedirectGridY); + return true; + } + return false; + } private bool HandleSimWideDeletes(IClientAPI client, Packet Packet) - { - SimWideDeletesPacket SimWideDeletesRequest = - (SimWideDeletesPacket)Packet; - SimWideDeletesDelegate handlerSimWideDeletesRequest = OnSimWideDeletes; - if (handlerSimWideDeletesRequest != null) - { - handlerSimWideDeletesRequest(this, SimWideDeletesRequest.AgentData.AgentID,(int)SimWideDeletesRequest.DataBlock.Flags,SimWideDeletesRequest.DataBlock.TargetID); - return true; - } - return false; - } + { + SimWideDeletesPacket SimWideDeletesRequest = + (SimWideDeletesPacket)Packet; + SimWideDeletesDelegate handlerSimWideDeletesRequest = OnSimWideDeletes; + if (handlerSimWideDeletesRequest != null) + { + handlerSimWideDeletesRequest(this, SimWideDeletesRequest.AgentData.AgentID,(int)SimWideDeletesRequest.DataBlock.Flags,SimWideDeletesRequest.DataBlock.TargetID); + return true; + } + return false; + } + + private bool HandleGodlikeMessage(IClientAPI client, Packet Packet) + { + GodlikeMessagePacket GodlikeMessage = + (GodlikeMessagePacket)Packet; + + GodlikeMessage handlerGodlikeMessage = onGodlikeMessageEvent; + if (handlerGodlikeMessage != null) + { + handlerGodlikeMessage(this, + GodlikeMessage.MethodData.Invoice, + GodlikeMessage.MethodData.Method, + GodlikeMessage.ParamList[0].Parameter); + return true; + } + return false; + } + + private bool HandleSaveStatePacket(IClientAPI client, Packet Packet) + { + StateSavePacket SaveStateMessage = + (StateSavePacket)Packet; + SaveStateHandler handlerSaveStatePacket = OnSaveStateEvent; + if (handlerSaveStatePacket != null) + { + handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID); + return true; + } + return false; + } - private bool HandleGodlikeMessage(IClientAPI client, Packet Packet) - { - GodlikeMessagePacket GodlikeMessage = - (GodlikeMessagePacket)Packet; - - GodlikeMessage handlerGodlikeMessage = onGodlikeMessageEvent; - if (handlerGodlikeMessage != null) - { - handlerGodlikeMessage(this, - GodlikeMessage.MethodData.Invoice, - GodlikeMessage.MethodData.Method, - GodlikeMessage.ParamList[0].Parameter); - return true; - } - return false; - } - - private bool HandleSaveStatePacket(IClientAPI client, Packet Packet) - { - StateSavePacket SaveStateMessage = - (StateSavePacket)Packet; - SaveStateHandler handlerSaveStatePacket = OnSaveStateEvent; - if (handlerSaveStatePacket != null) - { - handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID); - return true; - } - return false; - } - private bool HandleGodKickUser(IClientAPI sender, Packet Pack) { GodKickUserPacket gkupack = (GodKickUserPacket)Pack; @@ -9018,74 +9018,74 @@ namespace OpenSim.Region.ClientStack.LindenUDP } private bool HandleUpdateMuteListEntry(IClientAPI client, Packet Packet) - { - UpdateMuteListEntryPacket UpdateMuteListEntry = - (UpdateMuteListEntryPacket)Packet; - MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntryEvent; - if (handlerUpdateMuteListEntry != null) - { - handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, - Utils.BytesToString(UpdateMuteListEntry.MuteData.MuteName), - UpdateMuteListEntry.MuteData.MuteType, - UpdateMuteListEntry.AgentData.AgentID); - return true; - } - return false; - } + { + UpdateMuteListEntryPacket UpdateMuteListEntry = + (UpdateMuteListEntryPacket)Packet; + MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntryEvent; + if (handlerUpdateMuteListEntry != null) + { + handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, + Utils.BytesToString(UpdateMuteListEntry.MuteData.MuteName), + UpdateMuteListEntry.MuteData.MuteType, + UpdateMuteListEntry.AgentData.AgentID); + return true; + } + return false; + } - private bool HandleRemoveMuteListEntry(IClientAPI client, Packet Packet) - { - RemoveMuteListEntryPacket RemoveMuteListEntry = - (RemoveMuteListEntryPacket)Packet; - MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntryEvent; - if (handlerRemoveMuteListEntry != null) - { - handlerRemoveMuteListEntry(this, - RemoveMuteListEntry.MuteData.MuteID, - Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName), - RemoveMuteListEntry.AgentData.AgentID); - return true; - } - return false; - } - - private bool HandleUserReport(IClientAPI client, Packet Packet) - { - UserReportPacket UserReport = - (UserReportPacket)Packet; - - NewUserReport handlerUserReport = OnUserReportEvent; - if (handlerUserReport != null) - { - handlerUserReport(this, - Utils.BytesToString(UserReport.ReportData.AbuseRegionName), - UserReport.ReportData.AbuserID, - UserReport.ReportData.Category, - UserReport.ReportData.CheckFlags, - Utils.BytesToString(UserReport.ReportData.Details), - UserReport.ReportData.ObjectID, - UserReport.ReportData.Position, - UserReport.ReportData.ReportType, - UserReport.ReportData.ScreenshotID, - Utils.BytesToString(UserReport.ReportData.Summary), - UserReport.AgentData.AgentID); - return true; - } - return false; - } - - private bool HandleSendPostcard(IClientAPI client, Packet packet) - { - SendPostcardPacket SendPostcard = - (SendPostcardPacket)packet; - SendPostcard handlerSendPostcard = OnSendPostcard; - if (handlerSendPostcard != null) - { - handlerSendPostcard(this); - return true; - } - return false; - } + private bool HandleRemoveMuteListEntry(IClientAPI client, Packet Packet) + { + RemoveMuteListEntryPacket RemoveMuteListEntry = + (RemoveMuteListEntryPacket)Packet; + MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntryEvent; + if (handlerRemoveMuteListEntry != null) + { + handlerRemoveMuteListEntry(this, + RemoveMuteListEntry.MuteData.MuteID, + Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName), + RemoveMuteListEntry.AgentData.AgentID); + return true; + } + return false; + } + + private bool HandleUserReport(IClientAPI client, Packet Packet) + { + UserReportPacket UserReport = + (UserReportPacket)Packet; + + NewUserReport handlerUserReport = OnUserReportEvent; + if (handlerUserReport != null) + { + handlerUserReport(this, + Utils.BytesToString(UserReport.ReportData.AbuseRegionName), + UserReport.ReportData.AbuserID, + UserReport.ReportData.Category, + UserReport.ReportData.CheckFlags, + Utils.BytesToString(UserReport.ReportData.Details), + UserReport.ReportData.ObjectID, + UserReport.ReportData.Position, + UserReport.ReportData.ReportType, + UserReport.ReportData.ScreenshotID, + Utils.BytesToString(UserReport.ReportData.Summary), + UserReport.AgentData.AgentID); + return true; + } + return false; + } + + private bool HandleSendPostcard(IClientAPI client, Packet packet) + { + SendPostcardPacket SendPostcard = + (SendPostcardPacket)packet; + SendPostcard handlerSendPostcard = OnSendPostcard; + if (handlerSendPostcard != null) + { + handlerSendPostcard(this); + return true; + } + return false; + } private bool HandleUseCircuitCode(IClientAPI sender, Packet Pack) { @@ -9355,72 +9355,72 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } - + private bool HandleGroupVoteHistoryRequest(IClientAPI client, Packet Packet) - { - GroupVoteHistoryRequestPacket GroupVoteHistoryRequest = - (GroupVoteHistoryRequestPacket)Packet; - GroupVoteHistoryRequest handlerGroupVoteHistoryRequest = OnGroupVoteHistoryRequest; - if (handlerGroupVoteHistoryRequest != null) - { - handlerGroupVoteHistoryRequest(this, GroupVoteHistoryRequest.AgentData.AgentID,GroupVoteHistoryRequest.AgentData.SessionID,GroupVoteHistoryRequest.GroupData.GroupID,GroupVoteHistoryRequest.TransactionData.TransactionID); - return true; - } - return false; - } + { + GroupVoteHistoryRequestPacket GroupVoteHistoryRequest = + (GroupVoteHistoryRequestPacket)Packet; + GroupVoteHistoryRequest handlerGroupVoteHistoryRequest = OnGroupVoteHistoryRequest; + if (handlerGroupVoteHistoryRequest != null) + { + handlerGroupVoteHistoryRequest(this, GroupVoteHistoryRequest.AgentData.AgentID,GroupVoteHistoryRequest.AgentData.SessionID,GroupVoteHistoryRequest.GroupData.GroupID,GroupVoteHistoryRequest.TransactionData.TransactionID); + return true; + } + return false; + } + + private bool HandleGroupActiveProposalsRequest(IClientAPI client, Packet Packet) + { + GroupActiveProposalsRequestPacket GroupActiveProposalsRequest = + (GroupActiveProposalsRequestPacket)Packet; + GroupActiveProposalsRequest handlerGroupActiveProposalsRequest = OnGroupActiveProposalsRequest; + if (handlerGroupActiveProposalsRequest != null) + { + handlerGroupActiveProposalsRequest(this, GroupActiveProposalsRequest.AgentData.AgentID,GroupActiveProposalsRequest.AgentData.SessionID,GroupActiveProposalsRequest.GroupData.GroupID,GroupActiveProposalsRequest.TransactionData.TransactionID); + return true; + } + return false; + } + + private bool HandleGroupAccountDetailsRequest(IClientAPI client, Packet Packet) + { + GroupAccountDetailsRequestPacket GroupAccountDetailsRequest = + (GroupAccountDetailsRequestPacket)Packet; + GroupAccountDetailsRequest handlerGroupAccountDetailsRequest = OnGroupAccountDetailsRequest; + if (handlerGroupAccountDetailsRequest != null) + { + handlerGroupAccountDetailsRequest(this, GroupAccountDetailsRequest.AgentData.AgentID,GroupAccountDetailsRequest.AgentData.GroupID,GroupAccountDetailsRequest.MoneyData.RequestID,GroupAccountDetailsRequest.AgentData.SessionID); + return true; + } + return false; + } + + private bool HandleGroupAccountSummaryRequest(IClientAPI client, Packet Packet) + { + GroupAccountSummaryRequestPacket GroupAccountSummaryRequest = + (GroupAccountSummaryRequestPacket)Packet; + GroupAccountSummaryRequest handlerGroupAccountSummaryRequest = OnGroupAccountSummaryRequest; + if (handlerGroupAccountSummaryRequest != null) + { + handlerGroupAccountSummaryRequest(this, GroupAccountSummaryRequest.AgentData.AgentID,GroupAccountSummaryRequest.AgentData.GroupID); + return true; + } + return false; + } + + private bool HandleGroupTransactionsDetailsRequest(IClientAPI client, Packet Packet) + { + GroupAccountTransactionsRequestPacket GroupAccountTransactionsRequest = + (GroupAccountTransactionsRequestPacket)Packet; + GroupAccountTransactionsRequest handlerGroupAccountTransactionsRequest = OnGroupAccountTransactionsRequest; + if (handlerGroupAccountTransactionsRequest != null) + { + handlerGroupAccountTransactionsRequest(this, GroupAccountTransactionsRequest.AgentData.AgentID,GroupAccountTransactionsRequest.AgentData.GroupID,GroupAccountTransactionsRequest.MoneyData.RequestID,GroupAccountTransactionsRequest.AgentData.SessionID); + return true; + } + return false; + } - private bool HandleGroupActiveProposalsRequest(IClientAPI client, Packet Packet) - { - GroupActiveProposalsRequestPacket GroupActiveProposalsRequest = - (GroupActiveProposalsRequestPacket)Packet; - GroupActiveProposalsRequest handlerGroupActiveProposalsRequest = OnGroupActiveProposalsRequest; - if (handlerGroupActiveProposalsRequest != null) - { - handlerGroupActiveProposalsRequest(this, GroupActiveProposalsRequest.AgentData.AgentID,GroupActiveProposalsRequest.AgentData.SessionID,GroupActiveProposalsRequest.GroupData.GroupID,GroupActiveProposalsRequest.TransactionData.TransactionID); - return true; - } - return false; - } - - private bool HandleGroupAccountDetailsRequest(IClientAPI client, Packet Packet) - { - GroupAccountDetailsRequestPacket GroupAccountDetailsRequest = - (GroupAccountDetailsRequestPacket)Packet; - GroupAccountDetailsRequest handlerGroupAccountDetailsRequest = OnGroupAccountDetailsRequest; - if (handlerGroupAccountDetailsRequest != null) - { - handlerGroupAccountDetailsRequest(this, GroupAccountDetailsRequest.AgentData.AgentID,GroupAccountDetailsRequest.AgentData.GroupID,GroupAccountDetailsRequest.MoneyData.RequestID,GroupAccountDetailsRequest.AgentData.SessionID); - return true; - } - return false; - } - - private bool HandleGroupAccountSummaryRequest(IClientAPI client, Packet Packet) - { - GroupAccountSummaryRequestPacket GroupAccountSummaryRequest = - (GroupAccountSummaryRequestPacket)Packet; - GroupAccountSummaryRequest handlerGroupAccountSummaryRequest = OnGroupAccountSummaryRequest; - if (handlerGroupAccountSummaryRequest != null) - { - handlerGroupAccountSummaryRequest(this, GroupAccountSummaryRequest.AgentData.AgentID,GroupAccountSummaryRequest.AgentData.GroupID); - return true; - } - return false; - } - - private bool HandleGroupTransactionsDetailsRequest(IClientAPI client, Packet Packet) - { - GroupAccountTransactionsRequestPacket GroupAccountTransactionsRequest = - (GroupAccountTransactionsRequestPacket)Packet; - GroupAccountTransactionsRequest handlerGroupAccountTransactionsRequest = OnGroupAccountTransactionsRequest; - if (handlerGroupAccountTransactionsRequest != null) - { - handlerGroupAccountTransactionsRequest(this, GroupAccountTransactionsRequest.AgentData.AgentID,GroupAccountTransactionsRequest.AgentData.GroupID,GroupAccountTransactionsRequest.MoneyData.RequestID,GroupAccountTransactionsRequest.AgentData.SessionID); - return true; - } - return false; - } - private bool HandleGroupTitlesRequest(IClientAPI sender, Packet Pack) { GroupTitlesRequestPacket groupTitlesRequest = @@ -14221,7 +14221,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (handlerGodKickUser != null) { handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, - gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason,gkupack.UserInfo); + gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason,gkupack.UserInfo); } } else -- cgit v1.1 From 3ec502f5516bda5374e5d40ad5859ec1c5fbf20f Mon Sep 17 00:00:00 2001 From: Revolution Date: Thu, 31 Dec 2009 11:41:07 -0600 Subject: Readds llCollisionFilter and adds llPassCollision. Applied with whitespace cleanup Signed-off-by: Melanie --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 11 + OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 327 +++++++++++++++++---- .../Shared/Api/Implementation/LSL_Api.cs | 19 +- 3 files changed, 293 insertions(+), 64 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e9ed066..34d8b49 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -340,6 +340,17 @@ namespace OpenSim.Region.Framework.Scenes { get { return true; } } + + private bool m_passCollision; + public bool PassCollision + { + get { return m_passCollision; } + set + { + m_passCollision = value; + HasGroupChanged = true; + } + } public bool IsSelected { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index c0243a5..b50def3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -140,6 +140,9 @@ namespace OpenSim.Region.Framework.Scenes [XmlIgnore] public UUID FromItemID; + + [XmlIgnore] + private Dictionary m_CollisionFilter = new Dictionary(); /// /// The UUID of the user inventory item from which this object was rezzed if this is a root part. @@ -452,6 +455,17 @@ namespace OpenSim.Region.Framework.Scenes } } + + [XmlIgnore] + public Dictionary CollisionFilter + { + get { return m_CollisionFilter; } + set + { + m_CollisionFilter = value; + } + } + public ulong RegionHandle { get { return m_regionHandle; } @@ -1876,18 +1890,49 @@ namespace OpenSim.Region.Framework.Scenes return; SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); + string data = ""; if (obj != null) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this object + else + { + } + } + else + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + } } else { @@ -1899,16 +1944,47 @@ namespace OpenSim.Region.Framework.Scenes if (av.LocalId == localId) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.ControllingClient.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this avatar + else + { + } + } + else + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + } + } } } @@ -1922,7 +1998,10 @@ namespace OpenSim.Region.Framework.Scenes if (m_parentGroup.Scene == null) return; - + if(m_parentGroup.PassCollision == true) + { + //TODO: Add pass to root prim! + } m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); } } @@ -1947,39 +2026,101 @@ namespace OpenSim.Region.Framework.Scenes return; SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); + string data = ""; if (obj != null) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this object + else + { + } + } + else + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + } } else { ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); - + for (int i = 0; i < avlist.Length; i++) { ScenePresence av = avlist[i]; if (av.LocalId == localId) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this avatar + else + { + } + } + else + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + } + } } } @@ -2016,18 +2157,49 @@ namespace OpenSim.Region.Framework.Scenes if (m_parentGroup.Scene == null) return; SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); + string data = ""; if (obj != null) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = obj.UUID; - detobj.nameStr = obj.Name; - detobj.ownerUUID = obj._ownerID; - detobj.posVector = obj.AbsolutePosition; - detobj.rotQuat = obj.GetWorldRotation(); - detobj.velVector = obj.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = obj._groupID; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this object + else + { + } + } + else + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = obj.UUID; + detobj.nameStr = obj.Name; + detobj.ownerUUID = obj._ownerID; + detobj.posVector = obj.AbsolutePosition; + detobj.rotQuat = obj.GetWorldRotation(); + detobj.velVector = obj.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = obj._groupID; + colliding.Add(detobj); + } + } } else { @@ -2039,16 +2211,47 @@ namespace OpenSim.Region.Framework.Scenes if (av.LocalId == localId) { - DetectedObject detobj = new DetectedObject(); - detobj.keyUUID = av.UUID; - detobj.nameStr = av.Name; - detobj.ownerUUID = av.UUID; - detobj.posVector = av.AbsolutePosition; - detobj.rotQuat = av.Rotation; - detobj.velVector = av.Velocity; - detobj.colliderType = 0; - detobj.groupUUID = av.ControllingClient.ActiveGroupId; - colliding.Add(detobj); + if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + //If it is 0, it is to not accept collisions from this avatar + else + { + } + } + else + { + bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); + //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work + if(found) + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = av.UUID; + detobj.nameStr = av.ControllingClient.Name; + detobj.ownerUUID = av.UUID; + detobj.posVector = av.AbsolutePosition; + detobj.rotQuat = av.Rotation; + detobj.velVector = av.Velocity; + detobj.colliderType = 0; + detobj.groupUUID = av.ControllingClient.ActiveGroupId; + colliding.Add(detobj); + } + } + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6102504..d242506 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2752,7 +2752,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionFilter(string name, string id, int accept) { m_host.AddScriptLPS(1); - NotImplemented("llCollisionFilter"); + m_host.CollisionFilter.Clear(); + if(id != null) + { + m_host.CollisionFilter.Add(accept,id); + } + else + { + m_host.CollisionFilter.Add(accept,name); + } } public void llTakeControls(int controls, int accept, int pass_on) @@ -4232,7 +4240,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPassCollisions(int pass) { m_host.AddScriptLPS(1); - NotImplemented("llPassCollisions"); + if(pass == 0) + { + m_host.ParentGroup.PassCollision = false; + } + else + { + m_host.ParentGroup.PassCollision = true; + } } public LSL_String llGetScriptName() -- cgit v1.1