overlook-csgo 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.travis.yml +1 -2
 - data/README.md +1 -1
 - data/lib/overlook.rb +1 -1
 - data/lib/overlook/csgo/demo/user_message_message_handler.rb +4 -8
 - data/lib/overlook/csgo/match_info_decoder.rb +1 -6
 - data/lib/overlook/version.rb +1 -1
 - data/overlook-csgo.gemspec +3 -1
 - metadata +6 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 87a7cd83f7ad143ebf6ce47b5cf32fb9e43769f0
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 37b4c303d2e4c3893f3b81eb7ebd581464c18d81
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 30216334445101d00fbb60ab18b8e0edc4db471cab11fbfc6e0152311f298c73045c5383d28b720a0c9471d0aac05affbeaf6e59dd41df8fc19c875b60fbc8eb
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 59c971f5ebb5069d6eefcc7217225d16a861637f5dacb1bdf06016c24f8008ec799823544abf67a516f6d04c11ddd05ff2b8d61a8892683803d2a741703d647e
         
     | 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -46,7 +46,7 @@ class ReplayAnalyzerSubscriber 
     | 
|
| 
       46 
46 
     | 
    
         
             
              # The header event comes in the form
         
     | 
| 
       47 
47 
     | 
    
         
             
              #   { map_name: 'cs_office' }
         
     | 
| 
       48 
48 
     | 
    
         
             
              def header(header)
         
     | 
| 
       49 
     | 
    
         
            -
                # do something with the header 
     | 
| 
      
 49 
     | 
    
         
            +
                # do something with the header[:map_name]
         
     | 
| 
       50 
50 
     | 
    
         
             
              end
         
     | 
| 
       51 
51 
     | 
    
         | 
| 
       52 
52 
     | 
    
         
             
              # Called when the replay has been parsed successfully.
         
     | 
    
        data/lib/overlook.rb
    CHANGED
    
    
| 
         @@ -1,11 +1,7 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'steamidlib'
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
1 
     | 
    
         
             
            module Overlook
         
     | 
| 
       4 
2 
     | 
    
         
             
              module Csgo
         
     | 
| 
       5 
3 
     | 
    
         
             
                module Demo
         
     | 
| 
       6 
4 
     | 
    
         
             
                  class UserMessageMessageHandler
         
     | 
| 
       7 
     | 
    
         
            -
                    include SteamIDs
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
5 
     | 
    
         
             
                    def initialize(parser)
         
     | 
| 
       10 
6 
     | 
    
         
             
                      @parser = parser
         
     | 
| 
       11 
7 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -16,10 +12,10 @@ module Overlook 
     | 
|
| 
       16 
12 
     | 
    
         
             
                      case user_message.msg_type
         
     | 
| 
       17 
13 
     | 
    
         
             
                      when ::Csgo::ECstrike15UserMessages::CS_UM_XpUpdate
         
     | 
| 
       18 
14 
     | 
    
         
             
                        xp_update_message =  ::Csgo::CCSUsrMsg_XpUpdate.decode(user_message.msg_data)
         
     | 
| 
       19 
     | 
    
         
            -
                        community_id =  
     | 
| 
      
 15 
     | 
    
         
            +
                        community_id = Steam3Id.parse("[U:1:#{xp_update_message.data.account_id}]").to_i
         
     | 
| 
       20 
16 
     | 
    
         | 
| 
       21 
17 
     | 
    
         
             
                        xp_update = {
         
     | 
| 
       22 
     | 
    
         
            -
                          community_id => {
         
     | 
| 
      
 18 
     | 
    
         
            +
                          community_id.to_s => {
         
     | 
| 
       23 
19 
     | 
    
         
             
                            xp: xp_update_message.data.current_xp,
         
     | 
| 
       24 
20 
     | 
    
         
             
                            lvl: xp_update_message.data.current_level,
         
     | 
| 
       25 
21 
     | 
    
         
             
                            progress: xp_update_message.data.xp_progress_data.map do |item|
         
     | 
| 
         @@ -35,10 +31,10 @@ module Overlook 
     | 
|
| 
       35 
31 
     | 
    
         
             
                        server_rank_update_message.rank_update.each do |update|
         
     | 
| 
       36 
32 
     | 
    
         
             
                          # The account_id is used in the 'modern' steam format.
         
     | 
| 
       37 
33 
     | 
    
         
             
                          # [U:1:account_id]
         
     | 
| 
       38 
     | 
    
         
            -
                          community_id =  
     | 
| 
      
 34 
     | 
    
         
            +
                          community_id = Steam3Id.parse("[U:1:#{update.account_id}]").to_i
         
     | 
| 
       39 
35 
     | 
    
         | 
| 
       40 
36 
     | 
    
         
             
                          rank_update_payload = { rank_change: update.rank_change.to_i, wins: update.num_wins,
         
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
                                                  community_id: community_id.to_s, rank: update.rank_new }
         
     | 
| 
       42 
38 
     | 
    
         | 
| 
       43 
39 
     | 
    
         
             
                          @parser.emit(:rank_update, rank_update_payload)
         
     | 
| 
       44 
40 
     | 
    
         
             
                        end
         
     | 
| 
         @@ -3,11 +3,6 @@ require 'stringio' 
     | 
|
| 
       3 
3 
     | 
    
         
             
            module Overlook
         
     | 
| 
       4 
4 
     | 
    
         
             
              module Csgo
         
     | 
| 
       5 
5 
     | 
    
         
             
                class MatchInfoDecoder
         
     | 
| 
       6 
     | 
    
         
            -
                  include SteamIDs
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
                  def initialize
         
     | 
| 
       9 
     | 
    
         
            -
                  end
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
6 
     | 
    
         
             
                  def decode(io)
         
     | 
| 
       12 
7 
     | 
    
         
             
                    match = ::Csgo::CDataGCCStrike15_v2_MatchInfo.decode(io.read)
         
     | 
| 
       13 
8 
     | 
    
         | 
| 
         @@ -69,7 +64,7 @@ module Overlook 
     | 
|
| 
       69 
64 
     | 
    
         
             
                  end
         
     | 
| 
       70 
65 
     | 
    
         | 
| 
       71 
66 
     | 
    
         
             
                  def extract_round_stats(round)
         
     | 
| 
       72 
     | 
    
         
            -
                    players = round.reservation.account_ids.collect! { |id|  
     | 
| 
      
 67 
     | 
    
         
            +
                    players = round.reservation.account_ids.collect! { |id| Steam3Id.parse("[U:1:#{id}]").to_i.to_s }
         
     | 
| 
       73 
68 
     | 
    
         | 
| 
       74 
69 
     | 
    
         
             
                    raise RuntimeError,
         
     | 
| 
       75 
70 
     | 
    
         
             
                          "Invalid player list, expected 10 players got #{players.count}" unless players.count == 10
         
     | 
    
        data/lib/overlook/version.rb
    CHANGED
    
    
    
        data/overlook-csgo.gemspec
    CHANGED
    
    | 
         @@ -19,11 +19,13 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       19 
19 
     | 
    
         
             
              spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
         
     | 
| 
       20 
20 
     | 
    
         
             
              spec.require_paths = ['lib']
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
      
 22 
     | 
    
         
            +
              spec.required_ruby_version = '>= 2.3.1'
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
       22 
24 
     | 
    
         
             
              # For protobuf
         
     | 
| 
       23 
25 
     | 
    
         
             
              spec.add_dependency 'beefcake', '= 1.2.0'
         
     | 
| 
       24 
26 
     | 
    
         | 
| 
       25 
27 
     | 
    
         
             
              # To handle converting steam ids between their various formats
         
     | 
| 
       26 
     | 
    
         
            -
              spec.add_dependency ' 
     | 
| 
      
 28 
     | 
    
         
            +
              spec.add_dependency 'steam-id', '= 0.1.0'
         
     | 
| 
       27 
29 
     | 
    
         | 
| 
       28 
30 
     | 
    
         
             
              # For a simple pub\sub implementation
         
     | 
| 
       29 
31 
     | 
    
         
             
              spec.add_dependency 'wisper', '= 1.6.1'
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: overlook-csgo
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.9
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Taylor Finnell
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2016-11- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-11-26 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: beefcake
         
     | 
| 
         @@ -25,19 +25,19 @@ dependencies: 
     | 
|
| 
       25 
25 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
26 
     | 
    
         
             
                    version: 1.2.0
         
     | 
| 
       27 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
     | 
    
         
            -
              name:  
     | 
| 
      
 28 
     | 
    
         
            +
              name: steam-id
         
     | 
| 
       29 
29 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       30 
30 
     | 
    
         
             
                requirements:
         
     | 
| 
       31 
31 
     | 
    
         
             
                - - '='
         
     | 
| 
       32 
32 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       33 
     | 
    
         
            -
                    version: 1.0 
     | 
| 
      
 33 
     | 
    
         
            +
                    version: 0.1.0
         
     | 
| 
       34 
34 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       35 
35 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       36 
36 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       37 
37 
     | 
    
         
             
                requirements:
         
     | 
| 
       38 
38 
     | 
    
         
             
                - - '='
         
     | 
| 
       39 
39 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       40 
     | 
    
         
            -
                    version: 1.0 
     | 
| 
      
 40 
     | 
    
         
            +
                    version: 0.1.0
         
     | 
| 
       41 
41 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       42 
42 
     | 
    
         
             
              name: wisper
         
     | 
| 
       43 
43 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -203,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       203 
203 
     | 
    
         
             
              requirements:
         
     | 
| 
       204 
204 
     | 
    
         
             
              - - ">="
         
     | 
| 
       205 
205 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       206 
     | 
    
         
            -
                  version:  
     | 
| 
      
 206 
     | 
    
         
            +
                  version: 2.3.1
         
     | 
| 
       207 
207 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       208 
208 
     | 
    
         
             
              requirements:
         
     | 
| 
       209 
209 
     | 
    
         
             
              - - ">="
         
     |