Git Product home page Git Product logo

csgo-tools's People

Contributors

jannislehmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

bioblaze

csgo-tools's Issues

Add tracing

Add opentracing / jaeger tracing to the project.

Restructure packages

The pkg does not contain re-usable packages.

  1. The ShareCode struct and functions could be put into a package. The database sharecode struct could then embed the pkg struct.
  2. The config dir should be in the root
  3. The demo package could be split up and one part could stay as public pkg
  4. The gamecoordinator package contains tool specific code

Reconsider database structure and engine

Currently everything shares one database and schema. However, the data itself might not fit a relation database perfectly. We could consider switching to a document or column database.

Fix disabling api users

The Steam API sometimes returns an invalid JSON response and thus the csgo api users get disabled even though their credentials are working.

Handle connection timeouts

The apiclient currently disables csgo users for further match fetching when the host running the codes times out.
In order to not disable the users by mistake, the error handling should be improved insofar that we detect whether the api returned an access exception or a temporary timeout happened.

Merge gameclient and downloader

When the gameclient receives the match download link from the coordinator, it should directly download it or enqueue it for later downloading. This would reduce the complexity a little and will help with a later database refactor.

Add statistics about the amount of anti-ecos / ecos won

We want to able to tell how often a player (/team) wins rounds with either no equipment or a full buy versus full buy / eco enemies.

A first version could simply use the round after the pistol rounds in order to check which teams win these rounds as they are kinda anti-ecos.

Parse demos and save the match history

We want to parse each demo file and persist the data in the database to calculate further information and stats based on the information.
In order to be able to reparse demos when the parser adds new information, we need to add a parsedWithVersion flag to the match entry in the database.

Persist kill information

We want to provide more information about every kill such as a kill log for every match. In order to do so, we have to persist every kill in the game.

Refactor all PKs to UUID

Some Primary Keys are too dependent on some sources like the match id from Valve MM demos. However, if we add support for Faceit demos, this will break. We should therefore refactor some primary keys and some models.

Allow third-party demos

We want to allow the parsing of third-party demos.
The main issue here is the demo importing as it heavily relies on the match id and download url.

Calculate won 1vX situations

We want to able to receive the amount of won rounds where the player was alone and played against >= 3 players.

Persist match results

The processed match result should be persisted in the database in order to serve them through a possible API.
However, in order to reprocess already processed demos if new parsing methods are added, a flag to reparse should be add. But, we do not want to reparse all demos, to fix that we could add a parsed with version x to the match result struct.

Document rest api

The rest api routes should be documented. If suitable, we could also add Swagger.

Do not copy root directory into Docker image

Currently, in order to build the Docker image, the whole project root directory is copied (with a few exceptions). This should not happen to prevent leaking private files.
We could also add a two-step image builder. The first step being a golang builder.

Some player's data is all 0

Sometimes a PlayerResult with the SteamID of 0 and all others stats of 0 show up. However, the death count is 1.
My guess is that those player disconnected or got banned.

Prevent duplicate demo downloading

The match id we use to scan the demo file names and the match ids, which the GC return, are not the same.
Therefore, demos could be downloaded twice in the following scenario:

  1. Full database reset, which scans the demo dir. This creates database entries for the local demos with some kind of match id.
  2. Run the API client to get the latest matches, which will return share codes
  3. Decode the share codes, which will return a similar match id.
  4. Get the download link via the GC.

The file name in the download link matches the match id from already downloaded demos. However this is different to the decoded match id.

A possible way could be to check the file names of the to be downloaded demo and query the db for this specific id. If that exists, skip the download.

However, the best way would be to somehow merge the entries.

Collect further REST ideas

scope.gg and Leetify have some great REST resources, which I want to use to collect some further ideas.

Prevent duplicate demos

Currently demos downloaded via the game might get downloaded again via the download tools.
Therefore, I have to find a way to scan demos for some unique identifier, before storing them.
Existing demos might be opened and the matchid might need to be extracted.

Duplicate share codes entries

When decoding the share code multiple times, the outcome id stays the same. However, the match id varies slightly.
My guess is that this comes from slight differences when using the float.

Therefore, the outcomeid should become the primary key.

Example:

Created Updated Deleted MatchID OutcomeID Token Sharecode
2021-03-13 17:29:02.097343+00 2021-03-13 17:29:02.097343+00   3469236333430440513 3469240190311072117 50359 CSGO-6MdTE-qNtNC-kiybE-DCDQ5-qVSFE
2021-03-13 17:29:02.097343+00 2021-03-13 17:29:02.097343+00   3469240190311072117 3469240190311072117 50359 CSGO-6MdTE-qNtNC-kiybE-DCDQ5-qVSFE

Prevent parsing non-existing demos

Currently, we mark a demo as downloaded if the download link as expired. Therefore, the demo parser tries to open and parse the specified demo. Thus, an error is returned since the file does not exist.

We should probably change the architecture or database structure a little to better differentiate.

Add message broker

A message broker could be add to allow communication across the different services.
This is somewhat overkill and is mainly meant to try and learn using a message broker e.g. RabbitMQ.
This would also replace the "communication" using the database.

Save economy / equipment value during demo parsing

In order to detect whether a team had an eco round or full buy, I need to save the equipment value while parsing the data.
The csgo parser exposes the following data per player:

  • MoneySpentThisRound
  • MoneySpentTotal
  • EquipmentValueCurrent
  • EquipmentValueFreezeTimeEnd
  • EquipmentValueFreezeTimeEnd

All this data could be used to determine the amount of eco round wins/losses and anti-eco round wins/losses etc.
I already wrote a PoC script to check all this data but need to rewrite this in order to fit into this project.

Persist round history

In order to expose information who killed whom during a round, we need to persist a kill log for each round.
This data might make the information about the k/d/a somewhat redundant as that could be calculated by the api during runtime.

Save thrown nades

I want to save the nade thrown etc. events to be able to parse the following and probably more:

  • Flash assists
  • Flash bang efficiency (how many blind enemies per flash / team mates)
  • Flash bang duration
  • Unused flash bangs
  • Similar information for the other nades (excepts decoys. we don't use them)

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.