acpc_table_manager 2.1.5 → 2.2.0
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 +4 -4
- data/exe/acpc_proxy +13 -0
- data/lib/acpc_table_manager/proxy.rb +18 -0
- data/lib/acpc_table_manager/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37d318b3c7a7ae1cb0bb9dac04919a4e26423968
|
|
4
|
+
data.tar.gz: 5a54e7687c8bcee32cd2b213846c9193967d711d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3043fa0b107b23f92fbb9cfbaac6ca52fb7a963ff1bed375f7d690f5412c4bc152d8380f8981494939d6198826182e1e8fa97fdc6e1c718662bb18dde7158b36
|
|
7
|
+
data.tar.gz: 76cad3c88f1e4905f7bf9209a0d93036ba8e7371e975dcb29bc5efc2d2f0fa924f69e6adebc288383131affefcdc5b7db545302364e3afd1fdf26eee4d677c29
|
data/exe/acpc_proxy
CHANGED
|
@@ -49,6 +49,8 @@ Signal.trap("TERM") { exit }
|
|
|
49
49
|
|
|
50
50
|
must_send_ready = AcpcTableManager.config.respond_to?(:next_hand_request_code)
|
|
51
51
|
|
|
52
|
+
last_message_received = Time.now
|
|
53
|
+
|
|
52
54
|
begin
|
|
53
55
|
proxy = AcpcTableManager::Proxy.start match, must_send_ready
|
|
54
56
|
proxy.log __method__, options
|
|
@@ -68,6 +70,17 @@ begin
|
|
|
68
70
|
else
|
|
69
71
|
proxy.play! action
|
|
70
72
|
end
|
|
73
|
+
last_message_received = Time.now
|
|
74
|
+
elsif (
|
|
75
|
+
AcpcTableManager.config.proxy_timeout &&
|
|
76
|
+
(
|
|
77
|
+
Time.now > (
|
|
78
|
+
last_message_received + AcpcTableManager.config.proxy_timeout
|
|
79
|
+
)
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
# @todo Allow different behaviour on timeout
|
|
83
|
+
proxy.play_check_fold!
|
|
71
84
|
end
|
|
72
85
|
if proxy.match_ended?
|
|
73
86
|
AcpcTableManager.redis.rpush(
|
|
@@ -128,6 +128,24 @@ class Proxy
|
|
|
128
128
|
self
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
+
def play_check_fold!
|
|
132
|
+
log __method__
|
|
133
|
+
if @player_proxy.users_turn_to_act?
|
|
134
|
+
play!(
|
|
135
|
+
if (
|
|
136
|
+
@player_proxy.legal_actions.any? do |a|
|
|
137
|
+
a == AcpcPokerTypes::PokerAction::FOLD
|
|
138
|
+
end
|
|
139
|
+
)
|
|
140
|
+
AcpcPokerTypes::PokerAction::FOLD
|
|
141
|
+
else
|
|
142
|
+
AcpcPokerTypes::PokerAction::CALL
|
|
143
|
+
end
|
|
144
|
+
)
|
|
145
|
+
end
|
|
146
|
+
self
|
|
147
|
+
end
|
|
148
|
+
|
|
131
149
|
# @see PlayerProxy#match_ended?
|
|
132
150
|
def match_ended?
|
|
133
151
|
return false if @player_proxy.nil?
|