本文整理汇总了C#中Aura.Shared.Network.Packet.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.Clear方法的具体用法?C# Packet.Clear怎么用?C# Packet.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.Shared.Network.Packet
的用法示例。
在下文中一共展示了Packet.Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: System_Broadcast
public static void System_Broadcast(string from, string format, params object[] args)
{
var packet = new Packet(Op.Chat, MabiId.Broadcast);
foreach (var msg in string.Format(format, args).Chunkify(100)) // Mabi displays up to 100 chars
{
packet.PutByte(0);
packet.PutString("<{0}>", from);
packet.PutString(msg);
packet.PutByte(true);
packet.PutUInt(0xFFFF8080);
packet.PutInt(0);
packet.PutByte(0);
ChannelServer.Instance.World.Broadcast(packet);
packet.Clear(packet.Op, packet.Id);
}
}
示例2: SystemMessage
/// <summary>
/// Sends system message (special Chat) to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="from"></param>
/// <param name="format"></param>
/// <param name="args"></param>
private static void SystemMessage(Creature creature, string from, string format, params object[] args)
{
var packet = new Packet(Op.Chat, creature.EntityId);
foreach (var msg in string.Format(format, args).Chunkify(100)) // Mabi displays up to 100 chars
{
packet.PutByte(0);
packet.PutString(from);
packet.PutString(msg);
packet.PutByte(true);
packet.PutUInt(0xFFFF8080);
packet.PutInt(0);
packet.PutByte(0);
creature.Client.Send(packet);
packet.Clear(packet.Op, packet.Id);
}
}