Shuffled() 공개 메소드

Part of a shuffle process.
public Shuffled ( Octgn.Play.Player player, Octgn.Play.Group group, int card, short pos ) : void
player Octgn.Play.Player
group Octgn.Play.Group The group being shuffled.
card int An array containing the CardIdentity ids to shuffle.
pos short
리턴 void
예제 #1
0
        public void Parse(byte[] data)
        {
            MemoryStream stream = new MemoryStream(data);
            BinaryReader reader = new BinaryReader(stream);
            short        length;

            Program.Client.Muted = reader.ReadInt32();
            byte method = reader.ReadByte();

            switch (method)
            {
            case 0:
            {
                handler.Binary();
                break;
            }

            case 1:
            {
                string arg0 = reader.ReadString();
                handler.Error(arg0);
                break;
            }

            case 3:
            {
                string arg0 = reader.ReadString();
                handler.Kick(arg0);
                break;
            }

            case 6:
            {
                byte arg0 = reader.ReadByte();
                Guid arg1 = new Guid(reader.ReadBytes(16));
                bool arg2 = reader.ReadBoolean();
                handler.Welcome(arg0, arg1, arg2);
                break;
            }

            case 7:
            {
                bool arg0 = reader.ReadBoolean();
                bool arg1 = reader.ReadBoolean();
                bool arg2 = reader.ReadBoolean();
                handler.Settings(arg0, arg1, arg2);
                break;
            }

            case 8:
            {
                Player arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerSettings] Player not found."); return;
                }
                bool arg1 = reader.ReadBoolean();
                bool arg2 = reader.ReadBoolean();
                handler.PlayerSettings(arg0, arg1, arg2);
                break;
            }

            case 9:
            {
                byte   arg0 = reader.ReadByte();
                string arg1 = reader.ReadString();
                ulong  arg2 = reader.ReadUInt64();
                bool   arg3 = reader.ReadBoolean();
                bool   arg4 = reader.ReadBoolean();
                handler.NewPlayer(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 10:
            {
                Player arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Leave] Player not found."); return;
                }
                handler.Leave(arg0);
                break;
            }

            case 12:
            {
                Player arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Nick] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                handler.Nick(arg0, arg1);
                break;
            }

            case 13:
            {
                handler.Start();
                break;
            }

            case 15:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Reset] Player not found."); return;
                }
                handler.Reset(arg0);
                break;
            }

            case 16:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[NextTurn] Player not found."); return;
                }
                bool arg1 = reader.ReadBoolean();
                handler.NextTurn(arg0, arg1);
                break;
            }

            case 18:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[StopTurn] Player not found."); return;
                }
                handler.StopTurn(arg0);
                break;
            }

            case 20:
            {
                Player arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Chat] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                handler.Chat(arg0, arg1);
                break;
            }

            case 22:
            {
                Player arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Print] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                handler.Print(arg0, arg1);
                break;
            }

            case 24:
            {
                int arg0 = reader.ReadInt32();
                handler.Random(arg0);
                break;
            }

            case 26:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Counter] Player not found."); return;
                }
                Counter arg1 = Counter.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Counter] Counter not found."); return;
                }
                int  arg2 = reader.ReadInt32();
                bool arg3 = reader.ReadBoolean();
                handler.Counter(arg0, arg1, arg2, arg3);
                break;
            }

            case 27:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                Guid[] arg1 = new Guid[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                length = reader.ReadInt16();
                Group[] arg2 = new Group[length];
                for (int i = 0; i < length; ++i)
                {
                    arg2[i] = Group.Find(reader.ReadInt32());
                    if (arg2[i] == null)
                    {
                        Debug.WriteLine("[LoadDeck] Group not found.");
                    }
                }
                length = reader.ReadInt16();
                string[] arg3 = new string[length];
                for (int i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadString();
                }
                string arg4 = reader.ReadString();
                bool   arg5 = reader.ReadBoolean();
                handler.LoadDeck(arg0, arg1, arg2, arg3, arg4, arg5);
                break;
            }

            case 28:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                Guid[] arg1 = new Guid[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                length = reader.ReadInt16();
                string[] arg2 = new string[length];
                for (int i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadString();
                }
                Group arg3 = Group.Find(reader.ReadInt32());
                if (arg3 == null)
                {
                    Debug.WriteLine("[CreateCard] Group not found."); return;
                }
                handler.CreateCard(arg0, arg1, arg2, arg3);
                break;
            }

            case 29:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                Guid[] arg1 = new Guid[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                length = reader.ReadInt16();
                int[] arg2 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                int[] arg3 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadInt32();
                }
                bool arg4 = reader.ReadBoolean();
                bool arg5 = reader.ReadBoolean();
                handler.CreateCardAt(arg0, arg1, arg2, arg3, arg4, arg5);
                break;
            }

            case 30:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                ulong[] arg1 = new ulong[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadUInt64();
                }
                handler.CreateAliasDeprecated(arg0, arg1);
                break;
            }

            case 32:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[MoveCard] Player not found."); return;
                }
                length = reader.ReadInt16();
                int[] arg1 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadInt32();
                }
                Group arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[MoveCard] Group not found."); return;
                }
                length = reader.ReadInt16();
                int[] arg3 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                bool[] arg4 = new bool[length];
                for (int i = 0; i < length; ++i)
                {
                    arg4[i] = reader.ReadBoolean();
                }
                bool arg5 = reader.ReadBoolean();
                handler.MoveCard(arg0, arg1, arg2, arg3, arg4, arg5);
                break;
            }

            case 34:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[MoveCardAt] Player not found."); return;
                }
                length = reader.ReadInt16();
                int[] arg1 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                int[] arg2 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                int[] arg3 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                int[] arg4 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg4[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                bool[] arg5 = new bool[length];
                for (int i = 0; i < length; ++i)
                {
                    arg5[i] = reader.ReadBoolean();
                }
                bool arg6 = reader.ReadBoolean();
                handler.MoveCardAt(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
                break;
            }

            case 36:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Peek] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Peek] Card not found."); return;
                }
                handler.Peek(arg0, arg1);
                break;
            }

            case 38:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Untarget] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Untarget] Card not found."); return;
                }
                bool arg2 = reader.ReadBoolean();
                handler.Untarget(arg0, arg1, arg2);
                break;
            }

            case 40:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Target] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Target] Card not found."); return;
                }
                bool arg2 = reader.ReadBoolean();
                handler.Target(arg0, arg1, arg2);
                break;
            }

            case 42:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[TargetArrow] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[TargetArrow] Card not found."); return;
                }
                Card arg2 = Card.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[TargetArrow] Card not found."); return;
                }
                bool arg3 = reader.ReadBoolean();
                handler.TargetArrow(arg0, arg1, arg2, arg3);
                break;
            }

            case 43:
            {
                Card arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Highlight] Card not found."); return;
                }
                string temp1 = reader.ReadString();
                Color? arg1  = temp1 == "" ? (Color?)null : (Color?)ColorConverter.ConvertFromString(temp1);
                handler.Highlight(arg0, arg1);
                break;
            }

            case 45:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Turn] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Turn] Card not found."); return;
                }
                bool arg2 = reader.ReadBoolean();
                handler.Turn(arg0, arg1, arg2);
                break;
            }

            case 47:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Rotate] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Rotate] Card not found."); return;
                }
                CardOrientation arg2 = (CardOrientation)reader.ReadByte();
                handler.Rotate(arg0, arg1, arg2);
                break;
            }

            case 48:
            {
                Group arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[ShuffleDeprecated] Group not found."); return;
                }
                length = reader.ReadInt16();
                int[] arg1 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadInt32();
                }
                handler.ShuffleDeprecated(arg0, arg1);
                break;
            }

            case 49:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Shuffled] Player not found."); return;
                }
                Group arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Shuffled] Group not found."); return;
                }
                length = reader.ReadInt16();
                int[] arg2 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                short[] arg3 = new short[length];
                for (int i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadInt16();
                }
                handler.Shuffled(arg0, arg1, arg2, arg3);
                break;
            }

            case 50:
            {
                Group arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[UnaliasGrpDeprecated] Group not found."); return;
                }
                handler.UnaliasGrpDeprecated(arg0);
                break;
            }

            case 51:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                ulong[] arg1 = new ulong[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadUInt64();
                }
                handler.UnaliasDeprecated(arg0, arg1);
                break;
            }

            case 53:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[AddMarker] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[AddMarker] Card not found."); return;
                }
                Guid   arg2 = new Guid(reader.ReadBytes(16));
                string arg3 = reader.ReadString();
                ushort arg4 = reader.ReadUInt16();
                ushort arg5 = reader.ReadUInt16();
                bool   arg6 = reader.ReadBoolean();
                handler.AddMarker(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
                break;
            }

            case 55:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[RemoveMarker] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[RemoveMarker] Card not found."); return;
                }
                Guid   arg2 = new Guid(reader.ReadBytes(16));
                string arg3 = reader.ReadString();
                ushort arg4 = reader.ReadUInt16();
                ushort arg5 = reader.ReadUInt16();
                bool   arg6 = reader.ReadBoolean();
                handler.RemoveMarker(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
                break;
            }

            case 57:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[TransferMarker] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[TransferMarker] Card not found."); return;
                }
                Card arg2 = Card.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[TransferMarker] Card not found."); return;
                }
                Guid   arg3 = new Guid(reader.ReadBytes(16));
                string arg4 = reader.ReadString();
                ushort arg5 = reader.ReadUInt16();
                ushort arg6 = reader.ReadUInt16();
                bool   arg7 = reader.ReadBoolean();
                handler.TransferMarker(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
                break;
            }

            case 59:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PassTo] Player not found."); return;
                }
                ControllableObject arg1 = ControllableObject.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[PassTo] ControllableObject not found."); return;
                }
                Player arg2 = Player.Find(reader.ReadByte());
                if (arg2 == null)
                {
                    Debug.WriteLine("[PassTo] Player not found."); return;
                }
                bool arg3 = reader.ReadBoolean();
                handler.PassTo(arg0, arg1, arg2, arg3);
                break;
            }

            case 61:
            {
                ControllableObject arg0 = ControllableObject.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[TakeFrom] ControllableObject not found."); return;
                }
                Player arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[TakeFrom] Player not found."); return;
                }
                handler.TakeFrom(arg0, arg1);
                break;
            }

            case 63:
            {
                ControllableObject arg0 = ControllableObject.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[DontTake] ControllableObject not found."); return;
                }
                handler.DontTake(arg0);
                break;
            }

            case 64:
            {
                Group arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[FreezeCardsVisibility] Group not found."); return;
                }
                handler.FreezeCardsVisibility(arg0);
                break;
            }

            case 66:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GroupVis] Player not found."); return;
                }
                Group arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[GroupVis] Group not found."); return;
                }
                bool arg2 = reader.ReadBoolean();
                bool arg3 = reader.ReadBoolean();
                handler.GroupVis(arg0, arg1, arg2, arg3);
                break;
            }

            case 68:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GroupVisAdd] Player not found."); return;
                }
                Group arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[GroupVisAdd] Group not found."); return;
                }
                Player arg2 = Player.Find(reader.ReadByte());
                if (arg2 == null)
                {
                    Debug.WriteLine("[GroupVisAdd] Player not found."); return;
                }
                handler.GroupVisAdd(arg0, arg1, arg2);
                break;
            }

            case 70:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GroupVisRemove] Player not found."); return;
                }
                Group arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[GroupVisRemove] Group not found."); return;
                }
                Player arg2 = Player.Find(reader.ReadByte());
                if (arg2 == null)
                {
                    Debug.WriteLine("[GroupVisRemove] Player not found."); return;
                }
                handler.GroupVisRemove(arg0, arg1, arg2);
                break;
            }

            case 72:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[LookAt] Player not found."); return;
                }
                int   arg1 = reader.ReadInt32();
                Group arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[LookAt] Group not found."); return;
                }
                bool arg3 = reader.ReadBoolean();
                handler.LookAt(arg0, arg1, arg2, arg3);
                break;
            }

            case 74:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[LookAtTop] Player not found."); return;
                }
                int   arg1 = reader.ReadInt32();
                Group arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[LookAtTop] Group not found."); return;
                }
                int  arg3 = reader.ReadInt32();
                bool arg4 = reader.ReadBoolean();
                handler.LookAtTop(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 76:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[LookAtBottom] Player not found."); return;
                }
                int   arg1 = reader.ReadInt32();
                Group arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[LookAtBottom] Group not found."); return;
                }
                int  arg3 = reader.ReadInt32();
                bool arg4 = reader.ReadBoolean();
                handler.LookAtBottom(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 78:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[StartLimited] Player not found."); return;
                }
                length = reader.ReadInt16();
                Guid[] arg1 = new Guid[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                handler.StartLimited(arg0, arg1);
                break;
            }

            case 80:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[CancelLimited] Player not found."); return;
                }
                handler.CancelLimited(arg0);
                break;
            }

            case 81:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[CardSwitchTo] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[CardSwitchTo] Card not found."); return;
                }
                string arg2 = reader.ReadString();
                handler.CardSwitchTo(arg0, arg1, arg2);
                break;
            }

            case 82:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerSetGlobalVariable] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                string arg2 = reader.ReadString();
                string arg3 = reader.ReadString();
                handler.PlayerSetGlobalVariable(arg0, arg1, arg2, arg3);
                break;
            }

            case 83:
            {
                string arg0 = reader.ReadString();
                string arg1 = reader.ReadString();
                string arg2 = reader.ReadString();
                handler.SetGlobalVariable(arg0, arg1, arg2);
                break;
            }

            case 85:
            {
                handler.Ping();
                break;
            }

            case 86:
            {
                bool arg0 = reader.ReadBoolean();
                handler.IsTableBackgroundFlipped(arg0);
                break;
            }

            case 87:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlaySound] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                handler.PlaySound(arg0, arg1);
                break;
            }

            case 88:
            {
                Player arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Ready] Player not found."); return;
                }
                handler.Ready(arg0);
                break;
            }

            case 89:
            {
                Player arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerState] Player not found."); return;
                }
                byte arg1 = reader.ReadByte();
                handler.PlayerState(arg0, arg1);
                break;
            }

            case 90:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[RemoteCall] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                string arg2 = reader.ReadString();
                handler.RemoteCall(arg0, arg1, arg2);
                break;
            }

            case 91:
            {
                Player arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GameStateReq] Player not found."); return;
                }
                handler.GameStateReq(arg0);
                break;
            }

            case 92:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GameState] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                handler.GameState(arg0, arg1);
                break;
            }

            case 93:
            {
                Card arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[DeleteCard] Card not found."); return;
                }
                Player arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[DeleteCard] Player not found."); return;
                }
                handler.DeleteCard(arg0, arg1);
                break;
            }

            case 94:
            {
                Player arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerDisconnect] Player not found."); return;
                }
                handler.PlayerDisconnect(arg0);
                break;
            }

            case 96:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[AddPacks] Player not found."); return;
                }
                length = reader.ReadInt16();
                Guid[] arg1 = new Guid[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                bool arg2 = reader.ReadBoolean();
                handler.AddPacks(arg0, arg1, arg2);
                break;
            }

            case 97:
            {
                Card arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[AnchorCard] Card not found."); return;
                }
                Player arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[AnchorCard] Player not found."); return;
                }
                bool arg2 = reader.ReadBoolean();
                handler.AnchorCard(arg0, arg1, arg2);
                break;
            }

            case 98:
            {
                Card arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[SetCardProperty] Card not found."); return;
                }
                Player arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[SetCardProperty] Player not found."); return;
                }
                string arg2 = reader.ReadString();
                string arg3 = reader.ReadString();
                string arg4 = reader.ReadString();
                handler.SetCardProperty(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 99:
            {
                Card arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[ResetCardProperties] Card not found."); return;
                }
                Player arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[ResetCardProperties] Player not found."); return;
                }
                handler.ResetCardProperties(arg0, arg1);
                break;
            }

            case 100:
            {
                Card arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Filter] Card not found."); return;
                }
                string temp1 = reader.ReadString();
                Color? arg1  = temp1 == "" ? (Color?)null : (Color?)ColorConverter.ConvertFromString(temp1);
                handler.Filter(arg0, arg1);
                break;
            }

            case 101:
            {
                string arg0 = reader.ReadString();
                handler.SetBoard(arg0);
                break;
            }

            case 102:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[SetPlayerColor] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                handler.SetPlayerColor(arg0, arg1);
                break;
            }

            case 103:
            {
                byte arg0 = reader.ReadByte();
                byte arg1 = reader.ReadByte();
                bool arg2 = reader.ReadBoolean();
                handler.SetPhase(arg0, arg1, arg2);
                break;
            }

            case 105:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[StopPhase] Player not found."); return;
                }
                byte arg1 = reader.ReadByte();
                handler.StopPhase(arg0, arg1);
                break;
            }

            default:
                Debug.WriteLine("[Client Parser] Unknown message (id =" + method + ")");
                break;
            }
            reader.Close();
        }
예제 #2
0
파일: BinaryParser.cs 프로젝트: jaras/OCTGN
        public void Parse(byte[] data)
        {
            var   stream = new MemoryStream(data);
            var   reader = new BinaryReader(stream);
            short length;

            Program.Client.Muted = reader.ReadInt32();
            var method = reader.ReadByte();

            switch (method)
            {
            case 0:
            {
                Log.Debug($"OCTGN IN: Binary");
                handler.Binary();
                break;
            }

            case 1:
            {
                var arg0 = reader.ReadString();
                Log.Debug($"OCTGN IN: Error");
                handler.Error(arg0);
                break;
            }

            case 3:
            {
                var arg0 = reader.ReadString();
                Log.Debug($"OCTGN IN: Kick");
                handler.Kick(arg0);
                break;
            }

            case 6:
            {
                var arg0 = reader.ReadByte();
                var arg1 = new Guid(reader.ReadBytes(16));
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: Welcome");
                handler.Welcome(arg0, arg1, arg2);
                break;
            }

            case 7:
            {
                var arg0 = reader.ReadBoolean();
                var arg1 = reader.ReadBoolean();
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: Settings");
                handler.Settings(arg0, arg1, arg2);
                break;
            }

            case 8:
            {
                var arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerSettings] Player not found."); return;
                }
                var arg1 = reader.ReadBoolean();
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: PlayerSettings");
                handler.PlayerSettings(arg0, arg1, arg2);
                break;
            }

            case 9:
            {
                var arg0 = reader.ReadByte();
                var arg1 = reader.ReadString();
                var arg2 = reader.ReadString();
                var arg3 = reader.ReadUInt64();
                var arg4 = reader.ReadBoolean();
                var arg5 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: NewPlayer");
                handler.NewPlayer(arg0, arg1, arg2, arg3, arg4, arg5);
                break;
            }

            case 10:
            {
                var arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Leave] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: Leave");
                handler.Leave(arg0);
                break;
            }

            case 12:
            {
                var arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Nick] Player not found."); return;
                }
                var arg1 = reader.ReadString();
                Log.Debug($"OCTGN IN: Nick");
                handler.Nick(arg0, arg1);
                break;
            }

            case 13:
            {
                Log.Debug($"OCTGN IN: Start");
                handler.Start();
                break;
            }

            case 15:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Reset] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: Reset");
                handler.Reset(arg0);
                break;
            }

            case 16:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[NextTurn] Player not found."); return;
                }
                var arg1 = reader.ReadBoolean();
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: NextTurn");
                handler.NextTurn(arg0, arg1, arg2);
                break;
            }

            case 18:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[StopTurn] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: StopTurn");
                handler.StopTurn(arg0);
                break;
            }

            case 20:
            {
                var arg0 = reader.ReadByte();
                length = reader.ReadInt16();
                var arg1 = new Player[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = Player.Find(reader.ReadByte());
                    if (arg1[i] == null)
                    {
                        Debug.WriteLine("[SetPhase] Player not found.");
                    }
                }
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: SetPhase");
                handler.SetPhase(arg0, arg1, arg2);
                break;
            }

            case 22:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[SetActivePlayer] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: SetActivePlayer");
                handler.SetActivePlayer(arg0);
                break;
            }

            case 23:
            {
                Log.Debug($"OCTGN IN: ClearActivePlayer");
                handler.ClearActivePlayer();
                break;
            }

            case 25:
            {
                var arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Chat] Player not found."); return;
                }
                var arg1 = reader.ReadString();
                Log.Debug($"OCTGN IN: Chat");
                handler.Chat(arg0, arg1);
                break;
            }

            case 27:
            {
                var arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Print] Player not found."); return;
                }
                var arg1 = reader.ReadString();
                Log.Debug($"OCTGN IN: Print");
                handler.Print(arg0, arg1);
                break;
            }

            case 29:
            {
                var arg0 = reader.ReadInt32();
                Log.Debug($"OCTGN IN: Random");
                handler.Random(arg0);
                break;
            }

            case 31:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Counter] Player not found."); return;
                }
                var arg1 = Counter.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Counter] Counter not found."); return;
                }
                var arg2 = reader.ReadInt32();
                var arg3 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: Counter");
                handler.Counter(arg0, arg1, arg2, arg3);
                break;
            }

            case 32:
            {
                length = reader.ReadInt16();
                var arg0 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg1 = new Guid[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                length = reader.ReadInt16();
                var arg2 = new Group[length];
                for (var i = 0; i < length; ++i)
                {
                    arg2[i] = Group.Find(reader.ReadInt32());
                    if (arg2[i] == null)
                    {
                        Debug.WriteLine("[LoadDeck] Group not found.");
                    }
                }
                length = reader.ReadInt16();
                var arg3 = new string[length];
                for (var i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadString();
                }
                var arg4 = reader.ReadString();
                var arg5 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: LoadDeck");
                handler.LoadDeck(arg0, arg1, arg2, arg3, arg4, arg5);
                break;
            }

            case 33:
            {
                length = reader.ReadInt16();
                var arg0 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg1 = new Guid[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                length = reader.ReadInt16();
                var arg2 = new string[length];
                for (var i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadString();
                }
                var arg3 = Group.Find(reader.ReadInt32());
                if (arg3 == null)
                {
                    Debug.WriteLine("[CreateCard] Group not found."); return;
                }
                Log.Debug($"OCTGN IN: CreateCard");
                handler.CreateCard(arg0, arg1, arg2, arg3);
                break;
            }

            case 34:
            {
                length = reader.ReadInt16();
                var arg0 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg1 = new Guid[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                length = reader.ReadInt16();
                var arg2 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg3 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadInt32();
                }
                var arg4 = reader.ReadBoolean();
                var arg5 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: CreateCardAt");
                handler.CreateCardAt(arg0, arg1, arg2, arg3, arg4, arg5);
                break;
            }

            case 35:
            {
                length = reader.ReadInt16();
                var arg0 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg1 = new ulong[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadUInt64();
                }
                Log.Debug($"OCTGN IN: CreateAliasDeprecated");
                handler.CreateAliasDeprecated(arg0, arg1);
                break;
            }

            case 37:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[MoveCard] Player not found."); return;
                }
                length = reader.ReadInt16();
                var arg1 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadInt32();
                }
                var arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[MoveCard] Group not found."); return;
                }
                length = reader.ReadInt16();
                var arg3 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg4 = new bool[length];
                for (var i = 0; i < length; ++i)
                {
                    arg4[i] = reader.ReadBoolean();
                }
                var arg5 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: MoveCard");
                handler.MoveCard(arg0, arg1, arg2, arg3, arg4, arg5);
                break;
            }

            case 39:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[MoveCardAt] Player not found."); return;
                }
                length = reader.ReadInt16();
                var arg1 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg2 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg3 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg4 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg4[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg5 = new bool[length];
                for (var i = 0; i < length; ++i)
                {
                    arg5[i] = reader.ReadBoolean();
                }
                var arg6 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: MoveCardAt");
                handler.MoveCardAt(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
                break;
            }

            case 41:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Peek] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Peek] Card not found."); return;
                }
                Log.Debug($"OCTGN IN: Peek");
                handler.Peek(arg0, arg1);
                break;
            }

            case 43:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Untarget] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Untarget] Card not found."); return;
                }
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: Untarget");
                handler.Untarget(arg0, arg1, arg2);
                break;
            }

            case 45:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Target] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Target] Card not found."); return;
                }
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: Target");
                handler.Target(arg0, arg1, arg2);
                break;
            }

            case 47:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[TargetArrow] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[TargetArrow] Card not found."); return;
                }
                var arg2 = Card.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[TargetArrow] Card not found."); return;
                }
                var arg3 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: TargetArrow");
                handler.TargetArrow(arg0, arg1, arg2, arg3);
                break;
            }

            case 48:
            {
                var arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Highlight] Card not found."); return;
                }
                var temp1 = reader.ReadString();
                var arg1  = temp1 == "" ? (Color?)null : (Color?)ColorConverter.ConvertFromString(temp1);
                Log.Debug($"OCTGN IN: Highlight");
                handler.Highlight(arg0, arg1);
                break;
            }

            case 50:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Turn] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Turn] Card not found."); return;
                }
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: Turn");
                handler.Turn(arg0, arg1, arg2);
                break;
            }

            case 52:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Rotate] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Rotate] Card not found."); return;
                }
                var arg2 = (CardOrientation)reader.ReadByte();
                Log.Debug($"OCTGN IN: Rotate");
                handler.Rotate(arg0, arg1, arg2);
                break;
            }

            case 53:
            {
                var arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[ShuffleDeprecated] Group not found."); return;
                }
                length = reader.ReadInt16();
                var arg1 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadInt32();
                }
                Log.Debug($"OCTGN IN: ShuffleDeprecated");
                handler.ShuffleDeprecated(arg0, arg1);
                break;
            }

            case 54:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Shuffled] Player not found."); return;
                }
                var arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Shuffled] Group not found."); return;
                }
                length = reader.ReadInt16();
                var arg2 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg3 = new short[length];
                for (var i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadInt16();
                }
                Log.Debug($"OCTGN IN: Shuffled");
                handler.Shuffled(arg0, arg1, arg2, arg3);
                break;
            }

            case 55:
            {
                var arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[UnaliasGrpDeprecated] Group not found."); return;
                }
                Log.Debug($"OCTGN IN: UnaliasGrpDeprecated");
                handler.UnaliasGrpDeprecated(arg0);
                break;
            }

            case 56:
            {
                length = reader.ReadInt16();
                var arg0 = new int[length];
                for (var i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                var arg1 = new ulong[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadUInt64();
                }
                Log.Debug($"OCTGN IN: UnaliasDeprecated");
                handler.UnaliasDeprecated(arg0, arg1);
                break;
            }

            case 58:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[AddMarker] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[AddMarker] Card not found."); return;
                }
                var arg2 = new Guid(reader.ReadBytes(16));
                var arg3 = reader.ReadString();
                var arg4 = reader.ReadUInt16();
                var arg5 = reader.ReadUInt16();
                var arg6 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: AddMarker");
                handler.AddMarker(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
                break;
            }

            case 60:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[RemoveMarker] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[RemoveMarker] Card not found."); return;
                }
                var arg2 = new Guid(reader.ReadBytes(16));
                var arg3 = reader.ReadString();
                var arg4 = reader.ReadUInt16();
                var arg5 = reader.ReadUInt16();
                var arg6 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: RemoveMarker");
                handler.RemoveMarker(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
                break;
            }

            case 62:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[TransferMarker] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[TransferMarker] Card not found."); return;
                }
                var arg2 = Card.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[TransferMarker] Card not found."); return;
                }
                var arg3 = new Guid(reader.ReadBytes(16));
                var arg4 = reader.ReadString();
                var arg5 = reader.ReadUInt16();
                var arg6 = reader.ReadUInt16();
                var arg7 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: TransferMarker");
                handler.TransferMarker(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
                break;
            }

            case 64:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PassTo] Player not found."); return;
                }
                var arg1 = ControllableObject.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[PassTo] ControllableObject not found."); return;
                }
                var arg2 = Player.Find(reader.ReadByte());
                if (arg2 == null)
                {
                    Debug.WriteLine("[PassTo] Player not found."); return;
                }
                var arg3 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: PassTo");
                handler.PassTo(arg0, arg1, arg2, arg3);
                break;
            }

            case 66:
            {
                var arg0 = ControllableObject.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[TakeFrom] ControllableObject not found."); return;
                }
                var arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[TakeFrom] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: TakeFrom");
                handler.TakeFrom(arg0, arg1);
                break;
            }

            case 68:
            {
                var arg0 = ControllableObject.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[DontTake] ControllableObject not found."); return;
                }
                Log.Debug($"OCTGN IN: DontTake");
                handler.DontTake(arg0);
                break;
            }

            case 69:
            {
                var arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[FreezeCardsVisibility] Group not found."); return;
                }
                Log.Debug($"OCTGN IN: FreezeCardsVisibility");
                handler.FreezeCardsVisibility(arg0);
                break;
            }

            case 71:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GroupVis] Player not found."); return;
                }
                var arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[GroupVis] Group not found."); return;
                }
                var arg2 = reader.ReadBoolean();
                var arg3 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: GroupVis");
                handler.GroupVis(arg0, arg1, arg2, arg3);
                break;
            }

            case 73:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GroupVisAdd] Player not found."); return;
                }
                var arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[GroupVisAdd] Group not found."); return;
                }
                var arg2 = Player.Find(reader.ReadByte());
                if (arg2 == null)
                {
                    Debug.WriteLine("[GroupVisAdd] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: GroupVisAdd");
                handler.GroupVisAdd(arg0, arg1, arg2);
                break;
            }

            case 75:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GroupVisRemove] Player not found."); return;
                }
                var arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[GroupVisRemove] Group not found."); return;
                }
                var arg2 = Player.Find(reader.ReadByte());
                if (arg2 == null)
                {
                    Debug.WriteLine("[GroupVisRemove] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: GroupVisRemove");
                handler.GroupVisRemove(arg0, arg1, arg2);
                break;
            }

            case 77:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[LookAt] Player not found."); return;
                }
                var arg1 = reader.ReadInt32();
                var arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[LookAt] Group not found."); return;
                }
                var arg3 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: LookAt");
                handler.LookAt(arg0, arg1, arg2, arg3);
                break;
            }

            case 79:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[LookAtTop] Player not found."); return;
                }
                var arg1 = reader.ReadInt32();
                var arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[LookAtTop] Group not found."); return;
                }
                var arg3 = reader.ReadInt32();
                var arg4 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: LookAtTop");
                handler.LookAtTop(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 81:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[LookAtBottom] Player not found."); return;
                }
                var arg1 = reader.ReadInt32();
                var arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[LookAtBottom] Group not found."); return;
                }
                var arg3 = reader.ReadInt32();
                var arg4 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: LookAtBottom");
                handler.LookAtBottom(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 83:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[StartLimited] Player not found."); return;
                }
                length = reader.ReadInt16();
                var arg1 = new Guid[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                Log.Debug($"OCTGN IN: StartLimited");
                handler.StartLimited(arg0, arg1);
                break;
            }

            case 85:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[CancelLimited] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: CancelLimited");
                handler.CancelLimited(arg0);
                break;
            }

            case 86:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[CardSwitchTo] Player not found."); return;
                }
                var arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[CardSwitchTo] Card not found."); return;
                }
                var arg2 = reader.ReadString();
                Log.Debug($"OCTGN IN: CardSwitchTo");
                handler.CardSwitchTo(arg0, arg1, arg2);
                break;
            }

            case 87:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerSetGlobalVariable] Player not found."); return;
                }
                var arg1 = reader.ReadString();
                var arg2 = reader.ReadString();
                var arg3 = reader.ReadString();
                Log.Debug($"OCTGN IN: PlayerSetGlobalVariable");
                handler.PlayerSetGlobalVariable(arg0, arg1, arg2, arg3);
                break;
            }

            case 88:
            {
                var arg0 = reader.ReadString();
                var arg1 = reader.ReadString();
                var arg2 = reader.ReadString();
                Log.Debug($"OCTGN IN: SetGlobalVariable");
                handler.SetGlobalVariable(arg0, arg1, arg2);
                break;
            }

            case 90:
            {
                handler.Ping();
                break;
            }

            case 91:
            {
                var arg0 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: IsTableBackgroundFlipped");
                handler.IsTableBackgroundFlipped(arg0);
                break;
            }

            case 92:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlaySound] Player not found."); return;
                }
                var arg1 = reader.ReadString();
                Log.Debug($"OCTGN IN: PlaySound");
                handler.PlaySound(arg0, arg1);
                break;
            }

            case 93:
            {
                var arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Ready] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: Ready");
                handler.Ready(arg0);
                break;
            }

            case 94:
            {
                var arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerState] Player not found."); return;
                }
                var arg1 = reader.ReadByte();
                Log.Debug($"OCTGN IN: PlayerState");
                handler.PlayerState(arg0, arg1);
                break;
            }

            case 95:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[RemoteCall] Player not found."); return;
                }
                var arg1 = reader.ReadString();
                var arg2 = reader.ReadString();
                Log.Debug($"OCTGN IN: RemoteCall");
                handler.RemoteCall(arg0, arg1, arg2);
                break;
            }

            case 96:
            {
                var arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GameStateReq] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: GameStateReq");
                handler.GameStateReq(arg0);
                break;
            }

            case 97:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GameState] Player not found."); return;
                }
                var arg1 = reader.ReadString();
                Log.Debug($"OCTGN IN: GameState");
                handler.GameState(arg0, arg1);
                break;
            }

            case 98:
            {
                var arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[DeleteCard] Card not found."); return;
                }
                var arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[DeleteCard] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: DeleteCard");
                handler.DeleteCard(arg0, arg1);
                break;
            }

            case 99:
            {
                var arg0 = Player.FindIncludingSpectators(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerDisconnect] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: PlayerDisconnect");
                handler.PlayerDisconnect(arg0);
                break;
            }

            case 101:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[AddPacks] Player not found."); return;
                }
                length = reader.ReadInt16();
                var arg1 = new Guid[length];
                for (var i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: AddPacks");
                handler.AddPacks(arg0, arg1, arg2);
                break;
            }

            case 102:
            {
                var arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[AnchorCard] Card not found."); return;
                }
                var arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[AnchorCard] Player not found."); return;
                }
                var arg2 = reader.ReadBoolean();
                Log.Debug($"OCTGN IN: AnchorCard");
                handler.AnchorCard(arg0, arg1, arg2);
                break;
            }

            case 103:
            {
                var arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[SetCardProperty] Card not found."); return;
                }
                var arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[SetCardProperty] Player not found."); return;
                }
                var arg2 = reader.ReadString();
                var arg3 = reader.ReadString();
                var arg4 = reader.ReadString();
                Log.Debug($"OCTGN IN: SetCardProperty");
                handler.SetCardProperty(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 104:
            {
                var arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[ResetCardProperties] Card not found."); return;
                }
                var arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[ResetCardProperties] Player not found."); return;
                }
                Log.Debug($"OCTGN IN: ResetCardProperties");
                handler.ResetCardProperties(arg0, arg1);
                break;
            }

            case 105:
            {
                var arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Filter] Card not found."); return;
                }
                var temp1 = reader.ReadString();
                var arg1  = temp1 == "" ? (Color?)null : (Color?)ColorConverter.ConvertFromString(temp1);
                Log.Debug($"OCTGN IN: Filter");
                handler.Filter(arg0, arg1);
                break;
            }

            case 106:
            {
                var arg0 = reader.ReadString();
                Log.Debug($"OCTGN IN: SetBoard");
                handler.SetBoard(arg0);
                break;
            }

            case 107:
            {
                var arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[SetPlayerColor] Player not found."); return;
                }
                var arg1 = reader.ReadString();
                Log.Debug($"OCTGN IN: SetPlayerColor");
                handler.SetPlayerColor(arg0, arg1);
                break;
            }

            default:
                Debug.WriteLine("[Client Parser] Unknown message (id =" + method + ")");
                break;
            }
            reader.Close();
        }
예제 #3
0
        public void Parse(byte[] data)
        {
            MemoryStream stream = new MemoryStream(data);
            BinaryReader reader = new BinaryReader(stream);
            short        length;

            Program.Client.Muted = reader.ReadInt32();
            byte method = reader.ReadByte();

            switch (method)
            {
            case 0:
            {
                handler.Binary();
                break;
            }

            case 1:
            {
                string arg0 = reader.ReadString();
                handler.Error(arg0);
                break;
            }

            case 3:
            {
                byte arg0 = reader.ReadByte();
                handler.Welcome(arg0);
                break;
            }

            case 4:
            {
                bool arg0 = reader.ReadBoolean();
                handler.Settings(arg0);
                break;
            }

            case 5:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerSettings] Player not found."); return;
                }
                bool arg1 = reader.ReadBoolean();
                handler.PlayerSettings(arg0, arg1);
                break;
            }

            case 6:
            {
                byte   arg0 = reader.ReadByte();
                string arg1 = reader.ReadString();
                ulong  arg2 = reader.ReadUInt64();
                handler.NewPlayer(arg0, arg1, arg2);
                break;
            }

            case 7:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Leave] Player not found."); return;
                }
                handler.Leave(arg0);
                break;
            }

            case 9:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Nick] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                handler.Nick(arg0, arg1);
                break;
            }

            case 10:
            {
                handler.Start();
                break;
            }

            case 12:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Reset] Player not found."); return;
                }
                handler.Reset(arg0);
                break;
            }

            case 13:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[NextTurn] Player not found."); return;
                }
                handler.NextTurn(arg0);
                break;
            }

            case 15:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[StopTurn] Player not found."); return;
                }
                handler.StopTurn(arg0);
                break;
            }

            case 17:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Chat] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                handler.Chat(arg0, arg1);
                break;
            }

            case 19:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Print] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                handler.Print(arg0, arg1);
                break;
            }

            case 21:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Random] Player not found."); return;
                }
                int arg1 = reader.ReadInt32();
                int arg2 = reader.ReadInt32();
                int arg3 = reader.ReadInt32();
                handler.Random(arg0, arg1, arg2, arg3);
                break;
            }

            case 23:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[RandomAnswer1] Player not found."); return;
                }
                int   arg1 = reader.ReadInt32();
                ulong arg2 = reader.ReadUInt64();
                handler.RandomAnswer1(arg0, arg1, arg2);
                break;
            }

            case 25:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[RandomAnswer2] Player not found."); return;
                }
                int   arg1 = reader.ReadInt32();
                ulong arg2 = reader.ReadUInt64();
                handler.RandomAnswer2(arg0, arg1, arg2);
                break;
            }

            case 27:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Counter] Player not found."); return;
                }
                Counter arg1 = Counter.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Counter] Counter not found."); return;
                }
                int arg2 = reader.ReadInt32();
                handler.Counter(arg0, arg1, arg2);
                break;
            }

            case 28:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                ulong[] arg1 = new ulong[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadUInt64();
                }
                length = reader.ReadInt16();
                Group[] arg2 = new Group[length];
                for (int i = 0; i < length; ++i)
                {
                    arg2[i] = Group.Find(reader.ReadInt32());
                    if (arg2[i] == null)
                    {
                        Debug.WriteLine("[LoadDeck] Group not found.");
                    }
                }
                handler.LoadDeck(arg0, arg1, arg2);
                break;
            }

            case 29:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                ulong[] arg1 = new ulong[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadUInt64();
                }
                Group arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[CreateCard] Group not found."); return;
                }
                handler.CreateCard(arg0, arg1, arg2);
                break;
            }

            case 30:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                ulong[] arg1 = new ulong[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadUInt64();
                }
                length = reader.ReadInt16();
                Guid[] arg2 = new Guid[length];
                for (int i = 0; i < length; ++i)
                {
                    arg2[i] = new Guid(reader.ReadBytes(16));
                }
                length = reader.ReadInt16();
                int[] arg3 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg3[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                int[] arg4 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg4[i] = reader.ReadInt32();
                }
                bool arg5 = reader.ReadBoolean();
                bool arg6 = reader.ReadBoolean();
                handler.CreateCardAt(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
                break;
            }

            case 31:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                ulong[] arg1 = new ulong[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadUInt64();
                }
                handler.CreateAlias(arg0, arg1);
                break;
            }

            case 33:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[MoveCard] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[MoveCard] Card not found."); return;
                }
                Group arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[MoveCard] Group not found."); return;
                }
                int  arg3 = reader.ReadInt32();
                bool arg4 = reader.ReadBoolean();
                handler.MoveCard(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 35:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[MoveCardAt] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[MoveCardAt] Card not found."); return;
                }
                int  arg2 = reader.ReadInt32();
                int  arg3 = reader.ReadInt32();
                int  arg4 = reader.ReadInt32();
                bool arg5 = reader.ReadBoolean();
                handler.MoveCardAt(arg0, arg1, arg2, arg3, arg4, arg5);
                break;
            }

            case 36:
            {
                Card arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Reveal] Card not found."); return;
                }
                ulong arg1 = reader.ReadUInt64();
                Guid  arg2 = new Guid(reader.ReadBytes(16));
                handler.Reveal(arg0, arg1, arg2);
                break;
            }

            case 38:
            {
                length = reader.ReadInt16();
                Player[] arg0 = new Player[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = Player.Find(reader.ReadByte());
                    if (arg0[i] == null)
                    {
                        Debug.WriteLine("[RevealTo] Player not found.");
                    }
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[RevealTo] Card not found."); return;
                }
                length = reader.ReadInt16();
                ulong[] arg2 = new ulong[length];
                for (int i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadUInt64();
                }
                handler.RevealTo(arg0, arg1, arg2);
                break;
            }

            case 40:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Peek] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Peek] Card not found."); return;
                }
                handler.Peek(arg0, arg1);
                break;
            }

            case 42:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Untarget] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Untarget] Card not found."); return;
                }
                handler.Untarget(arg0, arg1);
                break;
            }

            case 44:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Target] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Target] Card not found."); return;
                }
                handler.Target(arg0, arg1);
                break;
            }

            case 46:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[TargetArrow] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[TargetArrow] Card not found."); return;
                }
                Card arg2 = Card.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[TargetArrow] Card not found."); return;
                }
                handler.TargetArrow(arg0, arg1, arg2);
                break;
            }

            case 47:
            {
                Card arg0 = Card.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Highlight] Card not found."); return;
                }
                string temp1 = reader.ReadString();
                Color? arg1  = temp1 == "" ? (Color?)null : (Color?)ColorConverter.ConvertFromString(temp1);
                handler.Highlight(arg0, arg1);
                break;
            }

            case 49:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Turn] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Turn] Card not found."); return;
                }
                bool arg2 = reader.ReadBoolean();
                handler.Turn(arg0, arg1, arg2);
                break;
            }

            case 51:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Rotate] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[Rotate] Card not found."); return;
                }
                CardOrientation arg2 = (CardOrientation)reader.ReadByte();
                handler.Rotate(arg0, arg1, arg2);
                break;
            }

            case 52:
            {
                Group arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Shuffle] Group not found."); return;
                }
                length = reader.ReadInt16();
                int[] arg1 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadInt32();
                }
                handler.Shuffle(arg0, arg1);
                break;
            }

            case 53:
            {
                Group arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[Shuffled] Group not found."); return;
                }
                length = reader.ReadInt16();
                int[] arg1 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                short[] arg2 = new short[length];
                for (int i = 0; i < length; ++i)
                {
                    arg2[i] = reader.ReadInt16();
                }
                handler.Shuffled(arg0, arg1, arg2);
                break;
            }

            case 54:
            {
                Group arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[UnaliasGrp] Group not found."); return;
                }
                handler.UnaliasGrp(arg0);
                break;
            }

            case 55:
            {
                length = reader.ReadInt16();
                int[] arg0 = new int[length];
                for (int i = 0; i < length; ++i)
                {
                    arg0[i] = reader.ReadInt32();
                }
                length = reader.ReadInt16();
                ulong[] arg1 = new ulong[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = reader.ReadUInt64();
                }
                handler.Unalias(arg0, arg1);
                break;
            }

            case 57:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[AddMarker] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[AddMarker] Card not found."); return;
                }
                Guid   arg2 = new Guid(reader.ReadBytes(16));
                string arg3 = reader.ReadString();
                ushort arg4 = reader.ReadUInt16();
                handler.AddMarker(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 59:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[RemoveMarker] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[RemoveMarker] Card not found."); return;
                }
                Guid   arg2 = new Guid(reader.ReadBytes(16));
                string arg3 = reader.ReadString();
                ushort arg4 = reader.ReadUInt16();
                handler.RemoveMarker(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 61:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[SetMarker] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[SetMarker] Card not found."); return;
                }
                Guid   arg2 = new Guid(reader.ReadBytes(16));
                string arg3 = reader.ReadString();
                ushort arg4 = reader.ReadUInt16();
                handler.SetMarker(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 63:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[TransferMarker] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[TransferMarker] Card not found."); return;
                }
                Card arg2 = Card.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[TransferMarker] Card not found."); return;
                }
                Guid   arg3 = new Guid(reader.ReadBytes(16));
                string arg4 = reader.ReadString();
                ushort arg5 = reader.ReadUInt16();
                handler.TransferMarker(arg0, arg1, arg2, arg3, arg4, arg5);
                break;
            }

            case 65:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PassTo] Player not found."); return;
                }
                ControllableObject arg1 = ControllableObject.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[PassTo] ControllableObject not found."); return;
                }
                Player arg2 = Player.Find(reader.ReadByte());
                if (arg2 == null)
                {
                    Debug.WriteLine("[PassTo] Player not found."); return;
                }
                bool arg3 = reader.ReadBoolean();
                handler.PassTo(arg0, arg1, arg2, arg3);
                break;
            }

            case 67:
            {
                ControllableObject arg0 = ControllableObject.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[TakeFrom] ControllableObject not found."); return;
                }
                Player arg1 = Player.Find(reader.ReadByte());
                if (arg1 == null)
                {
                    Debug.WriteLine("[TakeFrom] Player not found."); return;
                }
                handler.TakeFrom(arg0, arg1);
                break;
            }

            case 69:
            {
                ControllableObject arg0 = ControllableObject.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[DontTake] ControllableObject not found."); return;
                }
                handler.DontTake(arg0);
                break;
            }

            case 70:
            {
                Group arg0 = Group.Find(reader.ReadInt32());
                if (arg0 == null)
                {
                    Debug.WriteLine("[FreezeCardsVisibility] Group not found."); return;
                }
                handler.FreezeCardsVisibility(arg0);
                break;
            }

            case 72:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GroupVis] Player not found."); return;
                }
                Group arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[GroupVis] Group not found."); return;
                }
                bool arg2 = reader.ReadBoolean();
                bool arg3 = reader.ReadBoolean();
                handler.GroupVis(arg0, arg1, arg2, arg3);
                break;
            }

            case 74:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GroupVisAdd] Player not found."); return;
                }
                Group arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[GroupVisAdd] Group not found."); return;
                }
                Player arg2 = Player.Find(reader.ReadByte());
                if (arg2 == null)
                {
                    Debug.WriteLine("[GroupVisAdd] Player not found."); return;
                }
                handler.GroupVisAdd(arg0, arg1, arg2);
                break;
            }

            case 76:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[GroupVisRemove] Player not found."); return;
                }
                Group arg1 = Group.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[GroupVisRemove] Group not found."); return;
                }
                Player arg2 = Player.Find(reader.ReadByte());
                if (arg2 == null)
                {
                    Debug.WriteLine("[GroupVisRemove] Player not found."); return;
                }
                handler.GroupVisRemove(arg0, arg1, arg2);
                break;
            }

            case 78:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[LookAt] Player not found."); return;
                }
                int   arg1 = reader.ReadInt32();
                Group arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[LookAt] Group not found."); return;
                }
                bool arg3 = reader.ReadBoolean();
                handler.LookAt(arg0, arg1, arg2, arg3);
                break;
            }

            case 80:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[LookAtTop] Player not found."); return;
                }
                int   arg1 = reader.ReadInt32();
                Group arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[LookAtTop] Group not found."); return;
                }
                int  arg3 = reader.ReadInt32();
                bool arg4 = reader.ReadBoolean();
                handler.LookAtTop(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 82:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[LookAtBottom] Player not found."); return;
                }
                int   arg1 = reader.ReadInt32();
                Group arg2 = Group.Find(reader.ReadInt32());
                if (arg2 == null)
                {
                    Debug.WriteLine("[LookAtBottom] Group not found."); return;
                }
                int  arg3 = reader.ReadInt32();
                bool arg4 = reader.ReadBoolean();
                handler.LookAtBottom(arg0, arg1, arg2, arg3, arg4);
                break;
            }

            case 84:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[StartLimited] Player not found."); return;
                }
                length = reader.ReadInt16();
                Guid[] arg1 = new Guid[length];
                for (int i = 0; i < length; ++i)
                {
                    arg1[i] = new Guid(reader.ReadBytes(16));
                }
                handler.StartLimited(arg0, arg1);
                break;
            }

            case 86:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[CancelLimited] Player not found."); return;
                }
                handler.CancelLimited(arg0);
                break;
            }

            case 87:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[CardSwitchTo] Player not found."); return;
                }
                Card arg1 = Card.Find(reader.ReadInt32());
                if (arg1 == null)
                {
                    Debug.WriteLine("[CardSwitchTo] Card not found."); return;
                }
                string arg2 = reader.ReadString();
                handler.CardSwitchTo(arg0, arg1, arg2);
                break;
            }

            case 88:
            {
                Player arg0 = Player.Find(reader.ReadByte());
                if (arg0 == null)
                {
                    Debug.WriteLine("[PlayerSetGlobalVariable] Player not found."); return;
                }
                string arg1 = reader.ReadString();
                string arg2 = reader.ReadString();
                handler.PlayerSetGlobalVariable(arg0, arg1, arg2);
                break;
            }

            case 89:
            {
                string arg0 = reader.ReadString();
                string arg1 = reader.ReadString();
                handler.SetGlobalVariable(arg0, arg1);
                break;
            }

            case 91:
            {
                handler.Ping();
                break;
            }

            case 92:
            {
                bool arg0 = reader.ReadBoolean();
                handler.IsTableBackgroundFlipped(arg0);
                break;
            }

            default:
                Debug.WriteLine("[Client Parser] Unknown message (id =" + method + ")");
                break;
            }
            reader.Close();
        }