diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/DwellModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/DwellModule.cs | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs index 5f1eab2..55a341e 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; | |||
53 | namespace OpenSim.Region.CoreModules.World.Land | 53 | namespace 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,15 +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 | { |
123 | ILandObject parcel = m_scene.LandChannel.GetLandObject(parcelID); | 131 | ILandObject parcel = m_scene.LandChannel.GetLandObject(parcelID); |
124 | if (parcel != null && parcel.LandData != null) | 132 | if (parcel != null && parcel.LandData != null) |
125 | return (int)parcel.LandData.Dwell; | 133 | return (int)(parcel.LandData.Dwell + 0.5f); |
134 | return 0; | ||
135 | } | ||
136 | |||
137 | public int GetDwell(LandData land) | ||
138 | { | ||
139 | if (land != null) | ||
140 | return (int)(land.Dwell + 0.5f); | ||
126 | return 0; | 141 | return 0; |
127 | } | 142 | } |
143 | |||
128 | } | 144 | } |
129 | } | 145 | } |