diff options
author | Tom Grimshaw | 2010-07-03 06:11:46 -0700 |
---|---|---|
committer | Tom Grimshaw | 2010-07-03 06:11:46 -0700 |
commit | e4739523d3a9f19a0af385b64fb81fcd83a3a175 (patch) | |
tree | 95a602904a1c0234725d1e4386eadeecfe34b364 /OpenSim | |
parent | Fix Undo! Made a lot of changes to Undo state saving; it now considers that ... (diff) | |
parent | Now, fix the slash issue the right way. Our URLs now work like SL's (diff) | |
download | opensim-SC_OLD-e4739523d3a9f19a0af385b64fb81fcd83a3a175.zip opensim-SC_OLD-e4739523d3a9f19a0af385b64fb81fcd83a3a175.tar.gz opensim-SC_OLD-e4739523d3a9f19a0af385b64fb81fcd83a3a175.tar.bz2 opensim-SC_OLD-e4739523d3a9f19a0af385b64fb81fcd83a3a175.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to '')
12 files changed, 47 insertions, 78 deletions
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index 62a1e17..da953bb 100644 --- a/OpenSim/Framework/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs | |||
@@ -814,7 +814,7 @@ namespace OpenSim.Framework.Capabilities | |||
814 | 814 | ||
815 | if (mm != null) | 815 | if (mm != null) |
816 | { | 816 | { |
817 | if (!mm.UploadCovered(client)) | 817 | if (!mm.UploadCovered(client, mm.UploadCharge)) |
818 | { | 818 | { |
819 | if (client != null) | 819 | if (client != null) |
820 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 820 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 3480960..3d4873d 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs | |||
@@ -35,35 +35,15 @@ namespace OpenSim.Framework | |||
35 | bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, | 35 | bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, |
36 | int amount); | 36 | int amount); |
37 | 37 | ||
38 | int GetBalance(IClientAPI client); | 38 | int GetBalance(UUID agentID); |
39 | void ApplyUploadCharge(UUID agentID); | 39 | bool UploadCovered(IClientAPI client, int amount); |
40 | bool UploadCovered(IClientAPI client); | ||
41 | void ApplyGroupCreationCharge(UUID agentID); | ||
42 | bool GroupCreationCovered(IClientAPI client); | ||
43 | bool AmountCovered(IClientAPI client, int amount); | 40 | bool AmountCovered(IClientAPI client, int amount); |
44 | void ApplyCharge(UUID agentID, int amount, string text); | 41 | void ApplyCharge(UUID agentID, int amount, string text); |
42 | void ApplyUploadCharge(UUID agentID, int amount, string text); | ||
45 | 43 | ||
46 | EconomyData GetEconomyData(); | 44 | int UploadCharge { get; } |
45 | int GroupCreationCharge { get; } | ||
47 | 46 | ||
48 | event ObjectPaid OnObjectPaid; | 47 | event ObjectPaid OnObjectPaid; |
49 | } | 48 | } |
50 | |||
51 | public struct EconomyData | ||
52 | { | ||
53 | public int ObjectCapacity; | ||
54 | public int ObjectCount; | ||
55 | public int PriceEnergyUnit; | ||
56 | public int PriceGroupCreate; | ||
57 | public int PriceObjectClaim; | ||
58 | public float PriceObjectRent; | ||
59 | public float PriceObjectScaleFactor; | ||
60 | public int PriceParcelClaim; | ||
61 | public float PriceParcelClaimFactor; | ||
62 | public int PriceParcelRent; | ||
63 | public int PricePublicObjectDecay; | ||
64 | public int PricePublicObjectDelete; | ||
65 | public int PriceRentLight; | ||
66 | public int PriceUpload; | ||
67 | public int TeleportMinPrice; | ||
68 | } | ||
69 | } | 49 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index cda461c..f2bcc0b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -900,7 +900,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
900 | 900 | ||
901 | // Start the IClientAPI | 901 | // Start the IClientAPI |
902 | // Spin it off so that it doesn't clog up the LLUDPServer | 902 | // Spin it off so that it doesn't clog up the LLUDPServer |
903 | Util.FireAndForget(delegate(object o) { client.Start(); }); | 903 | //Util.FireAndForget(delegate(object o) { client.Start(); }); |
904 | |||
905 | // NOTE: DO NOT CALL THIS ASYNCHRONOUSLY!!!!! | ||
906 | // This method will ultimately cause the modules to hook | ||
907 | // client events in OnNewClient. If they can't do this | ||
908 | // before further packets are processed, packets WILL BE LOST. | ||
909 | // This includes the all-important EconomyDataRequest! | ||
910 | // So using FireAndForget here WILL screw up money. Badly. | ||
911 | // You have been warned! | ||
912 | client.Start(); | ||
904 | } | 913 | } |
905 | else | 914 | else |
906 | { | 915 | { |
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/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 75efb79..8aa87fd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
190 | end = Utils.Clamp(end, 1, texture.Data.Length); | 190 | end = Utils.Clamp(end, 1, texture.Data.Length); |
191 | start = Utils.Clamp(start, 0, end - 1); | 191 | start = Utils.Clamp(start, 0, end - 1); |
192 | 192 | ||
193 | m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); | 193 | //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); |
194 | 194 | ||
195 | if (end - start < texture.Data.Length) | 195 | if (end - start < texture.Data.Length) |
196 | response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent; | 196 | response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent; |
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index f8cb414..1fd1f47 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -152,7 +152,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
152 | urlData.urlcode = urlcode; | 152 | urlData.urlcode = urlcode; |
153 | urlData.requests = new Dictionary<UUID, RequestData>(); | 153 | urlData.requests = new Dictionary<UUID, RequestData>(); |
154 | 154 | ||
155 | |||
156 | m_UrlMap[url] = urlData; | 155 | m_UrlMap[url] = urlData; |
157 | 156 | ||
158 | string uri = "/lslhttp/" + urlcode.ToString(); | 157 | string uri = "/lslhttp/" + urlcode.ToString(); |
@@ -386,6 +385,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
386 | 385 | ||
387 | return response; | 386 | return response; |
388 | } | 387 | } |
388 | |||
389 | public void HttpRequestHandler(UUID requestID, Hashtable request) | 389 | public void HttpRequestHandler(UUID requestID, Hashtable request) |
390 | { | 390 | { |
391 | lock (request) | 391 | lock (request) |
@@ -400,8 +400,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
400 | 400 | ||
401 | int pos1 = uri.IndexOf("/");// /lslhttp | 401 | int pos1 = uri.IndexOf("/");// /lslhttp |
402 | int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/ | 402 | int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/ |
403 | int pos3 = uri.IndexOf("/", pos2 + 1);// /lslhttp/<UUID>/ | 403 | int pos3 = pos2 + 37; // /lslhttp/urlcode |
404 | string uri_tmp = uri.Substring(0, pos3 + 1); | 404 | string uri_tmp = uri.Substring(0, pos3); |
405 | //HTTP server code doesn't provide us with QueryStrings | 405 | //HTTP server code doesn't provide us with QueryStrings |
406 | string pathInfo; | 406 | string pathInfo; |
407 | string queryString; | 407 | string queryString; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 167e166..489b8ca 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 e226682..11d7c2b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5247,7 +5247,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5247 | case ',': | 5247 | case ',': |
5248 | if (parens == 0) | 5248 | if (parens == 0) |
5249 | { | 5249 | { |
5250 | result.Add(src.Substring(start,length).Trim()); | 5250 | result.Add(new LSL_String(src.Substring(start,length).Trim())); |
5251 | start += length+1; | 5251 | start += length+1; |
5252 | length = 0; | 5252 | length = 0; |
5253 | } | 5253 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 212dbe3..5927973 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 bbaf923..a6ab5e9 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -840,8 +840,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
840 | item.Name, startParam, postOnRez, | 840 | item.Name, startParam, postOnRez, |
841 | stateSource, m_MaxScriptQueue); | 841 | stateSource, m_MaxScriptQueue); |
842 | 842 | ||
843 | m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", | 843 | m_log.DebugFormat( |
844 | part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); | 844 | "[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}.{5}", |
845 | part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, | ||
846 | part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); | ||
845 | 847 | ||
846 | if (presence != null) | 848 | if (presence != null) |
847 | { | 849 | { |