aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
index d364df6..e42dbf2 100644
--- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
+++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
@@ -805,6 +805,16 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
805 } 805 }
806 806
807 Scene s = LocateSceneClientIn(remoteClient.AgentId); 807 Scene s = LocateSceneClientIn(remoteClient.AgentId);
808
809 // Implmenting base sale data checking here so the default OpenSimulator implementation isn't useless
810 // combined with other implementations. We're actually validating that the client is sending the data
811 // that it should. In theory, the client should already know what to send here because it'll see it when it
812 // gets the object data. If the data sent by the client doesn't match the object, the viewer probably has an
813 // old idea of what the object properties are. Viewer developer Hazim informed us that the base module
814 // didn't check the client sent data against the object do any. Since the base modules are the
815 // 'crowning glory' examples of good practice..
816
817 // Validate that the object exists in the scene the user is in
808 SceneObjectPart part = s.GetSceneObjectPart(localID); 818 SceneObjectPart part = s.GetSceneObjectPart(localID);
809 if (part == null) 819 if (part == null)
810 { 820 {
@@ -812,6 +822,20 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
812 return; 822 return;
813 } 823 }
814 824
825 // Validate that the client sent the price that the object is being sold for
826 if (part.SalePrice != salePrice)
827 {
828 remoteClient.SendAgentAlertMessage("Cannot buy at this price. Buy Failed. If you continue to get this relog.", false);
829 return;
830 }
831
832 // Validate that the client sent the proper sale type the object has set
833 if (part.ObjectSaleType != saleType)
834 {
835 remoteClient.SendAgentAlertMessage("Cannot buy this way. Buy Failed. If you continue to get this relog.", false);
836 return;
837 }
838
815 IBuySellModule module = s.RequestModuleInterface<IBuySellModule>(); 839 IBuySellModule module = s.RequestModuleInterface<IBuySellModule>();
816 if (module != null) 840 if (module != null)
817 module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); 841 module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice);