本文整理汇总了C#中MabiPacket.PutLong方法的典型用法代码示例。如果您正苦于以下问题:C# MabiPacket.PutLong方法的具体用法?C# MabiPacket.PutLong怎么用?C# MabiPacket.PutLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MabiPacket
的用法示例。
在下文中一共展示了MabiPacket.PutLong方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CombatTargetSet
public static void CombatTargetSet(MabiCreature creature, MabiCreature target)
{
var packet = new MabiPacket(Op.CombatTargetSet, creature.Id);
packet.PutLong(target != null ? target.Id : 0);
WorldManager.Instance.Broadcast(packet, SendTargets.Range, creature);
}
示例2: Close
public virtual void Close(WorldClient client, string message = "<end/>")
{
var p = new MabiPacket(Op.NPCTalkEndR, client.Character.Id);
p.PutByte(1);
p.PutLong(client.NPCSession.Target.Id);
p.PutString(message);
client.Send(p);
}
示例3: ConfirmMailRecipentResponse
public static void ConfirmMailRecipentResponse(WorldClient client, bool success, ulong recipientId)
{
var packet = new MabiPacket(Op.ConfirmMailRecipentR, client.Character.Id);
packet.PutByte(success);
if (success)
packet.PutLong(recipientId);
client.Send(packet);
}
示例4: GetMailsResponse
public static void GetMailsResponse(WorldClient client, IEnumerable<MabiMail> mails)
{
var p = new MabiPacket(Op.GetMailsR, client.Character.Id);
foreach (var mail in mails)
p.Add(mail);
p.PutLong(0);
client.Send(p);
}
示例5: ItemAmount
/// <summary>
/// Sends ItemAmount to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="item"></param>
public static void ItemAmount(MabiCreature creature, MabiItem item)
{
var packet = new MabiPacket(Op.ItemAmount, creature.Id);
packet.PutLong(item.Id);
packet.PutShort(item.Info.Amount);
packet.PutByte(2); // ? (related to the 2 in move item?)
creature.Client.Send(packet);
}
示例6: NPCTalkStartResponse
public static void NPCTalkStartResponse(WorldClient client, bool success, ulong npcId)
{
var packet = new MabiPacket(Op.NPCTalkStartR, client.Character.Id);
packet.PutByte(success);
if (success)
packet.PutLong(npcId);
client.Send(packet);
}
示例7: LoginResponse
/// <summary>
/// Sends positive login response.
/// </summary>
/// <param name="client"></param>
/// <param name="creature"></param>
public static void LoginResponse(Client client, MabiCreature creature)
{
var packet = new MabiPacket(Op.WorldLoginR, Id.World);
packet.PutByte(true);
packet.PutLong(creature.Id);
packet.PutLong(MabiTime.Now.DateTime);
packet.PutInt(1);
packet.PutString("");
client.Send(packet);
}
示例8: RecallMailResponse
public static void RecallMailResponse(WorldClient client, bool success, ulong mailId)
{
var packet = new MabiPacket(Op.RecallMailR, client.Character.Id);
packet.PutByte(success);
if (success)
{
packet.PutByte(success);
packet.PutLong(mailId);
}
client.Send(packet);
}
示例9: NPCTalkPartnerStartResponse
public static void NPCTalkPartnerStartResponse(WorldClient client, bool success, ulong id, string partnerName)
{
var packet = new MabiPacket(Op.NPCTalkPartnerR, client.Character.Id);
packet.PutByte(success);
if (success)
{
packet.PutLong(id);
packet.PutString(client.Character.Name + "'s " + partnerName);
packet.PutString(client.Character.Name + "'s " + partnerName);
client.Send(packet);
}
client.Send(packet);
}
示例10: AddMemberPacket
public void AddMemberPacket(MabiPacket packet, MabiCreature member)
{
if (!Members.Contains(member))
return;
packet.PutInt(this.GetMemberNumber(member));
packet.PutLong(member.Id);
packet.PutString(member.Name);
packet.PutByte(1); // ?
packet.PutInt(member.Region);
MabiVertex loc = member.GetPosition();
packet.PutInt(loc.X);
packet.PutInt(loc.Y);
packet.PutByte(0); // ?
packet.PutInt((uint)((member.Life * 100) / member.LifeMax));
packet.PutInt((uint)member.LifeMax);
packet.PutLong(0); // ?
}
示例11: ViewEquipmentResponse
/// <summary>
/// Sends view equipment to client. Response is negative if items is null.
/// </summary>
/// <param name="client"></param>
/// <param name="targetId"></param>
/// <param name="items"></param>
public static void ViewEquipmentResponse(WorldClient client, ulong targetId, IEnumerable<MabiItem> items)
{
var packet = new MabiPacket(Op.ViewEquipmentR, client.Character.Id);
if (items != null)
{
packet.PutByte(true);
packet.PutLong(targetId);
packet.PutInt((ushort)items.Count());
foreach (var item in items)
packet.AddItemInfo(item, ItemPacketType.Private);
}
else
{
packet.PutByte(false);
}
client.Send(packet);
}
示例12: EnterRegionPermission
/// <summary>
/// Sends enter region permission, which kinda makes the client warp.
/// </summary>
/// <param name="client"></param>
/// <param name="creature"></param>
/// <param name="permission"></param>
public static void EnterRegionPermission(WorldClient client, MabiCreature creature, bool permission = true)
{
var pos = creature.GetPosition();
var p = new MabiPacket(Op.EnterRegionPermission, Id.World);
p.PutLong(creature.Id);
p.PutByte(permission);
if (permission)
{
p.PutInt(creature.Region);
p.PutInt(pos.X);
p.PutInt(pos.Y);
}
client.Send(p);
}
示例13: StatusEffectUpdate
/// <summary>
/// Broadcasts current conditions of creature.
/// </summary>
/// <param name="wm"></param>
/// <param name="creature"></param>
public static void StatusEffectUpdate(MabiCreature creature)
{
var packet = new MabiPacket(Op.StatusEffectUpdate, creature.Id);
packet.PutLong((ulong)creature.Conditions.A);
packet.PutLong((ulong)creature.Conditions.B);
packet.PutLong((ulong)creature.Conditions.C);
// [150100] New conditions list
{
packet.PutLong((ulong)creature.Conditions.D);
}
packet.PutInt(0);
WorldManager.Instance.Broadcast(packet, SendTargets.Range, creature);
}
示例14: ItemRemove
/// <summary>
/// Sends ItemRemove to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="item"></param>
public static void ItemRemove(MabiCreature creature, MabiItem item)
{
var packet = new MabiPacket(Op.ItemRemove, creature.Id);
packet.PutLong(item.Id);
packet.PutByte(item.Info.Pocket);
creature.Client.Send(packet);
}
示例15: CutsceneStart
public static void CutsceneStart(WorldClient client, MabiCutscene cutscene)
{
var p = new MabiPacket(Op.CutsceneStart, Id.World);
p.PutLongs(client.Character.Id, cutscene.Leader.Id);
p.PutString(cutscene.Name);
p.PutSInt(cutscene.Actors.Count);
foreach (var a in cutscene.Actors)
{
p.PutString(a.Item1);
p.PutShort((ushort)a.Item2.Length);
p.PutBin(a.Item2);
}
p.PutInt(1);
p.PutLong(client.Character.Id);
client.Send(p);
}