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


C# NetIncomingMessage.ReadUInt32方法代码示例

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


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

示例1: R

 public void R(NetIncomingMessage im)
 {
     Operat          = im.ReadByte();
     UserId          = im.ReadUInt32();
     if (Operat == Add || Operat == Changed)
     {
         Tag         = im.ReadUInt32();
         if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.POSITION_TAG))
         {
             X       = im.ReadFloat();
             Y       = im.ReadFloat();
         }
         if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.RADIUS_TAG))
         {
             Radius  = im.ReadInt32();
         }
         if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.COLOR_TAG))
         {
             Color   = im.ReadUInt32();
         }
         if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.NAME_TAG))
         {
             Name    = im.ReadString();
         }
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:26,代码来源:Msg_AgarPlayInfo.cs

示例2: R

 public void R(NetIncomingMessage im)
 {
     Uid         = im.ReadUInt32();
     X           = im.ReadInt32();
     Y           = im.ReadInt32();
     SpriteId    = im.ReadUInt32();
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:7,代码来源:Msg_HappyPlayerLoginRsp.cs

示例3: DataReceived

			public override void DataReceived ( NetCommand command, NetIncomingMessage msg )
			{
				if (command==NetCommand.Snapshot) {
					
					var frame		=	msg.ReadUInt32();
					var prevFrame	=	msg.ReadUInt32();
					var ackCmdID	=	msg.ReadUInt32();
					var serverTicks	=	msg.ReadInt64();
					var size		=	msg.ReadInt32();

					//Log.Warning("{0}", offsetTicks );

					if (prevFrame!=0) {
						Log.Warning("Bad initial snapshot. Previous frame does not equal zero.");
						return;
					}
					if (ackCmdID!=0) {
						Log.Warning("Bad command ID {0}. Command ID for initial snapshot must be zero.", ackCmdID);
						return;
					}

					//	read snapshot :
					var snapshot	=	NetDeflate.Decompress( msg.ReadBytes(size) );

					//	initial snapshot contains atom table :
					gameClient.Atoms	=	new AtomCollection( msg );


					gameClient.SetState( new Active( gameClient, frame, snapshot, serverTicks ) );
				}

				if (command==NetCommand.Notification) {
					gameClient.FeedNotification( msg.ReadString() );
				}
			}
开发者ID:demiurghg,项目名称:FusionEngine,代码行数:35,代码来源:GameClient.Awaiting.cs

示例4: R

 public void R(NetIncomingMessage im)
 {
     Operat = im.ReadByte();
     BallId = im.ReadUInt32();
     if(Operat == Add)
     {
         X       = im.ReadFloat();
         Y       = im.ReadFloat();
         Radius  = im.ReadInt32();
         Color   = im.ReadUInt32();
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:12,代码来源:Msg_AgarFixedBall.cs

示例5: R

 public void R(NetIncomingMessage im)
 {
     int Count = im.ReadInt32();
     for(int i = 0; i < Count; ++i)
     {
         uint uid = im.ReadUInt32();
         float x = im.ReadFloat();
         float y = im.ReadFloat();
         int r = im.ReadInt32();
         uint color = im.ReadUInt32();
         FixedList.Add(Tuple.Create<uint, float, float, int, uint>(uid, x, y, r, color));
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:13,代码来源:Msg_AgarFixBallPack.cs

示例6: ReadDelta

        public static GameStateDelta ReadDelta(NetIncomingMessage message)
        {
            uint sequence = message.ReadUInt32();
            uint fromSequence = message.ReadUInt32();
            int length = message.ReadInt32();
            byte[] bytes;
            message.ReadBytes(length, out bytes);

            var delta = new GameStateDelta(bytes);
            delta.Sequence = sequence;
            delta.FromSequence = fromSequence;
            return delta;
        }
开发者ID:Gartley,项目名称:ss13remake,代码行数:13,代码来源:GameStateDelta.cs

示例7: R

 public void R(NetIncomingMessage im)
 {
     int Count = im.ReadInt32();
     for (int i = 0; i < Count; ++i)
     {
         uint uid    = im.ReadUInt32();
         float x     = im.ReadFloat();
         float y     = im.ReadFloat();
         int r     = im.ReadInt32();
         uint color  = im.ReadUInt32();
         string name = im.ReadString();
         PLayerList.Add(Tuple.Create<uint, float, float, int, uint, string>(uid, x, y, r, color, name));
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:14,代码来源:Msg_AgarPlayInfoPack.cs

示例8: ReadPayload

 public override void ReadPayload(NetIncomingMessage message)
 {
     base.ReadPayload(message);
     Image = message.ReadBytes(message.ReadInt32());
     Number = message.ReadUInt32();
     SendIndex = message.ReadInt32();
 }
开发者ID:theslyone,项目名称:RemoteDesktop,代码行数:7,代码来源:ResponseScreenshotMessage.cs

示例9: ReadPayload

 public override void ReadPayload(NetIncomingMessage message)
 {
     base.ReadPayload(message);
     Region = new Rectangle(message.ReadInt32(), message.ReadInt32(), message.ReadInt32(), message.ReadInt32());
     Number = message.ReadUInt32();
     FinalLength = message.ReadInt32();
 }
开发者ID:theslyone,项目名称:RemoteDesktop,代码行数:7,代码来源:ResponseBeginScreenshotMessage.cs

示例10: Write

        /// <summary>
        /// Writes a <see cref="NetIncomingMessage"/> buffer into the BitStream.
        /// </summary>
        /// <param name="source">The <see cref="NetIncomingMessage"/> who's contents will be copied to this BitStream.</param>
        public void Write(NetIncomingMessage source)
        {
#if DEBUG
            var startBSPos = PositionBits;
            var startMsgPos = (int)source.Position;
#endif

            // Read full 32-bit integers
            while (source.LengthBits - source.Position >= _bitsInt)
            {
                var v = source.ReadUInt32();
                Write(v);
            }

            // Read full 8-bit integers
            while (source.LengthBits - source.Position >= _bitsByte)
            {
                var v = source.ReadByte();
                Write(v);
            }

            // Read the remaining bits
            while (source.LengthBits > source.Position)
            {
                var v = source.ReadBoolean();
                Write(v);
            }

            Debug.Assert(source.Position == source.LengthBits);

#if DEBUG
            Debug.Assert(PositionBits - startBSPos == source.LengthBits - startMsgPos);
#endif
        }
开发者ID:wtfcolt,项目名称:game,代码行数:38,代码来源:BitStream.Lidgren.cs

示例11: R

 public void R(NetIncomingMessage im)
 {
     if(PlayerPack == null)
     {
         PlayerPack = new List<Tuple<uint, int, int, bool, uint>>();
     }
     int l = im.ReadInt32();
     for(int i = 0; i < l; ++i)
     {
         var id      = im.ReadUInt32();
         var x       = im.ReadInt32();
         var y       = im.ReadInt32();
         var alive   = im.ReadBoolean();
         var sid     = im.ReadUInt32();
         PlayerPack.Add(Tuple.Create<uint, int, int, bool, uint>(id, x, y, alive, sid));
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:17,代码来源:Msg_HappyPlayerPack.cs

示例12: readBytes

 public static void readBytes(NetIncomingMessage data, ClientSprite cs)
 {
     data.ReadByte();
     cs.ID = data.ReadUInt32();
     cs.SpriteID = (SpriteIDs)data.ReadUInt16();
     cs.Position = new Microsoft.Xna.Framework.Vector2(data.ReadFloat(),data.ReadFloat());
     cs.Rotation = data.ReadFloat();
 }
开发者ID:Harlonlonmo,项目名称:Network-Game,代码行数:8,代码来源:ClientSpriteParser.cs

示例13: ReceiveChunkData

 public void ReceiveChunkData(NetIncomingMessage message)
 {
     for (int i = 0; i < Tiles.Length; ++i)
     {
         Tile tile = (Tile)message.ReadUInt32();
         Tiles[i] = tile;
     }
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:8,代码来源:Chunk.cs

示例14: R

 public void R(NetIncomingMessage im)
 {
     int Count = im.ReadInt32();
     for(int i = 0; i < Count; ++i)
     {
         uint id = im.ReadUInt32();
         int mark = im.ReadInt32();
         MarkList.Add(new KeyValuePair<uint, int>(id, mark));
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:10,代码来源:Msg_AgarMarkListPack.cs

示例15: HandleEntityComponentNetworkMessage

 /// <summary>
 /// Handles an incoming entity component message
 /// </summary>
 /// <param name="message">Raw network message</param>
 /// <returns>An IncomingEntityComponentMessage object</returns>
 public IncomingEntityComponentMessage HandleEntityComponentNetworkMessage(NetIncomingMessage message)
 {
     var componentFamily = (ComponentFamily) message.ReadByte();
     var messageParams = new List<object>();
     while (message.Position < message.LengthBits)
     {
         switch ((NetworkDataType) message.ReadByte())
         {
             case NetworkDataType.d_enum:
                 messageParams.Add(message.ReadInt32());
                 break;
             case NetworkDataType.d_bool:
                 messageParams.Add(message.ReadBoolean());
                 break;
             case NetworkDataType.d_byte:
                 messageParams.Add(message.ReadByte());
                 break;
             case NetworkDataType.d_sbyte:
                 messageParams.Add(message.ReadSByte());
                 break;
             case NetworkDataType.d_ushort:
                 messageParams.Add(message.ReadUInt16());
                 break;
             case NetworkDataType.d_short:
                 messageParams.Add(message.ReadInt16());
                 break;
             case NetworkDataType.d_int:
                 messageParams.Add(message.ReadInt32());
                 break;
             case NetworkDataType.d_uint:
                 messageParams.Add(message.ReadUInt32());
                 break;
             case NetworkDataType.d_ulong:
                 messageParams.Add(message.ReadUInt64());
                 break;
             case NetworkDataType.d_long:
                 messageParams.Add(message.ReadInt64());
                 break;
             case NetworkDataType.d_float:
                 messageParams.Add(message.ReadFloat());
                 break;
             case NetworkDataType.d_double:
                 messageParams.Add(message.ReadDouble());
                 break;
             case NetworkDataType.d_string:
                 messageParams.Add(message.ReadString());
                 break;
             case NetworkDataType.d_byteArray:
                 int length = message.ReadInt32();
                 messageParams.Add(message.ReadBytes(length));
                 break;
         }
     }
     return new IncomingEntityComponentMessage(componentFamily, messageParams);
 }
开发者ID:Tri125,项目名称:space-station-14,代码行数:60,代码来源:EntityNetworkManager.cs


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