本文整理汇总了C#中PacketWriter.WriteShort方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteShort方法的具体用法?C# PacketWriter.WriteShort怎么用?C# PacketWriter.WriteShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteShort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public override void Serialize(PacketWriter writer, bool prefix)
{
writer.WriteShort((short)ServerRules.Length);
foreach (var rule in ServerRules) {
writer.WriteString(rule.CVar);
writer.WriteString(rule.Value);
}
}
示例2: OnHandshake
public void OnHandshake(short major, string minor, byte locale)
{
Logger.Write(LogLevel.Info, "Logging in...");
if (LoginServer)
{
PacketWriter p = new PacketWriter((short)SendOps.LOGIN_PASSWORD);
p.WriteMapleString(Constants.Username);
p.WriteMapleString(Constants.Password);
Socket.Send(p);
}
else
{
PacketWriter p = new PacketWriter((short)SendOps.PLAYER_LOGGEDIN, 8);
p.WriteInt(Player.Id);
p.WriteShort();
Socket.Send(p);
}
}
示例3: Move
public void Move(int x, int y)
{
PacketWriter p = new PacketWriter((short)SendOps.MOVE_PLAYER);
p.WriteZero(9); //skipped in moopledev
p.WriteByte(1); //loop count
p.WriteByte(11); //Chair ;)
p.WriteShort((short)x);
p.WriteShort((short)y);
p.WriteShort(); //fh
p.WriteByte(4); //stance
p.WriteShort(10000); //duration
//no trail bc un parsed in moopledev
//X = x;
//Y = y;
MainGame.Instance.Socket.Send(p);
}