wc3_protocol 0.0.1 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 497152467d10e7a3e76fc722af52711c61be78688223dc49c3d6f964409e8454
4
- data.tar.gz: 3a893457a4b10d0f50ecba541842062bad79a4990cc5452ce56e5dab8cb071fa
3
+ metadata.gz: 7732c694f73220d17322f119ac938c07487e42567c728c789526761caa59158a
4
+ data.tar.gz: 974c87ea87b089d2f012eae16cf7fe572c13a56665b7699ef6a160b757a1d402
5
5
  SHA512:
6
- metadata.gz: fab86e87c0553c716d02fe2c0bc1ffa9655b75099b09355ffba511e782b57c2befa9f114dca338395e49657af1b7be0298d3eb8b22c2a583a5044439069da239
7
- data.tar.gz: 3a63d93392bf209b4e084d9704164724a256f5e1d0749e83baa7bf3f05806f79e9c21a809c3c2c1144d34c569a38970c552dee73a7c1dca05ebc5664d72178ac
6
+ metadata.gz: 3238585a8cb8deedb7831eb652cb2d0216411b94f9cdca281c272d4b5cfd50941081c92d736087684910b7889ba3a70dda7587a388cbf2d1e66bc44dd219d87f
7
+ data.tar.gz: 5d6f6964a0cfbfeec1910b06b61c4d66009a6cbcaf176d08150f1a7f4dbfb4e162ed67e1e821c849e2dc1f283679efd69d89937c55531cff336cf6d8fec4182c
data/.gitignore CHANGED
@@ -15,4 +15,5 @@
15
15
  .rspec_status
16
16
 
17
17
 
18
- /playground
18
+ /playground
19
+ /playground.rb
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # wc3_protocol
2
- ![Gem](https://img.shields.io/gem/v/wc3_protocol?color=default&style=plastic&logo=ruby&logoColor=red)
3
- ![Gem](https://img.shields.io/gem/dt/wc3_protocol?color=blue&style=plastic)
2
+ [![Gem](https://img.shields.io/gem/v/wc3_protocol?color=default&style=plastic&logo=ruby&logoColor=red)](https://rubygems.org/gems/wc3_protocol)
3
+ ![downloads](https://img.shields.io/gem/dt/wc3_protocol?color=blue&style=plastic)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-gold.svg?style=plastic&logo=mit)](LICENSE)
5
5
 
6
6
  > The ruby gem to find and retrieve information of Warcraft3 games
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
3
 
4
+ require_relative 'lib/wc3_protocol'
5
+
4
6
  #
5
7
  # run default task to see tasks to build and publish gem
6
8
  #
@@ -12,4 +14,9 @@ task :test do
12
14
  system 'rspec'
13
15
  end
14
16
 
17
+ task :playground do
18
+ g = Wc3Protocol::Broadcast.find_games
19
+ puts g.inspect
20
+ end
21
+
15
22
  RSpec::Core::RakeTask.new(:spec)
@@ -75,6 +75,7 @@ module Wc3Protocol
75
75
  rescue Timeout::Error
76
76
  # messages received until timeout
77
77
  end
78
+ @udp_socket.close # ensure socket is closed after
78
79
  raw_messages.map { |m| Wc3Protocol::Message.new(raw_msg: m.message, raw_sender_info: m.sender_info) }
79
80
  end
80
81
 
@@ -90,10 +90,11 @@ module Wc3Protocol
90
90
 
91
91
  # extract map name from 14th byte
92
92
  @game_map_name = decrypted_string[13..-1]
93
+ # cut string at NULL string termination byte
94
+ @game_map_name = @game_map_name[0..@game_map_name.index("\x00")-1]
93
95
 
94
96
  # Get last segment of map name that is split by '\\'
95
97
  last_map_name_segment = @game_map_name.split('\\').last
96
- last_map_name_segment = last_map_name_segment[0..(last_map_name_segment.index('.w3') + 4)]
97
98
 
98
99
  # use original map name if no segment is found
99
100
  @game_map_name = last_map_name_segment || @game_map_name
@@ -1,3 +1,3 @@
1
1
  module Wc3Protocol
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wc3_protocol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthäus J. N. Beyrle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-21 00:00:00.000000000 Z
11
+ date: 2023-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 3.1.4
100
+ rubygems_version: 3.4.10
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: The ruby gem to find and retrieve information of Warcraft3 games