本文整理汇总了C#中MabiPacket.PutString方法的典型用法代码示例。如果您正苦于以下问题:C# MabiPacket.PutString方法的具体用法?C# MabiPacket.PutString怎么用?C# MabiPacket.PutString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MabiPacket
的用法示例。
在下文中一共展示了MabiPacket.PutString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Chat
public static void Chat(MabiCreature creature, byte type, string format, params object[] args)
{
var packet = new MabiPacket(Op.Chat, creature.Id);
packet.PutByte(type);
packet.PutString(creature.Name);
packet.PutString(format, args);
WorldManager.Instance.Broadcast(packet, SendTargets.Range, creature);
}
示例2: 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);
}
示例3: PlaySound
/// <summary>
/// Plays sound in range of source.
/// </summary>
/// <param name="file">e.g. "data/sound/Glasgavelen_blowaway_endure.wav"</param>
public static void PlaySound(string file, MabiEntity source)
{
var packet = new MabiPacket(Op.PlaySound, source.Id);
packet.PutString(file);
WorldManager.Instance.Broadcast(packet, SendTargets.Range, source);
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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);
}
示例9: 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);
}
示例10: NPCTalkKeywordResponse
public static void NPCTalkKeywordResponse(WorldClient client, bool success, string keyword)
{
var packet = new MabiPacket(Op.NPCTalkKeywordR, client.Character.Id);
packet.PutByte(success);
if (success)
packet.PutString(keyword);
client.Send(packet);
}
示例11: 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);
}
示例12: 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); // ?
}
示例13: GetWeatherPacket
public MabiPacket GetWeatherPacket(uint region, float from, float to, uint transitionTime = Transition)
{
var p = new MabiPacket(Op.Weather, Id.Broadcast);
p.PutByte(0);
p.PutInt(region);
p.PutByte(2);
p.PutByte(0);
p.PutByte(1);
p.PutString("constant_smooth");
p.PutFloat(to);
p.PutLong(DateTime.Now);
p.PutLong(DateTime.MinValue);
p.PutFloat(from);
p.PutFloat(from);
p.PutLong(transitionTime);
p.PutByte(false);
p.PutLong(DateTime.MinValue);
p.PutInt(2);
p.PutByte(0);
return p;
}
示例14: MsgBox
public static void MsgBox(Client client, MabiCreature creature, string title, MsgBoxButtons buttons, MsgBoxAlign align, string format, params object[] args)
{
var packet = new MabiPacket(Op.MsgBox, creature.Id);
packet.PutString(format, args);
// Can be sent with the title enum as byte as well.
packet.PutString(title);
packet.PutByte((byte)buttons);
packet.PutByte((byte)align);
client.Send(packet);
}
示例15: PlayEffect
/// <summary>
/// Playing instrument effect (sound and motion) for creature,
/// based on the given MML code.
/// </summary>
/// <param name="creature"></param>
/// <param name="instrument"></param>
/// <param name="quality"></param>
/// <param name="compressedMML"></param>
/// <returns></returns>
public static MabiPacket PlayEffect(MabiCreature creature, InstrumentType instrument, PlayingQuality quality, string compressedMML)
{
var p = new MabiPacket(Op.Effect, creature.Id);
p.PutInt(Effect.PlayMusic);
p.PutByte(true); // has scroll
p.PutString(compressedMML);
p.PutInt(0);
p.PutShort(0);
p.PutInt(14113); // ?
p.PutByte((byte)quality);
p.PutByte((byte)instrument);
p.PutByte(0);
p.PutByte(0);
p.PutByte(1); // loops
return p;
}