当前位置: 首页>>代码示例>>C#>>正文


C# NetIncomingMessage.ReadPoint方法代码示例

本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadPoint方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadPoint方法的具体用法?C# NetIncomingMessage.ReadPoint怎么用?C# NetIncomingMessage.ReadPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lidgren.Network.NetIncomingMessage的用法示例。


在下文中一共展示了NetIncomingMessage.ReadPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataProcessing

 private void DataProcessing(byte type, NetIncomingMessage message)
 {
     _counter++;
     Debug.Print("[" + _counter + "]Message received from server !");
     switch (type)
     {
         case (byte)MessageType.ServerMessage.ClientId:
             Debug.Print("A message type 'ClientId' have been received from server !");
             ReceiveMyClientId(message.ReadInt32());
             break;
         case (byte)MessageType.ServerMessage.NewClientInfo:
             Debug.Print("A message type 'NewClientInfo' have been received from server !");
             ReceiveNewClientInfo(message.ReadInt32(), message.ReadString(), message.ReadBoolean());
             break;
         case (byte)MessageType.ServerMessage.IsReady:
             Debug.Print("A message type 'IsReady' have been received from server !");
             ReceiveIsReady(message.ReadInt32(), message.ReadBoolean());
             break;
         case (byte)MessageType.ServerMessage.AvailableMaps:
             Debug.Print("A message type 'AvailableMaps' have been received from server !");
             ReceiveAvailableMaps(message);
             break;
         case (byte)MessageType.ServerMessage.SelectedMap:
             Debug.Print("A message type 'SelectedMap' have been received from server !");
             ReceiveSelectedMap(message.ReadString());
             break;
         case (byte)MessageType.ServerMessage.Map:
             Debug.Print("A message type 'Map' have been received from server !");
             ReceiveMap(message);
             break;
         case (byte)MessageType.ServerMessage.GameWillStart:
             Debug.Print("A message type 'GameWillStart' have been received from server !");
             ReceiveGameWillStart();
             break;
         case (byte)MessageType.ServerMessage.StartGame:
             Debug.Print("A message type 'StartGame' have been received from server !");
             ReceiveStartGame(message);
             break;
         case (byte)MessageType.ServerMessage.PlayerPosition:
             Debug.Print("A message type 'PlayerPosition' have been received from server !");
             ReceivePosition(message.ReadFloat(), message.ReadFloat(), message.ReadByte(), message.ReadInt32());
             break;
         case (byte)MessageType.ServerMessage.RemovePlayer:
             Debug.Print("A message type 'RemovePlayer' have been received from server !");
             ReceiveRemovePlayer(message.ReadInt32());
             break;
         case (byte)MessageType.ServerMessage.PlayerPlacingBomb:
             Debug.Print("A message type 'PlayerPlacingBomb' have been received from server !");
             ReceivePlacingBomb(message.ReadInt32(), message.ReadPoint());
             break;
         case (byte)MessageType.ServerMessage.BombExploded:
             ReceiveBombExploded(message);
             break;
         case (byte)MessageType.ServerMessage.PlayerKill:
             ReceivePlayerKill(message.ReadInt32(), message.ReadInt32());
             break;
         case (byte)MessageType.ServerMessage.PlayerSuicide:
             ReceivePlayerSuicide(message.ReadInt32());
             break;
         case (byte)MessageType.ServerMessage.PowerUpDrop:
             ReceivePowerupDrop((PowerUpType)message.ReadByte(), message.ReadPoint());
             break;
         case (byte)MessageType.ServerMessage.PowerUpPickUp:
             ReceivePowerUpPickUp(message.ReadInt32(), message.ReadPoint(), (PowerUpType)message.ReadByte());
             break;
         case (byte)MessageType.ServerMessage.SuddenDeath:
             //ReceiveSuddenDeath();
             break;
         case (byte)MessageType.ServerMessage.RoundEnd:
             Debug.Print("A message type 'RoundEnd' have been received from server !");
             ReceiveRoundEnd();
             break;
         case (byte)MessageType.ServerMessage.End:
             Debug.Print("A message type 'End' have been received from server !");
             ReceiveEnd(message.ReadBoolean());
             break;
         case (byte)MessageType.ServerMessage.Pings:
             //Debug.Print("A message type 'Pings have been received from server !");
             ReceivePings(message);
             break;
     }
 }
开发者ID:Noxalus,项目名称:Final-Bomber,代码行数:82,代码来源:DataProcessing.cs


注:本文中的Lidgren.Network.NetIncomingMessage.ReadPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。