本文整理汇总了C#中OpenSim.Region.ClientStack.LindenUDP.LLUDPClient类的典型用法代码示例。如果您正苦于以下问题:C# LLUDPClient类的具体用法?C# LLUDPClient怎么用?C# LLUDPClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LLUDPClient类属于OpenSim.Region.ClientStack.LindenUDP命名空间,在下文中一共展示了LLUDPClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OutgoingPacket
/// <summary>
/// Default constructor
/// </summary>
/// <param name="client">Reference to the client this packet is destined for</param>
/// <param name="buffer">Serialized packet data. If the flags or sequence number
/// need to be updated, they will be injected directly into this binary buffer</param>
/// <param name="category">Throttling category for this packet</param>
public OutgoingPacket(LLUDPClient client, UDPPacketBuffer buffer, ThrottleOutPacketType category, UnackedPacketMethod method)
{
Client = client;
Buffer = buffer;
Category = category;
UnackedMethod = method;
}
示例2: RexClientViewCompatible
public RexClientViewCompatible(EndPoint remoteEP, Scene scene,
LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse authenSessions, UUID agentId,
UUID sessionId, uint circuitCode)
: base(remoteEP, scene, udpServer, udpClient, authenSessions, agentId,
sessionId, circuitCode)
{
}
示例3: RexClientViewLegacy
public RexClientViewLegacy(EndPoint remoteEP, Scene scene,
LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse authenSessions, UUID agentId,
UUID sessionId, uint circuitCode)
: base(remoteEP, scene, udpServer, udpClient, authenSessions, agentId,
sessionId, circuitCode)
{
AddGenericPacketHandler("RexSkypeStore", HandleOnSkypeStore);
}
示例4: NaaliClientView
public NaaliClientView(EndPoint remoteEP, Scene scene,
LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse authenSessions, UUID agentId,
UUID sessionId, uint circuitCode)
: base(remoteEP, scene, udpServer, udpClient, authenSessions, agentId,
sessionId, circuitCode)
{
OnBinaryGenericMessage -= base.RexClientView_BinaryGenericMessage;
OnBinaryGenericMessage += ng_BinaryGenericMessage;
}
示例5: OutgoingPacket
/// <summary>
/// Default constructor
/// </summary>
/// <param name="client">Reference to the client this packet is destined for</param>
/// <param name="buffer">Serialized packet data. If the flags or sequence number
/// need to be updated, they will be injected directly into this binary buffer</param>
/// <param name="category">Throttling category for this packet</param>
/// <param name="resendMethod">The delegate to be called if this packet is determined to be unacknowledged</param>
/// <param name="finishedMethod">The delegate to be called when this packet is sent</param>
public OutgoingPacket(LLUDPClient client, UDPPacketBuffer buffer,
ThrottleOutPacketType category, UnackedPacketMethod resendMethod,
UnackedPacketMethod finishedMethod, Packet packet)
{
Client = client;
Buffer = buffer;
Category = category;
UnackedMethod = resendMethod;
FinishedMethod = finishedMethod;
Packet = packet;
}
示例6: AddClient
protected override void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
{
// Create the LLUDPClient
LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
IClientAPI existingClient;
if (!m_scene.TryGetClient(agentID, out existingClient))
{
// Create the LLClientView
LLClientView client = CreateNewClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
client.OnLogout += LogoutHandler;
// Start the IClientAPI
client.Start();
}
else
{
m_log.WarnFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode from {0} at {1} for circuit {2}",
udpClient.AgentID, remoteEndPoint, circuitCode);
}
}
示例7: CreateNewClientView
protected LLClientView CreateNewClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient,
AuthenticateResponse sessionInfo, OpenMetaverse.UUID agentId, OpenMetaverse.UUID sessionId, uint circuitCode)
{
switch (m_clientToSpawn.ToLower())
{
case "ng":
case "naali":
return new NaaliClientView(remoteEP, scene, udpServer, udpClient,
sessionInfo, agentId, sessionId, circuitCode);
case "0.4":
case "0.40":
case "0.41":
case "legacy":
return new RexClientViewLegacy(remoteEP, scene, udpServer, udpClient,
sessionInfo, agentId, sessionId, circuitCode);
case "default":
case "compatible":
default:
return new RexClientViewCompatible(remoteEP, scene, udpServer, udpClient,
sessionInfo, agentId, sessionId, circuitCode);
}
}
示例8: SendPacketData
public void SendPacketData(LLUDPClient udpClient, byte[] data, Packet packet, ThrottleOutPacketType category, UnackedPacketMethod resendMethod, UnackedPacketMethod finishedMethod)
{
int dataLength = data.Length;
bool doZerocode = (data[0] & Helpers.MSG_ZEROCODED) != 0;
bool doCopy = true;
// Frequency analysis of outgoing packet sizes shows a large clump of packets at each end of the spectrum.
// The vast majority of packets are less than 200 bytes, although due to asset transfers and packet splitting
// there are a decent number of packets in the 1000-1140 byte range. We allocate one of two sizes of data here
// to accomodate for both common scenarios and provide ample room for ACK appending in both
int bufferSize = dataLength * 2;
UDPPacketBuffer buffer = new UDPPacketBuffer(udpClient.RemoteEndPoint, bufferSize);
// Zerocode if needed
if (doZerocode)
{
try
{
dataLength = Helpers.ZeroEncode(data, dataLength, buffer.Data);
doCopy = false;
}
catch (IndexOutOfRangeException)
{
// The packet grew larger than the bufferSize while zerocoding.
// Remove the MSG_ZEROCODED flag and send the unencoded data
// instead
m_log.Info("[LLUDPSERVER]: Packet exceeded buffer size during zerocoding for " + packet.Type + ". DataLength=" + dataLength +
" and BufferLength=" + buffer.Data.Length + ". Removing MSG_ZEROCODED flag");
data[0] = (byte)(data[0] & ~Helpers.MSG_ZEROCODED);
}
}
// If the packet data wasn't already copied during zerocoding, copy it now
if (doCopy)
{
if (dataLength <= buffer.Data.Length)
{
Buffer.BlockCopy(data, 0, buffer.Data, 0, dataLength);
}
else
{
bufferSize = dataLength;
buffer = new UDPPacketBuffer(udpClient.RemoteEndPoint, bufferSize);
// m_log.Error("[LLUDPSERVER]: Packet exceeded buffer size! This could be an indication of packet assembly not obeying the MTU. Type=" +
// type + ", DataLength=" + dataLength + ", BufferLength=" + buffer.Data.Length + ". Dropping packet");
Buffer.BlockCopy(data, 0, buffer.Data, 0, dataLength);
}
}
buffer.DataLength = dataLength;
#region Queue or Send
OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category, resendMethod, finishedMethod, packet);
if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket))
SendPacketFinal(outgoingPacket);
#endregion Queue or Send
}
示例9: OutgoingPacket
/// <summary>
/// Default constructor
/// </summary>
/// <param name="client">Reference to the client this packet is destined for</param>
/// <param name="buffer">Serialized packet data. If the flags or sequence number
/// need to be updated, they will be injected directly into this binary buffer</param>
/// <param name="category">Throttling category for this packet</param>
public OutgoingPacket(LLUDPClient client, UDPPacketBuffer buffer, ThrottleOutPacketType category)
{
Client = client;
Buffer = buffer;
Category = category;
}
示例10: SendPacket
/// <summary>
/// Start the process of sending a packet to the client.
/// </summary>
/// <param name="udpClient"></param>
/// <param name="packet"></param>
/// <param name="category"></param>
/// <param name="allowSplitting"></param>
/// <param name="method">
/// The method to call if the packet is not acked by the client. If null, then a standard
/// resend of the packet is done.
/// </param>
public virtual void SendPacket(
LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting, UnackedPacketMethod method)
{
// CoarseLocationUpdate packets cannot be split in an automated way
if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting)
allowSplitting = false;
if (allowSplitting && packet.HasVariableBlocks)
{
byte[][] datas = packet.ToBytesMultiple();
int packetCount = datas.Length;
if (packetCount < 1)
m_log.Error("[LLUDPSERVER]: Failed to split " + packet.Type + " with estimated length " + packet.Length);
for (int i = 0; i < packetCount; i++)
{
byte[] data = datas[i];
SendPacketData(udpClient, data, packet.Type, category, method);
}
}
else
{
byte[] data = packet.ToBytes();
SendPacketData(udpClient, data, packet.Type, category, method);
}
PacketPool.Instance.ReturnPacket(packet);
m_dataPresentEvent.Set();
}
示例11: Flush
public void Flush(LLUDPClient udpClient)
{
// FIXME: Implement?
}
示例12: SendPing
public void SendPing(LLUDPClient udpClient)
{
StartPingCheckPacket pc = (StartPingCheckPacket)PacketPool.Instance.GetPacket(PacketType.StartPingCheck);
pc.Header.Reliable = false;
pc.PingID.PingID = (byte)udpClient.CurrentPingSequence++;
// We *could* get OldestUnacked, but it would hurt performance and not provide any benefit
pc.PingID.OldestUnacked = 0;
SendPacket(udpClient, pc, ThrottleOutPacketType.Unknown, false, null);
}
示例13: RemoveClient
private void RemoveClient(LLUDPClient udpClient)
{
// Remove this client from the scene
IClientAPI client;
if (m_scene.ClientManager.TryGetValue (udpClient.AgentID, out client))
{
client.IsLoggingOut = true;
IEntityTransferModule transferModule = m_scene.RequestModuleInterface<IEntityTransferModule> ();
if (transferModule != null)
transferModule.IncomingCloseAgent (m_scene, udpClient.AgentID);
}
}
示例14: AddClient
/// <summary>
/// Add a client.
/// </summary>
/// <param name="circuitCode"></param>
/// <param name="agentID"></param>
/// <param name="sessionID"></param>
/// <param name="remoteEndPoint"></param>
/// <param name="sessionInfo"></param>
/// <returns>The client if it was added. Null if the client already existed.</returns>
protected virtual IClientAPI AddClient(
uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
{
IClientAPI client = null;
// In priciple there shouldn't be more than one thread here, ever.
// But in case that happens, we need to synchronize this piece of code
// because it's too important
lock (this)
{
if (!m_scene.TryGetClient(agentID, out client))
{
LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
client.OnLogout += LogoutHandler;
((LLClientView)client).DisableFacelights = m_disableFacelights;
client.Start();
}
}
return client;
}
示例15: CompletePing
public void CompletePing(LLUDPClient udpClient, byte pingID)
{
CompletePingCheckPacket completePing =
(CompletePingCheckPacket) PacketPool.Instance.GetPacket(PacketType.CompletePingCheck);
completePing.PingID.PingID = pingID;
SendPacket(udpClient, completePing, ThrottleOutPacketType.OutBand, false, null, null);
}