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


C# YGOSharp.CoreMessage類代碼示例

本文整理匯總了C#中YGOSharp.CoreMessage的典型用法代碼示例。如果您正苦於以下問題:C# CoreMessage類的具體用法?C# CoreMessage怎麽用?C# CoreMessage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CoreMessage類屬於YGOSharp命名空間,在下文中一共展示了CoreMessage類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnSelectChain

        private int OnSelectChain(CoreMessage msg)
        {
            int player = msg.Reader.ReadByte();
            int count = msg.Reader.ReadByte();
            msg.Reader.ReadBytes(10 + count * 11);

            if (count > 0)
            {
                Game.WaitForResponse(player);
                SendToPlayer(msg, player);
                return 1;
            }

            Game.SetResponse(-1);
            return 0;
        }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:16,代碼來源:GameAnalyser.cs

示例2: OnTagSwap

        private void OnTagSwap(CoreMessage msg)
        {
            GameServerPacket packet = new GameServerPacket(GameMessage.TagSwap);

            int player = msg.Reader.ReadByte();
            packet.Write((byte)player);
            packet.Write(msg.Reader.ReadBytes(2));
            int count = msg.Reader.ReadByte();
            packet.Write((byte)count);
            packet.Write(msg.Reader.ReadBytes(4));

            for (int i = 0; i < count; i++)
            {
                uint code = msg.Reader.ReadUInt32();
                if ((code & 0x80000000) != 0)
                    packet.Write(code);
                else
                    packet.Write(0);
            }

            SendToPlayer(msg, player);
            Game.SendToAllBut(packet, player);

            Game.RefreshExtra(player);
            Game.RefreshMonsters(0, 0x81fff, false);
            Game.RefreshMonsters(1, 0x81fff, false);
            Game.RefreshSpells(0, 0x681fff, false);
            Game.RefreshSpells(1, 0x681fff, false);
            Game.RefreshHand(0, 0x181fff, false);
            Game.RefreshHand(1, 0x181fff, false);
        }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:31,代碼來源:GameAnalyser.cs

示例3: SendToAll

 private void SendToAll(CoreMessage msg, int length)
 {
     if (length == 0)
     {
         Game.SendToAll(new GameServerPacket(msg.Message));
         return;
     }
     msg.Reader.ReadBytes(length);
     SendToAll(msg);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:10,代碼來源:GameAnalyser.cs

示例4: OnTossCoin

 private void OnTossCoin(CoreMessage msg)
 {
     msg.Reader.ReadByte();
     int count = msg.Reader.ReadByte();
     msg.Reader.ReadBytes(count);
     SendToAll(msg);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:7,代碼來源:GameAnalyser.cs

示例5: OnAnnounceNumber

 private void OnAnnounceNumber(CoreMessage msg)
 {
     int player = msg.Reader.ReadByte();
     int count = msg.Reader.ReadByte();
     msg.Reader.ReadBytes(count * 4);
     Game.WaitForResponse(player);
     SendToPlayer(msg, player);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:8,代碼來源:GameAnalyser.cs

示例6: OnBecomeTarget

 private void OnBecomeTarget(CoreMessage msg)
 {
     int count = msg.Reader.ReadByte();
     msg.Reader.ReadBytes(count * 4);
     SendToAll(msg);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:6,代碼來源:GameAnalyser.cs

示例7: OnLpUpdate

        private void OnLpUpdate(CoreMessage msg)
        {
            int player = msg.Reader.ReadByte();
            int value = msg.Reader.ReadInt32();

            switch (msg.Message)
            {
                case GameMessage.LpUpdate:
                    Game.LifePoints[player] = value;
                    break;
                case GameMessage.PayLpCost:
                case GameMessage.Damage:
                    Game.LifePoints[player] -= value;
                    if (Game.LifePoints[player] < 0)
                        Game.LifePoints[player] = 0;
                    break;
                case GameMessage.Recover:
                    Game.LifePoints[player] += value;
                    break;
            }

            SendToAll(msg);
        }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:23,代碼來源:GameAnalyser.cs

示例8: OnShuffleHand

        private void OnShuffleHand(CoreMessage msg)
        {
            GameServerPacket packet = new GameServerPacket(msg.Message);
            int player = msg.Reader.ReadByte();
            int count = msg.Reader.ReadByte();
            packet.Write((byte)player);
            packet.Write((byte)count);

            msg.Reader.ReadBytes(count * 4);
            for (int i = 0; i < count; i++)
                packet.Write(0);

            SendToPlayer(msg, player);
            Game.SendToAllBut(packet, player);
            Game.RefreshHand(player, 0x181fff, false);
        }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:16,代碼來源:GameAnalyser.cs

示例9: OnSwapGraveDeck

 private void OnSwapGraveDeck(CoreMessage msg)
 {
     int player = msg.Reader.ReadByte();
     SendToAll(msg);
     Game.RefreshGrave(player);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:6,代碼來源:GameAnalyser.cs

示例10: OnConfirmDecktop

 private void OnConfirmDecktop(CoreMessage msg)
 {
     msg.Reader.ReadByte();
     int count = msg.Reader.ReadByte();
     msg.Reader.ReadBytes(count * 7);
     SendToAll(msg);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:7,代碼來源:GameAnalyser.cs

示例11: OnConfirmCards

        private void OnConfirmCards(CoreMessage msg)
        {
            int player = msg.Reader.ReadByte();
            int count = msg.Reader.ReadByte();
            msg.Reader.ReadBytes(count * 7);

            byte[] buffer = msg.CreateBuffer();
            GameServerPacket packet = new GameServerPacket(msg.Message);
            packet.Write(buffer);
            if ((CardLocation)buffer[7] == CardLocation.Hand)
                Game.SendToAll(packet);
            else
                Game.CurPlayers[player].Send(packet);
        }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:14,代碼來源:GameAnalyser.cs

示例12: OnSortCard

 private void OnSortCard(CoreMessage msg)
 {
     int player = msg.Reader.ReadByte();
     int count = msg.Reader.ReadByte();
     msg.Reader.ReadBytes(count * 7);
     Game.WaitForResponse(player);
     SendToPlayer(msg, player);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:8,代碼來源:GameAnalyser.cs

示例13: OnSelectSum

 private void OnSelectSum(CoreMessage msg)
 {
     msg.Reader.ReadByte();
     int player = msg.Reader.ReadByte();
     msg.Reader.ReadBytes(6);
     int count = msg.Reader.ReadByte();
     msg.Reader.ReadBytes(count * 11);
     Game.WaitForResponse(player);
     SendToPlayer(msg, player);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:10,代碼來源:GameAnalyser.cs

示例14: OnSelectPlace

 private void OnSelectPlace(CoreMessage msg)
 {
     int player = msg.Reader.ReadByte();
     msg.Reader.ReadBytes(5);
     Game.WaitForResponse(player);
     SendToPlayer(msg, player);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:7,代碼來源:GameAnalyser.cs

示例15: OnCardSelected

 private void OnCardSelected(CoreMessage msg)
 {
     msg.Reader.ReadByte();
     int count = msg.Reader.ReadByte();
     msg.Reader.ReadBytes(count * 4);
 }
開發者ID:Ygocore,項目名稱:ygosharp_v0.1.1,代碼行數:6,代碼來源:GameAnalyser.cs


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