1.0.0 • Published 3 years ago

ptcgo-log-parser v1.0.0

Weekly downloads
20
License
ISC
Repository
github
Last release
3 years ago

Welcome to PTCGO-Log-Parser

Node.js module for quickly parsing PTCGO Game logs into a more usable json representation.

Installation

$ npm i ptcgo-log-parser

Usage

var ptcgo-parser = require('ptcgo-log-parser');

Read log data from a file, and parse it.

var result = ptcgo-parser.parse(data);

Result Json will look something like this:

{
	"turns": 
	[{ 
		"number": 1, 
		"entry": "August flipped 1 coin(s), resulting in 1 heads and 0 tails, for Beginning of Game", 
		"data": 
		{
			"hasData": false,
       			"noDataString": "",
       			"source": {"CARD OBJECT"},
       			"actor": "",
       			"target": {"CARD OBJECT"}
		}
	}],
	"errors": [""],
  	"gs":
    	{ 
		"data":
		{
			"playerHand": [{"CARD OBJECT"}],
			"playerDiscard": [{"CARD OBJECT"}],
			"playerBench": [{"CARD OBJECT"}],
			"playerActivePokemon": [{"CARD OBJECT"}],
			"opponentHand": [{"CARD OBJECT"}],
			"opponentDiscard": [{"CARD OBJECT"}],
			"opponentBench": [{"CARD OBJECT"}],
			"opponentActivePokemon": [{"CARD OBJECT"}],
			"lostZone": [{"CARD OBJECT"}],
			"stadium": {"CARD OBJECT"},
			"playerDeckCount": 0,
			"playerprizeCount": 0,
			"opponentDeckCount": 0,
			"opponentPrizeCount": 0
		},
		"errors": [""]
	}
}

Each Card Object will have this structure:

{ 
	"numberInSet": 193,
	"name": "DarkCity",
	"series": "Sun & Moon",
	"set": "Unified Minds",
	"link": "",
	"type": "TrainerCard" 
}

Npm Url

https://www.npmjs.com/package/ptcgo-log-parser

Versions

  • 0.1.6 (Latest) - JSON names finalized, sample JSON provided in README.md
  • 0.1.5 - Clean data for turn entries and cards
  • 0.1.4 - No major feature addition. Reason for publish: Don't deploy tests to npm, just source code
  • 0.1.3 - No major feature addition. Reason for publish: Don't deploy tests to npm, just source code
  • 0.1.2 - No major feature addition. Reason for publish: Project source code restructure
  • 0.1.1 - Parsing of game log and game state is functional
  • 0.1.0 - Project initialization

Upcoming Features

  • Card JSON Representations will include a link to their specific card entry in the Pokemon Card Database instead of only raw data. Link to database: https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/
  • Ability to generate PTCGO decklists from log files (Helps with discovering decks that are hidden from viewing/exporting
1.0.0

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago