From 27e557eb9857ccc34ae3588c4e0ff43bd5e6644a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 16 Nov 2008 00:47:21 +0000 Subject: Introduces the message transfer module. It splits the transfer mechanics off the IM module and makes it into a module of it's own, which can be used by all other modules. Removes some ugly hacks. Refer to the IM module to see how it's used. Also fixes the persistence issue (Mantis #2598) --- OpenSim/Framework/GridInstantMessage.cs | 50 +++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 8 deletions(-) (limited to 'OpenSim/Framework/GridInstantMessage.cs') diff --git a/OpenSim/Framework/GridInstantMessage.cs b/OpenSim/Framework/GridInstantMessage.cs index 037f110..4ca4e67 100644 --- a/OpenSim/Framework/GridInstantMessage.cs +++ b/OpenSim/Framework/GridInstantMessage.cs @@ -33,27 +33,61 @@ namespace OpenSim.Framework [Serializable] public class GridInstantMessage { - public byte[] binaryBucket; - public byte dialog; public Guid fromAgentID; public string fromAgentName; public Guid fromAgentSession; + public Guid toAgentID; + public byte dialog; public bool fromGroup; - public Guid imSessionID; - public string message; + public Guid imSessionID; public byte offline; - - public uint ParentEstateID; - public Vector3 Position; + public byte[] binaryBucket; + + public uint ParentEstateID; public Guid RegionID; public uint timestamp; - public Guid toAgentID; public GridInstantMessage() { + binaryBucket = new byte[0]; + } + + public GridInstantMessage(IScene scene, UUID _fromAgentID, + string _fromAgentName, UUID _fromAgentSession, UUID _toAgentID, + byte _dialog, bool _fromGroup, string _message, + UUID _imSessionID, bool _offline, Vector3 _position, + byte[] _binaryBucket) + { + fromAgentID = _fromAgentID.Guid; + fromAgentName = _fromAgentName; + fromAgentSession = _fromAgentSession.Guid; + toAgentID = _toAgentID.Guid; + dialog = _dialog; + fromGroup = _fromGroup; + message = _message; + imSessionID = _imSessionID.Guid; + if (_offline) + offline = 1; + else + offline = 0; + Position = _position; + binaryBucket = _binaryBucket; + + ParentEstateID = scene.RegionInfo.EstateSettings.ParentEstateID; + RegionID = scene.RegionInfo.RegionSettings.RegionUUID.Guid; + timestamp = (uint)Util.UnixTimeSinceEpoch(); + } + + public GridInstantMessage(IScene scene, UUID _fromAgentID, + string _fromAgentName, UUID _toAgentID, byte _dialog, + string _message, bool _offline, + Vector3 _position) : this(scene, _fromAgentID, _fromAgentName, + UUID.Zero, _toAgentID, _dialog, false, _message, + _fromAgentID ^ _toAgentID, _offline, _position, new byte[0]) + { } } } -- cgit v1.1