hohav / peppi

Rust parser for Slippi SSBM replay files
MIT License
37 stars 9 forks source link

game.start.players netplay not parsed correctly #4

Closed NickCondron closed 2 years ago

NickCondron commented 2 years ago

When I attempt to parse this replay and print out the game object I get the wrong result (irrelevant parts removed). As you can see it looks good in the metadata, but something is wrong in the start block. Verified that it parses correctly using official slippi-js.

game-slp.zip

Game {
    metadata: Metadata {
        date: Some(
            2022-05-03T04:53:54Z,
        ),
        ...
        players: Some(
            [
                Player {
                    port: P1,
                    characters: Some(
                        {
                            22: 18497,
                        },
                    ),
                    netplay: Some(
                        Netplay {
                            code: "MANG#0",
                            name: "mang",
                        },
                    ),
                },
                Player {
                    port: P2,
                    characters: Some(
                        {
                            18: 18497,
                        },
                    ),
                    netplay: Some(
                        Netplay {
                            code: "ZAIN#0",
                            name: "Zain",
                        },
                    ),
                },
            ],
        ),
    },
    start: Start {
        slippi: Slippi {
            version: Version(
                3,
                12,
                0,
            ),
        },
        ...
        players: [
            Player {
                port: P1,
                ...
                netplay: Some(
                    Netplay {
                        name: "mang",
                        code: "mang", // HERE
                    },
                ),
            },
            Player {
                port: P2,
                ...
                netplay: Some(
                    Netplay {
                        name: "", // HERE
                        code: "", // HERE
                    },
                ),
            },
        ]
...
    }
NickCondron commented 2 years ago

Ok I was able to fix this. Let me know if you want me to add the changes to my existing PR for version-3.12 or wait until that is merged. I would make a separate PR but the merges will conflict.

Edit: I just added it to the PR