From cbd454d69231598daf6748070fb5f0baace61c59 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 16 Aug 2009 22:01:18 +1000 Subject: * Implements ISecurityCredential member on SPAvatar, SPAvatarAttachment * Disables 'event not used' warning for IRCClientView; cuts OpenSim total warnings back. --- .../Agent/InternetRelayClientView/Server/IRCClientView.cs | 3 ++- OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | 2 +- OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | 8 ++++++-- .../OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs | 7 +++++-- OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs | 6 +++--- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index a3be181..4a2d7b5 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -634,7 +634,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server { get { return (uint)Util.RandomClass.Next(0,int.MaxValue); } } - +#pragma warning disable 67 public event GenericMessage OnGenericMessage; public event ImprovedInstantMessage OnInstantMessage; public event ChatMessage OnChatFromClient; @@ -826,6 +826,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public event AvatarNotesUpdate OnAvatarNotesUpdate; public event MuteListRequest OnMuteListRequest; public event PlacesQuery OnPlacesQuery; +#pragma warning restore 67 public void SetDebugPacketLevel(int newDebug) { diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index bdc7a15..35b0a0f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs @@ -117,7 +117,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule if (_OnTouchActive && m_localID == localID) { TouchEventArgs e = new TouchEventArgs(); - e.Avatar = new SPAvatar(m_rootScene, remoteClient.AgentId); + e.Avatar = new SPAvatar(m_rootScene, remoteClient.AgentId, m_security); e.TouchBiNormal = surfaceArgs.Binormal; e.TouchMaterialIndex = surfaceArgs.FaceIndex; e.TouchNormal = surfaceArgs.Normal; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs index ce2d339..4600836 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs @@ -42,11 +42,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { private readonly Scene m_rootScene; private readonly UUID m_ID; + private readonly ISecurityCredential m_security; //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public SPAvatar(Scene scene, UUID ID) + public SPAvatar(Scene scene, UUID ID, ISecurityCredential security) { m_rootScene = scene; + m_security = security; m_ID = ID; } @@ -84,7 +86,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule foreach (DictionaryEntry element in internalAttachments) { Hashtable attachInfo = (Hashtable)element.Value; - attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int)element.Key, new UUID((string)attachInfo["item"]), new UUID((string)attachInfo["asset"]))); + attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int) element.Key, + new UUID((string) attachInfo["item"]), + new UUID((string) attachInfo["asset"]), m_security)); } } diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs index 9b684fe..570459a 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs @@ -39,10 +39,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule private readonly int m_location; //private readonly UUID m_itemId; private readonly UUID m_assetId; + + private readonly ISecurityCredential m_security; - public SPAvatarAttachment(Scene rootScene, IAvatar self, int location, UUID itemId, UUID assetId) + public SPAvatarAttachment(Scene rootScene, IAvatar self, int location, UUID itemId, UUID assetId, ISecurityCredential security) { m_rootScene = rootScene; + m_security = security; //m_parent = self; m_location = location; //m_itemId = itemId; @@ -55,7 +58,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { get { - return new SOPObject(m_rootScene, m_rootScene.GetSceneObjectPart(m_assetId).LocalId); + return new SOPObject(m_rootScene, m_rootScene.GetSceneObjectPart(m_assetId).LocalId, m_security); } } } diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs index 497ca39..da5ea0d 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs @@ -86,7 +86,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule if (_OnNewUser != null) { NewUserEventArgs e = new NewUserEventArgs(); - e.Avatar = new SPAvatar(m_internalScene, presence.UUID); + e.Avatar = new SPAvatar(m_internalScene, presence.UUID, m_security); _OnNewUser(this, e); } } @@ -156,7 +156,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule if (chat.Sender != null && chat.SenderObject == null) { ChatEventArgs e = new ChatEventArgs(); - e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID); + e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID, m_security); e.Text = chat.Message; _OnChat(this, e); @@ -209,7 +209,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule for (int i = 0; i < ents.Count; i++) { EntityBase ent = ents[i]; - rets[i] = new SPAvatar(m_internalScene, ent.UUID); + rets[i] = new SPAvatar(m_internalScene, ent.UUID, m_security); } return rets; -- cgit v1.1