From d9b802bb26ee659a68270ac05ea0406389afc883 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 8 Jul 2008 11:25:18 +0000 Subject: [PATCH] * Split out various classes from IClientAPI into their own files, in accordance with code standards --- OpenSim/Framework/AgentUpdateArgs.cs | 21 + .../AvatarPickerReplyAgentDataArgs.cs | 11 + .../Framework/AvatarPickerReplyDataArgs.cs | 12 + OpenSim/Framework/AvatarWearingArgs.cs | 36 ++ OpenSim/Framework/ChatFromViewerArgs.cs | 118 ++++++ OpenSim/Framework/ChatTypeEnum.cs | 16 + OpenSim/Framework/ClientInfo.cs | 22 ++ OpenSim/Framework/IClientAPI.cs | 368 +----------------- OpenSim/Framework/LandUpdateArgs.cs | 26 ++ OpenSim/Framework/RegionHandshakeArgs.cs | 32 ++ .../Framework/RegionInfoForEstateMenuArgs.cs | 24 ++ OpenSim/Framework/RequestAssetArgs.cs | 13 + OpenSim/Framework/TextureRequestArgs.cs | 46 +++ OpenSim/Framework/ThrottleOutPacketType.cs | 15 + OpenSim/Framework/UpdateShapeArgs.cs | 27 ++ .../Framework/ViewerEffectEventHandlerArg.cs | 15 + 16 files changed, 437 insertions(+), 365 deletions(-) create mode 100644 OpenSim/Framework/AgentUpdateArgs.cs create mode 100644 OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs create mode 100644 OpenSim/Framework/AvatarPickerReplyDataArgs.cs create mode 100644 OpenSim/Framework/AvatarWearingArgs.cs create mode 100644 OpenSim/Framework/ChatFromViewerArgs.cs create mode 100644 OpenSim/Framework/ChatTypeEnum.cs create mode 100644 OpenSim/Framework/ClientInfo.cs create mode 100644 OpenSim/Framework/LandUpdateArgs.cs create mode 100644 OpenSim/Framework/RegionHandshakeArgs.cs create mode 100644 OpenSim/Framework/RegionInfoForEstateMenuArgs.cs create mode 100644 OpenSim/Framework/RequestAssetArgs.cs create mode 100644 OpenSim/Framework/TextureRequestArgs.cs create mode 100644 OpenSim/Framework/ThrottleOutPacketType.cs create mode 100644 OpenSim/Framework/UpdateShapeArgs.cs create mode 100644 OpenSim/Framework/ViewerEffectEventHandlerArg.cs diff --git a/OpenSim/Framework/AgentUpdateArgs.cs b/OpenSim/Framework/AgentUpdateArgs.cs new file mode 100644 index 0000000000..8709434d69 --- /dev/null +++ b/OpenSim/Framework/AgentUpdateArgs.cs @@ -0,0 +1,21 @@ +using System; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class AgentUpdateArgs : EventArgs + { + public LLUUID AgentID; + public LLQuaternion BodyRotation; + public LLVector3 CameraAtAxis; + public LLVector3 CameraCenter; + public LLVector3 CameraLeftAxis; + public LLVector3 CameraUpAxis; + public uint ControlFlags; + public float Far; + public byte Flags; + public LLQuaternion HeadRotation; + public LLUUID SessionID; + public byte State; + } +} \ No newline at end of file diff --git a/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs b/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs new file mode 100644 index 0000000000..c2b4b0e5ee --- /dev/null +++ b/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs @@ -0,0 +1,11 @@ +using System; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class AvatarPickerReplyAgentDataArgs : EventArgs + { + public LLUUID AgentID; + public LLUUID QueryID; + } +} \ No newline at end of file diff --git a/OpenSim/Framework/AvatarPickerReplyDataArgs.cs b/OpenSim/Framework/AvatarPickerReplyDataArgs.cs new file mode 100644 index 0000000000..654a13533b --- /dev/null +++ b/OpenSim/Framework/AvatarPickerReplyDataArgs.cs @@ -0,0 +1,12 @@ +using System; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class AvatarPickerReplyDataArgs : EventArgs + { + public LLUUID AvatarID; + public byte[] FirstName; + public byte[] LastName; + } +} \ No newline at end of file diff --git a/OpenSim/Framework/AvatarWearingArgs.cs b/OpenSim/Framework/AvatarWearingArgs.cs new file mode 100644 index 0000000000..2e64601ef5 --- /dev/null +++ b/OpenSim/Framework/AvatarWearingArgs.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class AvatarWearingArgs : EventArgs + { + private List m_nowWearing = new List(); + + /// + /// + /// + public List NowWearing + { + get { return m_nowWearing; } + set { m_nowWearing = value; } + } + + #region Nested type: Wearable + + public class Wearable + { + public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); + public byte Type = 0; + + public Wearable(LLUUID itemId, byte type) + { + ItemID = itemId; + Type = type; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/OpenSim/Framework/ChatFromViewerArgs.cs b/OpenSim/Framework/ChatFromViewerArgs.cs new file mode 100644 index 0000000000..5000fc660c --- /dev/null +++ b/OpenSim/Framework/ChatFromViewerArgs.cs @@ -0,0 +1,118 @@ +using System; +using libsecondlife; + +namespace OpenSim.Framework +{ + public interface IEventArgs + { + IScene Scene { get; set; } + IClientAPI Sender { get; set; } + } + + /// + /// ChatFromViewer Arguments + /// + public class ChatFromViewerArgs : EventArgs, IEventArgs + { + protected int m_channel; + protected string m_from; + protected string m_message; + protected LLVector3 m_position; + + protected IScene m_scene; + protected IClientAPI m_sender; + protected object m_senderObject; + protected ChatTypeEnum m_type; + protected LLUUID m_fromID; + + public ChatFromViewerArgs() + { + m_position = new LLVector3(); + } + + /// + /// The message sent by the user + /// + public string Message + { + get { return m_message; } + set { m_message = value; } + } + + /// + /// The type of message, eg say, shout, broadcast. + /// + public ChatTypeEnum Type + { + get { return m_type; } + set { m_type = value; } + } + + /// + /// Which channel was this message sent on? Different channels may have different listeners. Public chat is on channel zero. + /// + public int Channel + { + get { return m_channel; } + set { m_channel = value; } + } + + /// + /// The position of the sender at the time of the message broadcast. + /// + public LLVector3 Position + { + get { return m_position; } + set { m_position = value; } + } + + /// + /// The name of the sender (needed for scripts) + /// + public string From + { + get { return m_from; } + set { m_from = value; } + } + + #region IEventArgs Members + + /// TODO: Sender and SenderObject should just be Sender and of + /// type IChatSender + + /// + /// The client responsible for sending the message, or null. + /// + public IClientAPI Sender + { + get { return m_sender; } + set { m_sender = value; } + } + + /// + /// The object responsible for sending the message, or null. + /// + public object SenderObject + { + get { return m_senderObject; } + set { m_senderObject = value; } + } + + public LLUUID SenderUUID + { + get { return m_fromID; } + set { m_fromID = value; } + } + + /// + /// + /// + public IScene Scene + { + get { return m_scene; } + set { m_scene = value; } + } + + #endregion + } +} \ No newline at end of file diff --git a/OpenSim/Framework/ChatTypeEnum.cs b/OpenSim/Framework/ChatTypeEnum.cs new file mode 100644 index 0000000000..afde12e8bf --- /dev/null +++ b/OpenSim/Framework/ChatTypeEnum.cs @@ -0,0 +1,16 @@ +namespace OpenSim.Framework +{ + public enum ChatTypeEnum + { + Whisper = 0, + Say = 1, + Shout = 2, + // 3 is an obsolete version of Say + StartTyping = 4, + StopTyping = 5, + DebugChannel = 6, + Region = 7, + Owner = 8, + Broadcast = 0xFF + } +} \ No newline at end of file diff --git a/OpenSim/Framework/ClientInfo.cs b/OpenSim/Framework/ClientInfo.cs new file mode 100644 index 0000000000..099449dc60 --- /dev/null +++ b/OpenSim/Framework/ClientInfo.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Net; + +namespace OpenSim.Framework +{ + [Serializable] + public class ClientInfo + { + public sAgentCircuitData agentcircuit; + + public Dictionary needAck; + + public List out_packets; + public Dictionary pendingAcks; + public EndPoint proxyEP; + + public uint sequence; + public byte[] usecircuit; + public EndPoint userEP; + } +} \ No newline at end of file diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 9307aef6ef..f2eb6a02c1 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -33,360 +33,12 @@ using libsecondlife.Packets; namespace OpenSim.Framework { - // Base Args Interface - public interface IEventArgs - { - IScene Scene { get; set; } - IClientAPI Sender { get; set; } - } + #region Client API Delegate definitions public delegate void ViewerEffectEventHandler(IClientAPI sender, List args); public delegate void ChatFromViewer(Object sender, ChatFromViewerArgs e); - public enum ChatTypeEnum - { - Whisper = 0, - Say = 1, - Shout = 2, - // 3 is an obsolete version of Say - StartTyping = 4, - StopTyping = 5, - DebugChannel = 6, - Region = 7, - Owner = 8, - Broadcast = 0xFF - } - - public enum ThrottleOutPacketType : int - { - Resend = 0, - Land = 1, - Wind = 2, - Cloud = 3, - Task = 4, - Texture = 5, - Asset = 6, - Unknown = 7, // Also doubles as 'do not throttle' - Back = 8 - } - - /// - /// ChatFromViewer Arguments - /// - public class ChatFromViewerArgs : EventArgs, IEventArgs - { - protected int m_channel; - protected string m_from; - protected string m_message; - protected LLVector3 m_position; - - protected IScene m_scene; - protected IClientAPI m_sender; - protected object m_senderObject; - protected ChatTypeEnum m_type; - protected LLUUID m_fromID; - - public ChatFromViewerArgs() - { - m_position = new LLVector3(); - } - - /// - /// The message sent by the user - /// - public string Message - { - get { return m_message; } - set { m_message = value; } - } - - /// - /// The type of message, eg say, shout, broadcast. - /// - public ChatTypeEnum Type - { - get { return m_type; } - set { m_type = value; } - } - - /// - /// Which channel was this message sent on? Different channels may have different listeners. Public chat is on channel zero. - /// - public int Channel - { - get { return m_channel; } - set { m_channel = value; } - } - - /// - /// The position of the sender at the time of the message broadcast. - /// - public LLVector3 Position - { - get { return m_position; } - set { m_position = value; } - } - - /// - /// The name of the sender (needed for scripts) - /// - public string From - { - get { return m_from; } - set { m_from = value; } - } - - #region IEventArgs Members - - /// TODO: Sender and SenderObject should just be Sender and of - /// type IChatSender - - /// - /// The client responsible for sending the message, or null. - /// - public IClientAPI Sender - { - get { return m_sender; } - set { m_sender = value; } - } - - /// - /// The object responsible for sending the message, or null. - /// - public object SenderObject - { - get { return m_senderObject; } - set { m_senderObject = value; } - } - - public LLUUID SenderUUID - { - get { return m_fromID; } - set { m_fromID = value; } - } - - /// - /// - /// - public IScene Scene - { - get { return m_scene; } - set { m_scene = value; } - } - - #endregion - } - - public class TextureRequestArgs : EventArgs - { - private sbyte m_discardLevel; - private uint m_packetNumber; - private float m_priority; - protected LLUUID m_requestedAssetID; - - public float Priority - { - get { return m_priority; } - set { m_priority = value; } - } - - /// - /// - /// - public uint PacketNumber - { - get { return m_packetNumber; } - set { m_packetNumber = value; } - } - - /// - /// - /// - public sbyte DiscardLevel - { - get { return m_discardLevel; } - set { m_discardLevel = value; } - } - - /// - /// - /// - public LLUUID RequestedAssetID - { - get { return m_requestedAssetID; } - set { m_requestedAssetID = value; } - } - } - - public class AvatarWearingArgs : EventArgs - { - private List m_nowWearing = new List(); - - /// - /// - /// - public List NowWearing - { - get { return m_nowWearing; } - set { m_nowWearing = value; } - } - - #region Nested type: Wearable - - public class Wearable - { - public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); - public byte Type = 0; - - public Wearable(LLUUID itemId, byte type) - { - ItemID = itemId; - Type = type; - } - } - - #endregion - } - - public class ViewerEffectEventHandlerArg : EventArgs - { - public LLUUID AgentID; - public byte[] Color; - public float Duration; - public LLUUID ID; - public byte Type; - public byte[] TypeData; - } - - public class LandUpdateArgs : EventArgs - { - public LLUUID AuthBuyerID; - public Parcel.ParcelCategory Category; - public string Desc; - public LLUUID GroupID; - public byte LandingType; - public byte MediaAutoScale; - public LLUUID MediaID; - public string MediaURL; - public string MusicURL; - public string Name; - public uint ParcelFlags; - public float PassHours; - public int PassPrice; - public int SalePrice; - public LLUUID SnapshotID; - public LLVector3 UserLocation; - public LLVector3 UserLookAt; - } - - public class RegionHandshakeArgs : EventArgs - { - public bool isEstateManager; - public float billableFactor; - public float terrainHeightRange0; - public float terrainHeightRange1; - public float terrainHeightRange2; - public float terrainHeightRange3; - public float terrainStartHeight0; - public float terrainStartHeight1; - public float terrainStartHeight2; - public float terrainStartHeight3; - public byte simAccess; - public float waterHeight; - public uint regionFlags; - public string regionName; - public LLUUID SimOwner; - public LLUUID terrainBase0; - public LLUUID terrainBase1; - public LLUUID terrainBase2; - public LLUUID terrainBase3; - public LLUUID terrainDetail0; - public LLUUID terrainDetail1; - public LLUUID terrainDetail2; - public LLUUID terrainDetail3; - } - - public class RegionInfoForEstateMenuArgs : EventArgs - { - public float billableFactor; - public uint estateID; - public byte maxAgents; - public float objectBonusFactor; - public uint parentEstateID; - public int pricePerMeter; - public int redirectGridX; - public int redirectGridY; - public uint regionFlags; - public byte simAccess; - public float sunHour; - public float terrainLowerLimit; - public float terrainRaiseLimit; - public bool useEstateSun; - public float waterHeight; - public string simName; - } - - public class UpdateShapeArgs : EventArgs - { - public uint ObjectLocalID; - public ushort PathBegin; - public byte PathCurve; - public ushort PathEnd; - public sbyte PathRadiusOffset; - public byte PathRevolutions; - public byte PathScaleX; - public byte PathScaleY; - public byte PathShearX; - public byte PathShearY; - public sbyte PathSkew; - public sbyte PathTaperX; - public sbyte PathTaperY; - public sbyte PathTwist; - public sbyte PathTwistBegin; - public ushort ProfileBegin; - public byte ProfileCurve; - public ushort ProfileEnd; - public ushort ProfileHollow; - } - - public class RequestAssetArgs : EventArgs - { - public int ChannelType; - public float Priority; - public int SourceType; - public LLUUID TransferID; - } - - public class AgentUpdateArgs : EventArgs - { - public LLUUID AgentID; - public LLQuaternion BodyRotation; - public LLVector3 CameraAtAxis; - public LLVector3 CameraCenter; - public LLVector3 CameraLeftAxis; - public LLVector3 CameraUpAxis; - public uint ControlFlags; - public float Far; - public byte Flags; - public LLQuaternion HeadRotation; - public LLUUID SessionID; - public byte State; - } - - public class AvatarPickerReplyAgentDataArgs : EventArgs - { - public LLUUID AgentID; - public LLUUID QueryID; - } - - public class AvatarPickerReplyDataArgs : EventArgs - { - public LLUUID AvatarID; - public byte[] FirstName; - public byte[] LastName; - } - public delegate void TextureRequest(Object sender, TextureRequestArgs e); public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e); @@ -646,6 +298,8 @@ namespace OpenSim.Framework public delegate void GetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); public delegate void SetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, bool running); + #endregion + public interface IClientAPI { LLVector3 StartPos { get; set; } @@ -1044,20 +698,4 @@ namespace OpenSim.Framework void SetClientInfo(ClientInfo info); void Terminate(); } - - [Serializable] - public class ClientInfo - { - public sAgentCircuitData agentcircuit; - - public Dictionary needAck; - - public List out_packets; - public Dictionary pendingAcks; - public EndPoint proxyEP; - - public uint sequence; - public byte[] usecircuit; - public EndPoint userEP; - } } diff --git a/OpenSim/Framework/LandUpdateArgs.cs b/OpenSim/Framework/LandUpdateArgs.cs new file mode 100644 index 0000000000..1f685f4b3f --- /dev/null +++ b/OpenSim/Framework/LandUpdateArgs.cs @@ -0,0 +1,26 @@ +using System; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class LandUpdateArgs : EventArgs + { + public LLUUID AuthBuyerID; + public Parcel.ParcelCategory Category; + public string Desc; + public LLUUID GroupID; + public byte LandingType; + public byte MediaAutoScale; + public LLUUID MediaID; + public string MediaURL; + public string MusicURL; + public string Name; + public uint ParcelFlags; + public float PassHours; + public int PassPrice; + public int SalePrice; + public LLUUID SnapshotID; + public LLVector3 UserLocation; + public LLVector3 UserLookAt; + } +} \ No newline at end of file diff --git a/OpenSim/Framework/RegionHandshakeArgs.cs b/OpenSim/Framework/RegionHandshakeArgs.cs new file mode 100644 index 0000000000..e618d3cfae --- /dev/null +++ b/OpenSim/Framework/RegionHandshakeArgs.cs @@ -0,0 +1,32 @@ +using System; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class RegionHandshakeArgs : EventArgs + { + public bool isEstateManager; + public float billableFactor; + public float terrainHeightRange0; + public float terrainHeightRange1; + public float terrainHeightRange2; + public float terrainHeightRange3; + public float terrainStartHeight0; + public float terrainStartHeight1; + public float terrainStartHeight2; + public float terrainStartHeight3; + public byte simAccess; + public float waterHeight; + public uint regionFlags; + public string regionName; + public LLUUID SimOwner; + public LLUUID terrainBase0; + public LLUUID terrainBase1; + public LLUUID terrainBase2; + public LLUUID terrainBase3; + public LLUUID terrainDetail0; + public LLUUID terrainDetail1; + public LLUUID terrainDetail2; + public LLUUID terrainDetail3; + } +} \ No newline at end of file diff --git a/OpenSim/Framework/RegionInfoForEstateMenuArgs.cs b/OpenSim/Framework/RegionInfoForEstateMenuArgs.cs new file mode 100644 index 0000000000..081017b3c0 --- /dev/null +++ b/OpenSim/Framework/RegionInfoForEstateMenuArgs.cs @@ -0,0 +1,24 @@ +using System; + +namespace OpenSim.Framework +{ + public class RegionInfoForEstateMenuArgs : EventArgs + { + public float billableFactor; + public uint estateID; + public byte maxAgents; + public float objectBonusFactor; + public uint parentEstateID; + public int pricePerMeter; + public int redirectGridX; + public int redirectGridY; + public uint regionFlags; + public byte simAccess; + public float sunHour; + public float terrainLowerLimit; + public float terrainRaiseLimit; + public bool useEstateSun; + public float waterHeight; + public string simName; + } +} \ No newline at end of file diff --git a/OpenSim/Framework/RequestAssetArgs.cs b/OpenSim/Framework/RequestAssetArgs.cs new file mode 100644 index 0000000000..0602421088 --- /dev/null +++ b/OpenSim/Framework/RequestAssetArgs.cs @@ -0,0 +1,13 @@ +using System; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class RequestAssetArgs : EventArgs + { + public int ChannelType; + public float Priority; + public int SourceType; + public LLUUID TransferID; + } +} \ No newline at end of file diff --git a/OpenSim/Framework/TextureRequestArgs.cs b/OpenSim/Framework/TextureRequestArgs.cs new file mode 100644 index 0000000000..1c894ae438 --- /dev/null +++ b/OpenSim/Framework/TextureRequestArgs.cs @@ -0,0 +1,46 @@ +using System; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class TextureRequestArgs : EventArgs + { + private sbyte m_discardLevel; + private uint m_packetNumber; + private float m_priority; + protected LLUUID m_requestedAssetID; + + public float Priority + { + get { return m_priority; } + set { m_priority = value; } + } + + /// + /// + /// + public uint PacketNumber + { + get { return m_packetNumber; } + set { m_packetNumber = value; } + } + + /// + /// + /// + public sbyte DiscardLevel + { + get { return m_discardLevel; } + set { m_discardLevel = value; } + } + + /// + /// + /// + public LLUUID RequestedAssetID + { + get { return m_requestedAssetID; } + set { m_requestedAssetID = value; } + } + } +} \ No newline at end of file diff --git a/OpenSim/Framework/ThrottleOutPacketType.cs b/OpenSim/Framework/ThrottleOutPacketType.cs new file mode 100644 index 0000000000..465c0d087d --- /dev/null +++ b/OpenSim/Framework/ThrottleOutPacketType.cs @@ -0,0 +1,15 @@ +namespace OpenSim.Framework +{ + public enum ThrottleOutPacketType : int + { + Resend = 0, + Land = 1, + Wind = 2, + Cloud = 3, + Task = 4, + Texture = 5, + Asset = 6, + Unknown = 7, // Also doubles as 'do not throttle' + Back = 8 + } +} \ No newline at end of file diff --git a/OpenSim/Framework/UpdateShapeArgs.cs b/OpenSim/Framework/UpdateShapeArgs.cs new file mode 100644 index 0000000000..7dad33f223 --- /dev/null +++ b/OpenSim/Framework/UpdateShapeArgs.cs @@ -0,0 +1,27 @@ +using System; + +namespace OpenSim.Framework +{ + public class UpdateShapeArgs : EventArgs + { + public uint ObjectLocalID; + public ushort PathBegin; + public byte PathCurve; + public ushort PathEnd; + public sbyte PathRadiusOffset; + public byte PathRevolutions; + public byte PathScaleX; + public byte PathScaleY; + public byte PathShearX; + public byte PathShearY; + public sbyte PathSkew; + public sbyte PathTaperX; + public sbyte PathTaperY; + public sbyte PathTwist; + public sbyte PathTwistBegin; + public ushort ProfileBegin; + public byte ProfileCurve; + public ushort ProfileEnd; + public ushort ProfileHollow; + } +} \ No newline at end of file diff --git a/OpenSim/Framework/ViewerEffectEventHandlerArg.cs b/OpenSim/Framework/ViewerEffectEventHandlerArg.cs new file mode 100644 index 0000000000..a000a53369 --- /dev/null +++ b/OpenSim/Framework/ViewerEffectEventHandlerArg.cs @@ -0,0 +1,15 @@ +using System; +using libsecondlife; + +namespace OpenSim.Framework +{ + public class ViewerEffectEventHandlerArg : EventArgs + { + public LLUUID AgentID; + public byte[] Color; + public float Duration; + public LLUUID ID; + public byte Type; + public byte[] TypeData; + } +} \ No newline at end of file