Files
libremetaverse/Programs/Simian/Interfaces/IUDPProvider.cs
John Hurliman e611558add * Adding the first (of many to come) unit tests for Simian
* Removed Simian's Agent.AgentID, it was redundant with Agent.Avatar.ID
* Added IUDPProvider.OnOutgoingPacket to hook all outgoing Simian packets (for testing)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2386 52acb1d6-8a22-11de-b505-999d5b087335
2008-12-21 02:09:54 +00:00

59 lines
2.2 KiB
C#

using System;
using System.Net;
using OpenMetaverse;
using OpenMetaverse.Packets;
namespace Simian
{
public enum PacketCategory
{
/// <summary>Any sort of transactional message, such as
/// AgentMovementComplete</summary>
Transaction = 0,
/// <summary>State synchronization, such as animations or
/// object updates</summary>
State,
/// <summary>State synchronization of inventory</summary>
Inventory,
/// <summary>State synchronization of terrain, LayerData
/// packets</summary>
Terrain,
/// <summary>Asset transfer packets</summary>
Asset,
/// <summary>Texture transfer packets</summary>
Texture,
/// <summary>Protocol overhead such as PacketAck</summary>
Overhead,
}
/// <summary>
/// Coupled with RegisterCallback(), this is triggered whenever a packet
/// of a registered type is received
/// </summary>
public delegate void PacketCallback(Packet packet, Agent agent);
/// <summary>
/// Triggered whenever a packet is going to be sent out to one or more
/// clients
/// </summary>
/// <param name="packet">The packet that will be sent out</param>
/// <param name="agentID">The UUID of the agent receiving this packet. Equal
/// to UUID.Zero if this packet will be broadcast to all connected agents</param>
/// <param name="category">The specified category of the outgoing packet</param>
/// <returns>True to continue sending this packet, otherwise false</returns>
public delegate bool OutgoingPacketCallback(Packet packet, UUID agentID, PacketCategory category);
public interface IUDPProvider
{
event OutgoingPacketCallback OnOutgoingPacket;
void AddClient(Agent agent, IPEndPoint endpoint);
bool RemoveClient(Agent agent);
uint CreateCircuit(Agent agent);
void SendPacket(UUID agentID, Packet packet, PacketCategory category);
void BroadcastPacket(Packet packet, PacketCategory category);
void RegisterPacketCallback(PacketType type, PacketCallback callback);
}
}