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


C# PacketReader.ReadSlot方法代码示例

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


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

示例1: OnPlayerBlockPlacement

        public void OnPlayerBlockPlacement(ref PacketReader _pReader, PacketType pt, ref ClientManager _client)
        {
            PlayerBlockPlacementPacket p = new PlayerBlockPlacementPacket(PacketType.PlayerBlockPlacement);
            p.X = _pReader.ReadInt();
            p.Y = _pReader.ReadByte();
            p.Z = _pReader.ReadInt();
            p.Direction = _pReader.ReadByte();
            p.BlockID = _pReader.ReadSlot();
            //if (p.BlockID.s_short <= -1)
            //{
                p.Amount = _pReader.ReadByte();
                p.Damage = _pReader.ReadShort();
            //}
            GridServer.player_list[_client.id].WaitToRead = false;
            p.BuildPacket();

            PacketReader pr = new PacketReader(new System.IO.MemoryStream(p.GetBytes()));
            int i = 0;
            for (; i < base.ModuleAddons.Count; i++)
            {
                base.ModuleAddons.ElementAt(i).Value(pt, ModuleAddons.ElementAt(i).Key, ref pr, (PacketHandler)p, ref _client);
            }
        }
开发者ID:ultimakaz,项目名称:lib-open-craft,代码行数:23,代码来源:PlayerBlockPlacement.cs

示例2: OnCreativeInventory

 public void OnCreativeInventory(ref PacketReader _pReader, PacketType pt, ref ClientManager _client)
 {
     CreateInventoryPacket cip = new CreateInventoryPacket(PacketType.CreativeInventory);
     cip.Slot = _pReader.ReadSlot();
     _client.WaitToRead = false;
 }
开发者ID:ultimakaz,项目名称:lib-open-craft,代码行数:6,代码来源:CreativeInventory.cs


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