本文整理汇总了C#中MabiPacket.PutInt方法的典型用法代码示例。如果您正苦于以下问题:C# MabiPacket.PutInt方法的具体用法?C# MabiPacket.PutInt怎么用?C# MabiPacket.PutInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MabiPacket
的用法示例。
在下文中一共展示了MabiPacket.PutInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EffectDelayed
/// <summary>
/// Broadcasts Effect packet in range. Parameters can be added,
/// but you have to watch the types.
/// </summary>
/// <param name="delay">Delay in milliseconds</param>
public static void EffectDelayed(uint effect, uint delay, MabiEntity source, params object[] args)
{
var packet = new MabiPacket(Op.EffectDelayed, source.Id);
packet.PutInt(delay);
packet.PutInt(effect);
foreach (var arg in args)
{
if (!(arg is bool))
packet.Put(arg);
else
packet.PutByte((bool)arg);
}
WorldManager.Instance.Broadcast(packet, SendTargets.Range, source);
}
示例2: AcquireStat
public static MabiPacket AcquireStat(MabiCreature creature, string statName, double amount)
{
var p = new MabiPacket(Op.AcquireInfo, creature.Id);
p.PutString("<xml type='{0}' value='{1}' simple='true' onlyLog='false' />", statName, (uint)amount);
p.PutInt(3000);
return p;
}
示例3: AcquireAp
public static MabiPacket AcquireAp(MabiCreature creature, uint amount)
{
var p = new MabiPacket(Op.AcquireInfo, creature.Id);
p.PutString("<xml type='ap' value='{0}' simple='true' onlyLog='false' />", amount);
p.PutInt(3000);
return p;
}
示例4: AcquireExp
public static MabiPacket AcquireExp(MabiCreature creature, uint amount)
{
var p = new MabiPacket(Op.AcquireInfo, creature.Id);
p.PutString("<xml type='exp' value='{0}'/>", amount);
p.PutInt(3000);
return p;
}
示例5: AcquireItem
public static MabiPacket AcquireItem(MabiCreature creature, uint cls, uint amount)
{
var p = new MabiPacket(Op.AcquireInfo, creature.Id);
p.PutString("<xml type='item' classid='{0}' value='{1}'/>", cls, amount);
p.PutInt(3000);
return p;
}
示例6: AcquireDyedItem
/// <summary>
/// Sends item box packet for fixed dyed item to client.
/// </summary>
/// <param name="client"></param>
/// <param name="creature"></param>
/// <param name="itemId"></param>
public static void AcquireDyedItem(Client client, MabiCreature creature, ulong itemId)
{
var packet = new MabiPacket(Op.AcquireInfo2, creature.Id);
packet.PutString("<xml type='fixed_color_dyeing' objectid='{0}'/>", itemId);
packet.PutInt(3000);
client.Send(packet);
}
示例7: DyeSkillComplete
/// <summary>
/// Fixed dye complete
/// </summary>
/// <param name="client"></param>
/// <param name="creature"></param>
/// <param name="skillId"></param>
/// <param name="part"></param>
public static void DyeSkillComplete(Client client, MabiCreature creature, SkillConst skillId, uint part)
{
var packet = new MabiPacket(Op.SkillComplete, creature.Id);
packet.PutShort((ushort)skillId);
packet.PutInt(part);
client.Send(packet);
}
示例8: ConvertGpR
/// <summary>
/// Sends ConvertGpR to creature's client.
/// </summary>
public static void ConvertGpR(MabiCreature creature, bool success, uint amount)
{
var packet = new MabiPacket(Op.ConvertGpR, creature.Id);
packet.PutByte(success);
packet.PutInt(amount);
creature.Client.Send(packet);
}
示例9: AcceptGiftResponse
/// <summary>
/// Sends response to accept gift. Response will be negative if gift is null.
/// </summary>
/// <param name="client"></param>
/// <param name="gift"></param>
public static void AcceptGiftResponse(LoginClient client, Gift gift)
{
var packet = new MabiPacket(Op.AcceptGiftR, Id.Login);
if (gift != null)
{
packet.PutByte(true);
packet.PutByte(gift.IsCharacter);
packet.PutInt(0); // ?
packet.PutInt(0); // ?
packet.PutInt(gift.Type);
// ?
}
else
{
packet.PutByte(false);
}
client.Send(packet);
}
示例10: GuildMembershipChanged
/// <summary>
/// Sends info on guild membership status changed. Pass null for guild to remove.
/// </summary>
/// <param name="guild"></param>
/// <param name="creature"></param>
/// <returns></returns>
public static MabiPacket GuildMembershipChanged(MabiGuild guild, MabiCreature creature, GuildMemberRank rank = GuildMemberRank.Member)
{
var p = new MabiPacket(Op.GuildMembershipChanged, creature.Id);
if (guild == null)
{
p.PutInt(0);
}
else
{
p.PutInt(1);
p.PutString(guild.Name);
p.PutLong(guild.Id);
p.PutInt((uint)rank); // (5) Member Rank?
p.PutByte(0);
}
return p;
}
示例11: 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); // ?
}
示例12: DeadFeather
/// <summary>
/// Broadcasts Phoenix Feather above dead creature effect in creature's range.
/// </summary>
/// <param name="client"></param>
/// <param name="creature"></param>
public static void DeadFeather(MabiCreature creature, DeadMenuOptions options)
{
var bits = (uint)options;
var flags = new List<uint>();
// Break down options bit by bit, and add them to flags if set.
for (uint i = 1; bits != 0; ++i, bits >>= 1)
{
if ((bits & 1) != 0)
flags.Add(i);
}
var packet = new MabiPacket(Op.DeadFeather, creature.Id);
packet.PutShort((ushort)flags.Count);
foreach (var f in flags)
packet.PutInt(f);
packet.PutByte(0);
WorldManager.Instance.Broadcast(packet, SendTargets.Range, creature);
}
示例13: OpenNPCShop
public static void OpenNPCShop(WorldClient client, MabiShop shop)
{
var packet = new MabiPacket(Op.OpenNPCShop, client.Character.Id);
packet.PutString("shopname");
packet.PutByte(0);
packet.PutByte(0);
packet.PutInt(0);
packet.PutByte((byte)shop.Tabs.Count);
for (var i = 0; i < shop.Tabs.Count; ++i)
{
packet.PutString("[{0}]{1}", i, shop.Tabs[i].Name);
// [160200] ?
{
packet.PutByte(0);
}
packet.PutShort((ushort)shop.Tabs[i].Items.Count);
foreach (var item in shop.Tabs[i].Items)
packet.AddItemInfo(item, ItemPacketType.Private);
}
client.Send(packet);
}
示例14: 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);
}
示例15: UnreadMailCount
public static void UnreadMailCount(Client client, MabiCreature creature, uint count)
{
var packet = new MabiPacket(Op.UnreadMailCount, creature.Id);
packet.PutInt(count);
client.Send(packet);
}