aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneEvents.cs38
3 files changed, 49 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 5a7d4de..8adb281 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -138,6 +138,14 @@ namespace OpenSim.Region.Environment.Scenes
138 } 138 }
139 } 139 }
140 140
141 public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount, int transactiontype, string description)
142 {
143 EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(
144 source, destination, amount, transactiontype, description);
145
146 EventManager.TriggerMoneyTransfer(this, args);
147 }
148
141 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) 149 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
142 { 150 {
143 EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient); 151 EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient);
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index c99cac0..89fd5ea 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1078,7 +1078,7 @@ namespace OpenSim.Region.Environment.Scenes
1078 } 1078 }
1079 } 1079 }
1080 1080
1081 public virtual void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) 1081 public virtual SceneObjectGroup AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape)
1082 { 1082 {
1083 SceneObjectGroup sceneOb = 1083 SceneObjectGroup sceneOb =
1084 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); 1084 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
@@ -1093,18 +1093,21 @@ namespace OpenSim.Region.Environment.Scenes
1093 } 1093 }
1094 // if not phantom, add to physics 1094 // if not phantom, add to physics
1095 sceneOb.ApplyPhysics(m_physicalPrim); 1095 sceneOb.ApplyPhysics(m_physicalPrim);
1096
1097 return sceneOb;
1096 } 1098 }
1097 1099
1098 public void AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position, 1100 public SceneObjectGroup AddTree(LLVector3 scale, LLQuaternion rotation, LLVector3 position,
1099 Tree treeType, bool newTree) 1101 Tree treeType, bool newTree)
1100 { 1102 {
1103 LLUUID uuid = this.RegionInfo.MasterAvatarAssignedUUID;
1101 PrimitiveBaseShape treeShape = new PrimitiveBaseShape(); 1104 PrimitiveBaseShape treeShape = new PrimitiveBaseShape();
1102 treeShape.PathCurve = 16; 1105 treeShape.PathCurve = 16;
1103 treeShape.PathEnd = 49900; 1106 treeShape.PathEnd = 49900;
1104 treeShape.PCode = newTree ? (byte) PCode.NewTree : (byte) PCode.Tree; 1107 treeShape.PCode = newTree ? (byte) PCode.NewTree : (byte) PCode.Tree;
1105 treeShape.Scale = scale; 1108 treeShape.Scale = scale;
1106 treeShape.State = (byte) treeType; 1109 treeShape.State = (byte) treeType;
1107 AddNewPrim(LLUUID.Random(), position, rotation, treeShape,(byte)1,LLVector3.Zero,LLUUID.Zero,(byte)1); 1110 return AddNewPrim(uuid, position, rotation, treeShape);
1108 } 1111 }
1109 1112
1110 public void RemovePrim(uint localID, LLUUID avatar_deleter) 1113 public void RemovePrim(uint localID, LLUUID avatar_deleter)
@@ -1253,6 +1256,7 @@ namespace OpenSim.Region.Environment.Scenes
1253 client.OnUpdateTaskInventory += UpdateTaskInventory; 1256 client.OnUpdateTaskInventory += UpdateTaskInventory;
1254 1257
1255 client.OnGrabObject += ProcessObjectGrab; 1258 client.OnGrabObject += ProcessObjectGrab;
1259 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
1256 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; 1260 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
1257 client.OnPacketStats += AddPacketStats; 1261 client.OnPacketStats += AddPacketStats;
1258 1262
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index 4e9a258..51d1b32 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -129,6 +129,31 @@ namespace OpenSim.Region.Environment.Scenes
129 129
130 public event ScriptChangedEvent OnScriptChangedEvent; 130 public event ScriptChangedEvent OnScriptChangedEvent;
131 131
132 public class MoneyTransferArgs : System.EventArgs
133 {
134 public LLUUID sender;
135 public LLUUID reciever;
136
137 // Always false. The SL protocol sucks.
138 public bool authenticated = false;
139
140 public int amount;
141 public int transactiontype;
142 public string description;
143
144 public MoneyTransferArgs(LLUUID asender, LLUUID areciever, int aamount, int atransactiontype, string adescription) {
145 sender = asender;
146 reciever = areciever;
147 amount = aamount;
148 transactiontype = atransactiontype;
149 description = adescription;
150 }
151 }
152
153 public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e);
154
155 public event MoneyTransferEvent OnMoneyTransfer;
156
132 public void TriggerOnScriptChangedEvent(uint localID, uint change) 157 public void TriggerOnScriptChangedEvent(uint localID, uint change)
133 { 158 {
134 if (OnScriptChangedEvent != null) 159 if (OnScriptChangedEvent != null)
@@ -191,16 +216,21 @@ namespace OpenSim.Region.Environment.Scenes
191 216
192 public void TriggerParcelPrimCountUpdate() 217 public void TriggerParcelPrimCountUpdate()
193 { 218 {
194 /*
195 * Removed by Adam to prevent some exceptions, temporary.
196 * */
197 if (OnParcelPrimCountUpdate != null) 219 if (OnParcelPrimCountUpdate != null)
198 { 220 {
199 OnParcelPrimCountUpdate(); 221 OnParcelPrimCountUpdate();
222 }
223 }
224
225 public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e)
226 {
227 if (OnMoneyTransfer != null)
228 {
229 OnMoneyTransfer(sender, e);
200 } 230 }
201
202 } 231 }
203 232
233
204 public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) 234 public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
205 { 235 {
206 if (OnParcelPrimCountAdd != null) 236 if (OnParcelPrimCountAdd != null)