diff options
author | Adam Frisby | 2008-05-01 16:35:00 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-01 16:35:00 +0000 |
commit | 13526097f24b7a8ad63b1d482c44b44397fa055f (patch) | |
tree | 7a82c20ed7c63e2aea5ad3863325e37f64e1cbea /OpenSim/Region/Environment/Modules/Avatar/Currency | |
parent | * Breaking all the code, breaking all the code..! (diff) | |
download | opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.zip opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.gz opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.bz2 opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.xz |
* Spring cleaning on Region.Environment.
* Converted a large number of read-only fields to be actually, readonly.
* Reformatted code sections.
* Removed redundant code.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/Currency')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs index 966c5e2..cc6fd77 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs | |||
@@ -65,55 +65,55 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
65 | public class SampleMoneyModule : IMoneyModule | 65 | public class SampleMoneyModule : IMoneyModule |
66 | { | 66 | { |
67 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 67 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
68 | private readonly Dictionary<LLUUID, int> m_KnownClientFunds = new Dictionary<LLUUID, int>(); | ||
69 | |||
70 | /// <summary> | ||
71 | /// Region UUIDS indexed by AgentID | ||
72 | /// </summary> | ||
73 | private readonly Dictionary<LLUUID, LLUUID> m_rootAgents = new Dictionary<LLUUID, LLUUID>(); | ||
74 | |||
75 | /// <summary> | ||
76 | /// Scenes by Region Handle | ||
77 | /// </summary> | ||
78 | private readonly Dictionary<ulong, Scene> m_scenel = new Dictionary<ulong, Scene>(); | ||
68 | 79 | ||
69 | /// <summary> | 80 | /// <summary> |
70 | /// Where Stipends come from and Fees go to. | 81 | /// Where Stipends come from and Fees go to. |
71 | /// </summary> | 82 | /// </summary> |
72 | private LLUUID EconomyBaseAccount = LLUUID.Zero; | 83 | private LLUUID EconomyBaseAccount = LLUUID.Zero; |
73 | 84 | ||
74 | private float EnergyEfficiency = 0f; | 85 | private float EnergyEfficiency; |
75 | private bool gridmode = false; | 86 | private bool gridmode; |
76 | private ObjectPaid handerOnObjectPaid; | 87 | private ObjectPaid handerOnObjectPaid; |
77 | private bool m_enabled = true; | 88 | private bool m_enabled = true; |
78 | 89 | ||
79 | private IConfigSource m_gConfig; | 90 | private IConfigSource m_gConfig; |
80 | 91 | ||
81 | private bool m_keepMoneyAcrossLogins = true; | 92 | private bool m_keepMoneyAcrossLogins = true; |
82 | private Dictionary<LLUUID, int> m_KnownClientFunds = new Dictionary<LLUUID, int>(); | ||
83 | private string m_LandAddress = String.Empty; | 93 | private string m_LandAddress = String.Empty; |
84 | 94 | ||
85 | private int m_minFundsBeforeRefresh = 100; | 95 | private int m_minFundsBeforeRefresh = 100; |
86 | private string m_MoneyAddress = String.Empty; | 96 | private string m_MoneyAddress = String.Empty; |
87 | 97 | ||
88 | /// <summary> | ||
89 | /// Region UUIDS indexed by AgentID | ||
90 | /// </summary> | ||
91 | private Dictionary<LLUUID, LLUUID> m_rootAgents = new Dictionary<LLUUID, LLUUID>(); | ||
92 | |||
93 | /// <summary> | ||
94 | /// Scenes by Region Handle | ||
95 | /// </summary> | ||
96 | private Dictionary<ulong, Scene> m_scenel = new Dictionary<ulong, Scene>(); | ||
97 | |||
98 | private int m_stipend = 1000; | 98 | private int m_stipend = 1000; |
99 | 99 | ||
100 | private int ObjectCapacity = 45000; | 100 | private int ObjectCapacity = 45000; |
101 | private int ObjectCount = 0; | 101 | private int ObjectCount; |
102 | private int PriceEnergyUnit = 0; | 102 | private int PriceEnergyUnit; |
103 | private int PriceGroupCreate = 0; | 103 | private int PriceGroupCreate; |
104 | private int PriceObjectClaim = 0; | 104 | private int PriceObjectClaim; |
105 | private float PriceObjectRent = 0f; | 105 | private float PriceObjectRent; |
106 | private float PriceObjectScaleFactor = 0f; | 106 | private float PriceObjectScaleFactor; |
107 | private int PriceParcelClaim = 0; | 107 | private int PriceParcelClaim; |
108 | private float PriceParcelClaimFactor = 0f; | 108 | private float PriceParcelClaimFactor; |
109 | private int PriceParcelRent = 0; | 109 | private int PriceParcelRent; |
110 | private int PricePublicObjectDecay = 0; | 110 | private int PricePublicObjectDecay; |
111 | private int PricePublicObjectDelete = 0; | 111 | private int PricePublicObjectDelete; |
112 | private int PriceRentLight = 0; | 112 | private int PriceRentLight; |
113 | private int PriceUpload = 0; | 113 | private int PriceUpload; |
114 | private int TeleportMinPrice = 0; | 114 | private int TeleportMinPrice; |
115 | 115 | ||
116 | private float TeleportPriceExponent = 0f; | 116 | private float TeleportPriceExponent; |
117 | private int UserLevelPaysFees = 2; | 117 | private int UserLevelPaysFees = 2; |
118 | private Scene XMLRPCHandler; | 118 | private Scene XMLRPCHandler; |
119 | 119 | ||
@@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
305 | Hashtable hbinfo = | 305 | Hashtable hbinfo = |
306 | GetBalanceForUserFromMoneyServer(client.AgentId, client.SecureSessionId, s.RegionInfo.originRegionID.ToString(), | 306 | GetBalanceForUserFromMoneyServer(client.AgentId, client.SecureSessionId, s.RegionInfo.originRegionID.ToString(), |
307 | s.RegionInfo.regionSecret); | 307 | s.RegionInfo.regionSecret); |
308 | if ((bool) hbinfo["success"] == true) | 308 | if ((bool) hbinfo["success"]) |
309 | { | 309 | { |
310 | Helpers.TryParse((string) hbinfo["agentId"], out agentID); | 310 | Helpers.TryParse((string) hbinfo["agentId"], out agentID); |
311 | try | 311 | try |
@@ -333,7 +333,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
333 | else | 333 | else |
334 | { | 334 | { |
335 | m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentID, | 335 | m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentID, |
336 | (string) hbinfo["errorMessage"]); | 336 | hbinfo["errorMessage"]); |
337 | client.SendAlertMessage((string) hbinfo["errorMessage"]); | 337 | client.SendAlertMessage((string) hbinfo["errorMessage"]); |
338 | } | 338 | } |
339 | SendMoneyBalance(client, agentID, client.SessionId, LLUUID.Zero); | 339 | SendMoneyBalance(client, agentID, client.SessionId, LLUUID.Zero); |
@@ -660,7 +660,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
660 | 660 | ||
661 | Hashtable hresult = genericCurrencyXMLRPCRequest(ht, "regionMoveMoney"); | 661 | Hashtable hresult = genericCurrencyXMLRPCRequest(ht, "regionMoveMoney"); |
662 | 662 | ||
663 | if ((bool) hresult["success"] == true) | 663 | if ((bool) hresult["success"]) |
664 | { | 664 | { |
665 | int funds1 = 0; | 665 | int funds1 = 0; |
666 | int funds2 = 0; | 666 | int funds2 = 0; |
@@ -718,7 +718,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
718 | Hashtable hbinfo = | 718 | Hashtable hbinfo = |
719 | GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID.ToString(), | 719 | GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID.ToString(), |
720 | s.RegionInfo.regionSecret); | 720 | s.RegionInfo.regionSecret); |
721 | if ((bool) hbinfo["success"] == true) | 721 | if ((bool) hbinfo["success"]) |
722 | { | 722 | { |
723 | try | 723 | try |
724 | { | 724 | { |
@@ -743,7 +743,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
743 | else | 743 | else |
744 | { | 744 | { |
745 | m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentId, | 745 | m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentId, |
746 | (string) hbinfo["errorMessage"]); | 746 | hbinfo["errorMessage"]); |
747 | aClient.SendAlertMessage((string) hbinfo["errorMessage"]); | 747 | aClient.SendAlertMessage((string) hbinfo["errorMessage"]); |
748 | } | 748 | } |
749 | } | 749 | } |
@@ -812,7 +812,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
812 | string secret = (string) requestData["secret"]; | 812 | string secret = (string) requestData["secret"]; |
813 | 813 | ||
814 | Scene userScene = GetRandomScene(); | 814 | Scene userScene = GetRandomScene(); |
815 | if (userScene.RegionInfo.regionSecret.ToString() == secret) | 815 | if (userScene.RegionInfo.regionSecret == secret) |
816 | { | 816 | { |
817 | IClientAPI client = LocateClientObject(agentId); | 817 | IClientAPI client = LocateClientObject(agentId); |
818 | 818 | ||
@@ -1238,7 +1238,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1238 | { | 1238 | { |
1239 | lock (e) | 1239 | lock (e) |
1240 | { | 1240 | { |
1241 | if (e.economyValidated == true && e.transactionID == 0) | 1241 | if (e.economyValidated && e.transactionID == 0) |
1242 | { | 1242 | { |
1243 | e.transactionID = Util.UnixTimeSinceEpoch(); | 1243 | e.transactionID = Util.UnixTimeSinceEpoch(); |
1244 | 1244 | ||
@@ -1328,7 +1328,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1328 | else | 1328 | else |
1329 | { | 1329 | { |
1330 | m_log.Warn("[MONEY]: Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + | 1330 | m_log.Warn("[MONEY]: Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + |
1331 | e.sender.ToString() + " Receiver: " + e.receiver.ToString() + " Amount: " + e.amount.ToString()); | 1331 | e.sender + " Receiver: " + e.receiver + " Amount: " + e.amount); |
1332 | } | 1332 | } |
1333 | } | 1333 | } |
1334 | 1334 | ||
@@ -1400,7 +1400,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1400 | { | 1400 | { |
1401 | Hashtable hresult = | 1401 | Hashtable hresult = |
1402 | claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret); | 1402 | claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret); |
1403 | if ((bool) hresult["success"] == true) | 1403 | if ((bool) hresult["success"]) |
1404 | { | 1404 | { |
1405 | int funds = 0; | 1405 | int funds = 0; |
1406 | try | 1406 | try |
@@ -1432,7 +1432,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1432 | if (RegionItem != null) | 1432 | if (RegionItem != null) |
1433 | { | 1433 | { |
1434 | Hashtable hresult = claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret); | 1434 | Hashtable hresult = claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret); |
1435 | if ((bool) hresult["success"] == true) | 1435 | if ((bool) hresult["success"]) |
1436 | { | 1436 | { |
1437 | int funds = 0; | 1437 | int funds = 0; |
1438 | try | 1438 | try |
@@ -1460,7 +1460,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney | |||
1460 | #endregion | 1460 | #endregion |
1461 | } | 1461 | } |
1462 | 1462 | ||
1463 | public enum TransactionType : int | 1463 | public enum TransactionType |
1464 | { | 1464 | { |
1465 | SystemGenerated = 0, | 1465 | SystemGenerated = 0, |
1466 | RegionMoneyRequest = 1, | 1466 | RegionMoneyRequest = 1, |