This commit is contained in:
xbl
2026-01-02 17:05:57 +01:00
parent 7c031d2cae
commit 8d8a729490
4 changed files with 59 additions and 3137 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ venv3/
*.log
cvarlist.txt
curztest.py
rconpw.txt

View File

@ -223,7 +223,20 @@ class EventParser:
weapon = killer.get('WEAPON', 'UNKNOWN')
weapon_name = WEAPON_KILL_NAMES.get(weapon, f'the {weapon}')
return f"{score_prefix}{killer_prefix}^8{killer_name}^0 ^7fragged^7 {victim_prefix}^8{victim_name}^0 ^7with {weapon_name}{warmup}\n"
hp_left = killer.get('HEALTH', '0 HP')
hp_left_colored = ""
if hp_left <= 0: # from the grave
hp_left_colored = f"^8^5From the Grave^0"
elif hp_left < 25: # red
hp_left_colored = f"^8^1{hp_left}^0 ^7HP"
elif hp_left < 80: # yellow
hp_left_colored = f"^8^3{hp_left}^0 ^7HP"
elif hp_left < 126: # white
hp_left_colored = f"^8^7{hp_left}^0 ^7HP"
else: # green
hp_left_colored = f"^8^2{hp_left}^0 ^7HP"
return f"{score_prefix}{killer_prefix}^8{killer_name}^0 ^7fragged^7 {victim_prefix}^8{victim_name}^0 ^7with {weapon_name}^0 ^7({hp_left_colored}^7){warmup}\n"
def _handle_round_over(self, data):
"""Handle ROUND_OVER events for CA"""

44
qlpycon.bash Executable file
View File

@ -0,0 +1,44 @@
#/usr/bin/env bash
#
workdir="/home/xbl/gits/qlpycon"
password="$(cat $workdir/rconpw.txt)"
serverip="10.13.12.93"
cd "$workdir"
source venv/bin/activate
if [ "$1" == "ffa" ]; then
python3 main.py --host tcp://"$serverip":28960 --password "$password"
elif [ "$1" == "duel" ]; then
python3 main.py --host tcp://"$serverip":28961 --password "$password"
elif [ "$1" == "rcpma" ]; then
python3 main.py --host tcp://"$serverip":28962 --password "$password"
elif [ "$1" == "iffa" ]; then
python3 main.py --host tcp://"$serverip":28963 --password "$password"
elif [ "$1" == "ca" ]; then
python3 main.py --host tcp://"$serverip":28964 --password "$password"
elif [ "$1" == "ctf" ]; then
python3 main.py --host tcp://"$serverip":28965 --password "$password"
elif [ "$1" == "rcvq3" ]; then
python3 main.py --host tcp://"$serverip":28966 --password "$password"
elif [ "$1" == "test" ]; then
python3 main.py --host tcp://"$serverip":28967 --password "$password"
elif [ "$1" == "ft" ]; then
python3 main.py --host tcp://"$serverip":28968 --password "$password"
elif [ "$1" == "leduel" ]; then
python3 main.py --host tcp://"$serverip":28969 --password "$password"
else
echo "[ ffa (27960), duel (27961), rcpma (27962), iffa (27963), ca (27964), ctf (27965), rcvq3 (27966), test (27967), ft (27968), leduel (27969) ]"
fi

3136
raw.json

File diff suppressed because it is too large Load Diff