本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadAllProperties方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadAllProperties方法的具体用法?C# NetIncomingMessage.ReadAllProperties怎么用?C# NetIncomingMessage.ReadAllProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lidgren.Network.NetIncomingMessage
的用法示例。
在下文中一共展示了NetIncomingMessage.ReadAllProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadPlayer
private Player ReadPlayer(NetIncomingMessage inc)
{
var player = new Player();
inc.ReadAllProperties(player);
return player;
}
示例2: UpdatePlayerList
private void UpdatePlayerList(NetIncomingMessage nim)
{
lock (mPlayerList)
{
mPlayerList.Clear();
int playerCount = 0;
playerCount = nim.ReadInt32();
int npcCount = 0;
npcCount = nim.ReadInt32();
for (int i = 0; i < playerCount; i++)
{
PlayerPrimitive player = new PlayerPrimitive();
nim.ReadAllProperties(player);
if(player.UniqueId != ClientsUniqueId)
Console.WriteLine("player: " + player.Name + " x: " + player.X + "; y: " + player.Y);
mPlayerList.Add(player.UniqueId, player);
}
for (int i = 0; i < npcCount; i++)
{
PlayerPrimitive player = new PlayerPrimitive();
nim.ReadAllProperties(player);
if (player.UniqueId != ClientsUniqueId)
Console.WriteLine("player: " + player.Name + " x: " + player.X + "; y: " + player.Y);
mPlayerList.Add(player.UniqueId, player);
}
}
}