https://github.com/jpalumickas/csstats
Ruby gem which handle csstats.dat file generated by CSX module in AMX Mod X.
https://github.com/jpalumickas/csstats
amxx counter-strike csstats csx ruby
Last synced: about 1 year ago
JSON representation
Ruby gem which handle csstats.dat file generated by CSX module in AMX Mod X.
- Host: GitHub
- URL: https://github.com/jpalumickas/csstats
- Owner: jpalumickas
- License: mit
- Created: 2013-04-15T15:12:17.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2019-10-29T20:31:26.000Z (over 6 years ago)
- Last Synced: 2025-04-09T22:47:00.855Z (about 1 year ago)
- Topics: amxx, counter-strike, csstats, csx, ruby
- Language: Ruby
- Homepage: https://jpalumickas.com/csstats
- Size: 88.9 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# CSstats
Gem which handle `csstats.dat` file generated by CSX module
in AMX Mod X ([https://www.amxmodx.org][amxx])
[][rubygems]
[][codecov]
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'csstats'
```
## Usage
```ruby
require 'csstats'
stats = CSstats.new(path: 'csstats.dat')
stats.players.find(2).nick
```
You can set `max_players` option if you need to get specified number of players.
```ruby
stats = CSstats.new(path: 'csstats.dat', max_players: 15)
stats.players.count
# => 15
```
You can get player information by specified name.
```ruby
stats = CSstats.new(path: 'csstats.dat')
player_stats = stats.players.find_by(nick: 'my-super-nick')
puts player_stats.kills
# => 3
```
## Supported Ruby Versions
This library aims to support and is [tested against][github_actions] the following Ruby
implementations:
* Ruby 2.4.0
* Ruby 2.5.0
* Ruby 2.6.0
## Copyright
Copyright (c) 2013-2019 Justas Palumickas.
See [LICENSE][license] for details.
[rubygems]: https://rubygems.org/gems/csstats
[codecov]: https://codecov.io/gh/jpalumickas/csstats
[github_actions]: https://github.com/jpalumickas/csstats/actions
[amxx]: https://www.amxmodx.org
[license]: https://raw.githubusercontent.com/jpalumickas/csstats/master/LICENSE