Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get metadata when player's name has a special character #126

Open
Sheepolution opened this issue May 24, 2023 · 3 comments
Open

Can't get metadata when player's name has a special character #126

Sheepolution opened this issue May 24, 2023 · 3 comments

Comments

@Sheepolution
Copy link

Sheepolution commented May 24, 2023

Today I noticed slippi-js not working on certain matches. Later on I realized that this specifically happened on the matches with the player who has ェnoonェ as their display name. My guess is that because of the special character (ェ) Slippi-js somehow fails.

Here are some .slp files of matches with this player.

slippi_files.zip

@cnkeats
Copy link
Contributor

cnkeats commented May 24, 2023

Can you be more specific about how to reproduce the issue? The replays process fine for me

const game = new SlippiGame("./Game_20230523T215817.slp");
const settings = game.getSettings();
console.info(settings);
{
      slpVersion: '3.14.0',
      timerType: 2,
      inGameMode: 32,
      friendlyFireEnabled: true,
      isTeams: false,
      itemSpawnBehavior: 255,
      stageId: 8,
      startingTimerSeconds: 480,
      enabledItems: 1099511627775,
      players: [
        {
          playerIndex: 0,
          port: 1,
          characterId: 8,
          type: 0,
          startStocks: 4,
          characterColor: 2,
          teamShade: 0,
          handicap: 9,
          teamId: 0,
          staminaMode: false,
          silentCharacter: false,
          lowGravity: false,
          invisible: false,
          blackStockIcon: false,
          metal: false,
          startOnAngelPlatform: false,
          rumbleEnabled: false,
          cpuLevel: 1,
          offenseRatio: 1,
          defenseRatio: 1,
          modelScale: 1,
          controllerFix: 'UCF',
          nametag: '',
          displayName: 'ェnoonェ',
          connectCode: 'NOON#888',
          userId: '8YEJcBGEIqc54Dzk1t68K1audW13'
        },
        {
          playerIndex: 1,
          port: 2,
          characterId: 13,
          type: 0,
          startStocks: 4,
          characterColor: 2,
          teamShade: 0,
          handicap: 9,
          teamId: 1,
          staminaMode: false,
          silentCharacter: false,
          lowGravity: false,
          invisible: false,
          blackStockIcon: false,
          metal: false,
          startOnAngelPlatform: false,
          rumbleEnabled: false,
          cpuLevel: 1,
          offenseRatio: 1,
          defenseRatio: 1,
          modelScale: 1,
          controllerFix: 'UCF',
          nametag: '',
          displayName: 'xin',
          connectCode: 'XIN#484',
          userId: 'cJeLclrRp9R6jbQmaHd2oeHvOdx2'
        }
      ],
      scene: 2,
      gameMode: 8,
      language: 1,
      gameInfoBlock: {
        gameBitfield1: 50,
        gameBitfield2: 1,
        gameBitfield3: 134,
        gameBitfield4: 76,
        bombRainEnabled: false,
        itemSpawnBehavior: -1,
        selfDestructScoreValue: -1,
        itemSpawnBitfield1: 255,
        itemSpawnBitfield2: 255,
        itemSpawnBitfield3: 255,
        itemSpawnBitfield4: 255,
        itemSpawnBitfield5: 255,
        damageRatio: 1
      },
      randomSeed: 14584,
      isPAL: false,
      isFrozenPS: false,
      matchInfo: {
        matchId: 'mode.direct-2023-05-23T19:52:22.37-2',
        gameNumber: 5,
        tiebreakerNumber: 0
      }
}

image
image

@Sheepolution
Copy link
Author

Yes, my apologies. I was specifically talking about getMetadata().

const { SlippiGame } = require("@slippi/slippi-js");

const game1 = new SlippiGame("./Game_20230523T204542.slp"); // ェnoonェ vs Danubi
const metadata1 = game1.getMetadata();
console.info(metadata1); // null

const game2 = new SlippiGame("./Game_20230523T215817.slp"); // ェnoonェ vs Xin
const metadata2 = game2.getMetadata();
console.info(metadata2); // null

const game3 = new SlippiGame("./Game_20230523T214550.slp"); // Xin vs Lily
const metadata3 = game3.getMetadata();
console.info(metadata3); // Data!

@NikhilNarayana
Copy link
Member

summary: these characters are unsupported in UBJSON's non binary types. for now try to use fallbacks when possible.

the parse error occurs at the decode stage in slippi-js
image

i'm inclined to believe this is a UBJSON limitation because peppi also fails like slippi-js
image

here's a quick screenshot of the metadata decoded in HxD, not sure how helpful that is, but it is possible wide characters are being decoded similarly
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants