本文整理汇总了C#中DOL.GS.PacketHandler.GSTCPPacketOut.Close方法的典型用法代码示例。如果您正苦于以下问题:C# GSTCPPacketOut.Close方法的具体用法?C# GSTCPPacketOut.Close怎么用?C# GSTCPPacketOut.Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOL.GS.PacketHandler.GSTCPPacketOut
的用法示例。
在下文中一共展示了GSTCPPacketOut.Close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendUpdatePlayerSkills
//.........这里部分代码省略.........
if (skill.Name == Abilities.VampiirConstitution ||
skill.Name == Abilities.VampiirDexterity ||
skill.Name == Abilities.VampiirStrength)
str = " +" + ((m_gameClient.Player.Level - 5)*3);
else if (skill.Name == Abilities.VampiirQuickness)
str = " +" + ((m_gameClient.Player.Level - 5)*2);
}
pak.WritePascalString(skill.Name + str);
}
foreach (Style style in styles)
{
m_styleId[(int) style.ID] = i++;
CheckLengthHybridSkillsPacket(ref pak, ref maxSkills, ref firstSkills);
//DOLConsole.WriteLine("style sended "+style.Name);
pak.WriteByte(0); // no level for style
pak.WriteByte((byte) eSkillPage.Styles);
int pre = 0;
switch (style.OpeningRequirementType)
{
case Style.eOpening.Offensive:
pre = 0 + (int) style.AttackResultRequirement; // last result of our attack against enemy
// hit, miss, target blocked, target parried, ...
if (style.AttackResultRequirement == Style.eAttackResult.Style)
pre |= ((100 + (int) m_styleId[style.OpeningRequirementValue]) << 8);
break;
case Style.eOpening.Defensive:
pre = 100 + (int) style.AttackResultRequirement; // last result of enemies attack against us
// hit, miss, you block, you parry, ...
break;
case Style.eOpening.Positional:
pre = 200 + style.OpeningRequirementValue;
break;
}
// style required?
if (pre == 0)
{
pre = 0x100;
}
pak.WriteShort((ushort) pre);
pak.WriteByte(0); // bonus
pak.WriteShort((ushort) style.Icon);
pak.WritePascalString(style.Name);
}
if (sendHybridList)
{
Dictionary<string, KeyValuePair<Spell, SpellLine>> spells = m_gameClient.Player.GetUsableSpells(spelllines, false);
foreach (var spell in spells)
{
CheckLengthHybridSkillsPacket(ref pak, ref maxSkills, ref firstSkills);
int spec_index = specs.IndexOf(m_gameClient.Player.GetSpecialization(spell.Value.Value.Spec));
if (spec_index == -1)
spec_index = 0xFE; // Nightshade special value
pak.WriteByte((byte) spell.Value.Key.Level);
if (spell.Value.Key.InstrumentRequirement == 0)
{
pak.WriteByte((byte) eSkillPage.Spells);
pak.WriteByte(0);
pak.WriteByte((byte) spec_index);
}
else
{
pak.WriteByte((byte) eSkillPage.Songs);
pak.WriteByte(0);
pak.WriteByte(0xFF);
}
pak.WriteByte(0);
pak.WriteShort(spell.Value.Key.Icon);
pak.WritePascalString(spell.Value.Key.Name);
}
}
}
}
}
if (pak.Length > 7)
{
pak.Position = 4;
pak.WriteByte((byte) (maxSkills - firstSkills)); //number of entry
pak.WriteByte(0x03); //subtype
pak.WriteByte((byte) firstSkills);
SendTCP(pak);
}
SendNonHybridSpellLines();
}
}
finally
{
pak.Close();
}
}