本文整理汇总了C#中NetworkMessage.GetUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkMessage.GetUInt16方法的具体用法?C# NetworkMessage.GetUInt16怎么用?C# NetworkMessage.GetUInt16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkMessage
的用法示例。
在下文中一共展示了NetworkMessage.GetUInt16方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.ChannelOpen)
return false;
Destination = destination;
Type = IncomingPacketType.ChannelOpen;
ChannelId = (ChatChannel)msg.GetUInt16();
ChannelName = msg.GetString();
if (Client.VersionNumber >= 872)
{
NumberOfParticipants = msg.GetUInt16();
for (ushort p = 0; p < NumberOfParticipants; p++)
{
Participants[p] = msg.GetString();
}
NumberOfInvitees = msg.GetUInt16();
for (ushort i = 0; i < NumberOfInvitees; i++)
{
Invitees[i] = msg.GetString();
}
}
return true;
}
示例2: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination, NetworkMessage outMsg)
{
if (msg.GetByte() != (byte)IncomingPacketType.TileUpdate)
return false;
Destination = destination;
Type = IncomingPacketType.TileUpdate;
outMsg.AddByte((byte)Type);
Objects.Location pos = msg.GetLocation();
outMsg.AddLocation(pos);
ushort thingId = msg.PeekUInt16();
if (thingId == 0xFF01)
{
outMsg.AddUInt16(msg.GetUInt16());
}
else
{
ParseTileDescription(msg, pos, outMsg);
outMsg.AddUInt16(msg.GetUInt16());
}
return true;
}
示例3: Parse
public static AccountPacket Parse(NetworkMessage message)
{
AccountPacket packet = new AccountPacket();
packet.Os = message.GetUInt16(); // OS
packet.Version = message.GetUInt16(); // version
// File checks
message.GetUInt32();
message.GetUInt32();
message.GetUInt32();
message.RSADecrypt();
message.GetByte(); // should be zero
packet.XteaKey = new uint[4];
packet.XteaKey[0] = message.GetUInt32();
packet.XteaKey[1] = message.GetUInt32();
packet.XteaKey[2] = message.GetUInt32();
packet.XteaKey[3] = message.GetUInt32();
packet.AccountName = message.GetString(); // account name
packet.Password = message.GetString(); // password
return packet;
}
示例4: 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;
}
示例5: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)PipePacketType.AddSkin)
return false;
Type = PipePacketType.AddSkin;
SkinId = msg.GetUInt32();
PosX = msg.GetUInt16();
PosY = msg.GetUInt16();
Width = msg.GetUInt16();
Height = msg.GetUInt16();
GUIId = msg.GetUInt16();
return true;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)OutgoingPacketType.ItemUseOn)
return false;
Destination = destination;
Type = OutgoingPacketType.ItemUseOn;
FromLocation = msg.GetLocation();
FromSpriteId = msg.GetUInt16();
FromStackPosition = msg.GetByte();
ToLocation = msg.GetLocation();
ToSpriteId = msg.GetUInt16();
ToStackPosition = msg.GetByte();
return true;
}
示例12: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)PipePacketType.UpdateIcon)
return false;
Type = PipePacketType.UpdateIcon;
IconId = msg.GetUInt32();
PosX = msg.GetUInt16();
PosY = msg.GetUInt16();
Size = msg.GetUInt16();
ItemId = msg.GetUInt16();
ItemCount = msg.GetUInt16();
Font = (ClientFont)msg.GetByte();
Color = Color.FromArgb(msg.GetByte(), msg.GetByte(), msg.GetByte());
return true;
}
示例13: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.ItemTextWindow)
return false;
Destination = destination;
Type = IncomingPacketType.ItemTextWindow;
WindowId = msg.GetUInt32();
ItemId = msg.GetUInt16();
MaxLength = msg.GetUInt16();
Text = msg.GetString();
Author = msg.GetString();
Date = msg.GetString();
return true;
}
示例14: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)OutgoingPacketType.ChannelClose)
return false;
Destination = destination;
Type = OutgoingPacketType.ChannelClose;
ChannelId = (ChatChannel)msg.GetUInt16();
return true;
}
示例15: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)PipePacketType.HookSendToServer)
return false;
Type = PipePacketType.HookSendToServer;
ushort InnerLength = msg.GetUInt16();
msg.Position -= 2;
PacketToSend = msg.GetBytes(InnerLength+2);
return true;
}