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.

afrisby
MW 2007-07-12 15:16:19 +00:00
parent 27c595c007
commit 20a77a6d4b
7 changed files with 33 additions and 23 deletions

View File

@ -31,8 +31,6 @@ using OpenSim.Framework.Types;
namespace OpenSim.Framework.Communications
{
public interface IGridServices
{
RegionCommsListener RegisterRegion(RegionInfo regionInfos);

View File

@ -154,7 +154,7 @@ namespace OpenSim.Framework.Interfaces
void SendRegionHandshake(RegionInfo regionInfo);
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 SendInstantMessage(string message, LLUUID target);
void SendInstantMessage(string message, LLUUID target, string fromName, LLUUID id);
void SendLayerData(float[] map);
void SendLayerData(int px, int py, float[] map);
void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);

View File

@ -98,6 +98,7 @@ namespace OpenSim.Region.Capabilities
/// <returns></returns>
public string CapsRequest(string request, string path, string param)
{
// Console.WriteLine("caps request " + request);
string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities());
return result;
}
@ -112,6 +113,8 @@ namespace OpenSim.Region.Capabilities
string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath;
caps.MapLayer = capsBaseUrl + m_mapLayerPath;
caps.NewFileAgentInventory = capsBaseUrl + m_newInventory;
//caps.RequestTextureDownload = capsBaseUrl + m_requestTexture;
// caps.ChatSessionRequest = capsBaseUrl + m_requestTexture;
return caps;
}
@ -149,6 +152,7 @@ namespace OpenSim.Region.Capabilities
/// <returns></returns>
public string RequestTexture(string request, string path, string param)
{
Console.WriteLine("texture request " + request);
// Needs implementing (added to remove compiler warning)
return "";
}

View File

@ -6,6 +6,8 @@ namespace OpenSim.Region.Capabilities
public string MapLayer = "";
public string NewFileAgentInventory = "";
//public string EventQueueGet = "";
//public string RequestTextureDownload = "";
//public string ChatSessionRequest = "";
public LLSDCapsDetails()
{

View File

@ -245,24 +245,30 @@ namespace OpenSim.Region.ClientStack
/// <remarks>TODO</remarks>
/// <param name="message"></param>
/// <param name="target"></param>
public void SendInstantMessage(string message, LLUUID target)
public void SendInstantMessage(string message, LLUUID target, string fromName)
{
if (message != "typing")
{
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.AgentID);
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];
this.OutPacket(msg);
}
}
/// <summary>
/// Send the region heightmap to the client

View File

@ -102,9 +102,7 @@ namespace OpenSim.Region.ClientStack
this.OnInstantMessage(msgpack.AgentData.AgentID, msgpack.MessageBlock.ToAgentID,
msgpack.MessageBlock.Timestamp, IMfromName, IMmessage);
}
break;
case PacketType.RezObject:
RezObjectPacket rezPacket = (RezObjectPacket)Pack;
AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID);

View File

@ -113,8 +113,10 @@ namespace OpenSim.Region.Environment.Scenes
if (this.Avatars.ContainsKey(fromAgentID))
{
// Local sim message
ScenePresence avatar = this.Avatars[fromAgentID];
avatar.ControllingClient.SendInstantMessage(message, toAgentID);
ScenePresence fromAvatar = this.Avatars[fromAgentID];
ScenePresence toAvatar = this.Avatars[toAgentID];
string fromName = fromAvatar.firstname + " " + fromAvatar.lastname;
toAvatar.ControllingClient.SendInstantMessage(message, toAgentID, fromName);
}
else
{