diff options
author | Diva Canto | 2010-07-02 06:36:08 -0700 |
---|---|---|
committer | Diva Canto | 2010-07-02 06:36:08 -0700 |
commit | 79c1eb1e394c658bf2f0af0f1e20a9c5f8ea1b53 (patch) | |
tree | 94689bae9d0813616dc9f487824d17d8954f0414 /OpenSim/Region | |
parent | Fixes mantis #4782 (diff) | |
parent | Clean up IMoneyModule and adjust the other modules to the changes (diff) | |
download | opensim-SC-79c1eb1e394c658bf2f0af0f1e20a9c5f8ea1b53.zip opensim-SC-79c1eb1e394c658bf2f0af0f1e20a9c5f8ea1b53.tar.gz opensim-SC-79c1eb1e394c658bf2f0af0f1e20a9c5f8ea1b53.tar.bz2 opensim-SC-79c1eb1e394c658bf2f0af0f1e20a9c5f8ea1b53.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
7 files changed, 26 insertions, 46 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 7e08ecf..ae31050 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs | |||
@@ -243,7 +243,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
243 | 243 | ||
244 | if (mm != null) | 244 | if (mm != null) |
245 | { | 245 | { |
246 | if (!mm.UploadCovered(remoteClient)) | 246 | if (!mm.UploadCovered(remoteClient, mm.UploadCharge)) |
247 | { | 247 | { |
248 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 248 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
249 | return; | 249 | return; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index f9da341..33173dd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
73 | IMoneyModule money=RequestModuleInterface<IMoneyModule>(); | 73 | IMoneyModule money=RequestModuleInterface<IMoneyModule>(); |
74 | if (money != null) | 74 | if (money != null) |
75 | { | 75 | { |
76 | money.ApplyUploadCharge(agentID); | 76 | money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload"); |
77 | } | 77 | } |
78 | 78 | ||
79 | AddInventoryItem(agentID, item); | 79 | AddInventoryItem(agentID, item); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 56c0d98..3f15b69 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -722,11 +722,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
722 | if (money != null) | 722 | if (money != null) |
723 | { | 723 | { |
724 | // do the transaction, that is if the agent has got sufficient funds | 724 | // do the transaction, that is if the agent has got sufficient funds |
725 | if (!money.GroupCreationCovered(remoteClient)) { | 725 | if (!money.AmountCovered(remoteClient, money.GroupCreationCharge)) { |
726 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); | 726 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); |
727 | return UUID.Zero; | 727 | return UUID.Zero; |
728 | } | 728 | } |
729 | money.ApplyGroupCreationCharge(GetRequestingAgentID(remoteClient)); | 729 | money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation"); |
730 | } | 730 | } |
731 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); | 731 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); |
732 | 732 | ||
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index b9a75cc..6f5ef9e 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -108,6 +108,16 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
108 | 108 | ||
109 | public event ObjectPaid OnObjectPaid; | 109 | public event ObjectPaid OnObjectPaid; |
110 | 110 | ||
111 | public int UploadCharge | ||
112 | { | ||
113 | get { return 0; } | ||
114 | } | ||
115 | |||
116 | public int GroupCreationCharge | ||
117 | { | ||
118 | get { return 0; } | ||
119 | } | ||
120 | |||
111 | /// <summary> | 121 | /// <summary> |
112 | /// Startup | 122 | /// Startup |
113 | /// </summary> | 123 | /// </summary> |
@@ -188,15 +198,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
188 | // Please do not refactor these to be just one method | 198 | // Please do not refactor these to be just one method |
189 | // Existing implementations need the distinction | 199 | // Existing implementations need the distinction |
190 | // | 200 | // |
191 | public void ApplyUploadCharge(UUID agentID) | 201 | public void ApplyCharge(UUID agentID, int amount, string text) |
192 | { | ||
193 | } | ||
194 | |||
195 | public void ApplyGroupCreationCharge(UUID agentID) | ||
196 | { | 202 | { |
197 | } | 203 | } |
198 | 204 | public void ApplyUploadCharge(UUID agentID, int amount, string text) | |
199 | public void ApplyCharge(UUID agentID, int amount, string text) | ||
200 | { | 205 | { |
201 | } | 206 | } |
202 | 207 | ||
@@ -268,27 +273,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
268 | 273 | ||
269 | } | 274 | } |
270 | 275 | ||
271 | public EconomyData GetEconomyData() | ||
272 | { | ||
273 | EconomyData edata = new EconomyData(); | ||
274 | edata.ObjectCapacity = ObjectCapacity; | ||
275 | edata.ObjectCount = ObjectCount; | ||
276 | edata.PriceEnergyUnit = PriceEnergyUnit; | ||
277 | edata.PriceGroupCreate = PriceGroupCreate; | ||
278 | edata.PriceObjectClaim = PriceObjectClaim; | ||
279 | edata.PriceObjectRent = PriceObjectRent; | ||
280 | edata.PriceObjectScaleFactor = PriceObjectScaleFactor; | ||
281 | edata.PriceParcelClaim = PriceParcelClaim; | ||
282 | edata.PriceParcelClaimFactor = PriceParcelClaimFactor; | ||
283 | edata.PriceParcelRent = PriceParcelRent; | ||
284 | edata.PricePublicObjectDecay = PricePublicObjectDecay; | ||
285 | edata.PricePublicObjectDelete = PricePublicObjectDelete; | ||
286 | edata.PriceRentLight = PriceRentLight; | ||
287 | edata.PriceUpload = PriceUpload; | ||
288 | edata.TeleportMinPrice = TeleportMinPrice; | ||
289 | return edata; | ||
290 | } | ||
291 | |||
292 | private void GetClientFunds(IClientAPI client) | 276 | private void GetClientFunds(IClientAPI client) |
293 | { | 277 | { |
294 | CheckExistAndRefreshFunds(client.AgentId); | 278 | CheckExistAndRefreshFunds(client.AgentId); |
@@ -790,7 +774,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
790 | //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString()); | 774 | //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString()); |
791 | } | 775 | } |
792 | 776 | ||
793 | public int GetBalance(IClientAPI client) | 777 | public int GetBalance(UUID agentID) |
794 | { | 778 | { |
795 | return 0; | 779 | return 0; |
796 | } | 780 | } |
@@ -798,16 +782,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
798 | // Please do not refactor these to be just one method | 782 | // Please do not refactor these to be just one method |
799 | // Existing implementations need the distinction | 783 | // Existing implementations need the distinction |
800 | // | 784 | // |
801 | public bool UploadCovered(IClientAPI client) | 785 | public bool UploadCovered(IClientAPI client, int amount) |
802 | { | 786 | { |
803 | return AmountCovered(client, PriceUpload); | 787 | return true; |
804 | } | ||
805 | |||
806 | public bool GroupCreationCovered(IClientAPI client) | ||
807 | { | ||
808 | return AmountCovered(client, PriceGroupCreate); | ||
809 | } | 788 | } |
810 | |||
811 | public bool AmountCovered(IClientAPI client, int amount) | 789 | public bool AmountCovered(IClientAPI client, int amount) |
812 | { | 790 | { |
813 | return true; | 791 | return true; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 712bd7d..0a8d7cb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4950,7 +4950,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4950 | case ',': | 4950 | case ',': |
4951 | if (parens == 0) | 4951 | if (parens == 0) |
4952 | { | 4952 | { |
4953 | result.Add(src.Substring(start,length).Trim()); | 4953 | result.Add(new LSL_String(src.Substring(start,length).Trim())); |
4954 | start += length+1; | 4954 | start += length+1; |
4955 | length = 0; | 4955 | length = 0; |
4956 | } | 4956 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 1ea52c5..941c761 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -663,13 +663,13 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
663 | Object[] ret; | 663 | Object[] ret; |
664 | 664 | ||
665 | if (start < 0) | 665 | if (start < 0) |
666 | start=m_data.Length-start; | 666 | start=m_data.Length+start; |
667 | 667 | ||
668 | if (start < 0) | 668 | if (start < 0) |
669 | start=0; | 669 | start=0; |
670 | 670 | ||
671 | if (end < 0) | 671 | if (end < 0) |
672 | end=m_data.Length-end; | 672 | end=m_data.Length+end; |
673 | if (end < 0) | 673 | if (end < 0) |
674 | end=0; | 674 | end=0; |
675 | 675 | ||
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 808cf82..bc5df11 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -770,8 +770,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
770 | item.Name, startParam, postOnRez, | 770 | item.Name, startParam, postOnRez, |
771 | stateSource, m_MaxScriptQueue); | 771 | stateSource, m_MaxScriptQueue); |
772 | 772 | ||
773 | m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", | 773 | m_log.DebugFormat( |
774 | part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); | 774 | "[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}.{5}", |
775 | part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, | ||
776 | part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); | ||
775 | 777 | ||
776 | if (presence != null) | 778 | if (presence != null) |
777 | { | 779 | { |