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.
parent
27c595c007
commit
20a77a6d4b
|
@ -31,8 +31,6 @@ using OpenSim.Framework.Types;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Communications
|
namespace OpenSim.Framework.Communications
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public interface IGridServices
|
public interface IGridServices
|
||||||
{
|
{
|
||||||
RegionCommsListener RegisterRegion(RegionInfo regionInfos);
|
RegionCommsListener RegisterRegion(RegionInfo regionInfos);
|
||||||
|
|
|
@ -154,7 +154,7 @@ namespace OpenSim.Framework.Interfaces
|
||||||
void SendRegionHandshake(RegionInfo regionInfo);
|
void SendRegionHandshake(RegionInfo regionInfo);
|
||||||
void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
|
void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
|
||||||
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
|
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
|
||||||
void SendInstantMessage(string message, LLUUID target);
|
void SendInstantMessage(string message, LLUUID target, string fromName, LLUUID id);
|
||||||
void SendLayerData(float[] map);
|
void SendLayerData(float[] map);
|
||||||
void SendLayerData(int px, int py, float[] map);
|
void SendLayerData(int px, int py, float[] map);
|
||||||
void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);
|
void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace OpenSim.Region.Capabilities
|
||||||
|
|
||||||
AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest);
|
AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest);
|
||||||
// AddLegacyCapsHandler( httpListener, eventQueue, ProcessEventQueue);
|
// AddLegacyCapsHandler( httpListener, eventQueue, ProcessEventQueue);
|
||||||
// AddLegacyCapsHandler( httpListener, m_requestTexture, RequestTexture);
|
// AddLegacyCapsHandler( httpListener, m_requestTexture, RequestTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("Use BaseHttpServer.AddStreamHandler(new LLSDStreamHandler( LLSDMethod delegate )) instead.")]
|
[Obsolete("Use BaseHttpServer.AddStreamHandler(new LLSDStreamHandler( LLSDMethod delegate )) instead.")]
|
||||||
|
@ -98,6 +98,7 @@ namespace OpenSim.Region.Capabilities
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string CapsRequest(string request, string path, string param)
|
public string CapsRequest(string request, string path, string param)
|
||||||
{
|
{
|
||||||
|
// Console.WriteLine("caps request " + request);
|
||||||
string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities());
|
string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -112,6 +113,8 @@ namespace OpenSim.Region.Capabilities
|
||||||
string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath;
|
string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath;
|
||||||
caps.MapLayer = capsBaseUrl + m_mapLayerPath;
|
caps.MapLayer = capsBaseUrl + m_mapLayerPath;
|
||||||
caps.NewFileAgentInventory = capsBaseUrl + m_newInventory;
|
caps.NewFileAgentInventory = capsBaseUrl + m_newInventory;
|
||||||
|
//caps.RequestTextureDownload = capsBaseUrl + m_requestTexture;
|
||||||
|
// caps.ChatSessionRequest = capsBaseUrl + m_requestTexture;
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,6 +152,7 @@ namespace OpenSim.Region.Capabilities
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string RequestTexture(string request, string path, string param)
|
public string RequestTexture(string request, string path, string param)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("texture request " + request);
|
||||||
// Needs implementing (added to remove compiler warning)
|
// Needs implementing (added to remove compiler warning)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ namespace OpenSim.Region.Capabilities
|
||||||
public string MapLayer = "";
|
public string MapLayer = "";
|
||||||
public string NewFileAgentInventory = "";
|
public string NewFileAgentInventory = "";
|
||||||
//public string EventQueueGet = "";
|
//public string EventQueueGet = "";
|
||||||
|
//public string RequestTextureDownload = "";
|
||||||
|
//public string ChatSessionRequest = "";
|
||||||
|
|
||||||
public LLSDCapsDetails()
|
public LLSDCapsDetails()
|
||||||
{
|
{
|
||||||
|
|
|
@ -245,23 +245,29 @@ namespace OpenSim.Region.ClientStack
|
||||||
/// <remarks>TODO</remarks>
|
/// <remarks>TODO</remarks>
|
||||||
/// <param name="message"></param>
|
/// <param name="message"></param>
|
||||||
/// <param name="target"></param>
|
/// <param name="target"></param>
|
||||||
public void SendInstantMessage(string message, LLUUID target)
|
public void SendInstantMessage(string message, LLUUID target, string fromName)
|
||||||
{
|
{
|
||||||
ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
|
if (message != "typing")
|
||||||
msg.AgentData.AgentID = this.AgentID;
|
{
|
||||||
msg.AgentData.SessionID = this.SessionID;
|
Encoding enc = Encoding.ASCII;
|
||||||
|
ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
|
||||||
|
msg.AgentData.AgentID = this.AgentID;
|
||||||
|
msg.AgentData.SessionID = this.SessionID;
|
||||||
|
msg.MessageBlock.FromAgentName = enc.GetBytes(fromName + " \0");
|
||||||
|
msg.MessageBlock.Dialog = 0;
|
||||||
|
msg.MessageBlock.FromGroup = false;
|
||||||
|
msg.MessageBlock.ID = target.Combine(this.SecureSessionID);
|
||||||
|
msg.MessageBlock.Offline = 0;
|
||||||
|
msg.MessageBlock.ParentEstateID = 0;
|
||||||
|
msg.MessageBlock.Position = new LLVector3();
|
||||||
|
msg.MessageBlock.RegionID = new LLUUID();
|
||||||
|
msg.MessageBlock.Timestamp = 0;
|
||||||
|
msg.MessageBlock.ToAgentID = target;
|
||||||
|
msg.MessageBlock.Message = enc.GetBytes(message + "\0");
|
||||||
|
msg.MessageBlock.BinaryBucket = new byte[0];
|
||||||
|
|
||||||
msg.MessageBlock.Dialog = 0;
|
this.OutPacket(msg);
|
||||||
msg.MessageBlock.FromGroup = false;
|
}
|
||||||
msg.MessageBlock.ID = target.Combine(this.AgentID);
|
|
||||||
msg.MessageBlock.Offline = 0;
|
|
||||||
msg.MessageBlock.ParentEstateID = 0;
|
|
||||||
msg.MessageBlock.Position = new LLVector3();
|
|
||||||
msg.MessageBlock.RegionID = new LLUUID();
|
|
||||||
msg.MessageBlock.Timestamp = 0;
|
|
||||||
msg.MessageBlock.ToAgentID = target;
|
|
||||||
|
|
||||||
this.OutPacket(msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -102,9 +102,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
this.OnInstantMessage(msgpack.AgentData.AgentID, msgpack.MessageBlock.ToAgentID,
|
this.OnInstantMessage(msgpack.AgentData.AgentID, msgpack.MessageBlock.ToAgentID,
|
||||||
msgpack.MessageBlock.Timestamp, IMfromName, IMmessage);
|
msgpack.MessageBlock.Timestamp, IMfromName, IMmessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PacketType.RezObject:
|
case PacketType.RezObject:
|
||||||
RezObjectPacket rezPacket = (RezObjectPacket)Pack;
|
RezObjectPacket rezPacket = (RezObjectPacket)Pack;
|
||||||
AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
|
AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
|
||||||
|
|
|
@ -113,8 +113,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (this.Avatars.ContainsKey(fromAgentID))
|
if (this.Avatars.ContainsKey(fromAgentID))
|
||||||
{
|
{
|
||||||
// Local sim message
|
// Local sim message
|
||||||
ScenePresence avatar = this.Avatars[fromAgentID];
|
ScenePresence fromAvatar = this.Avatars[fromAgentID];
|
||||||
avatar.ControllingClient.SendInstantMessage(message, toAgentID);
|
ScenePresence toAvatar = this.Avatars[toAgentID];
|
||||||
|
string fromName = fromAvatar.firstname + " " + fromAvatar.lastname;
|
||||||
|
toAvatar.ControllingClient.SendInstantMessage(message, toAgentID, fromName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue