wc3_protocol 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/README.md +2 -2
- data/Rakefile +7 -0
- data/lib/wc3_protocol/broadcast.rb +1 -0
- data/lib/wc3_protocol/message.rb +2 -1
- data/lib/wc3_protocol/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7732c694f73220d17322f119ac938c07487e42567c728c789526761caa59158a
|
4
|
+
data.tar.gz: 974c87ea87b089d2f012eae16cf7fe572c13a56665b7699ef6a160b757a1d402
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3238585a8cb8deedb7831eb652cb2d0216411b94f9cdca281c272d4b5cfd50941081c92d736087684910b7889ba3a70dda7587a388cbf2d1e66bc44dd219d87f
|
7
|
+
data.tar.gz: 5d6f6964a0cfbfeec1910b06b61c4d66009a6cbcaf176d08150f1a7f4dbfb4e162ed67e1e821c849e2dc1f283679efd69d89937c55531cff336cf6d8fec4182c
|
data/.gitignore
CHANGED
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
|
-
![
|
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)
|
data/lib/wc3_protocol/message.rb
CHANGED
@@ -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
|
data/lib/wc3_protocol/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|