aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorAdam Frisby2007-07-08 03:32:27 +0000
committerAdam Frisby2007-07-08 03:32:27 +0000
commitbdab40280b64e31b763a99f6c2011e7e91e7d0fa (patch)
tree57540fafec9c125c0a9cae9db23dd069685a175f /OpenSim/Region
parent* Updating prebuild (diff)
downloadopensim-SC-bdab40280b64e31b763a99f6c2011e7e91e7d0fa.zip
opensim-SC-bdab40280b64e31b763a99f6c2011e7e91e7d0fa.tar.gz
opensim-SC-bdab40280b64e31b763a99f6c2011e7e91e7d0fa.tar.bz2
opensim-SC-bdab40280b64e31b763a99f6c2011e7e91e7d0fa.tar.xz
* Added instant message support for the local region. Grid support forthcoming.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs25
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs14
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs24
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
4 files changed, 64 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 9e7117f..cefe856 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -40,6 +40,7 @@ namespace OpenSim.Region.ClientStack
40{ 40{
41 partial class ClientView 41 partial class ClientView
42 { 42 {
43 public event ImprovedInstantMessage OnInstantMessage;
43 public event ChatFromViewer OnChatFromViewer; 44 public event ChatFromViewer OnChatFromViewer;
44 public event RezObject OnRezObject; 45 public event RezObject OnRezObject;
45 public event GenericCall4 OnDeRezObject; 46 public event GenericCall4 OnDeRezObject;
@@ -236,6 +237,30 @@ namespace OpenSim.Region.ClientStack
236 this.OutPacket(reply); 237 this.OutPacket(reply);
237 } 238 }
238 239
240 /// <summary>
241 ///
242 /// </summary>
243 /// <remarks>TODO</remarks>
244 /// <param name="message"></param>
245 /// <param name="target"></param>
246 public void SendInstantMessage(string message, LLUUID target)
247 {
248 ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
249 msg.AgentData.AgentID = this.AgentID;
250 msg.AgentData.SessionID = this.SessionID;
251
252 msg.MessageBlock.Dialog = 0;
253 msg.MessageBlock.FromGroup = false;
254 msg.MessageBlock.ID = target.Combine(this.AgentID);
255 msg.MessageBlock.Offline = 0;
256 msg.MessageBlock.ParentEstateID = 0;
257 msg.MessageBlock.Position = new LLVector3();
258 msg.MessageBlock.RegionID = new LLUUID();
259 msg.MessageBlock.Timestamp = 0;
260 msg.MessageBlock.ToAgentID = target;
261
262 this.OutPacket(msg);
263 }
239 264
240 /// <summary> 265 /// <summary>
241 /// Send the region heightmap to the client 266 /// Send the region heightmap to the client
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 0114fb1..def14c7 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -92,6 +92,20 @@ namespace OpenSim.Region.ClientStack
92 this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID); 92 this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID);
93 } 93 }
94 break; 94 break;
95 case PacketType.ImprovedInstantMessage:
96 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;
97
98 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
99 string IMmessage = Util.FieldToString(msgpack.MessageBlock.Message);
100
101 if (OnInstantMessage != null)
102 {
103 this.OnInstantMessage(msgpack.AgentData.AgentID, msgpack.MessageBlock.ToAgentID,
104 msgpack.MessageBlock.Timestamp, IMfromName, IMmessage);
105 }
106
107 break;
108
95 case PacketType.RezObject: 109 case PacketType.RezObject:
96 RezObjectPacket rezPacket = (RezObjectPacket)Pack; 110 RezObjectPacket rezPacket = (RezObjectPacket)Pack;
97 AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID); 111 AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index bcef137..7535049 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -100,6 +100,30 @@ namespace OpenSim.Region.Environment.Scenes
100 /// <summary> 100 /// <summary>
101 /// 101 ///
102 /// </summary> 102 /// </summary>
103 /// <remarks>Inefficient. TODO: Fixme</remarks>
104 /// <param name="fromAgentID"></param>
105 /// <param name="toAgentID"></param>
106 /// <param name="timestamp"></param>
107 /// <param name="fromAgentName"></param>
108 /// <param name="message"></param>
109 public void InstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message)
110 {
111 if (this.Avatars.ContainsKey(toAgentID))
112 {
113 // Local sim message
114 ScenePresence avatar = this.Avatars[toAgentID];
115
116
117 }
118 else
119 {
120 // Grid message
121 }
122 }
123
124 /// <summary>
125 ///
126 /// </summary>
103 /// <param name="message"></param> 127 /// <param name="message"></param>
104 /// <param name="type"></param> 128 /// <param name="type"></param>
105 /// <param name="fromPos"></param> 129 /// <param name="fromPos"></param>
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 1f370c4..fdf3cc8 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -450,6 +450,7 @@ namespace OpenSim.Region.Environment.Scenes
450 client.OnRegionHandShakeReply += this.SendLayerData; 450 client.OnRegionHandShakeReply += this.SendLayerData;
451 //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); 451 //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims);
452 client.OnChatFromViewer += this.SimChat; 452 client.OnChatFromViewer += this.SimChat;
453 client.OnInstantMessage += this.InstantMessage;
453 client.OnRequestWearables += this.InformClientOfNeighbours; 454 client.OnRequestWearables += this.InformClientOfNeighbours;
454 client.OnAddPrim += this.AddNewPrim; 455 client.OnAddPrim += this.AddNewPrim;
455 client.OnUpdatePrimPosition += this.UpdatePrimPosition; 456 client.OnUpdatePrimPosition += this.UpdatePrimPosition;