本文整理汇总了C#中PacketWriter.WriteFixedLengthASCII方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteFixedLengthASCII方法的具体用法?C# PacketWriter.WriteFixedLengthASCII怎么用?C# PacketWriter.WriteFixedLengthASCII使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteFixedLengthASCII方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Build
public override byte[] Build()
{
var writer = new PacketWriter();
// Player header
writer.WritePlayerHeader((uint) _character.Player.PlayerId);
// Spawn position
writer.Write(Position);
writer.Write((ushort) 0); // padding?
writer.WriteFixedLengthASCII("Character", 32);
writer.Write((ushort) 1); // 0x44
writer.Write((ushort) 0); // 0x46
writer.Write((uint) 602); // 0x48
writer.Write((uint) 1); // 0x4C
writer.Write((uint) 53); // 0x50
writer.Write((uint) 0); // 0x54
writer.Write((uint) (IsItMe ? 47 : 39)); // 0x58
writer.Write((ushort) 559); // 0x5C
writer.Write((ushort) 306); // 0x5E
writer.Write((uint) _character.Player.PlayerId); // player ID copy
writer.Write((uint) 0); // "char array ugggghhhhh" according to PolarisLegacy
writer.Write((uint) 0); // "voiceParam_unknown4"
writer.Write((uint) 0); // "voiceParam_unknown8"
writer.WriteFixedLengthUtf16(_character.Name, 16);
writer.Write((uint) 0); // 0x90
writer.WriteStruct(_character.Looks);
writer.WriteStruct(_character.Jobs);
writer.WriteFixedLengthUtf16("", 32); // title?
writer.Write((uint) 0); // 0x204
writer.Write((uint) 0); // gmflag?
writer.WriteFixedLengthUtf16(_character.Player.Nickname, 16); // nickname, maybe not 16 chars?
for (var i = 0; i < 64; i++)
writer.Write((byte) 0);
return writer.ToArray();
}