playlyfe_client 1.1.0 → 1.1.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f60f5a03a4b845f9fa638d24b10d74fde2e4b3e2
|
4
|
+
data.tar.gz: 9704cd30d13338af3b5627a91536968e94c4ca7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46decdb377e1314c6b3f3142bc239fc5c79d8ca9cf8df771a5a578efa58abdfee4d97abca2cdfe66ecd592fc61a4202910b00b77f76d9c13fd7ee81e2ccf1e77
|
7
|
+
data.tar.gz: 7004a254a84bb638da2ecc8edda3ff07562d363e035b143d95da01c3ad4bdfc8aca22809810a5362b19f805e8dd1933d6b28833808856402cc259cb8e42fba06
|
data/Gemfile.lock
CHANGED
@@ -4,7 +4,7 @@ module PlaylyfeClient
|
|
4
4
|
class Base < PlaylyfeClient::V2::Event
|
5
5
|
attr_reader :actor_id, :actor_alias #who trigger event (player or admin)
|
6
6
|
attr_reader :player_id, :player_alias #who receive results of event (player)
|
7
|
-
attr_reader :
|
7
|
+
attr_reader :rule_id , :rule_name, :process_id, :process_name, :action_id, :action_name #what triggers event
|
8
8
|
attr_reader :count #The count with which the action was played.
|
9
9
|
attr_reader :changes
|
10
10
|
|
@@ -12,6 +12,19 @@ module PlaylyfeClient
|
|
12
12
|
game.players.find(player_id)
|
13
13
|
end
|
14
14
|
|
15
|
+
def rule
|
16
|
+
rule_id #todo
|
17
|
+
end
|
18
|
+
|
19
|
+
def process
|
20
|
+
process_id #todo
|
21
|
+
end
|
22
|
+
|
23
|
+
def action
|
24
|
+
return nil if action_id.nil?
|
25
|
+
game.actions.find(action_id)
|
26
|
+
end
|
27
|
+
|
15
28
|
private
|
16
29
|
|
17
30
|
def initialize(ev_hash,game,player=nil)
|
@@ -30,9 +43,14 @@ module PlaylyfeClient
|
|
30
43
|
end
|
31
44
|
end
|
32
45
|
|
33
|
-
|
34
|
-
|
35
|
-
|
46
|
+
["action", "rule", "process"].each do |att|
|
47
|
+
unless @ev_hash[att].nil?
|
48
|
+
instance_variable_set("@#{att}_id", @ev_hash[att]["id"])
|
49
|
+
instance_variable_set("@#{att}_name", @ev_hash[att]["name"])
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
|
36
54
|
@count= @ev_hash["count"] || 0
|
37
55
|
|
38
56
|
@player_id=@actor_id
|
@@ -49,9 +49,14 @@ module PlaylyfeClient
|
|
49
49
|
data=connection.get_game_image_data
|
50
50
|
puts(data)
|
51
51
|
end
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
|
53
|
+
#results are cached if start_time is nil (events for last 24 hours), otherwise direct call to Playlyfe is made
|
54
|
+
def events(start_time=nil,end_time=nil)
|
55
|
+
if start_time.nil?
|
56
|
+
@events ||= PlaylyfeClient::V2::EventCollection.new(self)
|
57
|
+
else
|
58
|
+
PlaylyfeClient::V2::EventCollection.new(self, self.connection.get_game_events_array(start_time, end_time))
|
59
|
+
end
|
55
60
|
end
|
56
61
|
|
57
62
|
private
|
@@ -36,8 +36,11 @@ module PlaylyfeClient
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
def scores
|
40
|
-
@scores
|
39
|
+
def scores(force_refill=false)
|
40
|
+
if (!defined?(@scores) || force_refill)
|
41
|
+
@scores=fill_scores
|
42
|
+
end
|
43
|
+
@scores
|
41
44
|
end
|
42
45
|
|
43
46
|
def roles_in_team(team)
|
@@ -56,8 +59,13 @@ module PlaylyfeClient
|
|
56
59
|
game.leaderboards.for_players
|
57
60
|
end
|
58
61
|
|
62
|
+
#results are cached if start_time is nil, otherwise, direct call to Playlyfe is made
|
59
63
|
def events(start_time=nil,end_time=nil)
|
60
|
-
|
64
|
+
if start_time.nil?
|
65
|
+
@events ||= PlaylyfeClient::V2::EventCollection.new(game, game.connection.get_player_events_array(self.id), self)
|
66
|
+
else
|
67
|
+
PlaylyfeClient::V2::EventCollection.new(game, game.connection.get_player_events_array(self.id, start_time, end_time), self)
|
68
|
+
end
|
61
69
|
end
|
62
70
|
|
63
71
|
private
|
@@ -13,9 +13,14 @@ module PlaylyfeClient
|
|
13
13
|
def leaderboards
|
14
14
|
@game.leaderboards.for_teams
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
|
+
#results are cached if start_time is nil (events for last 24 hours), otherwise direct call to Playlyfe is made
|
17
18
|
def events(start_time=nil,end_time=nil)
|
18
|
-
|
19
|
+
if start_time.nil?
|
20
|
+
@events ||= PlaylyfeClient::V2::EventCollection.new(game, game.connection.get_team_events_array(self.id), self)
|
21
|
+
else
|
22
|
+
PlaylyfeClient::V2::EventCollection.new(game, game.connection.get_team_events_array(self.id,start_time, end_time), self)
|
23
|
+
end
|
19
24
|
end
|
20
25
|
|
21
26
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playlyfe_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|