add missing IM parameter ( needs fix where it is really relevant )

LSLKeyTest
UbitUmarov 2016-07-24 15:17:25 +01:00
parent 96a5a053ef
commit bf604c85c6
3 changed files with 24 additions and 10 deletions

View File

@ -47,6 +47,7 @@ namespace OpenSim.Framework
public uint ParentEstateID;
public Guid RegionID;
public uint timestamp;
public Guid ID;
public GridInstantMessage()
{
@ -66,6 +67,8 @@ namespace OpenSim.Framework
Position = im.Position;
binaryBucket = im.binaryBucket;
RegionID = im.RegionID;
ParentEstateID = im.ParentEstateID;
ID = im.ID;
if (addTimestamp)
timestamp = (uint)Util.UnixTimeSinceEpoch();
@ -75,7 +78,7 @@ namespace OpenSim.Framework
string _fromAgentName, UUID _toAgentID,
byte _dialog, bool _fromGroup, string _message,
UUID _imSessionID, bool _offline, Vector3 _position,
byte[] _binaryBucket, bool addTimestamp)
byte[] _binaryBucket, UUID _ID, bool addTimestamp)
{
fromAgentID = _fromAgentID.Guid;
fromAgentName = _fromAgentName;
@ -84,6 +87,8 @@ namespace OpenSim.Framework
fromGroup = _fromGroup;
message = _message;
imSessionID = _imSessionID.Guid;
ID = _ID.Guid;
if (_offline)
offline = 1;
else
@ -101,12 +106,22 @@ namespace OpenSim.Framework
timestamp = (uint)Util.UnixTimeSinceEpoch();
}
public GridInstantMessage(IScene scene, UUID _fromAgentID,
string _fromAgentName, UUID _toAgentID,
byte _dialog, bool _fromGroup, string _message,
UUID _imSessionID, bool _offline, Vector3 _position,
byte[] _binaryBucket, bool addTimestamp) : this(scene, _fromAgentID, _fromAgentName,
_toAgentID, _dialog, false, _message,
_fromAgentID ^ _toAgentID, _offline, _position, new byte[0], UUID.Zero, true)
{
}
public GridInstantMessage(IScene scene, UUID _fromAgentID,
string _fromAgentName, UUID _toAgentID, byte _dialog,
string _message, bool _offline,
Vector3 _position) : this(scene, _fromAgentID, _fromAgentName,
_toAgentID, _dialog, false, _message,
_fromAgentID ^ _toAgentID, _offline, _position, new byte[0], true)
_fromAgentID ^ _toAgentID, _offline, _position, new byte[0], UUID.Zero, true)
{
}
}

View File

@ -953,7 +953,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Send an instant message to this client
/// </summary>
//
// Don't remove transaction ID! Groups and item gives need to set it!
public void SendInstantMessage(GridInstantMessage im)
{
if (((Scene)(m_scene)).Permissions.CanInstantMessage(new UUID(im.fromAgentID), new UUID(im.toAgentID)))
@ -962,14 +961,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
= (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage);
msg.AgentData.AgentID = new UUID(im.fromAgentID);
msg.AgentData.SessionID = UUID.Zero;
msg.AgentData.SessionID = new UUID(im.imSessionID);
msg.MessageBlock.FromAgentName = Util.StringToBytes256(im.fromAgentName);
msg.MessageBlock.Dialog = im.dialog;
msg.MessageBlock.FromGroup = im.fromGroup;
if (im.imSessionID == UUID.Zero.Guid)
msg.MessageBlock.ID = new UUID(im.fromAgentID) ^ new UUID(im.toAgentID);
else
msg.MessageBlock.ID = new UUID(im.imSessionID);
msg.MessageBlock.ID = new UUID(im.ID);
msg.MessageBlock.Offline = im.offline;
msg.MessageBlock.ParentEstateID = im.ParentEstateID;
msg.MessageBlock.Position = im.Position;

View File

@ -216,6 +216,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
UUID fromAgentID = UUID.Zero;
UUID toAgentID = UUID.Zero;
UUID imSessionID = UUID.Zero;
UUID imID = UUID.Zero;
uint timestamp = 0;
string fromAgentName = "";
string message = "";
@ -232,7 +233,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
float pos_z = 0;
//m_log.Info("Processing IM");
Hashtable requestData = (Hashtable)request.Params[0];
// Check if it's got all the data
if (requestData.ContainsKey("from_agent_id")
@ -263,6 +263,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
UUID.TryParse((string)requestData["to_agent_id"], out toAgentID);
UUID.TryParse((string)requestData["im_session_id"], out imSessionID);
UUID.TryParse((string)requestData["region_id"], out RegionID);
UUID.TryParse((string)requestData["id"], out imID);
try
{
@ -390,6 +391,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
gim.ParentEstateID = ParentEstateID;
gim.Position = Position;
gim.binaryBucket = binaryBucket;
gim.ID = imID.Guid;
// Trigger the Instant message in the scene.
@ -508,7 +510,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
UUID toAgentID = new UUID(im.toAgentID);
PresenceInfo upd = null;
UUID regionID;
bool lookupAgent = false;
lock (m_UserRegionMap)
@ -701,6 +702,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
gim["from_agent_session"] = UUID.Zero.ToString();
gim["to_agent_id"] = msg.toAgentID.ToString();
gim["im_session_id"] = msg.imSessionID.ToString();
if(msg.ID != Guid.Empty)
gim["id"] = msg.ID.ToString();
gim["timestamp"] = msg.timestamp.ToString();
gim["from_agent_name"] = msg.fromAgentName;
gim["message"] = msg.message;