本文整理汇总了C#中Solar.FiestaLib.Networking.Packet.WriteUShort方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteUShort方法的具体用法?C# Packet.WriteUShort怎么用?C# Packet.WriteUShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solar.FiestaLib.Networking.Packet
的用法示例。
在下文中一共展示了Packet.WriteUShort方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginDisplayRest
public static Packet BeginDisplayRest(ZoneCharacter character)
{
Packet packet = new Packet(SH8Type.BeginDisplayRest);
packet.WriteUShort(character.MapObjectID);
packet.WriteUShort(character.House.ItemID);
packet.Fill(10, 0xff);
return packet;
}
示例2: Write
public void Write(Packet packet)
{
packet.WriteUShort(ID);
packet.WriteUShort(Item.ItemID);
packet.WriteInt(Position.X);
packet.WriteInt(Position.Y);
packet.WriteUShort((DroppedBy != null) ? DroppedBy.MapObjectID : (ushort)0xffff);
packet.WriteByte(CanTake ? (byte)0x08 : (byte)0x00);
}
示例3: Write
public void Write(Packet pPacket)
{
pPacket.WriteUShort(ID);
pPacket.WriteInt(60000); // Cooldown
//pPacket.WriteShort(Upgrades);
pPacket.WriteUShort(GetUpgrades(4, 3, 2, 1));
pPacket.WriteInt(9000); // Skill exp???
}
示例4: Equip
public static Packet Equip(ZoneCharacter character, Equip equip)
{
//B2 00 - AB 38 - 07 - 0D 00 04
Packet packet = new Packet(SH7Type.ShowEquip);
packet.WriteUShort(character.MapObjectID);
packet.WriteUShort(equip.ItemID);
packet.WriteByte(equip.Upgrades);
packet.Fill(3, 0xff);
return packet;
}
示例5: SendChangeZone
public static void SendChangeZone(ZoneCharacter character, ushort mapid, int x, int y, string IP, ushort port, ushort randomid)
{
using (var packet = new Packet(SH6Type.ChangeZone))
{
packet.WriteUShort(mapid);
packet.WriteInt(x);
packet.WriteInt(y);
packet.WriteString(character.Client.Host == "127.0.0.1" ? "127.0.0.1" : IP, 16);
packet.WriteUShort(port);
packet.WriteUShort(randomid);
character.Client.SendPacket(packet);
}
}
示例6: SendAttackAnimation
public static void SendAttackAnimation(MapObject from, ushort objectID, ushort attackspeed, byte stance)
{
using (var packet = new Packet(SH9Type.AttackAnimation))
{
packet.WriteUShort(from.MapObjectID);
packet.WriteUShort(objectID);
packet.WriteByte(stance);
packet.WriteUShort(attackspeed);
packet.WriteByte(4);
packet.WriteByte(100);
from.MapSector.Broadcast(packet);
}
}
示例7: Animation
public static Packet Animation(ZoneCharacter character, byte id)
{
Packet packet = new Packet(SH8Type.Emote);
packet.WriteUShort(character.MapObjectID);
packet.WriteByte(id);
return packet;
}
示例8: SendConnectError
public static void SendConnectError(WorldClient client, ConnectErrors error)
{
using (var packet = new Packet(SH4Type.ConnectError))
{
packet.WriteUShort((ushort)error);
client.SendPacket(packet);
}
}
示例9: SendCharacterChunkEnd
public static void SendCharacterChunkEnd(ZoneCharacter character)
{
using (var packet = new Packet(SH4Type.CharacterInfoEnd))
{
packet.WriteUShort(0xFFFF);
character.Client.SendPacket(packet);
}
}
示例10: FailedUnequip
public static void FailedUnequip(ZoneCharacter character)
{
using (var packet = new Packet(SH12Type.FailedUnequip))
{
packet.WriteUShort(706);
character.Client.SendPacket(packet);
}
}
示例11: FailedEquip
public static void FailedEquip(ZoneCharacter character, ushort val = 0)
{
using (var packet = new Packet(SH12Type.FailedEquip))
{
packet.WriteUShort(val);
character.Client.SendPacket(packet);
}
}
示例12: SendSkillLearnt
public static void SendSkillLearnt(ZoneCharacter character, ushort skillid)
{
using (var packet = new Packet(SH18Type.LearnSkill))
{
packet.WriteUShort(skillid);
packet.WriteByte(0); //unk
character.Client.SendPacket(packet);
}
}
示例13: SendZoneServerIP
public static void SendZoneServerIP(WorldClient client, ZoneConnection info)
{
using (var packet = new Packet(SH4Type.ServerIP))
{
packet.WriteString(client.Host == "127.0.0.1" ? "127.0.0.1" : info.IP, 16);
packet.WriteUShort(info.Port);
client.SendPacket(packet);
}
}
示例14: SendQuestion
public static void SendQuestion(ZoneCharacter character, Question question, ushort range)
{
using (var packet = new Packet(SH15Type.Question))
{
packet.WriteString(question.Text, 129);
packet.WriteUShort(character.MapObjectID); // Obj id
packet.WriteInt(character.Position.X);
packet.WriteInt(character.Position.Y);
packet.WriteUShort(range); // Distance how far your allowed to run when the question window is closed by Client
packet.WriteByte((byte)question.Answers.Count);
for (byte i = 0; i < question.Answers.Count; ++i)
{
packet.WriteByte(i);
packet.WriteString(question.Answers[i], 32);
}
character.Client.SendPacket(packet);
}
}
示例15: SendServerTime
public static void SendServerTime(WorldClient client)
{
using (var packet = new Packet(SH2Type.ServerTime))
{
packet.WriteByte(Convert.ToByte(DateTime.Now.Hour));
packet.WriteUShort(Convert.ToUInt16(DateTime.Now.Minute));
client.SendPacket(packet);
}
}