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.
0.6.5-rc1
Melanie Thielker 2009-05-11 18:23:39 +00:00
parent 91bfd25ef8
commit d7b2beea18
2 changed files with 24 additions and 34 deletions

View File

@ -64,6 +64,7 @@ namespace OpenSim.Region.ReplaceableModules.MoneyModule
private bool gridmode = false;
// private ObjectPaid handerOnObjectPaid;
private bool m_enabled = true;
private bool m_sellEnabled = false;
private IConfigSource m_gConfig;
@ -244,13 +245,7 @@ namespace OpenSim.Region.ReplaceableModules.MoneyModule
PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10);
PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1);
PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1);
// string EBA = startupConfig.GetString("EconomyBaseAccount", UUID.Zero.ToString());
// Helpers.TryParse(EBA, out EconomyBaseAccount);
// UserLevelPaysFees = startupConfig.GetInt("UserLevelPaysFees", -1);
m_stipend = startupConfig.GetInt("UserStipend", 1000);
// m_LandAddress = startupConfig.GetString("LandServer", String.Empty);
m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false);
}
// Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter.
@ -818,8 +813,27 @@ namespace OpenSim.Region.ReplaceableModules.MoneyModule
public void ObjectBuy(IClientAPI remoteClient, UUID agentID,
UUID sessionID, UUID groupID, UUID categoryID,
uint localID, byte saleType, int salePrice)
{
if (!m_sellEnabled)
{
remoteClient.SendBlueBoxMessage(UUID.Zero, "", "Buying is not implemented in this version");
return;
}
if (salePrice != 0)
{
remoteClient.SendBlueBoxMessage(UUID.Zero, "", "Buying anything for a price other than zero is not implemented");
return;
}
Scene s = LocateSceneClientIn(remoteClient.AgentId);
SceneObjectPart part = s.GetSceneObjectPart(localID);
if (part == null)
{
remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false);
return;
}
s.PerformObjectBuy(remoteClient, categoryID, localID, saleType);
}
}

View File

@ -942,13 +942,9 @@
[Economy]
; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only -
; In grid mode, use this currency XMLRPC server. Leave blank for normal functionality
CurrencyServer = ""
; "http://192.168.1.127/currency.php"
; In grid mode, this is the land XMLRPC server. Leave blank for normal functionality
LandServer = ""
;"http://192.168.1.127/landtool.php"
; Enables selling things for $0
SellEnabled = "false"
; 45000 is the highest value that the sim could possibly report because of protocol constraints
ObjectCapacity = 45000
@ -959,26 +955,6 @@
; Money Unit fee to create groups
PriceGroupCreate = 0
; This is the account Money goes to for fees. Remember, economy requires that money circulates somewhere... even if it's an upload fee
EconomyBaseAccount = 00000000-0000-0000-0000-000000000000
; This is the type of user that will pay fees.
; Set this to 2 for users, estate managers and Estate Owners
; Set this to 1 for Users and Estate Managers
; Set this to 0 for Users only.
; -1 disables
UserLevelPaysFees = -1
; Amount to give to user as a stipend
UserStipend = 1000
; 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
; amount. Be aware that the account money isn't stored anywhere so users will get a stipend if you restart the simulator
IssueStipendWhenClientIsBelowAmount = 10
; If this is true, the simulator will remember account balances until the simulator is shutdown or restarted.
KeepMoneyAcrossLogins = true
; We don't really know what the rest of these values do. These get sent to the client
; These taken from Agni at a Public Telehub. Change at your own risk.
ObjectCount = 0