@@ -14,6 +14,7 @@ def __init__(self, config):
14
14
self .owners = config ["owners" ]
15
15
self .rconowners = config ["rconowners" ]
16
16
self .password = config ["rconpasswd" ]
17
+ self .clan = config ["clantag" ]
17
18
18
19
self .servers = {}
19
20
for line in open ("servers.txt" , "r" ).readlines ():
@@ -129,6 +130,7 @@ def parseStatus(self, data, playersCmd = False, serverCmd = False):
129
130
sparts = r .split ("\n " )
130
131
131
132
players = [p for p in sparts [2 :] if p ]
133
+ clanmems = " " .join (players ).count (self .clan )
132
134
133
135
rawvars = sparts [1 ].split ("\\ " )[1 :]
134
136
svars = {rawvars [i ]:rawvars [i + 1 ] for i in range (0 , len (rawvars ), 2 )}
@@ -144,7 +146,10 @@ def parseStatus(self, data, playersCmd = False, serverCmd = False):
144
146
self .reply ("\x03 16,2{}\x03 command sent to \x03 16,2{}\x03 " .format (" " .join (data [1 :]), name ))
145
147
else :
146
148
gamemode = self ._GAMEMODES [int (svars ["g_gametype" ])]
147
- self .reply ("\x03 16,2{}: {}/{} {} {}\x03 " .format (name , len (players ), svars ["sv_maxclients" ], gamemode , svars ["mapname" ]))
149
+ if clanmems :
150
+ self .reply ("\x03 16,2{}: {}/{} {} {} - {} {}\x03 " .format (name , len (players ), svars ["sv_maxclients" ], gamemode , svars ["mapname" ], clanmems , self .clan ))
151
+ else :
152
+ self .reply ("\x03 16,2{}: {}/{} {} {}\x03 " .format (name , len (players ), svars ["sv_maxclients" ], gamemode , svars ["mapname" ]))
148
153
149
154
def cmd_help (self , issuedBy , data ):
150
155
""".help [command] - displays this message"""
@@ -181,8 +186,8 @@ def cmd_status(self, issuedBy, data):
181
186
for s in self .servers :
182
187
self .parseStatus (s , False , False )
183
188
184
- def cmd_kill (self , issuedBy , data ):
185
- """.kill - kills the bot"""
189
+ def cmd_die (self , issuedBy , data ):
190
+ """.die - kills the bot"""
186
191
if issuedBy in self .owners :
187
192
if data :
188
193
self .die ("{}" .format (data ))
0 commit comments