本文整理汇总了C#中SharpTibiaProxy.Network.InMessage.ReadBool方法的典型用法代码示例。如果您正苦于以下问题:C# InMessage.ReadBool方法的具体用法?C# InMessage.ReadBool怎么用?C# InMessage.ReadBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpTibiaProxy.Network.InMessage
的用法示例。
在下文中一共展示了InMessage.ReadBool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseClientMarketCreate
private void ParseClientMarketCreate(InMessage message)
{
OfferKind Kind = (OfferKind)message.ReadByte();
ushort ItemId = message.ReadUShort();
ushort Amount = message.ReadUShort();
uint PiecePrice = message.ReadUInt();
bool IsAnonymous = message.ReadBool();
}
示例2: GetThing
private Thing GetThing(InMessage message)
{
//get thing type
var thingId = message.ReadUShort();
if (thingId == 0x0061 || thingId == 0x0062)
{
//creatures
Creature creature = null;
if (thingId == 0x0062)
{
creature = client.BattleList.GetCreature(message.ReadUInt());
if (creature == null)
throw new Exception("[GetThing] (0x0062) Can't find the creature in the battle list.");
creature.Health = message.ReadByte();
}
else if (thingId == 0x0061)
{ //creature is not known
client.BattleList.RemoveCreature(message.ReadUInt());
creature = new Creature(message.ReadUInt());
client.BattleList.AddCreature(creature);
creature.Type = (CreatureType)message.ReadByte();
creature.Name = message.ReadString();
creature.Health = message.ReadByte();
}
var direction = (Direction)message.ReadByte();
creature.LookDirection = direction;
creature.TurnDirection = direction;
creature.Outfit = message.ReadOutfit();
creature.LightLevel = message.ReadByte();
creature.LightColor = message.ReadByte();
creature.Speed = message.ReadUShort();
creature.Skull = message.ReadByte();
creature.Shield = message.ReadByte();
if (thingId == 0x0061) // emblem is sent only in packet type 0x61
creature.Emblem = message.ReadByte();
creature.IsImpassable = message.ReadBool();
return creature;
}
else if (thingId == 0x0063)
{
Creature creature = client.BattleList.GetCreature(message.ReadUInt());
if (creature == null)
throw new Exception("[GetThing] (0x0063) Can't find the creature in the battle list.");
creature.TurnDirection = (Direction)message.ReadByte();
creature.IsImpassable = message.ReadBool();
return creature;
}
else
return GetItem(message, thingId);
}
示例3: GetThing
private Thing GetThing(InMessage message)
{
//get thing type
var thingId = message.ReadUShort();
if (thingId == 0x0061 || thingId == 0x0062)
{
//creatures
Creature creature = null;
if (thingId == 0x0062)
{
creature = client.BattleList.GetCreature(message.ReadUInt());
if (creature == null)
throw new Exception("[GetThing] (0x0062) Can't find the creature in the battle list.");
creature.Health = message.ReadByte();
}
else if (thingId == 0x0061)
{ //creature is not known
client.BattleList.RemoveCreature(message.ReadUInt());
creature = new Creature(message.ReadUInt());
client.BattleList.AddCreature(creature);
creature.Type = (CreatureType)message.ReadByte();
creature.Name = message.ReadString();
creature.Health = message.ReadByte();
}
var direction = (Direction)message.ReadByte();
creature.LookDirection = direction;
creature.TurnDirection = direction;
creature.Outfit = message.ReadOutfit();
creature.LightLevel = message.ReadByte();
creature.LightColor = message.ReadByte();
creature.Speed = message.ReadUShort();
creature.Skull = message.ReadByte();
creature.Shield = message.ReadByte();
if (thingId == 0x0061) // emblem/guildflag is sent only in packet type 0x61
{
if (client.Version.Number <= ClientVersion.Version986.Number)
{
creature.Emblem = message.ReadByte();
}
if (client.Version.Number >= ClientVersion.Version1010.Number)
{
var GuildFlag = message.ReadByte();
}
}
if (client.Version.Number >= ClientVersion.Version1010.Number)
{
creature.Type = (CreatureType)message.ReadByte();
if (client.Version.Number >= ClientVersion.Version1036.Number)
message.ReadByte(); //Speech Category
var Mark = message.ReadByte();
var NumberOfPVPHelpers = message.ReadUShort();
}
creature.IsImpassable = message.ReadBool();
return creature;
}
else if (thingId == 0x0063)
{
Creature creature = client.BattleList.GetCreature(message.ReadUInt());
if (creature == null)
throw new Exception("[GetThing] (0x0063) Can't find the creature in the battle list.");
creature.TurnDirection = (Direction)message.ReadByte();
creature.IsImpassable = message.ReadBool();
return creature;
}
else
return GetItem(message, thingId);
}