save
This commit is contained in:
31
qlpycon.py
31
qlpycon.py
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Version: 1.14.0
|
||||
# Version: 0.6.9
|
||||
|
||||
import sys
|
||||
import re
|
||||
@ -466,6 +466,22 @@ def ParseGameEvent(message):
|
||||
team_prefix = get_team_color(name)
|
||||
return "%s%s ^7got a medal: ^6%s%s\n" % (team_prefix, name, medal, warmup_suffix)
|
||||
|
||||
elif event_type == 'MATCH_STARTED':
|
||||
if current_gametype in team_modes:
|
||||
#redteam =
|
||||
#bluteam =
|
||||
return None
|
||||
elif current_gametype not in team_modes:
|
||||
players = []
|
||||
players_data = data.get('PLAYERS', [])
|
||||
for player in players_data:
|
||||
name = player.get('NAME', 'Unknown')
|
||||
players.append(name)
|
||||
formatted_players = " vs. ".join(players)
|
||||
return f"Match has started - {formatted_players}\n"
|
||||
else:
|
||||
return None
|
||||
|
||||
elif event_type == 'MATCH_REPORT':
|
||||
if current_gametype in team_modes:
|
||||
redscore = int(data.get('TSCORE0', '0'))
|
||||
@ -506,7 +522,14 @@ def ParseGameEvent(message):
|
||||
}
|
||||
weapon_name = weapon_names.get(best_weapon)
|
||||
return "^7%s%s K/D: %d/%d | Best Weapon: %s - Acc: %.2f%% - Kills: %d\n" % (team_prefix, name, kills, deaths, weapon_name, best_accuracy, best_weapon_kills)
|
||||
#return "^7%s%s K/D: %d/%d\n" % (team_prefix, name, kills, deaths)
|
||||
|
||||
# Placeholders
|
||||
elif event_type == 'PLAYER_CONNECT':
|
||||
return None
|
||||
elif event_type == 'PLAYER_DISCONNECT':
|
||||
return None
|
||||
elif event_type == 'ROUND_OVER':
|
||||
return None
|
||||
|
||||
else:
|
||||
# Unknown event type - log at debug level and to file
|
||||
@ -610,7 +633,7 @@ def main(screen):
|
||||
|
||||
input_window, output_window = InitWindows(screen, args)
|
||||
|
||||
PrintMessageFormatted(output_window, "*** QL pyCon Version 1.13.0 starting ***\n")
|
||||
PrintMessageFormatted(output_window, "*** QL pyCon Version 0.6.9 starting ***\n")
|
||||
PrintMessageFormatted(output_window, "zmq python bindings {}, libzmq version {}\n".format(repr(zmq.__version__), zmq.zmq_version()))
|
||||
|
||||
stats_port = None
|
||||
@ -953,4 +976,4 @@ def main(screen):
|
||||
if ( __name__ == '__main__' ):
|
||||
curses.wrapper(main)
|
||||
|
||||
# Version: 1.13.0
|
||||
# Version: 0.6.9
|
||||
|
||||
Reference in New Issue
Block a user