aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/DwellModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/DwellModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/DwellModule.cs27
1 files changed, 23 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs
index 70c6028..22480e6 100644
--- a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs
@@ -53,7 +53,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
53namespace OpenSim.Region.CoreModules.World.Land 53namespace OpenSim.Region.CoreModules.World.Land
54{ 54{
55 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DefaultDwellModule")] 55 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DefaultDwellModule")]
56 public class DefaultDwellModule : IDwellModule, INonSharedRegionModule 56 public class DefaultDwellModule : INonSharedRegionModule, IDwellModule
57 { 57 {
58 private Scene m_scene; 58 private Scene m_scene;
59 private IConfigSource m_Config; 59 private IConfigSource m_Config;
@@ -88,16 +88,21 @@ namespace OpenSim.Region.CoreModules.World.Land
88 return; 88 return;
89 89
90 m_scene = scene; 90 m_scene = scene;
91 91 m_scene.RegisterModuleInterface<IDwellModule>(this);
92 m_scene.EventManager.OnNewClient += OnNewClient;
93 } 92 }
94 93
95 public void RegionLoaded(Scene scene) 94 public void RegionLoaded(Scene scene)
96 { 95 {
96 if (!m_Enabled)
97 return;
98 m_scene.EventManager.OnNewClient += OnNewClient;
97 } 99 }
98 100
99 public void RemoveRegion(Scene scene) 101 public void RemoveRegion(Scene scene)
100 { 102 {
103 if (!m_Enabled)
104 return;
105 m_scene.EventManager.OnNewClient -= OnNewClient;
101 } 106 }
102 107
103 public void Close() 108 public void Close()
@@ -115,12 +120,26 @@ namespace OpenSim.Region.CoreModules.World.Land
115 if (parcel == null) 120 if (parcel == null)
116 return; 121 return;
117 122
118 client.SendParcelDwellReply(localID, parcel.LandData.GlobalID, parcel.LandData.Dwell); 123 LandData land = parcel.LandData;
124 if(land!= null)
125 client.SendParcelDwellReply(localID, land.GlobalID, land.Dwell);
119 } 126 }
120 127
128
121 public int GetDwell(UUID parcelID) 129 public int GetDwell(UUID parcelID)
122 { 130 {
131 ILandObject parcel = m_scene.LandChannel.GetLandObject(parcelID);
132 if (parcel != null && parcel.LandData != null)
133 return (int)(parcel.LandData.Dwell);
134 return 0;
135 }
136
137 public int GetDwell(LandData land)
138 {
139 if (land != null)
140 return (int)(land.Dwell);
123 return 0; 141 return 0;
124 } 142 }
143
125 } 144 }
126} 145}