本文整理汇总了C#中MabiPacket.GetByte方法的典型用法代码示例。如果您正苦于以下问题:C# MabiPacket.GetByte方法的具体用法?C# MabiPacket.GetByte怎么用?C# MabiPacket.GetByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MabiPacket
的用法示例。
在下文中一共展示了MabiPacket.GetByte方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Prepare
public override SkillResults Prepare(MabiCreature creature, MabiSkill skill, MabiPacket packet, uint castTime)
{
var itemId = packet.GetLong();
var title = packet.GetString();
var author = packet.GetString();
var mml = packet.GetString();
var singing = packet.GetString(); // [180300, NA166 (18.09.2013)] Singing
var hidden = packet.GetByte();
var item = creature.GetItem(itemId);
if (item == null)
return SkillResults.Failure;
var mmlParts = mml.Split(',');
// Check total score length
if (mml.Length > MMLMaxLength)
return SkillResults.Failure;
// Melody length
if (mmlParts[0].Length > skill.RankInfo.Var1)
return SkillResults.Failure;
// Harmony 1 length
if (mmlParts.Length > 1 && mmlParts[1].Length > skill.RankInfo.Var2)
return SkillResults.Failure;
// Harmony 2 length
if (mmlParts.Length > 2 && mmlParts[2].Length > skill.RankInfo.Var3)
return SkillResults.Failure;
creature.Temp.SkillItem1 = item;
var level = SkillRank.Novice;
// Score level = Musical Knowledge rank
var knowledge = creature.Skills.Get(SkillConst.MusicalKnowledge);
if (knowledge != null)
level = knowledge.Rank;
item.Tags.SetString("TITLE", title);
item.Tags.SetString("AUTHOR", author);
item.Tags.SetString("SCORE", MabiZip.Compress(mml));
item.Tags.SetString("SCSING", ""); // [180300, NA166 (18.09.2013)] Singing
item.Tags.SetByte("HIDDEN", hidden);
item.Tags.SetShort("LEVEL", (ushort)level);
Send.SkillUse(creature.Client, creature, skill.Id, itemId);
return SkillResults.Okay;
}
示例2: Use
public override SkillResults Use(MabiCreature creature, MabiSkill skill, MabiPacket packet)
{
if (creature.Temp.SkillItem1 == null || creature.Temp.SkillItem2 == null)
return SkillResults.Failure;
var part = packet.GetInt();
// Regular
if (packet.GetElementType() == ElementType.Short)
{
var x = packet.GetShort();
var y = packet.GetShort();
Send.SkillUseDye(creature.Client, creature, skill.Id, part, x, y);
}
// Fixed
else if (packet.GetElementType() == ElementType.Byte)
{
var unk = packet.GetByte();
Send.SkillUseDye(creature.Client, creature, skill.Id, part, unk);
}
return SkillResults.Okay;
}