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


C# NetIncomingMessage.ReadInt32方法代码示例

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


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

示例1: Decode

 public void Decode(NetIncomingMessage im)
 {
     this.Value = (ResultOfAttack) im.ReadInt32();
        this.Text = im.ReadString();
        this.Row = im.ReadInt32();
        this.Col = im.ReadInt32();
 }
开发者ID:kflo,项目名称:Battleship2,代码行数:7,代码来源:AttackResultMessage.cs

示例2: 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

示例3: 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

示例4: Decode

 public void Decode(NetIncomingMessage im)
 {
     this.MessageTime = im.ReadDouble();
     this.Id = im.ReadInt32();
     this.OldPosition = im.ReadInt32();
     this.NewPosition = im.ReadInt32();
 }
开发者ID:Gothen111,项目名称:2DWorld,代码行数:7,代码来源:CreatureInventoryItemPositionChangeMessage.cs

示例5: Decode

 public void Decode(NetIncomingMessage im)
 {
     this.MessageTime = im.ReadDouble();
     this.Id = im.ReadInt32();
     this.EquipmentPosition = im.ReadInt32();
     this.InventoryPosition = im.ReadInt32();
 }
开发者ID:Gothen111,项目名称:2DWorld,代码行数:7,代码来源:CreatureInventoryToEquipmentMessage.cs

示例6: 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

示例7: LoadTileMap

        public bool LoadTileMap(NetIncomingMessage message)
        {
            int _mapWidth = message.ReadInt32();
            int _mapHeight = message.ReadInt32();


            _groundArray = new QuadTree<Tile>(new SizeF(2*TileSpacing, 2*TileSpacing), 4);
            _wallArray = new QuadTree<Tile>(new SizeF(2 * TileSpacing, 2 * TileSpacing), 4);

            while (message.PositionInBytes < message.LengthBytes)
            {
                float posX = message.ReadFloat();
                float posY = message.ReadFloat();
                byte index = message.ReadByte();
                var state = (TileState)message.ReadByte();
                string name = GetTileString(index);
                Direction dir = Direction.North;
                if (name == "Wall")
                {
                    dir = (Direction)message.ReadByte();
                }
                Tile newTile = GenerateNewTile(GetTileString(index), state, new Vector2D(posX, posY), dir);
                AddTile(newTile);
            }

            foreach (Wall w in GetAllWallIn(new RectangleF(0, 0, _mapWidth * TileSpacing, _mapHeight * TileSpacing)))
            {
                w.SetSprite();
            }

            _loaded = true;
            return true;
        }
开发者ID:Gartley,项目名称:ss13remake,代码行数:33,代码来源:MapManager.cs

示例8: Decode

 public void Decode(NetIncomingMessage im)
 {
     Shots = im.ReadInt32();
        Hits = im.ReadInt32();
        Misses = im.ReadInt32();
        ShipsKilled = im.ReadInt32();
 }
开发者ID:kflo,项目名称:Battleship2,代码行数:7,代码来源:playerStatsMessage.cs

示例9: HealthTransferableData

 public HealthTransferableData(NetIncomingMessage message)
 {
     SessionID = message.ReadInt64();
     ID = message.ReadInt32();
     IsValid = message.ReadBoolean();
     PlayerIndex = message.ReadInt32();
     Value = message.ReadFloat();
 }
开发者ID:elefantstudio-se,项目名称:xna-lidgren-multiplayer-game,代码行数:8,代码来源:HealthTransferableData.cs

示例10: 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

示例11: 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

示例12: PopulateFromMsg

        public void PopulateFromMsg(NetIncomingMessage msg)
        {
            m_serverName = msg.ReadString();
            m_serverType = (NetServerType)msg.ReadByte();
            m_serverInternalAdress = msg.ReadIPEndPoint();
            m_serverExternalAdress = msg.SenderEndPoint;
            m_currentNbPlayers = msg.ReadInt32();
            m_maxPlayers = msg.ReadInt32();
            m_NATtoken = msg.ReadString();

            m_lastContact = DateTime.Now;
        }
开发者ID:SharpEdgeEntertainment,项目名称:FrozenFlameFramework,代码行数:12,代码来源:F3_NetServerInfo.cs

示例13: Decode

        public void Decode(NetIncomingMessage im)
        {
            this.Id = im.ReadInt32();
            this.MessageTime = im.ReadDouble();

            //this.Region = Utility.Serializer.DeserializeObjectFromString<Model.Map.Region.Region>(im.ReadString());
            //this.Region.Parent = Model.Map.World.World.world;

            this.Position = im.ReadVector3();

            this.RegionEnum = (Model.Map.Region.RegionEnum)im.ReadInt32();
        }
开发者ID:Gothen111,项目名称:2DWorld,代码行数:12,代码来源:UpdateRegionMessage.cs

示例14: 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

示例15: 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


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