GithubHelp home page GithubHelp logo

node-csgo-parser's Introduction

Node-CSGO-Parser

Build Status Code Climate Test Coverage Issue Count npm

Extract Items/Skins/... from raw VDF data files


TODOs

  • Refactoring... This file will be too long
  • Generalization isDatasInitialized
  • Better handle of Little Endian for vdf / Hack dependency
  • Datamining File for more informations
  • DEBUG - Better Handle of Knifes and Rarities (My god, need so much hack ><. Volvo... that's not really clean ^^')
  • To ES6
  • Optimize Performances
  • defindex to int ?

Installation

npm install node-csgo-parser --save

Usage

var parser = require('./csgo-data-parser'),

var schemaFilePath = './test/test-data/schema.txt', 
	langFilePath = './test/test-data/csgo_english.txt',
	itemsFilePath = './test/test-data/items_game.txt',
	outLogFilePath = './out/logs/parser.log';

var csgoDataParser = new parser(schemaFilePath, langFilePath, itemsFilePath, 'debug', outLogFilePath);

Must pass schema file (like schema.txt), language file (like csgo_english.txt) and item file (like item_data.txt) at VDF format

Example

A sample script is at example.js.

API Documentation

new CSGODataParser(schemaFilePath, langFilePath, itemsFilePath, logLevel, logFilePath)

Param Type Description
schemaFilePath String Path to schema file.
langFilePath String Path to csgo_lang file.
itemsFilePath String Path to items_game file.
logLevel String Winston Log Level, if > info no timing data for generations.
logFilePath String Choosen file path to write logs.

csgoDataParser.getLogger() ⇒ winston.Logger

Return the parser's logger.

Kind: instance method of CSGODataParser
Returns: winston.Logger - Winston based Parser's Logger. Access: public

csgoDataParser.isDatasInitialized() ⇒ boolean

Check if datas files are OK.

Kind: instance method of CSGODataParser
Returns: boolean - True if datas initialized, false otherwise
Access: public

csgoDataParser.isLangInitialized() ⇒ boolean

Check if lang file is OK.

Kind: instance method of CSGODataParser
Returns: boolean - True if initialized, false otherwise
Access: public

csgoDataParser.getLangValue(keyLang) ⇒ String

Get the lang value from valve key i18n values.

Kind: instance method of CSGODataParser
Returns: String - traduction if langfile initialized and key is present, key otherwise
Access: public

Param Type Description
keyLang String valve key i18n values (like #PaintKit_aa_fade_Tag)

csgoDataParser.getSkinsMap() ⇒ {[key: string]: Weapon}

Generate a key-value map of all weapon skins (including rifles, knives, gloves and hand wraps).

Kind: instance method of CSGODataParser
Returns: {[key: string]: Weapon} - key-value map, where key is the skin's fullName (such as "Desert Eagle | Blaze") and the value is the Weapon object.
Access: public

csgoDataParser.getWeapons() ⇒ Array.<Weapon>

Generate bases Weapons data from schema's data.

Kind: instance method of CSGODataParser
Returns: Array.<Weapon> - List of Objects. One object represent one Weapon.
Access: public

csgoDataParser.getCollections() ⇒ Array.<Collection>

Generate collection's data from itemsgame's data.

Kind: instance method of CSGODataParser
Returns: Array.<Collection> - List of Collections. One object represent one Collection.
Access: public

csgoDataParser.getExteriors() ⇒ Array.<String>

Generate exteriors.

Kind: instance method of CSGODataParser
Returns: Array.<String> - One string represent one exterior type - I18N Name
Access: public

csgoDataParser.getCases() ⇒ Array.<Prefab>

Generate Weapon/Stickers skin Case list.

Kind: instance method of CSGODataParser
Returns: Array.<Prefab> - List of Object. One object represent one case
Access: public

csgoDataParser.getCaseKeys() ⇒ Array.<Prefab>

Generate Weapon/Stickers skin Case keys list.

Kind: instance method of CSGODataParser
Returns: Array.<Prefab> - List of Object. One object represent one case key
Access: public

csgoDataParser.getStickers() ⇒ Array.<Sticker>

Generate Stickers list. Note : Some unknown stickers are present in the item_game file so they have a rarity set to "default" (id 2 to 12)

Kind: instance method of CSGODataParser
Returns: Array.<Sticker> - List of Sticker. One object represent one sticker
Access: public

csgoDataParser.getMusicKits() ⇒ Array.<MusicKit>

Generate MusicKits list.

Kind: instance method of CSGODataParser
Returns: Array.<MusicKit> - List of MusicKit. One object represent one music kit
Access: public

csgoDataParser.getRaritiesIndex() ⇒ Array.<Rarity>

Generate Rarities index.

Kind: instance method of CSGODataParser
Returns: Array.<Rarity> - List of Rarity objects. One object represent one rarity.
Access: public

node-csgo-parser's People

Contributors

ballrock avatar redsparr0w avatar sentisso avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.