acpc_table_manager 2.1.0 → 2.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: 6b0064595ce9c7b86386220cd810ab89d8d39b4c
4
- data.tar.gz: 20722d18a11a3337a6eb15f38ce39448bdcf4ed8
3
+ metadata.gz: 5c36e100138bb92133b4ca50aee00f92480765e0
4
+ data.tar.gz: 19ccc449d3fbca40ccc22cf7b2734e1f4d39a963
5
5
  SHA512:
6
- metadata.gz: 86933039423c1239ff48919532d400c3b4e28ff3ddf95843db5190103bfac241959eafd9a6c282d8c9b63b35baa505bee4f4da365cc1868dfbbc5ef697d343f0
7
- data.tar.gz: bc5374598055f5b11032de6c30d0868f404e41df8f77e282d5390d51d9f629ea87c56775302840f7c00c33f951376980979c1bfa5fd8c3fd29b5145fe59ce26c
6
+ metadata.gz: 85de8218233b2a99e6b4e5978e13b45c599c40896a9b27922dcac1537bcc01a918d35a948eb95e4d46731871aee6bd2d3ef68eca4afe4a3899c8b64e288ebeeb
7
+ data.tar.gz: fc29c641dde8ad1fb4379c55b8a7003e7f72598dcf2ccbd9c55bbe46d9747fe3b45a1d6fd788cae71266e25a845a4557faba39c991a61446e60f9a34d5d68303
data/exe/acpc_proxy CHANGED
@@ -59,6 +59,9 @@ begin
59
59
  )
60
60
  if message
61
61
  data = JSON.parse message[1]
62
+
63
+ proxy.log(__method__, {data: data})
64
+
62
65
  action = data[AcpcTableManager.config.action_key]
63
66
  if must_send_ready && action == AcpcTableManager.config.next_hand_request_code
64
67
  proxy.next_hand!
@@ -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__, { match_id: match_id })
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.hand_ended? &&
144
- @player_proxy.match_state.hand_number >= @match.number_of_hands - 1
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
 
@@ -1,3 +1,3 @@
1
1
  module AcpcTableManager
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
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.0
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-20 00:00:00.000000000 Z
11
+ date: 2016-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pony