aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-11 18:23:39 +0000
committerMelanie Thielker2009-05-11 18:23:39 +0000
commitd7b2beea1826345e3b5b93ca0aea52629190ca3c (patch)
tree23734f849a47641136fdd4d825c32219d5975814
parentAdd a blue box to the stub money module to alert users that buying is (diff)
downloadopensim-SC-d7b2beea1826345e3b5b93ca0aea52629190ca3c.zip
opensim-SC-d7b2beea1826345e3b5b93ca0aea52629190ca3c.tar.gz
opensim-SC-d7b2beea1826345e3b5b93ca0aea52629190ca3c.tar.bz2
opensim-SC-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.
-rw-r--r--OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs30
-rw-r--r--bin/OpenSim.ini.example28
2 files changed, 24 insertions, 34 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
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 745b678..de8139b 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -942,13 +942,9 @@
942 942
943[Economy] 943[Economy]
944 ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only - 944 ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only -
945 ; In grid mode, use this currency XMLRPC server. Leave blank for normal functionality
946 CurrencyServer = ""
947 ; "http://192.168.1.127/currency.php"
948 945
949 ; In grid mode, this is the land XMLRPC server. Leave blank for normal functionality 946 ; Enables selling things for $0
950 LandServer = "" 947 SellEnabled = "false"
951 ;"http://192.168.1.127/landtool.php"
952 948
953 ; 45000 is the highest value that the sim could possibly report because of protocol constraints 949 ; 45000 is the highest value that the sim could possibly report because of protocol constraints
954 ObjectCapacity = 45000 950 ObjectCapacity = 45000
@@ -959,26 +955,6 @@
959 ; Money Unit fee to create groups 955 ; Money Unit fee to create groups
960 PriceGroupCreate = 0 956 PriceGroupCreate = 0
961 957
962 ; This is the account Money goes to for fees. Remember, economy requires that money circulates somewhere... even if it's an upload fee
963 EconomyBaseAccount = 00000000-0000-0000-0000-000000000000
964
965 ; This is the type of user that will pay fees.
966 ; Set this to 2 for users, estate managers and Estate Owners
967 ; Set this to 1 for Users and Estate Managers
968 ; Set this to 0 for Users only.
969 ; -1 disables
970 UserLevelPaysFees = -1
971
972 ; Amount to give to user as a stipend
973 UserStipend = 1000
974
975 ; When a user gets low on money units and logs off, then logs back on, issue a new stipend if they have less money units then this
976 ; amount. Be aware that the account money isn't stored anywhere so users will get a stipend if you restart the simulator
977 IssueStipendWhenClientIsBelowAmount = 10
978
979 ; If this is true, the simulator will remember account balances until the simulator is shutdown or restarted.
980 KeepMoneyAcrossLogins = true
981
982 ; We don't really know what the rest of these values do. These get sent to the client 958 ; We don't really know what the rest of these values do. These get sent to the client
983 ; These taken from Agni at a Public Telehub. Change at your own risk. 959 ; These taken from Agni at a Public Telehub. Change at your own risk.
984 ObjectCount = 0 960 ObjectCount = 0