本文整理汇总了C#中NetworkMessage.GetByte方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkMessage.GetByte方法的具体用法?C# NetworkMessage.GetByte怎么用?C# NetworkMessage.GetByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkMessage
的用法示例。
在下文中一共展示了NetworkMessage.GetByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.OutfitWindow)
return false;
Destination = destination;
Type = IncomingPacketType.OutfitWindow;
Default = msg.GetOutfit();
byte count = msg.GetByte();
OutfitList = new List<AvalibleOutfit> { };
for (int i = 0; i < count; i++)
{
AvalibleOutfit outfit = new AvalibleOutfit();
outfit.Id = msg.GetUInt16();
outfit.Name = msg.GetString();
outfit.Addons = msg.GetByte();
OutfitList.Add(outfit);
}
return true;
}
示例2: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.ContainerOpen)
return false;
Destination = destination;
Type = IncomingPacketType.ContainerOpen;
Id = msg.GetByte();
ItemId = msg.GetUInt16();
Name = msg.GetString();
Capacity = msg.GetByte();
HasParent = msg.GetByte();
ItemCount = msg.GetByte();
Items = new List<Tibia.Objects.Item>(ItemCount);
for (int i = 0; i < ItemCount; i++)
{
Objects.Item item = msg.GetItem();
item.Location = Tibia.Objects.ItemLocation.FromContainer(Id, (byte)i);
Items.Add(item);
}
return true;
}
示例3: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)OutgoingPacketType.AutoWalk)
return false;
Destination = destination;
Type = OutgoingPacketType.AutoWalk;
Directions = new List<Pokemon.Constants.Direction> { };
byte count = msg.GetByte();
for (int i = 0; i < count; i++)
{
Constants.Direction direction;
byte dir = msg.GetByte();
switch (dir)
{
case 1: direction = Pokemon.Constants.Direction.Right; break;
case 2: direction = Pokemon.Constants.Direction.UpRight; break;
case 3: direction = Pokemon.Constants.Direction.Up; break;
case 4: direction = Pokemon.Constants.Direction.UpLeft; break;
case 5: direction = Pokemon.Constants.Direction.Left; break;
case 6: direction = Pokemon.Constants.Direction.DownLeft; break;
case 7: direction = Pokemon.Constants.Direction.Down; break;
case 8: direction = Pokemon.Constants.Direction.DownRight; break;
default: continue;
}
Directions.Add(direction);
}
return true;
}
示例4: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.ShopWindowOpen)
return false;
Destination = destination;
Type = IncomingPacketType.ShopWindowOpen;
byte cap = msg.GetByte();
ShopList = new List<ShopInfo> { };
for (int i = 0; i < cap; i++)
{
ShopInfo item = new ShopInfo();
item.ItemId = msg.GetUInt16();
item.SubType = msg.GetByte();
item.ItemName = msg.GetString();
item.Weight = msg.GetUInt32();
item.BuyPrice = msg.GetUInt32();
item.SellPrice = msg.GetUInt32();
ShopList.Add(item);
}
return true;
}
示例5: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.ShopSaleGoldCount)
return false;
Destination = destination;
Type = IncomingPacketType.ShopSaleGoldCount;
Cash = msg.GetUInt32();
byte count = msg.GetByte();
ItemList = new List<ShopInfo> { };
for (int i = 0; i < count; i++)
{
ShopInfo item = new ShopInfo();
item.ItemId = msg.GetUInt16();
item.SubType = msg.GetByte();
ItemList.Add(item);
}
return true;
}
示例6: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.PlayerStatus)
return false;
Destination = destination;
Type = IncomingPacketType.PlayerStatus;
Health = msg.GetUInt16();
MaxHealth = msg.GetUInt16();
PokemonsCount = msg.GetUInt32();
Experience = msg.GetUInt32();
Level = msg.GetUInt16();
LevelPercent = msg.GetByte();
Pokemons = msg.GetUInt16();
PokemonsMax = msg.GetUInt16();
MagicLevel = msg.GetByte();
MagicLevelPercent = msg.GetByte();
Soul = msg.GetByte();
Stamina = msg.GetUInt16();
return true;
}
示例7: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.TileTransformThing)
return false;
Destination = destination;
Type = IncomingPacketType.TileTransformThing;
Position = msg.GetLocation();
StackPosition = msg.GetByte();
ThingId = msg.GetUInt16();
if (ThingId == 0x0061 || ThingId == 0x0062 || ThingId == 0x0063)
{
CreatureId = msg.GetUInt32();
CreatureDirection = msg.GetByte();
}
else
{
Item = new Pokemon.Objects.Item(Client, ThingId, 0);
Item.Location = Pokemon.Objects.ItemLocation.FromLocation(Position);
if (Item.HasExtraByte)
Item.Count = msg.GetByte();
}
return true;
}
示例8: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)IncomingPacketType.TileAddThing)
return false;
Destination = destination;
Type = IncomingPacketType.TileAddThing;
Location = msg.GetLocation();
Stack = msg.GetByte();
ThingId = msg.GetUInt16();
if (ThingId == 0x0061 || ThingId == 0x0062)
{
Creature = new PacketCreature(Client);
if (ThingId == 0x0062)
{
Creature.Type = PacketCreatureType.Known;
Creature.Id = msg.GetUInt32();
}
else if (ThingId == 0x0061)
{
Creature.Type = PacketCreatureType.Unknown;
Creature.RemoveId = msg.GetUInt32();
Creature.Id = msg.GetUInt32();
Creature.Name = msg.GetString();
}
Creature.Health = msg.GetByte();
Creature.Direction = msg.GetByte();
Creature.Outfit = msg.GetOutfit();
Creature.LightLevel = msg.GetByte();
Creature.LightColor = msg.GetByte();
Creature.Speed = msg.GetUInt16();
Creature.Skull = (Constants.Skull)msg.GetByte();
Creature.PartyShield = (PartyShield)msg.GetByte();
}
else if (ThingId == 0x0063)
{
Creature = new PacketCreature(Client);
Creature.Type = PacketCreatureType.Turn;
Creature.Id = msg.GetUInt32();
Creature.Direction = msg.GetByte();
}
else
{
Item = new Pokemon.Objects.Item(Client, ThingId);
Item.Location = Pokemon.Objects.ItemLocation.FromLocation(Location);
if (Item.HasExtraByte)
Item.Count = msg.GetByte();
}
return true;
}
示例9: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)PipePacketType.HooksEnableDisable)
return false;
Type = PipePacketType.HooksEnableDisable;
Enable = Convert.ToBoolean(msg.GetByte());
return true;
}
示例10: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)PipePacketType.SetConstant)
return false;
Type = PipePacketType.SetConstant;
ConstantType = (PipeConstantType)msg.GetByte();
Value = msg.GetUInt32();
return true;
}
示例11: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)IncomingPacketType.CanReportBugs)
return false;
Destination = destination;
Type = IncomingPacketType.CanReportBugs;
ReportBugs = msg.GetByte();
return true;
}
示例12: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)OutgoingPacketType.ContainerOpenParent)
return false;
Destination = destination;
Type = OutgoingPacketType.ContainerOpenParent;
Id = msg.GetByte();
return true;
}
示例13: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)PipePacketType.AddContextMenu)
return false;
Type = PipePacketType.AddContextMenu;
EventId = (int)msg.GetUInt32();
Text = msg.GetString();
ContextMenuType = (Constants.ContextMenuType)msg.GetByte();
HasSeparator = msg.GetByte();
return true;
}
示例14: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)IncomingPacketType.WaitingList)
return false;
Destination = destination;
Type = IncomingPacketType.WaitingList;
Message = msg.GetString();
Time = msg.GetByte();
return true;
}
示例15: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)OutgoingPacketType.FightModes)
return false;
Destination = destination;
Type = OutgoingPacketType.FightModes;
FightMode = msg.GetByte();
ChaseMode = msg.GetByte();
SafeMode = msg.GetByte();
return true;
}