Groups V2: charge for group creation only after the group has been successfully created

cpu-performance
Diva Canto 2013-06-30 08:39:35 -07:00
parent c738368846
commit e377abcc35
1 changed files with 4 additions and 1 deletions

View File

@ -766,14 +766,17 @@ namespace OpenSim.Groups
remoteClient.SendCreateGroupReply(UUID.Zero, false, "Insufficient funds to create a group."); remoteClient.SendCreateGroupReply(UUID.Zero, false, "Insufficient funds to create a group.");
return UUID.Zero; return UUID.Zero;
} }
money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, MoneyTransactionType.GroupCreate);
} }
string reason = string.Empty; string reason = string.Empty;
UUID groupID = m_groupData.CreateGroup(remoteClient.AgentId, name, charter, showInList, insigniaID, membershipFee, openEnrollment, UUID groupID = m_groupData.CreateGroup(remoteClient.AgentId, name, charter, showInList, insigniaID, membershipFee, openEnrollment,
allowPublish, maturePublish, remoteClient.AgentId, out reason); allowPublish, maturePublish, remoteClient.AgentId, out reason);
if (groupID != UUID.Zero) if (groupID != UUID.Zero)
{ {
if (money != null)
money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, MoneyTransactionType.GroupCreate);
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly"); remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly");
// Update the founder with new group information. // Update the founder with new group information.