aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-07-12 15:16:19 +0000
committerMW2007-07-12 15:16:19 +0000
commit20a77a6d4b05ee15b7b04a81920d19462e6e542a (patch)
tree93c10bd7724a62ccb3bec9697439e0db42fcd281
parentCleaning up some of the CAPS functions, Asset uploads now use the new LLSDStr... (diff)
downloadopensim-SC-20a77a6d4b05ee15b7b04a81920d19462e6e542a.zip
opensim-SC-20a77a6d4b05ee15b7b04a81920d19462e6e542a.tar.gz
opensim-SC-20a77a6d4b05ee15b7b04a81920d19462e6e542a.tar.bz2
opensim-SC-20a77a6d4b05ee15b7b04a81920d19462e6e542a.tar.xz
Fixed a number of bugs in the local InstantMessage handling, sending InstantMessages will no longer crash the server. But they still aren't really working correctly, you can't type replies to received messages.
-rw-r--r--OpenSim/Framework/Communications/IGridServices.cs2
-rw-r--r--OpenSim/Framework/General/Interfaces/IClientAPI.cs2
-rw-r--r--OpenSim/Region/Capabilities/Caps.cs6
-rw-r--r--OpenSim/Region/Capabilities/LLSDCapsDetails.cs2
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs38
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs6
7 files changed, 34 insertions, 24 deletions
diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs
index c296209..d2e5ab6 100644
--- a/OpenSim/Framework/Communications/IGridServices.cs
+++ b/OpenSim/Framework/Communications/IGridServices.cs
@@ -31,8 +31,6 @@ using OpenSim.Framework.Types;
31 31
32namespace OpenSim.Framework.Communications 32namespace OpenSim.Framework.Communications
33{ 33{
34
35
36 public interface IGridServices 34 public interface IGridServices
37 { 35 {
38 RegionCommsListener RegisterRegion(RegionInfo regionInfos); 36 RegionCommsListener RegisterRegion(RegionInfo regionInfos);
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
index d409ebe..9079ca5 100644
--- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs
+++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
@@ -154,7 +154,7 @@ namespace OpenSim.Framework.Interfaces
154 void SendRegionHandshake(RegionInfo regionInfo); 154 void SendRegionHandshake(RegionInfo regionInfo);
155 void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); 155 void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
156 void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); 156 void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
157 void SendInstantMessage(string message, LLUUID target); 157 void SendInstantMessage(string message, LLUUID target, string fromName, LLUUID id);
158 void SendLayerData(float[] map); 158 void SendLayerData(float[] map);
159 void SendLayerData(int px, int py, float[] map); 159 void SendLayerData(int px, int py, float[] map);
160 void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); 160 void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);
diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs
index 7216691..7acbf8e 100644
--- a/OpenSim/Region/Capabilities/Caps.cs
+++ b/OpenSim/Region/Capabilities/Caps.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Capabilities
79 79
80 AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest); 80 AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest);
81 // AddLegacyCapsHandler( httpListener, eventQueue, ProcessEventQueue); 81 // AddLegacyCapsHandler( httpListener, eventQueue, ProcessEventQueue);
82 // AddLegacyCapsHandler( httpListener, m_requestTexture, RequestTexture); 82 // AddLegacyCapsHandler( httpListener, m_requestTexture, RequestTexture);
83 } 83 }
84 84
85 [Obsolete("Use BaseHttpServer.AddStreamHandler(new LLSDStreamHandler( LLSDMethod delegate )) instead.")] 85 [Obsolete("Use BaseHttpServer.AddStreamHandler(new LLSDStreamHandler( LLSDMethod delegate )) instead.")]
@@ -98,6 +98,7 @@ namespace OpenSim.Region.Capabilities
98 /// <returns></returns> 98 /// <returns></returns>
99 public string CapsRequest(string request, string path, string param) 99 public string CapsRequest(string request, string path, string param)
100 { 100 {
101 // Console.WriteLine("caps request " + request);
101 string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); 102 string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities());
102 return result; 103 return result;
103 } 104 }
@@ -112,6 +113,8 @@ namespace OpenSim.Region.Capabilities
112 string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; 113 string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath;
113 caps.MapLayer = capsBaseUrl + m_mapLayerPath; 114 caps.MapLayer = capsBaseUrl + m_mapLayerPath;
114 caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; 115 caps.NewFileAgentInventory = capsBaseUrl + m_newInventory;
116 //caps.RequestTextureDownload = capsBaseUrl + m_requestTexture;
117 // caps.ChatSessionRequest = capsBaseUrl + m_requestTexture;
115 return caps; 118 return caps;
116 } 119 }
117 120
@@ -149,6 +152,7 @@ namespace OpenSim.Region.Capabilities
149 /// <returns></returns> 152 /// <returns></returns>
150 public string RequestTexture(string request, string path, string param) 153 public string RequestTexture(string request, string path, string param)
151 { 154 {
155 Console.WriteLine("texture request " + request);
152 // Needs implementing (added to remove compiler warning) 156 // Needs implementing (added to remove compiler warning)
153 return ""; 157 return "";
154 } 158 }
diff --git a/OpenSim/Region/Capabilities/LLSDCapsDetails.cs b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs
index 1522559..ecb2328 100644
--- a/OpenSim/Region/Capabilities/LLSDCapsDetails.cs
+++ b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs
@@ -6,6 +6,8 @@ namespace OpenSim.Region.Capabilities
6 public string MapLayer = ""; 6 public string MapLayer = "";
7 public string NewFileAgentInventory = ""; 7 public string NewFileAgentInventory = "";
8 //public string EventQueueGet = ""; 8 //public string EventQueueGet = "";
9 //public string RequestTextureDownload = "";
10 //public string ChatSessionRequest = "";
9 11
10 public LLSDCapsDetails() 12 public LLSDCapsDetails()
11 { 13 {
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index e88995f..5be82dd 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -245,23 +245,29 @@ namespace OpenSim.Region.ClientStack
245 /// <remarks>TODO</remarks> 245 /// <remarks>TODO</remarks>
246 /// <param name="message"></param> 246 /// <param name="message"></param>
247 /// <param name="target"></param> 247 /// <param name="target"></param>
248 public void SendInstantMessage(string message, LLUUID target) 248 public void SendInstantMessage(string message, LLUUID target, string fromName)
249 { 249 {
250 ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket(); 250 if (message != "typing")
251 msg.AgentData.AgentID = this.AgentID; 251 {
252 msg.AgentData.SessionID = this.SessionID; 252 Encoding enc = Encoding.ASCII;
253 253 ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
254 msg.MessageBlock.Dialog = 0; 254 msg.AgentData.AgentID = this.AgentID;
255 msg.MessageBlock.FromGroup = false; 255 msg.AgentData.SessionID = this.SessionID;
256 msg.MessageBlock.ID = target.Combine(this.AgentID); 256 msg.MessageBlock.FromAgentName = enc.GetBytes(fromName + " \0");
257 msg.MessageBlock.Offline = 0; 257 msg.MessageBlock.Dialog = 0;
258 msg.MessageBlock.ParentEstateID = 0; 258 msg.MessageBlock.FromGroup = false;
259 msg.MessageBlock.Position = new LLVector3(); 259 msg.MessageBlock.ID = target.Combine(this.SecureSessionID);
260 msg.MessageBlock.RegionID = new LLUUID(); 260 msg.MessageBlock.Offline = 0;
261 msg.MessageBlock.Timestamp = 0; 261 msg.MessageBlock.ParentEstateID = 0;
262 msg.MessageBlock.ToAgentID = target; 262 msg.MessageBlock.Position = new LLVector3();
263 263 msg.MessageBlock.RegionID = new LLUUID();
264 this.OutPacket(msg); 264 msg.MessageBlock.Timestamp = 0;
265 msg.MessageBlock.ToAgentID = target;
266 msg.MessageBlock.Message = enc.GetBytes(message + "\0");
267 msg.MessageBlock.BinaryBucket = new byte[0];
268
269 this.OutPacket(msg);
270 }
265 } 271 }
266 272
267 /// <summary> 273 /// <summary>
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 3265898..e5249f9 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -102,9 +102,7 @@ namespace OpenSim.Region.ClientStack
102 this.OnInstantMessage(msgpack.AgentData.AgentID, msgpack.MessageBlock.ToAgentID, 102 this.OnInstantMessage(msgpack.AgentData.AgentID, msgpack.MessageBlock.ToAgentID,
103 msgpack.MessageBlock.Timestamp, IMfromName, IMmessage); 103 msgpack.MessageBlock.Timestamp, IMfromName, IMmessage);
104 } 104 }
105
106 break; 105 break;
107
108 case PacketType.RezObject: 106 case PacketType.RezObject:
109 RezObjectPacket rezPacket = (RezObjectPacket)Pack; 107 RezObjectPacket rezPacket = (RezObjectPacket)Pack;
110 AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID); 108 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 1753772..14bf87c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -113,8 +113,10 @@ namespace OpenSim.Region.Environment.Scenes
113 if (this.Avatars.ContainsKey(fromAgentID)) 113 if (this.Avatars.ContainsKey(fromAgentID))
114 { 114 {
115 // Local sim message 115 // Local sim message
116 ScenePresence avatar = this.Avatars[fromAgentID]; 116 ScenePresence fromAvatar = this.Avatars[fromAgentID];
117 avatar.ControllingClient.SendInstantMessage(message, toAgentID); 117 ScenePresence toAvatar = this.Avatars[toAgentID];
118 string fromName = fromAvatar.firstname + " " + fromAvatar.lastname;
119 toAvatar.ControllingClient.SendInstantMessage(message, toAgentID, fromName);
118 } 120 }
119 else 121 else
120 { 122 {