sqid change and mailed loot are rather unimportant, but with this combat
logs seem to work completely.
This commit is contained in:
parent
e57175c57d
commit
80f3f30b92
@ -27,14 +27,14 @@ class CombatLog(Log):
|
|||||||
__slots__ = Log.__slots__ + [ '_match_id', 'values']
|
__slots__ = Log.__slots__ + [ '_match_id', 'values']
|
||||||
@classmethod
|
@classmethod
|
||||||
def _log_handler(cls, log):
|
def _log_handler(cls, log):
|
||||||
if log.get('log', '').strip().startswith(cls.__name__):
|
if log.startswith(cls.__name__):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_handler(cls, log):
|
def is_handler(cls, log):
|
||||||
if log.get('logtype', None) == L_CMBT:
|
if log.get('logtype', None) == L_CMBT:
|
||||||
return cls._log_handler(log)
|
return cls._log_handler(log.get('log', '').strip())
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def __init__(self, values=None):
|
def __init__(self, values=None):
|
||||||
@ -177,7 +177,7 @@ class GameEvent(CombatLog):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _log_handler(cls, log):
|
def _log_handler(cls, log):
|
||||||
if log.get('log', '').strip().startswith('======='):
|
if log.startswith('======='):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -241,16 +241,35 @@ class Set(CombatLog):
|
|||||||
__slots__ = CombatLog.__slots__
|
__slots__ = CombatLog.__slots__
|
||||||
matcher = re.compile("^Set\s(?P<what>\w+)\s(?P<name>[^\s]+)\sto\s(?P<value>\w+)")
|
matcher = re.compile("^Set\s(?P<what>\w+)\s(?P<name>[^\s]+)\sto\s(?P<value>\w+)")
|
||||||
|
|
||||||
|
class SqIdChange(CombatLog):
|
||||||
|
""" - number: player number
|
||||||
|
- name: player name
|
||||||
|
- old_sqid: sqid of player before
|
||||||
|
- sqid: new player sqid
|
||||||
|
"""
|
||||||
|
__slots__ = CombatLog.__slots__
|
||||||
|
matcher = re.compile("^Player\s(?P<number>\d+)\((?P<name>[^\)]+)\)\schanged\ssqid\sfrom\s(?P<old_sqid>\d+)\sto\s(?P<sqid>\d+)")
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _log_handler(cls, log):
|
||||||
|
if log.startswith('Player'):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
class Mailed(CombatLog):
|
||||||
|
""" has no information. only that loot has been mailed """
|
||||||
|
__slots__ = CombatLog.__slots__
|
||||||
|
matcher = re.compile("Mailed\sloot")
|
||||||
|
|
||||||
class UserEvent(CombatLog):
|
class UserEvent(CombatLog):
|
||||||
""" special class for combat logs that might be associated with the playing player """
|
""" special class for combat logs that might be associated with the playing player """
|
||||||
__slots__ = CombatLog.__slots__
|
__slots__ = CombatLog.__slots__
|
||||||
@classmethod
|
@classmethod
|
||||||
def _log_handler(cls, log):
|
def _log_handler(cls, log):
|
||||||
line = log.get('log', '').strip()
|
if log and 'earned medal' in log:
|
||||||
if line and 'earned medal' in line:
|
|
||||||
return True
|
return True
|
||||||
elif line:
|
elif log:
|
||||||
logging.debug('UserEvent saw unknown line:\n%s' % line)
|
logging.debug('UserEvent saw unknown line:\n%s' % log)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Action?
|
# Action?
|
||||||
@ -260,7 +279,7 @@ COMBAT_LOGS = [ Apply, Damage, Spawn, Spell, Reward, Participant, Rocket, Heal,
|
|||||||
Killed, Captured, AddStack, Cancel, Uncaptured,
|
Killed, Captured, AddStack, Cancel, Uncaptured,
|
||||||
# undone openspace:
|
# undone openspace:
|
||||||
PVE_Mission, Looted, Set, Dropped,
|
PVE_Mission, Looted, Set, Dropped,
|
||||||
|
SqIdChange, Mailed, # unknown if these are important...
|
||||||
# always last:
|
# always last:
|
||||||
GameEvent, UserEvent,
|
GameEvent, UserEvent,
|
||||||
Stacktrace,
|
Stacktrace,
|
||||||
|
Loading…
Reference in New Issue
Block a user