本文整理汇总了C#中PacketWriter.WriteSByte方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteSByte方法的具体用法?C# PacketWriter.WriteSByte怎么用?C# PacketWriter.WriteSByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteSByte方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateBuff
/// <summary>
/// Returns 'Login' packet buffer
/// </summary>
/// <returns></returns>
public byte[] CreateBuff()
{
byte[] packet_base = new byte[0x2F]; // Create our null byte array
PacketWriter PW = new PacketWriter(packet_base); // Initialize the writer
PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(packet_base.Length, 1009)); // Write the packet header
PW.WriteSByte(5, 1); // I don't know yet what is it
if (sessionkey.Length > 17 || sessionkey.Length < 17) // Session is and will always be 17 lenght long,
{ // so if its not.. you did something wrong.
Error.Invoke("Session key: '" + sessionkey + "' is too long, can't connect player."); // Optional
return null; // Returns null. Packet failed to create
}
else
{
PW.WriteString(9, sessionkey); // Write the player's auth key
PW.WriteInt32(42, 700); // I don't know yet what is it - idle time?
PW.WriteSByte(46, 1); // I don't know yet what is it
}
return packet_base;
}