本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadIPEndpoint方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadIPEndpoint方法的具体用法?C# NetIncomingMessage.ReadIPEndpoint怎么用?C# NetIncomingMessage.ReadIPEndpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lidgren.Network.NetIncomingMessage
的用法示例。
在下文中一共展示了NetIncomingMessage.ReadIPEndpoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadPayload
/// <summary>
/// Reads the transport into the contents of this type.
/// </summary>
public void ReadPayload(NetIncomingMessage message)
{
Identity = message.ReadString();
NovaId = message.ReadString();
PasswordHash = message.ReadString();
PublicEndPoint = message.ReadIPEndpoint();
PrivateEndPoint = message.ReadIPEndpoint();
}
示例2: HandleRequestIntroduction
private void HandleRequestIntroduction(NetIncomingMessage msg)
{
IPEndPoint clientInternal = msg.ReadIPEndpoint();
long hostId = msg.ReadInt64();
string token = msg.ReadString();
Object[] elist;
if (registeredHosts.TryGetValue(hostId, out elist))
{
peer.Introduce(
(IPEndPoint) elist[0],
(IPEndPoint) elist[1],
clientInternal,
msg.SenderEndpoint,
token
);
}
else
{
Console.WriteLine("Client requested introduction to nonlisted host!");
}
}
示例3: HandleRegisterHost
private void HandleRegisterHost(NetIncomingMessage inc)
{
var id = inc.ReadInt64();
var name = inc.ReadString();
var population = inc.ReadUInt16();
var maxPopulation = inc.ReadUInt16();
var guid = inc.ReadString();
var endpoint = inc.ReadIPEndpoint();
var game = inc.ReadInt32();
//if (manager.Register(id, new Guid(guid)))
{
registeredHosts[id] = new Object[]
{
endpoint,
inc.SenderEndpoint,
name,
population,
maxPopulation,
NetTime.Now,
game
};
}
}