本文整理汇总了C#中ServerEngine.PacketEngine.Packet.GetWrittenBuffer方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.GetWrittenBuffer方法的具体用法?C# Packet.GetWrittenBuffer怎么用?C# Packet.GetWrittenBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServerEngine.PacketEngine.Packet
的用法示例。
在下文中一共展示了Packet.GetWrittenBuffer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendSpawn10
public static byte[] SendSpawn10(Character Char)
{
Packet p = new Packet(200);
p.WriteByte(0);
p.WriteInt(Char.MapId);
p.WriteInt(Char.CharacterId);
p.WriteByte(Char.Class);
p.WriteShort(Char.X);
p.WriteShort(Char.Y);
p.WriteHexString("00 00 00 00 13 00 00 00 00 00 00 00 00");
return p.GetWrittenBuffer(PacketIds.SendSpawn);
}
示例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: 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);
}
示例5: SendChatMessage
public static byte[] SendChatMessage(Character ch, ChatMessageInfo cmi)
{
Packet p = new Packet(200);
p.WriteInt(ch.CharacterId);
p.WriteByte((byte)cmi.Type); // chat type probably
p.WriteString(cmi.Message);
p.WriteString(ch.Name);
if (cmi.Type == ChatType.Whisper)
{
p.WriteInt(cmi.TargetID);
p.WriteString(cmi.TargetName);
}
return p.GetWrittenBuffer(PacketIds.SendChatMessage);
}
示例6: SendBagItems
//.........这里部分代码省略.........
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");
p.WriteShort(pot.HealHp);
p.WriteShort(pot.HealMana);
p.WriteHexString("00 20 4E 00 00 00 00");
}
if (i is BookItem)
{
BookItem book = i as BookItem;
p.WriteByte(book.RequiredClass);
p.WriteShort(book.Amount);
p.WriteShort(book.RequiredLevel);
p.WriteInt(book.SkillID);
p.WriteByte(book.SkillLevel);
p.WriteInt(book.SkillData);
}
if (i is BeadItem)
{
BeadItem bead = i as BeadItem;
p.WriteByte(bead.RequiredClass);
p.WriteShort(bead.Amount);
p.WriteInt(bead.ToMapID);
p.WriteHexString("01 00 00 00 00 00 00");
}
}
return p.GetWrittenBuffer(PacketIds.SendItemList);
}
示例7: SendChannel
/// <summary>
/// Send channel to client
/// </summary>
/// <param name="CI">Channel Info, containing id, name, desc, ip address and port</param>
/// <param name="TotalChannels"></param>
/// <returns></returns>
public static byte[] SendChannel(ChannelInfo CI, int TotalChannels)
{
Packet p = new Packet(500);
p.WriteByte(TotalChannels); // total channels
p.WriteByte(CI.ChannelId); // channel id
p.WriteString(CI.ChannelName); // name
p.WriteString(CI.ChannelDesc); // desc
p.WriteHexString("12 F4 01");
p.WriteString(CI.IPAddress); // ip
p.WriteShort(CI.Port); // port
p.WriteHexString("00 00 00");
return p.GetWrittenBuffer(PacketIds.SendChannelList);
}
示例8: SendSpawnStats
// something about repulation, current hp/mana, stats
public static byte[] SendSpawnStats(Character ch)
{
Packet p = new Packet(200);
p.WriteShort(ch.Level);
p.WriteShort(ch.Strength);
p.WriteShort(ch.Stamina);
p.WriteShort(ch.Dexterity);
p.WriteShort(ch.Energy);
p.WriteHexString("01 01 01 01"); // unknown :(, maybe base stats?: D
p.WriteShort(ch.MaxMana);
p.WriteShort(ch.CurrentMana);
p.WriteInt(ch.MaxHp);
p.WriteInt(ch.CurrentHp);
p.WriteLong(ch.CurrentExp); // cur exp
p.WriteHexString("00 00 00 00 00 00 00 00"); // curxp to next training
p.WriteLong(1200000); // exp to level
p.WriteHexString("00 00 00 00 00 00 00 00"); // xp to next training
p.WriteHexString("00 00");
p.WriteHexString("04 00 00 00");
p.WriteHexString("00 00");
p.WriteHexString("08 00 00 00");
p.WriteShort(ch.StatPoint); // stat points
p.WriteHexString("6B 00 00 00"); // total trainings?
p.WriteShort(ch.TrainingPoint); // current trainings
p.WriteHexString("7C 00"); // damage from stats
p.WriteHexString("C5 00 00 00"); // total damage (from items, skills etc)
p.WriteHexString("11 00"); // defence from stats
p.WriteHexString("12 00 00 00"); // total defence (from items, skills etc)
p.WriteHexString("13 00"); // attack rating from stats
p.WriteHexString("14 00 00 00"); // total attack rating (from items, skills etc)
p.WriteHexString("07 00"); // attack range or speed
p.WriteHexString("0B 0B"); // animation speed (the speed hax thingy in xiah 2827)
p.WriteHexString("0B"); // movement speed, from shoes ^_ ^
p.WriteHexString("00 00 00 00 00");
p.WriteInt(ch.Money);
p.WriteHexString("02 00"); // Critical
p.WriteHexString("1A 00");
p.WriteInt(ch.Fame);
p.WriteShort(ch.FiveElementPoint); // five element points (unused)
p.WriteInt(ch.CurrentFEExp); // current fe experience
p.WriteHexString("02 00 00 00"); // fe experience to point, 40000 each level
p.WriteHexString("00 00 00 00"); // that other five element skill experience :S
p.WriteHexString("00 00"); // fire fe level
p.WriteHexString("00 00"); // water fe level
p.WriteHexString("00 00"); // wood fe level
p.WriteHexString("00 00"); // steel fe level
p.WriteHexString("00 00"); // soil fe level
p.WriteByte(ch.Rebirth); // rebirths
p.WriteInt(ch.RepulationPoint); // Repulation points, the points near stat ones :U
return p.GetWrittenBuffer(PacketIds.SendSpawnStats);
}
示例9: 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);
}
示例10: SendSpawnPlayers
public static byte[] SendSpawnPlayers(Character ch)
{
Packet p = new Packet(200);
p.WriteHexString("00");
p.WriteInt(ch.MapId);
p.WriteHexString("01 00");
p.WriteInt(ch.CharacterId);
p.WriteShort(ch.X);
p.WriteShort(ch.Y);
p.WriteHexString("76");
p.WriteShort(ch.X);
p.WriteShort(ch.Y);
p.WriteHexString("76");
p.WriteHexString("16 B2 00 00");
p.WriteByte(ch.Class);
p.WriteString(ch.Name);
p.WriteInt(ch.Fame);
p.WriteHexString("00"); // bool selling
p.WriteString(""); // shopname
p.WriteString(""); // shopdesc
p.WriteHexString("00"); // purple name
p.WriteHexString("00"); // fe
p.WriteHexString("00"); // fe ring
p.WriteHexString("00"); // maybe has guild thingy
//if Character has guild
//p.WriteHexString("00 00 00 00"); // guild id
//p.WriteString(""); // guild name
//p.WriteHexString("00 00 00 00"); // maybe guild position
//p.WriteHexString("00 00 00 00"); // maybe guild position
//p.WriteHexString("00 00 00 00 00 00 00 00");
//p.WriteHexString("00"); // something
p.WriteHexString("00 00 00 00 00 00 00 00 00"); // else write this
foreach (Equipment e in ch.GetVisuals())
{
p.WriteShort(e.VisualID);
p.WriteByte(e.Plus);
p.WriteByte(e.Slvl);
p.WriteByte(e.RequiredClass);
}
p.WriteByte(ch.Rebirth); // rebirth
p.WriteHexString("00 00 00 00 00");
return p.GetWrittenBuffer(PacketIds.SendSpawnPlayers);
}
示例11: SendSpawnPlayerSomething2
public static byte[] SendSpawnPlayerSomething2()
{
Packet p = new Packet(200);
p.WriteHexString("36 31 01 00 00");
return p.GetWrittenBuffer();
}
示例12: SendSpawnNpc
public static byte[] SendSpawnNpc(List<Npc> npcs, int mapid)
{
Packet p = new Packet(200);
p.WriteHexString("00"); // unknown
p.WriteInt(mapid);
p.WriteShort(npcs.Count);
foreach (Npc n in npcs)
{
p.WriteInt(n.NpcID);
p.WriteByte(n.NpcType);
p.WriteByte(n.NpcType);
p.WriteHexString("01"); // unknown
p.WriteShort(n.X);
p.WriteShort(n.Y);
p.WriteHexString("00"); // unknown
p.WriteShort(n.Direction);
p.WriteHexString("00 00 00 00 00 00 00 00 00"); // unknown
}
return p.GetWrittenBuffer(PacketIds.SendNpcSpawn);
}
示例13: SendSpawn12
public static byte[] SendSpawn12(Client[] Characters)
{
Packet p = new Packet(200);
p.WriteByte(0);
p.WriteByte(Characters.Length);
for (int i = 0; i < Characters.Length; i++)
{
p.WriteInt(Characters[i].MyCharacter.CharacterId);
p.WriteHexString("01 00"); // entity type, like 1 for players blabla
}
return p.GetWrittenBuffer(PacketIds.SendPlayerIdsSomething);
}
示例14: SendSpawn11
public static byte[] SendSpawn11()
{
Packet p = new Packet(200);
p.WriteHexString("2E 40 B6 00 00 0B 00 00 00 05 00 E4 4E F8 07 75 D2 06 2D 00 A8 03 00 ED 00 E4 4E 00 00 14 BE 06 8B 03 00 45 0C 00 00 45 0C 00 00 0B 80 FF E4 4E F5 07 75 B8 06 2D 00 8B 03 00 65 00 E4 4E 00 00 14 B5 06 97 03 00 45 0C 00 00 45 0C 00 00 0B 80 FF E4 4E F6 07 75 E2 06 2D 00 A0 03 00 50 00 E4 4E 00 00 18 E2 06 A0 03 00 45 0C 00 00 45 0C 00 00 0B 80 FF E4 4E F9 07 75 96 06 2D 00 8E 03 00 63 00 E4 4E 00 00 02 96 06 8E 03 00 45 0C 00 00 45 0C 00 00 0B 80 FF E4 4E F7 07 75 C8 06 2D 00 89 03 00 09 01 E4 4E 00 00 14 C3 06 5B 03 00 45 0C 00 00 45 0C 00 00 0B 80 FF");
return p.GetWrittenBuffer();
}
示例15: 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();
}