You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-15 06:36:30 +09:00
NetConnection.Status added - reflects the "message consumed" status for consistency. Encryption work in progress.
This commit is contained in:
@@ -33,6 +33,7 @@ namespace Lidgren.Network
|
||||
internal double m_lastHeardFrom;
|
||||
internal NetQueue<NetOutgoingMessage> m_unsentMessages;
|
||||
internal NetConnectionStatus m_status;
|
||||
private NetConnectionStatus m_visibleStatus;
|
||||
private double m_lastSentUnsentMessages;
|
||||
private float m_throttleDebt;
|
||||
private NetPeerConfiguration m_peerConfiguration;
|
||||
@@ -61,6 +62,18 @@ namespace Lidgren.Network
|
||||
/// </summary>
|
||||
public long RemoteUniqueIdentifier { get { return m_remoteUniqueIdentifier; } }
|
||||
|
||||
/// <summary>
|
||||
/// The current status of the connection
|
||||
/// </summary>
|
||||
public NetConnectionStatus Status
|
||||
{
|
||||
get { return m_visibleStatus; }
|
||||
internal set
|
||||
{
|
||||
m_visibleStatus = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the remote endpoint for the connection
|
||||
/// </summary>
|
||||
@@ -74,6 +87,7 @@ namespace Lidgren.Network
|
||||
m_unsentMessages = new NetQueue<NetOutgoingMessage>(16);
|
||||
m_fragmentGroups = new Dictionary<int, NetIncomingMessage>();
|
||||
m_status = NetConnectionStatus.None;
|
||||
m_visibleStatus = NetConnectionStatus.None;
|
||||
|
||||
double now = NetTime.Now;
|
||||
m_nextPing = now + 5.0f;
|
||||
@@ -646,7 +660,7 @@ namespace Lidgren.Network
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "[NetConnection to " + m_remoteEndpoint + ": " + m_status + "]";
|
||||
return "[NetConnection to " + m_remoteEndpoint + " Status: " + m_visibleStatus + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user