本文整理汇总了C#中WindBot.Game.Network.GameServerPacket.SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# GameServerPacket.SetPosition方法的具体用法?C# GameServerPacket.SetPosition怎么用?C# GameServerPacket.SetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindBot.Game.Network.GameServerPacket
的用法示例。
在下文中一共展示了GameServerPacket.SetPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnUpdateData
private void OnUpdateData(GameServerPacket packet)
{
int player = GetLocalPlayer(packet.ReadByte());
CardLocation loc = (CardLocation)packet.ReadByte();
IList<ClientCard> cards = null;
switch (loc)
{
case CardLocation.Hand:
cards = _duel.Fields[player].Hand;
break;
case CardLocation.MonsterZone:
cards = _duel.Fields[player].MonsterZone;
break;
case CardLocation.SpellZone:
cards = _duel.Fields[player].SpellZone;
break;
case CardLocation.Grave:
cards = _duel.Fields[player].Graveyard;
break;
case CardLocation.Removed:
cards = _duel.Fields[player].Banished;
break;
case CardLocation.Deck:
cards = _duel.Fields[player].Deck;
break;
case CardLocation.Extra:
cards = _duel.Fields[player].ExtraDeck;
break;
}
if (cards != null)
{
foreach (ClientCard card in cards)
{
try{
int len = packet.ReadInt32();
if (len < 8) continue;
long pos = packet.GetPosition();
card.Update(packet, _duel);
packet.SetPosition(pos + len - 4);
}catch(Exception){
}
}
}
}