本文整理汇总了C#中ServerEngine.PacketEngine.Packet.WriteHexString方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteHexString方法的具体用法?C# Packet.WriteHexString怎么用?C# Packet.WriteHexString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServerEngine.PacketEngine.Packet
的用法示例。
在下文中一共展示了Packet.WriteHexString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendPickUpText
public static byte[] SendPickUpText(short referenceId, int amount)
{
Packet p = new Packet(200);
p.WriteHexString("01 00"); // type maybe
p.WriteShort(referenceId);
p.WriteShort(amount);
p.WriteHexString("00 00");
return p.GetWrittenBuffer(PacketIds.SendPickUpText);
}
示例2: SendCreateCharacter
/// <summary>
/// Create character
/// </summary>
/// <param name="ms">State of character making</param>
/// <param name="playerid">ID of character that was made</param>
/// <returns></returns>
public static byte[] SendCreateCharacter(CharCreationState ms, int playerid)
{
Packet p = new Packet(500);
p.WriteByte((byte)ms);
if (ms == CharCreationState.Success)
p.WriteInt(playerid);
else
p.WriteHexString("00 00 00 00");
return p.GetWrittenBuffer(PacketIds.SendCreateCharacter);
}
示例3: SendHardSkillList
public static byte[] SendHardSkillList()
{
Packet p = new Packet(200);
p.WriteHexString("1D 31 01 00 00");
return p.GetWrittenBuffer();
}
示例4: SendBagItems
public static byte[] SendBagItems(List<BaseItem> items, int bag)
{
Packet p = new Packet(200);
// p.WriteHexString("18 31 A4 00 00 02 00 73 83 D0 00 2A 4E 01 02 B0 04 00 00 00 00 00 00 02 00 00 04 00 05 00 06 00 07 00 08 00 C0 C8 00 C8 00 05 00 06 00 07 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 08 00 00 00 04 00 05 00 07 00 0A 00 0B 00 0C 00 0D 00 00 00 00 01 01 01 02 02 74 83 D0 00 35 4E 02 01 34 08 00 00 00 00 00 00 02 01 00 01 00 00 00 00 00 01 00 00 00 C8 64 00 64 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
p.WriteByte(bag);
p.WriteByte(items.Count);
foreach (BaseItem i in items)
{
p.WriteByte(i.Slot);
p.WriteInt(i.ItemID);
p.WriteShort(i.ReferenceID);
p.WriteByte(i.bType);
p.WriteByte(i.bKind);
p.WriteShort(i.VisualID);
p.WriteInt(i.Price);
p.WriteHexString("00 00");
if (i is Equipment)
{
Equipment e = i as Equipment;
p.WriteByte(e.RequiredClass);
p.WriteShort(e.Amount);
p.WriteShort(e.RequiredLevel);
p.WriteShort(e.RequiredDexterity);
p.WriteShort(e.RequiredStrength);
p.WriteShort(e.RequiredStamina);
p.WriteShort(e.RequiredEnergy);
p.WriteByte(e.MaxImbueTries);
p.WriteShort(e.Durability);
p.WriteShort(e.MaxDurability);
p.WriteShort(e.Damage);
p.WriteShort(e.Defence);
p.WriteShort(e.AttackRating);
p.WriteShort(e.AttackSpeed);
p.WriteShort(e.AttackRange);
p.WriteShort(e.IncMaxLife);
p.WriteShort(e.IncMaxMana);
p.WriteShort(e.IncLifeRegen);
p.WriteShort(e.IncManaRegen);
p.WriteShort(e.Critical);
p.WriteByte(e.Plus);
p.WriteByte(e.Slvl);
p.WriteHexString("00"); // unknown
p.WriteByte(e.ImbueTries);
p.WriteHexString("00"); // unknown
p.WriteShort(e.DragonSuccessImbueTries);
p.WriteByte(e.DiscountRepairFee);
p.WriteShort(e.TotalDragonImbueTries);
p.WriteShort(e.DragonDamage);
p.WriteShort(e.DragonDefence);
p.WriteShort(e.DragonAttackRating);
p.WriteShort(e.DragonLife);
p.WriteByte(e.MappedData);
if (!(e is Ring) && !(e is Necklace) && !(e is Cape))
p.WriteByte(e.ForceSlot);
p.WriteHexString("00 00"); // unknown
if (e is Cape)
{
Cape c = e as Cape;
p.WriteHexString("00 00"); // required guild position
p.WriteHexString("00 00 00 00 00 00 00");
p.WriteHexString("01 00"); // decrease times of durability
p.WriteByte(c.PolishImbueTries); // polish imbue tries
p.WriteShort(c.MaxPolishImbueTries); // polish max tries
p.WriteShort(c.VigiStat1); // stat1
p.WriteShort(c.VigiStat2); // stat2
p.WriteShort(c.VigiStat3); // stat3
p.WriteShort(c.VigiStat4); // stat4
p.WriteHexString("00 00"); // stat5
p.WriteShort(c.VigiStatAdd1); // stat1 increase
p.WriteShort(c.VigiStatAdd2); // stat2 increase
p.WriteShort(c.VigiStatAdd3); // stat3 increase
p.WriteShort(c.VigiStatAdd4); // stat4 increase
p.WriteHexString("00 00"); // stat5 increase
p.WriteHexString("00 00"); // unknown
}
if (!(e is Ring) && !(e is Necklace) && !(e is Cape))
{
p.WriteByte(e.RebirthHole);
p.WriteByte(e.RebirthHoleItem);
p.WriteShort(e.RebirthHoleStat);
}
}
if (i is ImbueItem)
{
ImbueItem im = i as ImbueItem;
p.WriteByte(im.RequiredClass);
p.WriteShort(i.Amount);
p.WriteHexString("00"); // imbuestat, eg dec level, increase value etc
p.WriteShort(im.ImbueChance);
p.WriteShort(im.IncreaseValue);
p.WriteHexString("00 00"); // could be lowest lvl who knows
p.WriteHexString("00 00"); // maxlevel of usage, for dragon stones
p.WriteHexString("00 00"); // unknown
}
if (i is PotionItem)
{
PotionItem pot = i as PotionItem;
p.WriteByte(pot.RequiredClass);
p.WriteShort(pot.Amount);
p.WriteHexString("00 00 00 00");
//.........这里部分代码省略.........
示例5: SendChannelStatus
public static byte[] SendChannelStatus()
{
Packet p = new Packet(200);
p.WriteHexString("02 00 01 01 01 32 00 01 02 01 08 00");
return p.GetWrittenBuffer(PacketIds.SendChannelStatus);
}
示例6: SendUnitLoginState
/// <summary>
/// Send Unit Server login state to client
/// </summary>
/// <param name="uls"></param>
/// <param name="PlayerID"></param>
/// <returns></returns>
public static byte[] SendUnitLoginState(LoginState uls, int PlayerID)
{
Packet p = new Packet(100);
if (uls == LoginState.Success)
{
p.WriteShort((short)uls);
p.WriteInt(PlayerID); // if client were ingame before, else its just 00 00 00 00
}
else
{
p.WriteShort((short)uls);
p.WriteHexString("00 00 00 00"); // if its error just logintype and rest zeroes
}
return p.GetWrittenBuffer(PacketIds.SendUnitLoginState);
}
示例7: SendAddStat
public static byte[] SendAddStat(int error, AddStatInfo asi, int pointsleft, int statamount)
{
Packet p = new Packet(200);
p.WriteHexString("1E 35 07 00");
p.WriteByte(error);
p.WriteByte(asi.Stat);
p.WriteByte(asi.Amount);
p.WriteShort(pointsleft);
p.WriteShort(statamount);
return p.GetWrittenBuffer();
}
示例8: SendSomething
public static byte[] SendSomething()
{
Packet p = new Packet(200);
p.WriteHexString("2E 31 7B 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
return p.GetWrittenBuffer();
}
示例9: SendSomething2
public static byte[] SendSomething2()
{
Packet p = new Packet(200);
p.WriteHexString("04 3C 0A 00 01 01 01 00 00 00 00 00 00 00");
return p.GetWrittenBuffer();
}
示例10: SendRemoveItem
public static byte[] SendRemoveItem(byte bag, byte slot)
{
Packet p = new Packet(200);
p.WriteByte(bag);
p.WriteByte(slot);
p.WriteHexString("00");
return p.GetWrittenBuffer(PacketIds.SendRemoveItem);
}
示例11: SendShowMap
public static byte[] SendShowMap()
{
Packet p = new Packet(200);
p.WriteHexString("02 34 01 00 00");
return p.GetWrittenBuffer();
}
示例12: SendRemoveCharacter
public static byte[] SendRemoveCharacter(Character ch)
{
Packet p = new Packet(200);
p.WriteHexString("00");
p.WriteInt(ch.CharacterId);
p.WriteHexString("01");
p.WriteInt(ch.MapId);
p.WriteHexString("00");
return p.GetWrittenBuffer(PacketIds.SendRemoveCharacter);
}
示例13: SendPortal
public static byte[] SendPortal(Portal portal)
{
Packet p = new Packet(200);
p.WriteHexString("00");
p.WriteInt(portal.ToMapID);
p.WriteShort(portal.ToX);
p.WriteShort(portal.ToY);
p.WriteHexString("01");
return p.GetWrittenBuffer(PacketIds.SendPortal);
}
示例14: SendPlayerID
public static byte[] SendPlayerID(int id)
{
Packet p = new Packet(200);
p.WriteHexString("20 3A 05 00");
p.WriteInt(id);
p.WriteByte(0);
return p.GetWrittenBuffer();
}
示例15: SendStartMoving
public static byte[] SendStartMoving(MovementInfo mo, byte movingspeed)
{
Packet p = new Packet(200);
p.WriteByte(0);
p.WriteInt(mo.CharacterID);
p.WriteShort(mo.FromX);
p.WriteShort(mo.FromY);
p.WriteByte(mo.FromZ);
p.WriteShort(mo.ToX);
p.WriteShort(mo.ToY);
p.WriteByte(mo.ToZ);
p.WriteShort(mo.Rotation);
p.WriteHexString("00");
p.WriteByte(11 + movingspeed);
p.WriteHexString("00");
return p.GetWrittenBuffer(PacketIds.SendStartMoving);
}