kag-gather 1.4.3 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/lib/kag/bans/report.rb +2 -2
- data/lib/kag/gather/match.rb +36 -41
- data/lib/kag/gather/plugin.rb +64 -72
- data/lib/kag/gather/queue.rb +42 -0
- data/lib/kag/gather/team.rb +17 -23
- data/lib/kag/version.rb +1 -1
- data/lib/patches.rb +14 -0
- metadata +5 -20
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZTAyZDFkOGQyODNlYzlkZWEwNDE3NWUwMGE0ZjZkNTBjNGUyZTAxMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Mjk0M2ZmY2Y1YTEyYjMzNDNkMTYwMjYwYzA4NjMyOTAyYWU5NzZjMA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YzA4N2U5OTY5ZGQ1YzdiNDZmNDk4YmJmNmQzOWJlZDBhYTc4MWExNjU5MmQ2
|
10
|
+
ZTU3ZTg1ZjlmYzFhNDU3MDQyOWYwMzljZTlkYTAzMjJlYTA5NGEwMjY3ZmU5
|
11
|
+
YWRjMjE1NWRjYmVkZGE1MjNjNjE2Yzg2NGY1OTU2Y2YyOTdjMWY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YWYwYTY0ZDIxZTEwZDVhNGQ4MTYxMjc2N2RmZDllZjZlNDlmMzU0NDg5MDZi
|
14
|
+
YTg3ODdiMTNiZjlhNDQzNDFmZjgxOWJmNjZmMzkxMWFiMjE1ZmY3NGE5NTQ1
|
15
|
+
YzFiYmMzNmU3M2I3MTQ3YjFlZThjODNhZDNjMjgyNjZlODY0NDU=
|
data/lib/kag/bans/report.rb
CHANGED
@@ -149,7 +149,7 @@ module KAG
|
|
149
149
|
return true
|
150
150
|
end
|
151
151
|
|
152
|
-
if user.
|
152
|
+
if user.authed?
|
153
153
|
begin
|
154
154
|
KAG::Config.data[:ignored].key?(user.authname.to_sym)
|
155
155
|
rescue Exception => e
|
@@ -157,7 +157,7 @@ module KAG
|
|
157
157
|
puts e.backtrace
|
158
158
|
end
|
159
159
|
else
|
160
|
-
user.send "You must first AUTH on the IRC server before you can use this bot."
|
160
|
+
user.send "You must first AUTH on the IRC server via Q before you can use this bot."
|
161
161
|
KAG::Config.data.add_action(user)
|
162
162
|
end
|
163
163
|
end
|
data/lib/kag/gather/match.rb
CHANGED
@@ -17,38 +17,44 @@ module KAG
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def setup_teams
|
20
|
-
self
|
20
|
+
self.players.shuffle!
|
21
21
|
match_size = KAG::Config.instance[:match_size].to_i
|
22
22
|
match_size = 2 if match_size < 2
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
team_list = [{
|
25
|
+
:color => "\x0312",
|
26
|
+
:name => "Blue"
|
27
|
+
},{
|
28
|
+
:color => "\x0304",
|
29
|
+
:name => "Red"
|
30
|
+
}]
|
31
|
+
players_per_team = (match_size / 2).floor.to_i
|
26
32
|
|
27
33
|
debug "MATCH SIZE #{match_size.to_s}"
|
28
|
-
debug "
|
29
|
-
debug "PLAYERS: #{self
|
34
|
+
debug "Players Per Team: #{players_per_team.to_s}"
|
35
|
+
debug "PLAYERS: #{self.players.keys.join(",")}"
|
30
36
|
|
31
|
-
self
|
32
|
-
|
33
|
-
if u
|
34
|
-
KAG::User::User.add_stat(u,:matches)
|
35
|
-
end
|
37
|
+
self.players.each do |authname,user|
|
38
|
+
KAG::User::User.add_stat(user,:matches)
|
36
39
|
end
|
37
40
|
|
38
|
-
self
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
:
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
41
|
+
self.teams = []
|
42
|
+
lb = 0
|
43
|
+
team_list.each do |ts|
|
44
|
+
eb = lb+players_per_team-1
|
45
|
+
eb = self.players.length if eb > self.players.length-1
|
46
|
+
debug "Spread: #{lb}..#{(eb)}"
|
47
|
+
ps = Hash[self.players.sort_by{|k,v| v.to_s }[lb..(eb)]]
|
48
|
+
lb = players_per_team
|
49
|
+
|
50
|
+
self.teams << KAG::Gather::Team.new({
|
51
|
+
:players => ps,
|
52
|
+
:match => self,
|
53
|
+
:color => ts[:color],
|
54
|
+
:name => ts[:name]
|
55
|
+
}).setup
|
56
|
+
end
|
57
|
+
self.teams
|
52
58
|
end
|
53
59
|
|
54
60
|
def start
|
@@ -60,7 +66,7 @@ module KAG
|
|
60
66
|
|
61
67
|
def text_for_match_start
|
62
68
|
msg = "MATCH: #{KAG::Gather::Match.type_as_string} - "
|
63
|
-
self
|
69
|
+
self.teams.each do |team|
|
64
70
|
msg = msg+" "+team.text_for_match_start
|
65
71
|
end
|
66
72
|
msg+" \x0301(!end when done)"
|
@@ -68,11 +74,8 @@ module KAG
|
|
68
74
|
|
69
75
|
def notify_teams_of_match_start
|
70
76
|
messages = {}
|
71
|
-
self
|
72
|
-
|
73
|
-
ms.each do |nick,msg|
|
74
|
-
messages[nick] = msg
|
75
|
-
end
|
77
|
+
self.teams.each do |t|
|
78
|
+
messages.merge!(t.notify_of_match_start)
|
76
79
|
end
|
77
80
|
messages
|
78
81
|
end
|
@@ -95,7 +98,7 @@ module KAG
|
|
95
98
|
|
96
99
|
def has_player?(user)
|
97
100
|
playing = false
|
98
|
-
self
|
101
|
+
self.teams.each do |team|
|
99
102
|
playing = true if team.has_player?(user)
|
100
103
|
end
|
101
104
|
playing
|
@@ -104,7 +107,7 @@ module KAG
|
|
104
107
|
def cease
|
105
108
|
if self.server
|
106
109
|
if self.server.has_rcon?
|
107
|
-
self
|
110
|
+
self.teams.each do |team|
|
108
111
|
team.kick_all
|
109
112
|
end
|
110
113
|
else
|
@@ -148,19 +151,11 @@ module KAG
|
|
148
151
|
placement = false
|
149
152
|
if needs_sub?
|
150
153
|
placement = self[:subs_needed].shift
|
151
|
-
KAG::User::User.add_stat(
|
154
|
+
KAG::User::User.add_stat(user,:substitutions)
|
152
155
|
end
|
153
156
|
placement
|
154
157
|
end
|
155
158
|
|
156
|
-
def rename_player(user)
|
157
|
-
self[:teams].each do |team|
|
158
|
-
if team.has_player?(user)
|
159
|
-
team.rename_player(user)
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
159
|
def debug(msg)
|
165
160
|
if KAG::Config.instance[:debug]
|
166
161
|
puts msg
|
data/lib/kag/gather/plugin.rb
CHANGED
@@ -4,6 +4,7 @@ require 'commands/help'
|
|
4
4
|
require 'kag/bot/bot'
|
5
5
|
require 'kag/bans/report'
|
6
6
|
require 'kag/server'
|
7
|
+
require 'kag/gather/queue'
|
7
8
|
require 'kag/gather/match'
|
8
9
|
|
9
10
|
module KAG
|
@@ -17,7 +18,7 @@ module KAG
|
|
17
18
|
|
18
19
|
def initialize(*args)
|
19
20
|
super
|
20
|
-
@queue =
|
21
|
+
@queue = KAG::Gather::Queue.new
|
21
22
|
@matches = {}
|
22
23
|
_load_servers
|
23
24
|
end
|
@@ -45,8 +46,8 @@ module KAG
|
|
45
46
|
if sub
|
46
47
|
m.channel.msg sub[:msg]
|
47
48
|
end
|
48
|
-
elsif @queue.
|
49
|
-
remove_user_from_queue(
|
49
|
+
elsif @queue.has_player?(user)
|
50
|
+
remove_user_from_queue(user)
|
50
51
|
end
|
51
52
|
else
|
52
53
|
reply m,"User #{nick} not found"
|
@@ -56,16 +57,6 @@ module KAG
|
|
56
57
|
|
57
58
|
listen_to :nick, :method => :on_nick
|
58
59
|
def on_nick(m)
|
59
|
-
|
60
|
-
#unless is_banned?(m.user)
|
61
|
-
# match = get_match_in(m.user)
|
62
|
-
# if match
|
63
|
-
# match.rename_player(m.user)
|
64
|
-
# elsif @queue.key?(m.user.last_nick)
|
65
|
-
# @queue[m.user.nick] = @queue[m.user.last_nick]
|
66
|
-
# @queue.delete(m.user.last_nick)
|
67
|
-
# end
|
68
|
-
#end
|
69
60
|
end
|
70
61
|
|
71
62
|
command :sub,{},
|
@@ -90,7 +81,7 @@ module KAG
|
|
90
81
|
def add(m)
|
91
82
|
unless is_banned?(m.user)
|
92
83
|
KAG::User::User.add_stat(m.user,:adds)
|
93
|
-
add_user_to_queue(m,m.user
|
84
|
+
add_user_to_queue(m,m.user)
|
94
85
|
end
|
95
86
|
end
|
96
87
|
|
@@ -101,11 +92,11 @@ module KAG
|
|
101
92
|
match = get_match_in(m.user)
|
102
93
|
if match
|
103
94
|
match.remove_player(m.user)
|
104
|
-
send_channels_msg "#{m.user.
|
105
|
-
elsif @queue.
|
95
|
+
send_channels_msg "#{m.user.authname} has left the match at #{match.server[:key]}! You can sub in by typing !sub"
|
96
|
+
elsif @queue.has_player?(m.user)
|
106
97
|
KAG::User::User.add_stat(m.user,:rems)
|
107
|
-
unless remove_user_from_queue(m.user
|
108
|
-
debug "#{m.user.
|
98
|
+
unless remove_user_from_queue(m.user)
|
99
|
+
debug "#{m.user.authname} is not in the queue."
|
109
100
|
end
|
110
101
|
end
|
111
102
|
end
|
@@ -115,11 +106,7 @@ module KAG
|
|
115
106
|
summary: "List the users signed up for the next match"
|
116
107
|
def list(m)
|
117
108
|
unless is_banned?(m.user)
|
118
|
-
|
119
|
-
@queue.each do |n,u|
|
120
|
-
users << n
|
121
|
-
end
|
122
|
-
m.user.send "Queue (#{KAG::Gather::Match.type_as_string}) [#{@queue.length}] #{users.join(", ")}"
|
109
|
+
m.user.send "Queue (#{KAG::Gather::Match.type_as_string}) [#{@queue.length}] #{@queue.list}"
|
123
110
|
end
|
124
111
|
end
|
125
112
|
|
@@ -152,27 +139,22 @@ module KAG
|
|
152
139
|
end
|
153
140
|
end
|
154
141
|
|
155
|
-
def add_user_to_queue(m,
|
156
|
-
if @queue.
|
157
|
-
reply m,"#{
|
158
|
-
elsif get_match_in(
|
159
|
-
reply m,"#{
|
142
|
+
def add_user_to_queue(m,user,send_msg = true)
|
143
|
+
if @queue.has_player?(user)
|
144
|
+
reply m,"#{user.authname} is already in the queue!"
|
145
|
+
elsif get_match_in(user)
|
146
|
+
reply m,"#{user.authname} is already in a match!"
|
160
147
|
else
|
161
|
-
@queue
|
162
|
-
|
163
|
-
:irc => m.channel,
|
164
|
-
:message => m.message,
|
165
|
-
:joined_at => Time.now
|
166
|
-
})
|
167
|
-
send_channels_msg "Added #{nick} to queue (#{KAG::Gather::Match.type_as_string}) [#{@queue.length}]" if send_msg
|
148
|
+
@queue.add(user)
|
149
|
+
send_channels_msg "Added #{user.authname} to queue (#{KAG::Gather::Match.type_as_string}) [#{@queue.length}]" if send_msg
|
168
150
|
check_for_new_match
|
169
151
|
end
|
170
152
|
end
|
171
153
|
|
172
|
-
def remove_user_from_queue(
|
173
|
-
if @queue.
|
174
|
-
@queue.
|
175
|
-
send_channels_msg "Removed #{
|
154
|
+
def remove_user_from_queue(user,send_msg = true)
|
155
|
+
if @queue.has_player?(user)
|
156
|
+
@queue.remove(user)
|
157
|
+
send_channels_msg "Removed #{user.authname} from queue (#{KAG::Gather::Match.type_as_string}) [#{@queue.length}]" if send_msg
|
176
158
|
true
|
177
159
|
else
|
178
160
|
false
|
@@ -191,11 +173,6 @@ module KAG
|
|
191
173
|
|
192
174
|
def check_for_new_match
|
193
175
|
if @queue.length >= KAG::Config.instance[:match_size]
|
194
|
-
players = []
|
195
|
-
@queue.each do |n,i|
|
196
|
-
players << n
|
197
|
-
end
|
198
|
-
|
199
176
|
server = get_unused_server
|
200
177
|
unless server
|
201
178
|
send_channels_msg "Could not find any available servers!"
|
@@ -203,8 +180,10 @@ module KAG
|
|
203
180
|
return false
|
204
181
|
end
|
205
182
|
|
183
|
+
players = @queue.players
|
184
|
+
|
206
185
|
# reset queue first to prevent 11-player load
|
207
|
-
@queue
|
186
|
+
@queue.reset
|
208
187
|
|
209
188
|
match = KAG::Gather::Match.new(SymbolTable.new({
|
210
189
|
:server => server,
|
@@ -214,8 +193,8 @@ module KAG
|
|
214
193
|
match.start # prepare match data
|
215
194
|
messages = match.notify_teams_of_match_start # gather texts for private messages
|
216
195
|
send_channels_msg(match.text_for_match_start,false) # send channel-wide first
|
217
|
-
messages.each do |
|
218
|
-
|
196
|
+
messages.each do |user,msg|
|
197
|
+
user.send(msg)
|
219
198
|
sleep(2) # prevent excess flood stuff
|
220
199
|
end
|
221
200
|
@matches[server[:key]] = match
|
@@ -239,56 +218,69 @@ module KAG
|
|
239
218
|
def clear(m)
|
240
219
|
if is_admin(m.user)
|
241
220
|
send_channels_msg "Match queue cleared."
|
242
|
-
@queue
|
221
|
+
@queue.reset
|
243
222
|
end
|
244
223
|
end
|
245
224
|
|
246
|
-
command :rem,{
|
225
|
+
command :rem,{nicks: :string},
|
247
226
|
summary: "Remove a specific user from the queue",
|
248
227
|
method: :rem_admin,
|
249
228
|
admin: true
|
250
|
-
def rem_admin(m,
|
229
|
+
def rem_admin(m, nicks)
|
251
230
|
if is_admin(m.user)
|
252
|
-
|
253
|
-
|
254
|
-
|
231
|
+
nicks = nicks.split(",")
|
232
|
+
nicks.each do |nick|
|
233
|
+
u = User(nick)
|
234
|
+
if u and !u.unknown
|
235
|
+
remove_user_from_queue(u)
|
236
|
+
end
|
255
237
|
end
|
256
238
|
end
|
257
239
|
end
|
258
240
|
|
259
|
-
command :rem_silent,{
|
241
|
+
command :rem_silent,{nicks: :string},
|
260
242
|
summary: "Remove a specific user from the queue without pinging the user in the channel",
|
261
243
|
admin: true
|
262
|
-
def rem_silent(m,
|
244
|
+
def rem_silent(m, nicks)
|
263
245
|
if is_admin(m.user)
|
264
|
-
|
265
|
-
|
266
|
-
|
246
|
+
nicks = nicks.split(",")
|
247
|
+
nicks.each do |nick|
|
248
|
+
u = User(nick)
|
249
|
+
if u and !u.unknown
|
250
|
+
remove_user_from_queue(u,false)
|
251
|
+
end
|
267
252
|
end
|
268
253
|
end
|
269
254
|
end
|
270
255
|
|
271
|
-
command :add,{
|
256
|
+
command :add,{nicks: :string},
|
272
257
|
summary: "Add a specific user to the queue",
|
273
258
|
method: :add_admin,
|
274
259
|
admin: true
|
275
|
-
def add_admin(m,
|
260
|
+
def add_admin(m, nicks)
|
276
261
|
if is_admin(m.user)
|
277
|
-
|
278
|
-
|
279
|
-
|
262
|
+
nicks = nicks.split(",")
|
263
|
+
nicks.each do |nick|
|
264
|
+
u = User(nick)
|
265
|
+
if u and !u.unknown
|
266
|
+
add_user_to_queue(m,u)
|
267
|
+
end
|
280
268
|
end
|
281
269
|
end
|
282
270
|
end
|
283
271
|
|
284
|
-
command :add_silent,{
|
272
|
+
command :add_silent,{nicks: :string},
|
285
273
|
summary: "Add a specific user to the queue without pinging the user in the channel",
|
286
274
|
admin: true
|
287
|
-
def add_silent(m,
|
275
|
+
def add_silent(m, nicks)
|
288
276
|
if is_admin(m.user)
|
289
|
-
|
290
|
-
|
291
|
-
|
277
|
+
nicks = nicks.split(",")
|
278
|
+
puts nicks.inspect
|
279
|
+
nicks.each do |nick|
|
280
|
+
u = User(nick)
|
281
|
+
if u and !u.unknown
|
282
|
+
add_user_to_queue(m,u,false)
|
283
|
+
end
|
292
284
|
end
|
293
285
|
end
|
294
286
|
end
|
@@ -335,12 +327,12 @@ module KAG
|
|
335
327
|
summary: "Next map a given server",
|
336
328
|
method: :next_map_specify,
|
337
329
|
admin: true
|
338
|
-
def next_map_specify(m,
|
330
|
+
def next_map_specify(m,server)
|
339
331
|
if is_admin(m.user)
|
340
|
-
if @servers[
|
341
|
-
@servers[
|
332
|
+
if @servers[server]
|
333
|
+
@servers[server].next_map
|
342
334
|
else
|
343
|
-
m.reply "No server found with key #{
|
335
|
+
m.reply "No server found with key #{server}"
|
344
336
|
end
|
345
337
|
end
|
346
338
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module KAG
|
2
|
+
module Gather
|
3
|
+
class Queue
|
4
|
+
|
5
|
+
attr_accessor :players
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
self.players = {}
|
9
|
+
end
|
10
|
+
|
11
|
+
def add(user)
|
12
|
+
self.players[user.authname.to_sym] = user
|
13
|
+
end
|
14
|
+
|
15
|
+
def remove(user)
|
16
|
+
if has_player?(user)
|
17
|
+
self.players.delete(user.authname.to_sym)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def list
|
22
|
+
m = []
|
23
|
+
self.players.each do |authname,user|
|
24
|
+
m << user.authname
|
25
|
+
end
|
26
|
+
m.join(", ")
|
27
|
+
end
|
28
|
+
|
29
|
+
def has_player?(user)
|
30
|
+
self.players.has_key?(user.authname.to_sym)
|
31
|
+
end
|
32
|
+
|
33
|
+
def length
|
34
|
+
self.players.length
|
35
|
+
end
|
36
|
+
|
37
|
+
def reset
|
38
|
+
self.players = {}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/kag/gather/team.rb
CHANGED
@@ -16,10 +16,10 @@ module KAG
|
|
16
16
|
def setup_classes
|
17
17
|
classes = KAG::Config.instance[:classes].clone
|
18
18
|
classes.shuffle!
|
19
|
-
|
20
|
-
self
|
21
|
-
players.each do |
|
22
|
-
self[
|
19
|
+
|
20
|
+
self.teammates = {}
|
21
|
+
self.players.each do |authname,user|
|
22
|
+
self.teammates[authname.to_sym] = classes.shift
|
23
23
|
end
|
24
24
|
self
|
25
25
|
end
|
@@ -30,43 +30,37 @@ module KAG
|
|
30
30
|
msg = msg + " \x0303Class: " if KAG::Config.instance[:pick_classes]
|
31
31
|
|
32
32
|
messages = {}
|
33
|
-
self
|
33
|
+
self.players.each do |authname,user|
|
34
34
|
player_msg = msg.clone
|
35
35
|
player_msg = player_msg+cls if KAG::Config.instance[:pick_classes] and cls and !cls.empty?
|
36
|
-
player_msg = player_msg+" #{self[:color]}#{self[:name]} with: #{self
|
37
|
-
messages[
|
36
|
+
player_msg = player_msg+" #{self[:color]}#{self[:name]} with: #{self.teammates.keys.join(", ")}"
|
37
|
+
messages[user] = player_msg
|
38
38
|
end
|
39
|
+
puts messages.inspect
|
39
40
|
messages
|
40
41
|
end
|
41
42
|
|
42
43
|
def text_for_match_start
|
43
|
-
"#{self[:color]}#{self
|
44
|
+
"#{self[:color]}#{self.players.keys.join(", ")} (#{self[:name]})"
|
44
45
|
end
|
45
46
|
|
46
47
|
def has_player?(user)
|
47
|
-
self
|
48
|
-
end
|
49
|
-
|
50
|
-
def rename_player(user)
|
51
|
-
if self[:players].keys.include?(user.last_nick.to_sym)
|
52
|
-
cls = self[:players][user.last_nick.to_sym]
|
53
|
-
self[:players].delete(user.last_nick.to_sym)
|
54
|
-
self[:players][user.nick.to_sym] = cls
|
55
|
-
end
|
48
|
+
self.players.keys.include?(user.authname.to_sym)
|
56
49
|
end
|
57
50
|
|
58
51
|
def remove_player(user)
|
59
52
|
if has_player?(user)
|
60
53
|
sub = {}
|
61
|
-
sub[:cls] = self[
|
54
|
+
sub[:cls] = self.teammates[user.authname.to_sym]
|
62
55
|
sub[:team] = self.clone
|
63
56
|
sub[:msg] = "Sub needed at #{self.match.server[:ip]} for #{sub[:team][:name]}, #{sub[:cls]} Class! Type !sub to claim it!"
|
64
|
-
sub[:channel_msg] = "#{user.
|
57
|
+
sub[:channel_msg] = "#{user.authname} is now subbing in for #{self[:name]} at #{self.match.server[:key]}. Subs still needed: #{self.match[:subs_needed].length}"
|
65
58
|
sub[:private_msg] = "Please #{self.match.server.text_join} | #{sub[:cls]} on the #{self[:name]} Team"
|
66
|
-
self
|
59
|
+
self.players.delete(user.authname.to_sym)
|
60
|
+
self.teammates.delete(user.authname.to_sym)
|
67
61
|
|
68
62
|
KAG::User::User.subtract_stat(user,:matches)
|
69
|
-
KAG::User::User.add_stat(
|
63
|
+
KAG::User::User.add_stat(user,:desertions)
|
70
64
|
|
71
65
|
if self.match and self.match.server
|
72
66
|
self.match.server.kick(user.nick)
|
@@ -79,8 +73,8 @@ module KAG
|
|
79
73
|
end
|
80
74
|
|
81
75
|
def kick_all
|
82
|
-
self
|
83
|
-
self.match.server.kick(nick.to_s)
|
76
|
+
self.players.each do |authname,user|
|
77
|
+
self.match.server.kick(user.nick.to_s)
|
84
78
|
end
|
85
79
|
end
|
86
80
|
end
|
data/lib/kag/version.rb
CHANGED
data/lib/patches.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'cinch'
|
2
|
+
|
1
3
|
class Hash
|
2
4
|
@keys_not_used = nil
|
3
5
|
def random_key
|
@@ -13,4 +15,16 @@ class Hash
|
|
13
15
|
def shuffle!
|
14
16
|
self.replace(self.shuffle)
|
15
17
|
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module Cinch
|
21
|
+
class User < Target
|
22
|
+
def to_s
|
23
|
+
self.data[:authname]
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_i
|
27
|
+
self.to_s.to_i
|
28
|
+
end
|
29
|
+
end
|
16
30
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kag-gather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
5
|
-
prerelease:
|
4
|
+
version: 1.4.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Shaun McCormick
|
@@ -14,7 +13,6 @@ dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: cinch
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - '='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - '='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: json
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: symboltable
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - '='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - '='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: kagerator
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - '='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - '='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rake
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ! '>='
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ! '>='
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -94,7 +83,6 @@ dependencies:
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: rspec
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ! '>='
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,7 +90,6 @@ dependencies:
|
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ! '>='
|
108
95
|
- !ruby/object:Gem::Version
|
@@ -110,7 +97,6 @@ dependencies:
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: guard-rspec
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
101
|
- - ! '>='
|
116
102
|
- !ruby/object:Gem::Version
|
@@ -118,7 +104,6 @@ dependencies:
|
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
108
|
- - ! '>='
|
124
109
|
- !ruby/object:Gem::Version
|
@@ -144,6 +129,7 @@ files:
|
|
144
129
|
- lib/kag/data.rb
|
145
130
|
- lib/kag/gather/match.rb
|
146
131
|
- lib/kag/gather/plugin.rb
|
132
|
+
- lib/kag/gather/queue.rb
|
147
133
|
- lib/kag/gather/team.rb
|
148
134
|
- lib/kag/irc/plugin.rb
|
149
135
|
- lib/kag/server.rb
|
@@ -155,26 +141,25 @@ files:
|
|
155
141
|
homepage: https://github.com/splittingred/kag-gather
|
156
142
|
licenses:
|
157
143
|
- GPLv2
|
144
|
+
metadata: {}
|
158
145
|
post_install_message:
|
159
146
|
rdoc_options: []
|
160
147
|
require_paths:
|
161
148
|
- lib
|
162
149
|
required_ruby_version: !ruby/object:Gem::Requirement
|
163
|
-
none: false
|
164
150
|
requirements:
|
165
151
|
- - ! '>='
|
166
152
|
- !ruby/object:Gem::Version
|
167
153
|
version: 1.9.2
|
168
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
155
|
requirements:
|
171
156
|
- - ! '>='
|
172
157
|
- !ruby/object:Gem::Version
|
173
158
|
version: 1.3.6
|
174
159
|
requirements: []
|
175
160
|
rubyforge_project:
|
176
|
-
rubygems_version:
|
161
|
+
rubygems_version: 2.0.3
|
177
162
|
signing_key:
|
178
|
-
specification_version:
|
163
|
+
specification_version: 4
|
179
164
|
summary: KAG Gather IRC Bot
|
180
165
|
test_files: []
|