acpc_table_manager 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/acpc_proxy +3 -0
- data/exe/acpc_table_manager +2 -0
- data/lib/acpc_table_manager/maintainer.rb +23 -1
- data/lib/acpc_table_manager/proxy.rb +13 -3
- data/lib/acpc_table_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c36e100138bb92133b4ca50aee00f92480765e0
|
4
|
+
data.tar.gz: 19ccc449d3fbca40ccc22cf7b2734e1f4d39a963
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85de8218233b2a99e6b4e5978e13b45c599c40896a9b27922dcac1537bcc01a918d35a948eb95e4d46731871aee6bd2d3ef68eca4afe4a3899c8b64e288ebeeb
|
7
|
+
data.tar.gz: fc29c641dde8ad1fb4379c55b8a7003e7f72598dcf2ccbd9c55bbe46d9747fe3b45a1d6fd788cae71266e25a845a4557faba39c991a61446e60f9a34d5d68303
|
data/exe/acpc_proxy
CHANGED
data/exe/acpc_table_manager
CHANGED
@@ -39,6 +39,8 @@ loop do
|
|
39
39
|
message = AcpcTableManager.redis.blpop("table-manager", :timeout => AcpcTableManager.config.maintenance_interval_s)
|
40
40
|
if message
|
41
41
|
data = JSON.parse message[1]
|
42
|
+
table_manager.log(__method__, {data: data})
|
43
|
+
|
42
44
|
case data['request']
|
43
45
|
when AcpcTableManager.config.start_match_request_code
|
44
46
|
table_manager.enqueue_match!(
|
@@ -115,6 +115,8 @@ module AcpcTableManager
|
|
115
115
|
log(__method__, match_id: match_id)
|
116
116
|
|
117
117
|
@table_queues.each do |key, queue|
|
118
|
+
log(__method__, {queue: key, match_id: match_id})
|
119
|
+
|
118
120
|
queue.kill_match!(match_id)
|
119
121
|
end
|
120
122
|
end
|
@@ -127,6 +129,16 @@ module AcpcTableManager
|
|
127
129
|
begin
|
128
130
|
m = ::AcpcTableManager::Match.find match_id
|
129
131
|
rescue Mongoid::Errors::DocumentNotFound
|
132
|
+
|
133
|
+
log(
|
134
|
+
__method__,
|
135
|
+
{
|
136
|
+
msg: "Match not found",
|
137
|
+
match_id: match_id
|
138
|
+
},
|
139
|
+
Logger::Severity::ERROR
|
140
|
+
)
|
141
|
+
|
130
142
|
return kill_match!(match_id)
|
131
143
|
else
|
132
144
|
self.class().update_pids self.class().proxy_pids_file do
|
@@ -140,6 +152,16 @@ module AcpcTableManager
|
|
140
152
|
begin
|
141
153
|
match = ::AcpcTableManager::Match.find match_id
|
142
154
|
rescue Mongoid::Errors::DocumentNotFound
|
155
|
+
|
156
|
+
log(
|
157
|
+
__method__,
|
158
|
+
{
|
159
|
+
msg: "Match not found",
|
160
|
+
match_id: match_id
|
161
|
+
},
|
162
|
+
Logger::Severity::ERROR
|
163
|
+
)
|
164
|
+
|
143
165
|
return kill_match!(match_id)
|
144
166
|
else
|
145
167
|
self.class().update_pids self.class().proxy_pids_file do
|
@@ -149,7 +171,7 @@ module AcpcTableManager
|
|
149
171
|
end
|
150
172
|
|
151
173
|
def check_match(match_id)
|
152
|
-
log(__method__, {
|
174
|
+
log(__method__, {match_id: match_id})
|
153
175
|
begin
|
154
176
|
match = ::AcpcTableManager::Match.find match_id
|
155
177
|
rescue Mongoid::Errors::DocumentNotFound
|
@@ -135,13 +135,23 @@ class Proxy
|
|
135
135
|
@match ||= begin
|
136
136
|
Match.find(@match_id)
|
137
137
|
rescue Mongoid::Errors::DocumentNotFound
|
138
|
+
log(
|
139
|
+
__method__,
|
140
|
+
{
|
141
|
+
msg: "Unable to find match",
|
142
|
+
match_id: @match_id,
|
143
|
+
match_ended: @player_proxy.match_ended?
|
144
|
+
}
|
145
|
+
)
|
138
146
|
return true
|
139
147
|
end
|
140
148
|
|
141
|
-
@player_proxy.match_ended? ||
|
142
149
|
(
|
143
|
-
@player_proxy.
|
144
|
-
|
150
|
+
@player_proxy.match_ended? ||
|
151
|
+
(
|
152
|
+
@player_proxy.hand_ended? &&
|
153
|
+
@player_proxy.match_state.hand_number >= @match.number_of_hands - 1
|
154
|
+
)
|
145
155
|
)
|
146
156
|
end
|
147
157
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acpc_table_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Morrill
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pony
|