本文整理汇总了C#中Lidgren.Network.NetConnection.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# NetConnection.ToString方法的具体用法?C# NetConnection.ToString怎么用?C# NetConnection.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lidgren.Network.NetConnection
的用法示例。
在下文中一共展示了NetConnection.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UserConnected
protected virtual void UserConnected( NetConnection sender )
{
if (Connect != null)
Connect(this, new MonitoringEventArgs("Connection from " + sender.ToString()));
NewConnections.Add(sender);
}
示例2: UserDisconnected
protected virtual void UserDisconnected(NetConnection sender)
{
if (Disconnect != null)
Disconnect(this, new MonitoringEventArgs(sender.ToString() + " disconnected"));
NewDeletions.Add(sender);
}
示例3: FlushContainer
public void FlushContainer(NetConnection target, int channel)
{
//Console.WriteLine("Sending Container to: " + target.ToString());
if (target == null &&_allcontainer!=null)
{
_allcontainer.Encode();
if (_connection is NetServer && _connection.ConnectionsCount>0)
(_connection as NetServer).SendToAll(_allcontainer.GetMessage(), null,NetDeliveryMethod.ReliableOrdered,channel);
//Console.WriteLine(_allcontainer.GetMessage().LengthBytes);
_allcontainer = null;
}
else if (target != null && _containers.ContainsKey(target))
{
_containers[target].Encode();
_connection.SendMessage(_containers[target].GetMessage(), target, NetDeliveryMethod.ReliableOrdered, channel);
//Console.WriteLine("Sending Container Message: " + _containers[target].ReReadType.ToString() + " " + _containers[target].outgoing.ToString()+ " " +target.RemoteEndpoint.ToString());
//Console.WriteLine(target.Status.ToString());
for (int x = 0; x < _containers[target].Messages.Count; x++)
{
// Console.WriteLine("\t\t" + _containers[target].Messages[x].MessageType.ToString());
}
_containers.Remove(target);
}
else if (target != null)
{
Console.WriteLine("ERROR: could not send container message to: " + target.ToString());
}
}