diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 952e797..b84a34d 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -177,37 +177,9 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
177 | scene.EventManager.OnClientClosed += ClientLoggedOut; | 177 | scene.EventManager.OnClientClosed += ClientLoggedOut; |
178 | scene.EventManager.OnValidateLandBuy += ValidateLandBuy; | 178 | scene.EventManager.OnValidateLandBuy += ValidateLandBuy; |
179 | scene.EventManager.OnLandBuy += processLandBuy; | 179 | scene.EventManager.OnLandBuy += processLandBuy; |
180 | scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; | ||
181 | } | 180 | } |
182 | } | 181 | } |
183 | 182 | ||
184 | void OnMakeRootAgent(ScenePresence presence) | ||
185 | { | ||
186 | // Do this only for root agents | ||
187 | // Some implementations register $$ for | ||
188 | // child agents, then that never goes away | ||
189 | // We will send a zero balance when they are | ||
190 | // made root. | ||
191 | // | ||
192 | // Modules overriding this should only deal with | ||
193 | // root agents as well. | ||
194 | // | ||
195 | IClientAPI client = presence.ControllingClient; | ||
196 | |||
197 | client.OnEconomyDataRequest += EconomyDataRequestHandler; | ||
198 | client.OnMoneyBalanceRequest += SendMoneyBalance; | ||
199 | client.OnRequestPayPrice += requestPayPrice; | ||
200 | client.OnObjectBuy += ObjectBuy; | ||
201 | client.OnLogout += ClientClosed; | ||
202 | |||
203 | client.SendMoneyBalance (UUID.Random(), true, new byte[0], 0); | ||
204 | } | ||
205 | |||
206 | void HandleSceneEventManagerOnMakeRootAgent (ScenePresence presence) | ||
207 | { | ||
208 | |||
209 | } | ||
210 | |||
211 | public void RemoveRegion(Scene scene) | 183 | public void RemoveRegion(Scene scene) |
212 | { | 184 | { |
213 | } | 185 | } |
@@ -305,9 +277,13 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
305 | private void OnNewClient(IClientAPI client) | 277 | private void OnNewClient(IClientAPI client) |
306 | { | 278 | { |
307 | GetClientFunds(client); | 279 | GetClientFunds(client); |
308 | // Moved the event registrations to fire them when | ||
309 | // the agent becomes root | ||
310 | 280 | ||
281 | // Subscribe to Money messages | ||
282 | client.OnEconomyDataRequest += EconomyDataRequestHandler; | ||
283 | client.OnMoneyBalanceRequest += SendMoneyBalance; | ||
284 | client.OnRequestPayPrice += requestPayPrice; | ||
285 | client.OnObjectBuy += ObjectBuy; | ||
286 | client.OnLogout += ClientClosed; | ||
311 | } | 287 | } |
312 | 288 | ||
313 | /// <summary> | 289 | /// <summary> |