wowlog 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/wl_extract_encount +2 -1
- data/bin/wowlog2msgpack +44 -0
- data/lib/wowlog.rb +19 -5
- data/lib/wowlog/version.rb +1 -1
- data/wowlog.gemspec +1 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74586fc9615b447c898db824ac81cf0ad1a76057
|
4
|
+
data.tar.gz: e28e236d49b273fef2536ae38aba233b642e43ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c46f7077f4e540585fd8871d3b70ac77a07cebafd4c24ec2d713150cb8aa15cd88d82054b3b6bea48c9b3bf78b13b6aed3a2b6c25ccb0b3759758f25682c420
|
7
|
+
data.tar.gz: 3fd6d1735b83edb8f0163839390e9d11e787e0081bf256bfb64620da927cfa4f506a5dafe236006990970ab8f3ce5fe600e9907d14d0e765cb8e27c1e4e0cd5c
|
data/bin/wl_extract_encount
CHANGED
@@ -40,7 +40,8 @@ File.open(ARGV[0], 'r') { |fd|
|
|
40
40
|
|
41
41
|
if ev['event'] == 'ENCOUNTER_START'
|
42
42
|
enc_name = ev['encounterName'].gsub(/\s/, '_')
|
43
|
-
|
43
|
+
ts = ev['timestamp'].to_i
|
44
|
+
fname = "WowCombatLog_#{ts}_#{enc_name}_#{ev['groupSize']}man.txt"
|
44
45
|
out_fd = File.open(fname, "w")
|
45
46
|
puts "Open: #{fname}"
|
46
47
|
end
|
data/bin/wowlog2msgpack
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#
|
4
|
+
# Copyright (c) 2014 Masayoshi Mizutani <muret@haeena.net>
|
5
|
+
# All rights reserved.
|
6
|
+
# *
|
7
|
+
# Redistribution and use in source and binary forms, with or without
|
8
|
+
# modification, are permitted provided that the following conditions
|
9
|
+
# are met:
|
10
|
+
# 1. Redistributions of source code must retain the above copyright
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
13
|
+
# notice, this list of conditions and the following disclaimer in the
|
14
|
+
# documentation and/or other materials provided with the distribution.
|
15
|
+
#
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
18
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
19
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
20
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
21
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
22
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
23
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
24
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
25
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
26
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
#
|
28
|
+
|
29
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
30
|
+
require 'wowlog'
|
31
|
+
require 'msgpack'
|
32
|
+
|
33
|
+
psr = Wowlog::Parser.new
|
34
|
+
|
35
|
+
ARGV.each do |fpath|
|
36
|
+
File.open(fpath, 'r') do |in_fd|
|
37
|
+
File.open("#{fpath}.msg", "w") do |out_fd|
|
38
|
+
in_fd.each do |line|
|
39
|
+
ev = psr.parse_line(line)
|
40
|
+
out_fd.write(ev.to_msgpack)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/wowlog.rb
CHANGED
@@ -135,10 +135,6 @@ module Wowlog
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
-
class EncountEvent < EventParser
|
139
|
-
def parse(cols, obj); end
|
140
|
-
end
|
141
|
-
|
142
138
|
class ActionEvent < EventParser
|
143
139
|
def parse(cols, obj)
|
144
140
|
cols, obj = super(cols, obj)
|
@@ -343,11 +339,29 @@ module Wowlog
|
|
343
339
|
|
344
340
|
|
345
341
|
class EncountParser < EventParser
|
342
|
+
DIFFICULTY = {
|
343
|
+
1 => "Normal",
|
344
|
+
2 => "Heroic",
|
345
|
+
3 => "10 Player",
|
346
|
+
4 => "25 Player",
|
347
|
+
5 => "10 Player (Heroic)",
|
348
|
+
6 => "25 Player (Heroic)",
|
349
|
+
7 => "Looking For Raid",
|
350
|
+
8 => "Challenge Mode",
|
351
|
+
9 => "40 Player",
|
352
|
+
10 => nil,
|
353
|
+
11 => "Heroic Scenario",
|
354
|
+
12 => "Normal Scenario",
|
355
|
+
13 => nil,
|
356
|
+
14 => "Flexible",
|
357
|
+
}
|
346
358
|
def parse(cols, obj)
|
347
359
|
cols, obj = super(cols, obj)
|
348
360
|
obj['encounterID'] = cols[0]
|
349
361
|
obj['encounterName'] = cols[1]
|
350
|
-
|
362
|
+
d_id = cols[2].to_i
|
363
|
+
obj['difficultyID'] = d_id
|
364
|
+
obj['difficulty'] = DIFFICULTY[d_id]
|
351
365
|
obj['groupSize'] = cols[3]
|
352
366
|
cols.shift(4)
|
353
367
|
|
data/lib/wowlog/version.rb
CHANGED
data/wowlog.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wowlog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masayoshi Mizutani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,12 +38,27 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: msgpack
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.5'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.5'
|
41
55
|
description: Wowlog is Parser Library for World of Warcraft Combat Log to analyze
|
42
56
|
your combat.
|
43
57
|
email:
|
44
58
|
- muret@haeena.net
|
45
59
|
executables:
|
46
60
|
- wl_extract_encount
|
61
|
+
- wowlog2msgpack
|
47
62
|
- wowlogpp
|
48
63
|
extensions: []
|
49
64
|
extra_rdoc_files: []
|
@@ -54,6 +69,7 @@ files:
|
|
54
69
|
- README.md
|
55
70
|
- Rakefile
|
56
71
|
- bin/wl_extract_encount
|
72
|
+
- bin/wowlog2msgpack
|
57
73
|
- bin/wowlogpp
|
58
74
|
- lib/wowlog.rb
|
59
75
|
- lib/wowlog/version.rb
|