Beispiel #1
0
            public ushort unknown_be;       // 0xBE  always 0

            public USERRecord(byte[] byArrayUSERPacket)
            {
                const byte kMiiDataLength = 0x4C;

                record_id     = BinaryOps.ToU32(byArrayUSERPacket,0x00);
                max_mii_count = BinaryOps.ToU16(byArrayUSERPacket,0x04);
                unknown_06    = BinaryOps.ToU16(byArrayUSERPacket,0x06);

                mii_data_host = new byte[kMiiDataLength];
                Array.Copy(byArrayUSERPacket,0x08,mii_data_host,0x00,kMiiDataLength);

                mii_data_guest = new byte[kMiiDataLength];
                Array.Copy(byArrayUSERPacket,0x54,mii_data_guest,0x00,kMiiDataLength);

                wii_fc      = BinaryOps.ToU64(byArrayUSERPacket,0xA0);
                friend_code = BinaryOps.ToU64(byArrayUSERPacket,0xA8);

                country = byArrayUSERPacket[0xB0];
                state   = byArrayUSERPacket[0xB1];
                city    = BinaryOps.ToU16(byArrayUSERPacket,0xB2);

                location_lon = BinaryOps.ToU16(byArrayUSERPacket,0xB4);
                location_lat = BinaryOps.ToU16(byArrayUSERPacket,0xB6);

                racing_rankpts = BinaryOps.ToU16(byArrayUSERPacket,0xB8);
                battle_rankpts = BinaryOps.ToU16(byArrayUSERPacket,0xBA);
                game_id3       = byArrayUSERPacket[0xBC];
                region         = byArrayUSERPacket[0xBD];
                unknown_be     = byArrayUSERPacket[0xBE];
            }
Beispiel #2
0
            public byte                      sel_engine;     // 0x37  0:none, 1:100cc, 2:150cc 3:mirror (WW and 1st race of GP)

            public SELECTRecord(byte[] byArraySELECTPacket)
            {
                time_sender   = BinaryOps.ToU64(byArraySELECTPacket,0x00);
                time_receiver = BinaryOps.ToU64(byArraySELECTPacket,0x08);

                rank_pl1       = BinaryOps.ToU16(byArraySELECTPacket,0x10);
                sum_pts_pl1    = BinaryOps.ToU16(byArraySELECTPacket,0x12);
                driver_pl1     = byArraySELECTPacket[0x14];
                vehicle_pl1    = byArraySELECTPacket[0x15];
                user_track_pl1 = byArraySELECTPacket[0x16];
                ranking_pl1    = byArraySELECTPacket[0x17];

                rank_pl2       = BinaryOps.ToU16(byArraySELECTPacket,0x18);
                sum_pts_pl2    = BinaryOps.ToU16(byArraySELECTPacket,0x1A);
                driver_pl2     = byArraySELECTPacket[0x1C];
                vehicle_pl2    = byArraySELECTPacket[0x1D];
                user_track_pl2 = byArraySELECTPacket[0x1E];
                ranking_pl2    = byArraySELECTPacket[0x1F];

                select_id   = BinaryOps.ToU32(byArraySELECTPacket,0x20);
                battle_type = byArraySELECTPacket[0x24];
                team        = BinaryOps.ToU32(byArraySELECTPacket,0x25) >> 8;

                client_slot = new byte[12];
                for (int i = 0; i < 12; i++)
                {
                    client_slot[i] = byArraySELECTPacket[i + 0x28];
                }

                sel_track  = byArraySELECTPacket[0x34];
                sel_phase  = (MarioKartWii.ESelectPhase)byArraySELECTPacket[0x35];
                sel_client = byArraySELECTPacket[0x36];
                sel_engine = byArraySELECTPacket[0x37];
            }
Beispiel #3
0
            public byte   engine;       // 0x24  engine: 0:50cc, 1:100cc, 2:150cc, 3:mirror

            public RACEHEADER1Record(byte[] byArrayRACEHEADER1Packet)
            {
                timer      = BinaryOps.ToU16(byArrayRACEHEADER1Packet,0x02);
                select_id  = BinaryOps.ToU32(byArrayRACEHEADER1Packet,0x04);
                team       = BinaryOps.ToU16(byArrayRACEHEADER1Packet,0x0A);
                lag_frames = BinaryOps.ToU16(byArrayRACEHEADER1Packet,0x0C);

                vehicle    = new byte[2];
                vehicle[0] = byArrayRACEHEADER1Packet[0x0E];
                vehicle[1] = byArrayRACEHEADER1Packet[0x10];

                driver    = new byte[2];
                driver[0] = byArrayRACEHEADER1Packet[0x0F];
                driver[1] = byArrayRACEHEADER1Packet[0x11];

                track = byArrayRACEHEADER1Packet[0x16];

                client_slot = new byte[12];
                for (int i = 0; i < 12; i++)
                {
                    client_slot[i] = byArrayRACEHEADER1Packet[i + 0x18];
                }

                engine = byArrayRACEHEADER1Packet[0x24];
            }
Beispiel #4
0
            public ushort finish_timer; // 0x16  time since leader finish, 59.94 Hz

            public RACEHEADER2Record(byte[] byArrayRACEHEADER2Packet)
            {
                end_time    = new uint[2];
                end_time[0] = BinaryOps.ToU32(byArrayRACEHEADER2Packet,0x05) >> 5 & 0x003FFFFF;
                end_time[1] = BinaryOps.ToU32(byArrayRACEHEADER2Packet,0x0A) >> 6 & 0x003FFFFF;

                player_idx    = new byte[2];
                player_idx[0] = byArrayRACEHEADER2Packet[0x10];
                player_idx[1] = byArrayRACEHEADER2Packet[0x11];

                finish_timer = BinaryOps.ToU16(byArrayRACEHEADER2Packet,0x16);
            }
Beispiel #5
0
            public byte   rank;            // 0x32  Rank in race.

            public RACEDATARecord(byte[] byArrayRACEDATAPacket)
            {
                position    = new int[3];
                position[0] = (int)(BinaryOps.ToU32(byArrayRACEDATAPacket,0x00) >> 4 & 0x0FFFFFFF);
                position[1] = (int)(BinaryOps.ToU32(byArrayRACEDATAPacket,0x03) >> 0 & 0x0FFFFFFF);
                position[2] = (int)(BinaryOps.ToU32(byArrayRACEDATAPacket,0x07) >> 4 & 0x0FFFFFFF);

                direction    = new uint[3];
                direction[0] = BinaryOps.ToU32(byArrayRACEDATAPacket,0x09) >> 3 & 0x0001FFFF;
                direction[1] = BinaryOps.ToU32(byArrayRACEDATAPacket,0x0B) >> 2 & 0x0001FFFF;
                direction[2] = BinaryOps.ToU32(byArrayRACEDATAPacket,0x0D) >> 1 & 0x0001FFFF;

                speed = (short)(BinaryOps.ToU16(byArrayRACEDATAPacket,0x11));

                tilt_angle = (int)(BinaryOps.ToU32(byArrayRACEDATAPacket,0x18));

                nunchuk_X_axis = (byte)(byArrayRACEDATAPacket[0x25] >> 4 & 0x0F);
                nunchuk_Y_axis = (byte)(byArrayRACEDATAPacket[0x26] >> 4 & 0x0F);
                thundercloud   = (byte)(byArrayRACEDATAPacket[0x26] >> 0 & 0x01);
                lakitu         = (byte)(byArrayRACEDATAPacket[0x27] >> 6 & 0x03);
                falldown       = (byte)(byArrayRACEDATAPacket[0x27] >> 0 & 0x01);
                buttons        = (byte)(byArrayRACEDATAPacket[0x28] >> 4 & 0x0F);
                mt_start       = (byte)(byArrayRACEDATAPacket[0x28] >> 3 & 0x01);
                shroom         = (byte)(byArrayRACEDATAPacket[0x29] >> 6 & 0x01);
                blooper_ink    = (byte)(byArrayRACEDATAPacket[0x29] >> 1 & 0x01);
                megamushroom   = (byte)(byArrayRACEDATAPacket[0x29] >> 0 & 0x01);
                star           = (byte)(byArrayRACEDATAPacket[0x2A] >> 7 & 0x01);
                twanwan        = (byte)(byArrayRACEDATAPacket[0x2A] >> 2 & 0x01);
                thwomp_hit     = (byte)(byArrayRACEDATAPacket[0x2A] >> 0 & 0x01);
                fire           = (byte)(byArrayRACEDATAPacket[0x2B] >> 5 & 0x01);
                cataquack      = (byte)(byArrayRACEDATAPacket[0x2B] >> 4 & 0x01);
                star_hit       = (byte)(byArrayRACEDATAPacket[0x2C] >> 7 & 0x01);
                fakebox_hit    = (byte)(byArrayRACEDATAPacket[0x2C] >> 6 & 0x01);
                bomb_blue_hit  = (byte)(byArrayRACEDATAPacket[0x2C] >> 5 & 0x01);
                bomb_blue_half = (byte)(byArrayRACEDATAPacket[0x2C] >> 4 & 0x01);
                goomba_hit     = (byte)(byArrayRACEDATAPacket[0x2C] >> 1 & 0x01);
                collision      = (byte)(byArrayRACEDATAPacket[0x2E] >> 0 & 0x01);
                wheelie_start  = (byte)(byArrayRACEDATAPacket[0x2F] >> 7 & 0x01);
                stunt          = (byte)(byArrayRACEDATAPacket[0x2F] >> 5 & 0x01);
                hop            = (byte)(byArrayRACEDATAPacket[0x2F] >> 3 & 0x01);

                cannon = (byte)(BinaryOps.ToU16(byArrayRACEDATAPacket,0x2F) >> 6 & 0x0007);

                drift           = (byte)(byArrayRACEDATAPacket[0x32] >> 6 & 0x03);
                already_drifted = (byte)(byArrayRACEDATAPacket[0x32] >> 4 & 0x01);

                rank = (byte)(BinaryOps.ToU16(byArrayRACEDATAPacket,0x32) >> 7 & 0x000F);
            }