本文整理汇总了C#中PacketReader.ReadShort方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadShort方法的具体用法?C# PacketReader.ReadShort怎么用?C# PacketReader.ReadShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadShort方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreativeInventoryAction
public void OnCreativeInventoryAction(ref PacketReader _pReader, PacketType pt, ref ClientManager _client)
{
short slot = _pReader.ReadShort();
short item_id = _pReader.ReadShort();
short Quanity = _pReader.ReadShort();
short Damage = _pReader.ReadShort();
}
示例2: Read
public override void Read(PacketReader stream)
{
int posX = stream.ReadInt();
short posY = stream.ReadShort();
int posZ = stream.ReadInt();
byte sizeX = (byte)(stream.ReadByte() + 1);
byte sizeY = (byte)(stream.ReadByte() + 1);
byte sizeZ = (byte)(stream.ReadByte() + 1);
int o = sizeX * sizeY * sizeZ;
Chunk = new Chunk(null, UniversalCoords.FromWorld(posX, posY, posZ));
int len = stream.ReadInt();
stream.ReadBytes(len);
}
示例3: Read
public override void Read(PacketReader stream)
{
int posX = stream.ReadInt();
short posY = stream.ReadShort();
int posZ = stream.ReadInt();
byte sizeX = (byte)(stream.ReadByte() + 1);
byte sizeY = (byte)(stream.ReadByte() + 1);
byte sizeZ = (byte)(stream.ReadByte() + 1);
int o = sizeX * sizeY * sizeZ;
Chunk = new Chunk(null, posX << 4, posZ << 4);
int len = stream.ReadInt();
byte[] data = new byte[o * 5 / 2];
byte[] comp = stream.ReadBytes(len);
}
示例4: Parse
public IEnumerable<RuleInfo> Parse(byte[] data)
{
var rules = new List<RuleInfo>();
var reader = new PacketReader(data);
var header = reader.ReadByte();
var numberOfRules = reader.ReadShort();
for (short i = 1; i <= numberOfRules; i++)
{
if (!reader.IsEnd)
{
var rule = new RuleInfo();
rule.Index = i;
rule.Name = reader.ReadUTFString();
rule.Value = reader.ReadUTFString();
rules.Add(rule);
}
}
return rules;
}
示例5: 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);
}
}
示例6: Read
public override void Read(PacketReader stream)
{
World = stream.ReadInt();
Difficulty = stream.ReadSByte();
GameMode = stream.ReadSByte();
WorldHeight = stream.ReadShort();
LevelType = stream.ReadString16(9);
}
示例7: OnPacket
public void OnPacket(byte[] packet)
{
PacketReader reader = new PacketReader(packet);
var opcode = (RecvOps)reader.ReadShort();
IPacketHandler handler = PacketHandler.Get(opcode);
if (handler != null)
handler.Handle(reader);
}
示例8: OnHoldingChanged
public void OnHoldingChanged(ref PacketReader _pReader, PacketType pt, ref ClientManager _client)
{
_client._player.Current_Slot = _pReader.ReadShort();
}