Exemplo n.º 1
0
        public static Recv_JoinGameResponse read(BinaryReader binaryReader)
        {
            Recv_JoinGameResponse newObj = new Recv_JoinGameResponse();

            newObj.i_idGame     = binaryReader.ReadUInt32();
            newObj.i_iWhichTeam = binaryReader.ReadInt32();
            return(newObj);
        }
Exemplo n.º 2
0
    public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView)
    {
        bool handled = true;

        PacketOpcode opcode = Util.readOpcode(messageDataReader);

        switch (opcode)
        {
        case PacketOpcode.Evt_Game__Join_ID:
        {
            Join message = Join.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Game__Quit_ID:
        {
            EmptyMessage message = new EmptyMessage(opcode);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Game__Stalemate_ID:
        {
            Stalemate message = Stalemate.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Game__Recv_JoinGameResponse_ID:
        {
            Recv_JoinGameResponse message = Recv_JoinGameResponse.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Game__Recv_GameOver_ID:
        {
            Recv_GameOver message = Recv_GameOver.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        default: {
            handled = false;
            break;
        }
        }

        return(handled);
    }