aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
authorDiva Canto2010-07-30 14:04:29 -0700
committerDiva Canto2010-07-30 14:04:29 -0700
commitf3fa10fa151ef5f07599d557d1f7c05656e7ea04 (patch)
treea14ca2b853df1aa87cad30664210c995006e358e /OpenSim/Region/CoreModules/Avatar
parentChanged the way HG client verification is done: now transforming local and LA... (diff)
parentremove gods event subscription to gods module from scene (diff)
downloadopensim-SC-f3fa10fa151ef5f07599d557d1f7c05656e7ea04.zip
opensim-SC-f3fa10fa151ef5f07599d557d1f7c05656e7ea04.tar.gz
opensim-SC-f3fa10fa151ef5f07599d557d1f7c05656e7ea04.tar.bz2
opensim-SC-f3fa10fa151ef5f07599d557d1f7c05656e7ea04.tar.xz
Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs59
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs13
2 files changed, 56 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index ff3036a..d895bb1 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using log4net; 31using log4net;
32using Mono.Addins;
32using Nini.Config; 33using Nini.Config;
33using OpenMetaverse; 34using OpenMetaverse;
34using OpenMetaverse.Packets; 35using OpenMetaverse.Packets;
@@ -39,38 +40,64 @@ using OpenSim.Region.Framework.Scenes;
39 40
40namespace OpenSim.Region.CoreModules.Avatar.Attachments 41namespace OpenSim.Region.CoreModules.Avatar.Attachments
41{ 42{
42 public class AttachmentsModule : IAttachmentsModule, IRegionModule 43 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AttachmentsModule")]
44 public class AttachmentsModule : IAttachmentsModule, INonSharedRegionModule
43 { 45 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 47
46 protected Scene m_scene = null; 48 protected Scene m_scene = null;
49
50 public string Name { get { return "Attachments Module"; } }
51 public Type ReplaceableInterface { get { return null; } }
47 52
48 public void Initialise(Scene scene, IConfigSource source) 53 public void Initialise(IConfigSource source) {}
54
55 public void AddRegion(Scene scene)
49 { 56 {
50 scene.RegisterModuleInterface<IAttachmentsModule>(this);
51 m_scene = scene; 57 m_scene = scene;
58 m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
59 m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
60 // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI
52 } 61 }
53 62
54 public void PostInitialise() 63 public void RemoveRegion(Scene scene)
55 { 64 {
65 m_scene.UnregisterModuleInterface<IAttachmentsModule>(this);
66 m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
56 } 67 }
57 68
58 public void Close() 69 public void RegionLoaded(Scene scene) {}
70
71 public void Close()
59 { 72 {
73 RemoveRegion(m_scene);
60 } 74 }
61 75
62 public string Name 76 public void SubscribeToClientEvents(IClientAPI client)
63 { 77 {
64 get { return "Attachments Module"; } 78 client.OnRezSingleAttachmentFromInv += RezSingleAttachmentFromInventory;
79 client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory;
80 client.OnObjectAttach += AttachObject;
81 client.OnObjectDetach += DetachObject;
82 client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory;
65 } 83 }
66 84
67 public bool IsSharedModule 85 public void UnsubscribeFromClientEvents(IClientAPI client)
68 { 86 {
69 get { return false; } 87 client.OnRezSingleAttachmentFromInv -= RezSingleAttachmentFromInventory;
88 client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory;
89 client.OnObjectAttach -= AttachObject;
90 client.OnObjectDetach -= DetachObject;
91 client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory;
70 } 92 }
71 93
72 // Called by client 94 /// <summary>
73 // 95 /// Called by client
96 /// </summary>
97 /// <param name="remoteClient"></param>
98 /// <param name="objectLocalID"></param>
99 /// <param name="AttachmentPt"></param>
100 /// <param name="silent"></param>
74 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) 101 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
75 { 102 {
76 m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); 103 m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 50171a3..4b30b0d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
47 m_scene = scene; 47 m_scene = scene;
48 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); 48 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
49 m_scene.RegisterModuleInterface<IGodsModule>(this); 49 m_scene.RegisterModuleInterface<IGodsModule>(this);
50 m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
50 } 51 }
51 52
52 public void PostInitialise() {} 53 public void PostInitialise() {}
@@ -54,6 +55,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
54 public string Name { get { return "Gods Module"; } } 55 public string Name { get { return "Gods Module"; } }
55 public bool IsSharedModule { get { return false; } } 56 public bool IsSharedModule { get { return false; } }
56 57
58 public void SubscribeToClientEvents(IClientAPI client)
59 {
60 client.OnGodKickUser += KickUser;
61 client.OnRequestGodlikePowers += RequestGodlikePowers;
62 }
63
64 public void UnsubscribeFromClientEvents(IClientAPI client)
65 {
66 client.OnGodKickUser -= KickUser;
67 client.OnRequestGodlikePowers -= RequestGodlikePowers;
68 }
69
57 public void RequestGodlikePowers( 70 public void RequestGodlikePowers(
58 UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) 71 UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient)
59 { 72 {