aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs6
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs17
-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
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs12
7 files changed, 84 insertions, 9 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index aaf27bb..529614b 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -401,8 +401,7 @@ namespace OpenSim.Framework
401 401
402 public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes); 402 public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes);
403 403
404 404 public delegate void MoneyTransferRequest(LLUUID sourceID, LLUUID destID, int amount, int transactionType, string description);
405
406 405
407 406
408 public delegate void ObjectPermissions( 407 public delegate void ObjectPermissions(
@@ -505,6 +504,9 @@ namespace OpenSim.Framework
505 event FriendshipTermination OnTerminateFriendship; 504 event FriendshipTermination OnTerminateFriendship;
506 event PacketStats OnPacketStats; 505 event PacketStats OnPacketStats;
507 506
507 // Financial packets
508 event MoneyTransferRequest OnMoneyTransferRequest;
509
508 510
509 LLVector3 StartPos { get; set; } 511 LLVector3 StartPos { get; set; }
510 512
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 4aceac0..7f62d4d 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -578,6 +578,8 @@ namespace OpenSim.Region.ClientStack
578 578
579 public event PacketStats OnPacketStats; 579 public event PacketStats OnPacketStats;
580 580
581 public event MoneyTransferRequest OnMoneyTransferRequest;
582
581 583
582 #region Scene/Avatar to Client 584 #region Scene/Avatar to Client
583 585
@@ -2044,6 +2046,21 @@ namespace OpenSim.Region.ClientStack
2044 AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect); 2046 AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect);
2045 AddLocalPacketHandler(PacketType.AgentCachedTexture, AgentTextureCached); 2047 AddLocalPacketHandler(PacketType.AgentCachedTexture, AgentTextureCached);
2046 AddLocalPacketHandler(PacketType.MultipleObjectUpdate, MultipleObjUpdate); 2048 AddLocalPacketHandler(PacketType.MultipleObjectUpdate, MultipleObjUpdate);
2049 AddLocalPacketHandler(PacketType.MoneyTransferRequest, HandleMoneyTransferRequest);
2050 }
2051
2052 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack)
2053 {
2054 MoneyTransferRequestPacket money = (MoneyTransferRequestPacket)Pack;
2055
2056 if (OnMoneyTransferRequest != null)
2057 {
2058 OnMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID,
2059 money.MoneyData.Amount, money.MoneyData.TransactionType,
2060 Util.FieldToString(money.MoneyData.Description));
2061 }
2062
2063 return true;
2047 } 2064 }
2048 2065
2049 private bool HandleViewerEffect(IClientAPI sender, Packet Pack) 2066 private bool HandleViewerEffect(IClientAPI sender, Packet Pack)
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)
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 6ae74e6..453320c 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -47,6 +47,8 @@ namespace SimpleApp
47 47
48 public event Action<IClientAPI> OnLogout; 48 public event Action<IClientAPI> OnLogout;
49 public event ObjectPermissions OnObjectPermissions; 49 public event ObjectPermissions OnObjectPermissions;
50
51 public event MoneyTransferRequest OnMoneyTransferRequest;
50 public event Action<IClientAPI> OnConnectionClosed; 52 public event Action<IClientAPI> OnConnectionClosed;
51 53
52 public event ImprovedInstantMessage OnInstantMessage; 54 public event ImprovedInstantMessage OnInstantMessage;
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 3d5f106..76183ae 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -3199,6 +3199,18 @@ namespace OpenSim.Region.ScriptEngine.Common
3199 World.SendGeneralAlert(msg); 3199 World.SendGeneralAlert(msg);
3200 } 3200 }
3201 3201
3202 public void osSetRot(LLUUID target, Quaternion rotation)
3203 {
3204 if (World.Entities.ContainsKey(target))
3205 {
3206 World.Entities[target].Rotation = rotation;
3207 }
3208 else
3209 {
3210 LSLError("osSetRot: Invalid target");
3211 }
3212 }
3213
3202 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, 3214 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
3203 int timer) 3215 int timer)
3204 { 3216 {