當前位置: 首頁>>代碼示例>>C#>>正文


C# GameServerPacket.ReadSByte方法代碼示例

本文整理匯總了C#中WindBot.Game.Network.GameServerPacket.ReadSByte方法的典型用法代碼示例。如果您正苦於以下問題:C# GameServerPacket.ReadSByte方法的具體用法?C# GameServerPacket.ReadSByte怎麽用?C# GameServerPacket.ReadSByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WindBot.Game.Network.GameServerPacket的用法示例。


在下文中一共展示了GameServerPacket.ReadSByte方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnPosChange

		private void OnPosChange(GameServerPacket packet)
		{
			packet.ReadInt32(); // card id
			int pc = GetLocalPlayer(packet.ReadByte());
			int pl = packet.ReadByte();
			int ps = packet.ReadSByte();
			packet.ReadSByte(); // pp
			int cp = packet.ReadSByte();
			ClientCard card = _duel.GetCard(pc, (CardLocation)pl, ps);
			if (card != null)
				card.Position = cp;
		}
開發者ID:247321453,項目名稱:YgoServer,代碼行數:12,代碼來源:GameBehavior.cs

示例2: OnChaining

		private void OnChaining(GameServerPacket packet)
		{
			packet.ReadInt32(); // card id
			int pcc = GetLocalPlayer(packet.ReadByte());
			int pcl = packet.ReadByte();
			int pcs = packet.ReadSByte();
			int subs = packet.ReadSByte();
			ClientCard card = _duel.GetCard(pcc, pcl, pcs, subs);
			int cc = GetLocalPlayer(packet.ReadByte());
			_ai.OnChaining(card, cc);
		}
開發者ID:247321453,項目名稱:YgoServer,代碼行數:11,代碼來源:GameBehavior.cs

示例3: OnMove

		private void OnMove(GameServerPacket packet)
		{
			int cardId = packet.ReadInt32();
			int pc = GetLocalPlayer(packet.ReadByte());
			int pl = packet.ReadByte();
			int ps = packet.ReadSByte();
			packet.ReadSByte(); // pp
			int cc = GetLocalPlayer(packet.ReadByte());
			int cl = packet.ReadByte();
			int cs = packet.ReadSByte();
			int cp = packet.ReadSByte();
			packet.ReadInt32(); // reason

			ClientCard card = _duel.GetCard(pc, (CardLocation)pl, ps);

			if ((pl & (int)CardLocation.Overlay) != 0)
			{
				pl = pl & 0x7f;
				card = _duel.GetCard(pc, (CardLocation)pl, ps);
				if (card != null)
					card.Overlays.Remove(cardId);
			}
			else
				_duel.RemoveCard((CardLocation)pl, card, pc, ps);

			if ((cl & (int)CardLocation.Overlay) != 0)
			{
				cl = cl & 0x7f;
				card = _duel.GetCard(cc, (CardLocation)cl, cs);
				if (card != null)
					card.Overlays.Add(cardId);
			}
			else
			{
				_duel.AddCard((CardLocation)cl, cardId, cc, cs, cp);
				if ((pl & (int)CardLocation.Overlay) == 0 && card != null)
				{
					ClientCard newcard = _duel.GetCard(cc, (CardLocation)cl, cs);
					if (newcard != null)
						newcard.Overlays.AddRange(card.Overlays);
				}
			}
		}
開發者ID:247321453,項目名稱:YgoServer,代碼行數:43,代碼來源:GameBehavior.cs


注:本文中的WindBot.Game.Network.GameServerPacket.ReadSByte方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。