From 20a9bf08f51351e1e0a9de94f184ff56cd572665 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 1 May 2008 18:04:42 +0000 Subject: * Rolled back a few changes. --- .../Currency/SampleMoney/SampleMoneyModule.cs | 80 +++++++++++----------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney') 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 public class SampleMoneyModule : IMoneyModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private readonly Dictionary m_KnownClientFunds = new Dictionary(); - - /// - /// Region UUIDS indexed by AgentID - /// - private readonly Dictionary m_rootAgents = new Dictionary(); - - /// - /// Scenes by Region Handle - /// - private readonly Dictionary m_scenel = new Dictionary(); /// /// Where Stipends come from and Fees go to. /// private LLUUID EconomyBaseAccount = LLUUID.Zero; - private float EnergyEfficiency; - private bool gridmode; + private float EnergyEfficiency = 0f; + private bool gridmode = false; private ObjectPaid handerOnObjectPaid; private bool m_enabled = true; private IConfigSource m_gConfig; private bool m_keepMoneyAcrossLogins = true; + private Dictionary m_KnownClientFunds = new Dictionary(); private string m_LandAddress = String.Empty; private int m_minFundsBeforeRefresh = 100; private string m_MoneyAddress = String.Empty; + /// + /// Region UUIDS indexed by AgentID + /// + private Dictionary m_rootAgents = new Dictionary(); + + /// + /// Scenes by Region Handle + /// + private Dictionary m_scenel = new Dictionary(); + private int m_stipend = 1000; private int ObjectCapacity = 45000; - private int ObjectCount; - private int PriceEnergyUnit; - private int PriceGroupCreate; - private int PriceObjectClaim; - private float PriceObjectRent; - private float PriceObjectScaleFactor; - private int PriceParcelClaim; - private float PriceParcelClaimFactor; - private int PriceParcelRent; - private int PricePublicObjectDecay; - private int PricePublicObjectDelete; - private int PriceRentLight; - private int PriceUpload; - private int TeleportMinPrice; - - private float TeleportPriceExponent; + private int ObjectCount = 0; + private int PriceEnergyUnit = 0; + private int PriceGroupCreate = 0; + private int PriceObjectClaim = 0; + private float PriceObjectRent = 0f; + private float PriceObjectScaleFactor = 0f; + private int PriceParcelClaim = 0; + private float PriceParcelClaimFactor = 0f; + private int PriceParcelRent = 0; + private int PricePublicObjectDecay = 0; + private int PricePublicObjectDelete = 0; + private int PriceRentLight = 0; + private int PriceUpload = 0; + private int TeleportMinPrice = 0; + + private float TeleportPriceExponent = 0f; private int UserLevelPaysFees = 2; private Scene XMLRPCHandler; @@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney Hashtable hbinfo = GetBalanceForUserFromMoneyServer(client.AgentId, client.SecureSessionId, s.RegionInfo.originRegionID.ToString(), s.RegionInfo.regionSecret); - if ((bool) hbinfo["success"]) + if ((bool) hbinfo["success"] == true) { Helpers.TryParse((string) hbinfo["agentId"], out agentID); try @@ -333,7 +333,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney else { m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentID, - hbinfo["errorMessage"]); + (string) hbinfo["errorMessage"]); client.SendAlertMessage((string) hbinfo["errorMessage"]); } SendMoneyBalance(client, agentID, client.SessionId, LLUUID.Zero); @@ -660,7 +660,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney Hashtable hresult = genericCurrencyXMLRPCRequest(ht, "regionMoveMoney"); - if ((bool) hresult["success"]) + if ((bool) hresult["success"] == true) { int funds1 = 0; int funds2 = 0; @@ -718,7 +718,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney Hashtable hbinfo = GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID.ToString(), s.RegionInfo.regionSecret); - if ((bool) hbinfo["success"]) + if ((bool) hbinfo["success"] == true) { try { @@ -743,7 +743,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney else { m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentId, - hbinfo["errorMessage"]); + (string) hbinfo["errorMessage"]); aClient.SendAlertMessage((string) hbinfo["errorMessage"]); } } @@ -812,7 +812,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney string secret = (string) requestData["secret"]; Scene userScene = GetRandomScene(); - if (userScene.RegionInfo.regionSecret == secret) + if (userScene.RegionInfo.regionSecret.ToString() == secret) { IClientAPI client = LocateClientObject(agentId); @@ -1238,7 +1238,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { lock (e) { - if (e.economyValidated && e.transactionID == 0) + if (e.economyValidated == true && e.transactionID == 0) { e.transactionID = Util.UnixTimeSinceEpoch(); @@ -1328,7 +1328,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney else { m_log.Warn("[MONEY]: Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + - e.sender + " Receiver: " + e.receiver + " Amount: " + e.amount); + e.sender.ToString() + " Receiver: " + e.receiver.ToString() + " Amount: " + e.amount.ToString()); } } @@ -1400,7 +1400,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { Hashtable hresult = claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret); - if ((bool) hresult["success"]) + if ((bool) hresult["success"] == true) { int funds = 0; try @@ -1432,7 +1432,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney if (RegionItem != null) { Hashtable hresult = claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret); - if ((bool) hresult["success"]) + if ((bool) hresult["success"] == true) { int funds = 0; try @@ -1460,7 +1460,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney #endregion } - public enum TransactionType + public enum TransactionType : int { SystemGenerated = 0, RegionMoneyRequest = 1, -- cgit v1.1