From 46f884c2b7e41b4542c373f2ead9444cedc07475 Mon Sep 17 00:00:00 2001 From: void Date: Fri, 14 Aug 2009 12:37:27 +0200 Subject: [PATCH] PK info configuration variable has been added --- script/packets.py | 11 +++++++++++ script/player_kill.py | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/script/packets.py b/script/packets.py index fec93ab..c224ffd 100644 --- a/script/packets.py +++ b/script/packets.py @@ -197,6 +197,17 @@ def entering_game(bytes): def load_complete(bytes): return bytes[0] == 0x04 +def game_flags(bytes): + if len(bytes) < 8 or bytes[0] != 0x01: + return None + + difficulty = bytes[1] + hardcore = utility.read_bytes(bytes, 4, 2) + expansion = bytes[6] + ladder = bytes[7] + + return difficulty, hardcore, expansion, ladder + def parse_player_stop(bytes): if len(bytes) < 13 or bytes[0] != 0x0d: return None diff --git a/script/player_kill.py b/script/player_kill.py index 02c84fc..0d0e55b 100644 --- a/script/player_kill.py +++ b/script/player_kill.py @@ -1,7 +1,10 @@ -import craw, nil.time, utility, threading, packets +import craw, nil.time, utility, threading, packets, configuration class player_information: def __init__(self, name): + if not configuration.player_kill_information: + return + self.name = name player_data = utility.get_player_data_by_name(name) if player_data == None: @@ -57,6 +60,9 @@ class player_kill_handler_class: print line def process_bytes(self, bytes): + if not configuration.player_kill_information: + return + if len(bytes) < 26: return -- 2.11.4.GIT