aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ReplaceableModules/MoneyModule
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-11 18:23:39 +0000
committerMelanie Thielker2009-05-11 18:23:39 +0000
commitd7b2beea1826345e3b5b93ca0aea52629190ca3c (patch)
tree23734f849a47641136fdd4d825c32219d5975814 /OpenSim/Region/ReplaceableModules/MoneyModule
parentAdd a blue box to the stub money module to alert users that buying is (diff)
downloadopensim-SC_OLD-d7b2beea1826345e3b5b93ca0aea52629190ca3c.zip
opensim-SC_OLD-d7b2beea1826345e3b5b93ca0aea52629190ca3c.tar.gz
opensim-SC_OLD-d7b2beea1826345e3b5b93ca0aea52629190ca3c.tar.bz2
opensim-SC_OLD-d7b2beea1826345e3b5b93ca0aea52629190ca3c.tar.xz
Add selling for $0 back to the sample economy module. This is disabled by
default but can be enabled in OpenSim.ini. If enabled, things can be sold for $0. Other amounts will cause the buyer to see a message and the transaction will fail.
Diffstat (limited to 'OpenSim/Region/ReplaceableModules/MoneyModule')
-rw-r--r--OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs30
1 files changed, 22 insertions, 8 deletions
diff --git a/OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs
index 043c110..cd68541 100644
--- a/OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs
+++ b/OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs
@@ -64,6 +64,7 @@ namespace OpenSim.Region.ReplaceableModules.MoneyModule
64 private bool gridmode = false; 64 private bool gridmode = false;
65 // private ObjectPaid handerOnObjectPaid; 65 // private ObjectPaid handerOnObjectPaid;
66 private bool m_enabled = true; 66 private bool m_enabled = true;
67 private bool m_sellEnabled = false;
67 68
68 private IConfigSource m_gConfig; 69 private IConfigSource m_gConfig;
69 70
@@ -244,13 +245,7 @@ namespace OpenSim.Region.ReplaceableModules.MoneyModule
244 PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10); 245 PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10);
245 PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1); 246 PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1);
246 PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); 247 PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1);
247 // string EBA = startupConfig.GetString("EconomyBaseAccount", UUID.Zero.ToString()); 248 m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false);
248 // Helpers.TryParse(EBA, out EconomyBaseAccount);
249
250 // UserLevelPaysFees = startupConfig.GetInt("UserLevelPaysFees", -1);
251 m_stipend = startupConfig.GetInt("UserStipend", 1000);
252
253 // m_LandAddress = startupConfig.GetString("LandServer", String.Empty);
254 } 249 }
255 250
256 // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter. 251 // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter.
@@ -819,7 +814,26 @@ namespace OpenSim.Region.ReplaceableModules.MoneyModule
819 UUID sessionID, UUID groupID, UUID categoryID, 814 UUID sessionID, UUID groupID, UUID categoryID,
820 uint localID, byte saleType, int salePrice) 815 uint localID, byte saleType, int salePrice)
821 { 816 {
822 remoteClient.SendBlueBoxMessage(UUID.Zero, "", "Buying is not implemented in this version"); 817 if (!m_sellEnabled)
818 {
819 remoteClient.SendBlueBoxMessage(UUID.Zero, "", "Buying is not implemented in this version");
820 return;
821 }
822
823 if (salePrice != 0)
824 {
825 remoteClient.SendBlueBoxMessage(UUID.Zero, "", "Buying anything for a price other than zero is not implemented");
826 return;
827 }
828
829 Scene s = LocateSceneClientIn(remoteClient.AgentId);
830 SceneObjectPart part = s.GetSceneObjectPart(localID);
831 if (part == null)
832 {
833 remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false);
834 return;
835 }
836 s.PerformObjectBuy(remoteClient, categoryID, localID, saleType);
823 } 837 }
824 } 838 }
825 839