kag-gather 1.4.7 → 1.4.8
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 +8 -8
- data/lib/kag/gather/plugin.rb +15 -6
- data/lib/kag/gather/queue.rb +6 -0
- data/lib/kag/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
N2E4YWM4ODA4OGM2NGZjZGU3ZjAwNWY1ZGNhOWJiNWFlYjI3OWZlNw==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
ZjA5M2QzZmY0OWNjZjA0N2YzYTUyNDNiODg5MGZlMzdjOTJhYTRhYw==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
NjExZGRjMzY2ZTFjN2M2YjUxMjdiMTg2Y2JlODg5ZGMxY2M2OWZiMjQwZmIy
|
|
10
|
+
NjEyMTgwYWViNmU3NWExNzFlYTMxZjdhOWYzNWVhMjBmNTAxNGUxNGIzYTEz
|
|
11
|
+
ODM0Yzk3N2IzYzc0MjUzNDg3MWFjMDA2OTIxYTdmZDdkNTZmZGQ=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
YWNmMDk1ZDMxN2M0MWU5MjNlYjllN2ViOGZhY2I2MDJhNGU2OTg1ZmY5MDVl
|
|
14
|
+
ZjA5YmNhYjE0NGNlNzQ5MmI0MWQ3NjJjMzE3NTIzODlkNjVmOWZhZDEzYzM1
|
|
15
|
+
NzdiN2E4MDZkOWYxZDEyZDVmN2M4ZTk3OGVhNTQ0ZDUwNWYwMzY=
|
data/lib/kag/gather/plugin.rb
CHANGED
|
@@ -142,20 +142,29 @@ module KAG
|
|
|
142
142
|
def add_user_to_queue(m,user,send_msg = true)
|
|
143
143
|
if @queue.has_player?(user)
|
|
144
144
|
reply m,"#{user.authname} is already in the queue!"
|
|
145
|
+
false
|
|
145
146
|
elsif get_match_in(user)
|
|
146
147
|
reply m,"#{user.authname} is already in a match!"
|
|
148
|
+
false
|
|
147
149
|
else
|
|
148
|
-
@queue.add(user)
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
if @queue.add(user)
|
|
151
|
+
send_channels_msg "Added #{user.authname} to queue (#{KAG::Gather::Match.type_as_string}) [#{@queue.length}]" if send_msg
|
|
152
|
+
check_for_new_match
|
|
153
|
+
true
|
|
154
|
+
else
|
|
155
|
+
false
|
|
156
|
+
end
|
|
151
157
|
end
|
|
152
158
|
end
|
|
153
159
|
|
|
154
160
|
def remove_user_from_queue(user,send_msg = true)
|
|
155
161
|
if @queue.has_player?(user)
|
|
156
|
-
@queue.remove(user)
|
|
157
|
-
|
|
158
|
-
|
|
162
|
+
if @queue.remove(user)
|
|
163
|
+
send_channels_msg "Removed #{user.authname} from queue (#{KAG::Gather::Match.type_as_string}) [#{@queue.length}]" if send_msg
|
|
164
|
+
true
|
|
165
|
+
else
|
|
166
|
+
false
|
|
167
|
+
end
|
|
159
168
|
else
|
|
160
169
|
false
|
|
161
170
|
end
|
data/lib/kag/gather/queue.rb
CHANGED
|
@@ -9,12 +9,18 @@ module KAG
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def add(user)
|
|
12
|
+
return false unless user.authname and !user.authname.to_s.empty?
|
|
12
13
|
self.players[user.authname.to_sym] = user
|
|
14
|
+
true
|
|
13
15
|
end
|
|
14
16
|
|
|
15
17
|
def remove(user)
|
|
18
|
+
return false unless user.authname and !user.authname.to_s.empty?
|
|
16
19
|
if has_player?(user)
|
|
17
20
|
self.players.delete(user.authname.to_sym)
|
|
21
|
+
true
|
|
22
|
+
else
|
|
23
|
+
false
|
|
18
24
|
end
|
|
19
25
|
end
|
|
20
26
|
|
data/lib/kag/version.rb
CHANGED