Skip to content

Commit

Permalink
better handling of |title|
Browse files Browse the repository at this point in the history
This differs from upstream's BattleTextParser but is just generally
better behavior overall

identified by @singiamtel
  • Loading branch information
scheibo committed Mar 20, 2024
1 parent f466e29 commit a5bcdf2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pkmn/client",
"version": "0.6.20",
"version": "0.6.21",
"description": "Client battle engine for Pokémon Showdown",
"repository": "github:pkmn/ps",
"license": "MIT",
Expand All @@ -16,7 +16,7 @@
],
"dependencies": {
"@pkmn/data": "^0.9.0",
"@pkmn/protocol": "^0.6.20"
"@pkmn/protocol": "^0.6.21"
},
"devDependencies": {
"@pkmn/dex": "^0.9.0"
Expand Down
2 changes: 1 addition & 1 deletion protocol/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pkmn/protocol",
"version": "0.6.20",
"version": "0.6.21",
"description": "Parsing logic for Pokémon Showdown's PROTOCOL and SIM-PROTOCOL",
"repository": "github:pkmn/ps",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions protocol/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ describe('Protocol', () => {

chunk = '>battle-1\n|-damage|p2a: Poliwrath|219/383|[from] Recoil|[of] p1a: Chansey';
expect(Object.keys(Array.from(Protocol.parse(chunk))[0].kwArgs)).toEqual(['of', 'from']);

const parsed = Protocol.parseBattleLine('|title|[Modlog][techcode]');
expect(parsed.args[1]).toBe('[Modlog][techcode]');
expect(Object.keys(parsed.kwArgs)).toHaveLength(0);
});

it('#parsePokemonIdent', () => {
Expand Down
2 changes: 1 addition & 1 deletion protocol/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1932,7 +1932,7 @@ export const Protocol = new class {
const cmd = line.slice(1, index);
switch (cmd) {
case 'chatmsg': case 'chatmsg-raw': case 'raw': case 'error': case 'html':
case 'inactive': case 'inactiveoff': case 'warning':
case 'inactive': case 'inactiveoff': case 'warning': case 'title':
case 'fieldhtml': case 'controlshtml': case 'bigerror':
case 'debug': case 'tier': case 'challstr': case 'popup': case '':
return upgradeArgs([cmd, line.slice(index + 1)]);
Expand Down
4 changes: 2 additions & 2 deletions view/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pkmn/view",
"version": "0.6.20",
"version": "0.6.21",
"description": "Library for building Pokémon Showdown client UIs",
"repository": "github:pkmn/ps",
"license": "MIT",
Expand All @@ -18,7 +18,7 @@
"build"
],
"dependencies": {
"@pkmn/protocol": "^0.6.20",
"@pkmn/protocol": "^0.6.21",
"@pkmn/types": "^4.0.0"
},
"scripts": {
Expand Down

0 comments on commit a5bcdf2

Please sign in to comment.