本文整理汇总了C#中NetworkMessage.AddUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkMessage.AddUInt16方法的具体用法?C# NetworkMessage.AddUInt16怎么用?C# NetworkMessage.AddUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkMessage
的用法示例。
在下文中一共展示了NetworkMessage.AddUInt16方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddUInt16(Health);
msg.AddUInt16(MaxHealth);
msg.AddUInt32(Capacity);
if (Client.VersionNumber >= 870)
{
msg.AddUInt64(Experience);
}
else
{
msg.AddUInt32((uint)Experience);
}
msg.AddUInt16(Level);
msg.AddByte(LevelPercent);
msg.AddUInt16(Mana);
msg.AddUInt16(MaxMana);
msg.AddByte(MagicLevel);
msg.AddByte(MagicLevelPercent);
msg.AddByte(Soul);
msg.AddUInt16(Stamina);
}
示例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: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddLocation(FromLocation);
msg.AddUInt16(FromSpriteId);
msg.AddByte(FromStackPosition);
msg.AddLocation(ToLocation);
msg.AddUInt16(ToSpriteId);
msg.AddByte(ToStackPosition);
}
示例4: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddUInt32(WindowId);
msg.AddUInt16(ItemId);
msg.AddUInt16(MaxLength);
msg.AddString(Text);
msg.AddString(Author);
msg.AddString(Date);
}
示例5: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddUInt32(YourId);
msg.AddUInt16(0x0032); // Related to client-side drawing speed
msg.AddByte(CanReportBug);
}
示例6: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddUInt16(ChannelId);
msg.AddString(Name);
}
示例7: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddUInt16(ItemId);
msg.AddByte(Count);
msg.AddByte(Amount);
}
示例8: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddLocation(Location);
msg.AddUInt16(SpriteId);
msg.AddByte(StackPosition);
}
示例9: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddUInt16(ItemId);
msg.AddByte(Count);
msg.AddByte(Amount);
msg.AddByte(Unknown);
msg.AddByte(Convert.ToByte(WithBackpack));
}
示例10: Create
public static NetworkMessage Create(byte OS, ushort Version,
byte[] Signatures, byte[] XteaKey, string AccountName, string Password,bool OpenTibia)
{
NetworkMessage msg = new NetworkMessage(149);
msg.AddByte(0x95);
msg.AddByte(0x00);
msg.Position += 4;
msg.AddByte(0x01);
msg.AddUInt16(OS);
msg.AddUInt16(Version);
msg.AddBytes(Signatures);
msg.AddByte(0x0);
msg.AddBytes(XteaKey);
msg.AddString(AccountName);
msg.AddString(Password);
msg.RsaOTEncrypt(23);
return msg;
}
示例11: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddUInt16((ushort)ChannelId);
msg.AddString(ChannelName);
if (Client.VersionNumber >= 872)
{
msg.AddUInt16(NumberOfParticipants);
for (ushort p = 0; p < NumberOfParticipants; p++)
{
msg.AddString(Participants[p]);
}
msg.AddUInt16(NumberOfInvitees);
for (ushort i = 0; i < NumberOfInvitees; i++)
{
msg.AddString(Invitees[i]);
}
}
}
示例12: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddByte((byte)Channels.Count);
foreach (Objects.Channel c in Channels)
{
msg.AddUInt16((ushort)c.Id);
msg.AddString(c.Name);
}
}
示例13: Create
public static NetworkMessage Create(byte OS, ushort Version,
byte[] XteaKey, string AccountName,string CharacterName, string Password, bool OpenTibia)
{
NetworkMessage msg = new NetworkMessage(139);
msg.AddByte(0x89);
msg.AddByte(0x00);
msg.Position += 4;
msg.AddByte(0x0A);
msg.AddUInt16(OS);
msg.AddUInt16(Version);
msg.AddByte(0x0);
msg.AddBytes(XteaKey);
msg.AddByte(0x0);
msg.AddString(AccountName);
msg.AddString(CharacterName);
msg.AddString(Password);
msg.RsaOTEncrypt(11);
return msg;
}
示例14: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddUInt32(Cash);
msg.AddByte((byte)ItemList.Count);
foreach (ShopInfo i in ItemList)
{
msg.AddUInt16(i.ItemId);
msg.AddByte(i.SubType);
}
}
示例15: ToNetworkMessage
public override void ToNetworkMessage(NetworkMessage msg)
{
msg.AddByte((byte)Type);
msg.AddOutfit(Default);
msg.AddByte((byte)OutfitList.Count);
foreach (AvalibleOutfit i in OutfitList)
{
msg.AddUInt16(i.Id);
msg.AddString(i.Name);
msg.AddByte(i.Addons);
}
}