本文整理汇总了C#中Framework.Network.Packets.PacketWriter.WriteInt16方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteInt16方法的具体用法?C# PacketWriter.WriteInt16怎么用?C# PacketWriter.WriteInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework.Network.Packets.PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteInt16方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleUpdateTalentData
public static void HandleUpdateTalentData(ref WorldClass session)
{
var pChar = session.Character;
const byte glyphCount = 6;
PacketWriter updateTalentData = new PacketWriter(ServerMessage.UpdateTalentData);
BitPack BitPack = new BitPack(updateTalentData);
BitPack.Write(pChar.SpecGroupCount, 19);
for (int i = 0; i < pChar.SpecGroupCount; i++)
{
var talents = SpecializationMgr.GetTalentsBySpecGroup(pChar, (byte)i);
BitPack.Write(talents.Count, 23);
}
BitPack.Flush();
for (int i = 0; i < pChar.SpecGroupCount; i++)
{
var talents = SpecializationMgr.GetTalentsBySpecGroup(pChar, (byte)i);
var specId = (i == 0) ? pChar.PrimarySpec : pChar.SecondarySpec;
for (int j = 0; j < glyphCount; j++)
updateTalentData.WriteInt16(0); // Glyph Id
for (int j = 0; j < talents.Count; j++)
updateTalentData.WriteUInt16(talents[j].Id); // Talent Id
updateTalentData.WriteUInt32(specId); // Spec Id
}
updateTalentData.WriteUInt8(pChar.ActiveSpecGroup); // Active Spec (0 or 1)
session.Send(ref updateTalentData);
}
示例2: HandleTalentUpdate
public static void HandleTalentUpdate(ref WorldClass session)
{
var pChar = session.Character;
const byte glyphCount = 6;
PacketWriter writer = new PacketWriter();
writer.WriteUInt8((byte)pChar.SpecGroupCount); // Spec Count (Default 1)
writer.WriteUInt8((byte)pChar.ActiveSpecGroup); // Active Spec (0 or 1)
for (int i = 0; i < pChar.SpecGroupCount; i++)
{
var specId = (i == 0) ? pChar.PrimarySpec : pChar.SecondarySpec;
writer.WriteUInt32(specId); // Spec Id
var talents = SpecializationMgr.GetTalentsBySpecGroup(pChar, (byte)i);
writer.WriteUInt8((byte)talents.Count); // Spent Talent Row Count
for (int j = 0; j < talents.Count; j++)
writer.WriteUInt16(talents[j].Id); // Talent Id
writer.WriteUInt8(glyphCount); // Glyph Count - NYI
for (int j = 0; j < glyphCount; j++)
writer.WriteInt16(0); // Glyph Id - NYI
}
session.Send(ref writer);
}