diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs | 66 |
1 files changed, 27 insertions, 39 deletions
diff --git a/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs b/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs index d53083f..6e16eb3 100644 --- a/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs | |||
@@ -1,30 +1,29 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | */ |
27 | */ | ||
28 | 27 | ||
29 | using System; | 28 | using System; |
30 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
@@ -53,12 +52,8 @@ namespace OpenSim.Region.Environment.Modules | |||
53 | 52 | ||
54 | private bool m_enabled = true; | 53 | private bool m_enabled = true; |
55 | 54 | ||
56 | |||
57 | |||
58 | private Dictionary<LLUUID, int> m_KnownClientFunds = new Dictionary<LLUUID, int>(); | 55 | private Dictionary<LLUUID, int> m_KnownClientFunds = new Dictionary<LLUUID, int>(); |
59 | 56 | ||
60 | |||
61 | |||
62 | private bool gridmode = false; | 57 | private bool gridmode = false; |
63 | 58 | ||
64 | public void Initialise(Scene scene, IConfigSource config) | 59 | public void Initialise(Scene scene, IConfigSource config) |
@@ -86,12 +81,12 @@ namespace OpenSim.Region.Environment.Modules | |||
86 | scene.EventManager.OnClientClosed += ClientClosed; | 81 | scene.EventManager.OnClientClosed += ClientClosed; |
87 | } | 82 | } |
88 | } | 83 | } |
84 | |||
89 | private void ReadConfigAndPopulate() | 85 | private void ReadConfigAndPopulate() |
90 | { | 86 | { |
91 | IConfig startupConfig = m_gConfig.Configs["Startup"]; | 87 | IConfig startupConfig = m_gConfig.Configs["Startup"]; |
92 | gridmode = startupConfig.GetBoolean("gridmode", false); | 88 | gridmode = startupConfig.GetBoolean("gridmode", false); |
93 | m_enabled = (startupConfig.GetString("moneymodule", "BetaGridLikeMoneyModule") == "BetaGridLikeMoneyModule"); | 89 | m_enabled = (startupConfig.GetString("moneymodule", "BetaGridLikeMoneyModule") == "BetaGridLikeMoneyModule"); |
94 | |||
95 | } | 90 | } |
96 | 91 | ||
97 | private void OnNewClient(IClientAPI client) | 92 | private void OnNewClient(IClientAPI client) |
@@ -112,7 +107,6 @@ namespace OpenSim.Region.Environment.Modules | |||
112 | // Subscribe to Money messages | 107 | // Subscribe to Money messages |
113 | client.OnMoneyBalanceRequest += SendMoneyBalance; | 108 | client.OnMoneyBalanceRequest += SendMoneyBalance; |
114 | client.OnLogout += ClientClosed; | 109 | client.OnLogout += ClientClosed; |
115 | |||
116 | } | 110 | } |
117 | 111 | ||
118 | public void ClientClosed(LLUUID AgentID) | 112 | public void ClientClosed(LLUUID AgentID) |
@@ -122,7 +116,6 @@ namespace OpenSim.Region.Environment.Modules | |||
122 | if (!m_keepMoneyAcrossLogins) | 116 | if (!m_keepMoneyAcrossLogins) |
123 | m_KnownClientFunds.Remove(AgentID); | 117 | m_KnownClientFunds.Remove(AgentID); |
124 | } | 118 | } |
125 | |||
126 | } | 119 | } |
127 | 120 | ||
128 | private void MoneyTransferAction (Object osender, MoneyTransferArgs e) | 121 | private void MoneyTransferAction (Object osender, MoneyTransferArgs e) |
@@ -133,8 +126,6 @@ namespace OpenSim.Region.Environment.Modules | |||
133 | sender = LocateClientObject(e.sender); | 126 | sender = LocateClientObject(e.sender); |
134 | if (sender != null) | 127 | if (sender != null) |
135 | { | 128 | { |
136 | |||
137 | |||
138 | receiver = LocateClientObject(e.reciever); | 129 | receiver = LocateClientObject(e.reciever); |
139 | bool transactionresult = doMoneyTranfer(e.sender, e.reciever, e.amount); | 130 | bool transactionresult = doMoneyTranfer(e.sender, e.reciever, e.amount); |
140 | 131 | ||
@@ -238,7 +229,6 @@ namespace OpenSim.Region.Environment.Modules | |||
238 | { | 229 | { |
239 | if (client.AgentId == agentID && client.SessionId == SessionID) | 230 | if (client.AgentId == agentID && client.SessionId == SessionID) |
240 | { | 231 | { |
241 | |||
242 | int returnfunds = 0; | 232 | int returnfunds = 0; |
243 | 233 | ||
244 | try | 234 | try |
@@ -275,6 +265,7 @@ namespace OpenSim.Region.Environment.Modules | |||
275 | } | 265 | } |
276 | } | 266 | } |
277 | } | 267 | } |
268 | |||
278 | private int GetFundsForAgentID(LLUUID AgentID) | 269 | private int GetFundsForAgentID(LLUUID AgentID) |
279 | { | 270 | { |
280 | int returnfunds = 0; | 271 | int returnfunds = 0; |
@@ -296,8 +287,6 @@ namespace OpenSim.Region.Environment.Modules | |||
296 | { | 287 | { |
297 | } | 288 | } |
298 | 289 | ||
299 | |||
300 | |||
301 | public void Close() | 290 | public void Close() |
302 | { | 291 | { |
303 | } | 292 | } |
@@ -312,5 +301,4 @@ namespace OpenSim.Region.Environment.Modules | |||
312 | get { return true; } | 301 | get { return true; } |
313 | } | 302 | } |
314 | } | 303 | } |
315 | |||
316 | } | 304 | } |