diff options
author | BlueWall | 2011-05-24 16:33:51 -0400 |
---|---|---|
committer | BlueWall | 2011-05-24 16:33:51 -0400 |
commit | ef3f6b4e63a49430bebbc929cb61d018a0a0d37c (patch) | |
tree | 51b42c26237deaaf4c0b59a51da857a2f47fd2c9 /OpenSim/Region/OptionalModules/World | |
parent | Make client event handlers for money only work on root agents (diff) | |
download | opensim-SC_OLD-ef3f6b4e63a49430bebbc929cb61d018a0a0d37c.zip opensim-SC_OLD-ef3f6b4e63a49430bebbc929cb61d018a0a0d37c.tar.gz opensim-SC_OLD-ef3f6b4e63a49430bebbc929cb61d018a0a0d37c.tar.bz2 opensim-SC_OLD-ef3f6b4e63a49430bebbc929cb61d018a0a0d37c.tar.xz |
Revert "Make client event handlers for money only work on root agents"
This reverts commit a8913141c081202eb1f988901a4ac0988bbd72a2.
Pulling this back until some testing under various money
modules can be done. Need to be able to make purchases as
a child agent.
Diffstat (limited to 'OpenSim/Region/OptionalModules/World')
-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> |