diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs')
-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 cc6fd77..966c5e2 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>(); | ||
79 | 68 | ||
80 | /// <summary> | 69 | /// <summary> |
81 | /// Where Stipends come from and Fees go to. | 70 | /// Where Stipends come from and Fees go to. |
82 | /// </summary> | 71 | /// </summary> |
83 | private LLUUID EconomyBaseAccount = LLUUID.Zero; | 72 | private LLUUID EconomyBaseAccount = LLUUID.Zero; |
84 | 73 | ||
85 | private float EnergyEfficiency; | 74 | private float EnergyEfficiency = 0f; |
86 | private bool gridmode; | 75 | private bool gridmode = false; |
87 | private ObjectPaid handerOnObjectPaid; | 76 | private ObjectPaid handerOnObjectPaid; |
88 | private bool m_enabled = true; | 77 | private bool m_enabled = true; |
89 | 78 | ||
90 | private IConfigSource m_gConfig; | 79 | private IConfigSource m_gConfig; |
91 | 80 | ||
92 | private bool m_keepMoneyAcrossLogins = true; | 81 | private bool m_keepMoneyAcrossLogins = true; |
82 | private Dictionary<LLUUID, int> m_KnownClientFunds = new Dictionary<LLUUID, int>(); | ||
93 | private string m_LandAddress = String.Empty; | 83 | private string m_LandAddress = String.Empty; |
94 | 84 | ||
95 | private int m_minFundsBeforeRefresh = 100; | 85 | private int m_minFundsBeforeRefresh = 100; |
96 | private string m_MoneyAddress = String.Empty; | 86 | private string m_MoneyAddress = String.Empty; |
97 | 87 | ||
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; | 101 | private int ObjectCount = 0; |
102 | private int PriceEnergyUnit; | 102 | private int PriceEnergyUnit = 0; |
103 | private int PriceGroupCreate; | 103 | private int PriceGroupCreate = 0; |
104 | private int PriceObjectClaim; | 104 | private int PriceObjectClaim = 0; |
105 | private float PriceObjectRent; | 105 | private float PriceObjectRent = 0f; |
106 | private float PriceObjectScaleFactor; | 106 | private float PriceObjectScaleFactor = 0f; |
107 | private int PriceParcelClaim; | 107 | private int PriceParcelClaim = 0; |
108 | private float PriceParcelClaimFactor; | 108 | private float PriceParcelClaimFactor = 0f; |
109 | private int PriceParcelRent; | 109 | private int PriceParcelRent = 0; |
110 | private int PricePublicObjectDecay; | 110 | private int PricePublicObjectDecay = 0; |
111 | private int PricePublicObjectDelete; | 111 | private int PricePublicObjectDelete = 0; |
112 | private int PriceRentLight; | 112 | private int PriceRentLight = 0; |
113 | private int PriceUpload; | 113 | private int PriceUpload = 0; |
114 | private int TeleportMinPrice; | 114 | private int TeleportMinPrice = 0; |
115 | 115 | ||
116 | private float TeleportPriceExponent; | 116 | private float TeleportPriceExponent = 0f; |
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"]) | 308 | if ((bool) hbinfo["success"] == true) |
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 | hbinfo["errorMessage"]); | 336 | (string) 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"]) | 663 | if ((bool) hresult["success"] == true) |
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"]) | 721 | if ((bool) hbinfo["success"] == true) |
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 | hbinfo["errorMessage"]); | 746 | (string) 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 == secret) | 815 | if (userScene.RegionInfo.regionSecret.ToString() == 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 && e.transactionID == 0) | 1241 | if (e.economyValidated == true && 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 + " Receiver: " + e.receiver + " Amount: " + e.amount); | 1331 | e.sender.ToString() + " Receiver: " + e.receiver.ToString() + " Amount: " + e.amount.ToString()); |
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"]) | 1403 | if ((bool) hresult["success"] == true) |
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"]) | 1435 | if ((bool) hresult["success"] == true) |
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 | 1463 | public enum TransactionType : int |
1464 | { | 1464 | { |
1465 | SystemGenerated = 0, | 1465 | SystemGenerated = 0, |
1466 | RegionMoneyRequest = 1, | 1466 | RegionMoneyRequest = 1, |