SquadJS/squad-server/log-parser/player-died.js

24 lines
768 B
JavaScript
Raw Normal View History

2020-05-15 12:42:39 -05:00
export default {
regex:
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQSoldier::)?Die\(\): Player:(.+) KillingDamage=(?:-)*([0-9.]+) from ([A-z_0-9]+) \(Online IDs: EOS: ([\w\d]{32}) steam: (\d{17}) \| Contoller ID: ([\w\d]+)\) caused by ([A-z_0-9-]+)_C/,
2020-10-14 10:40:11 -05:00
onMatch: (args, logParser) => {
2020-05-15 12:42:39 -05:00
const data = {
...logParser.eventStore.session[args[3]],
2020-05-15 12:42:39 -05:00
raw: args[0],
time: args[1],
woundTime: args[1],
chainID: args[2],
2020-10-05 12:52:01 -05:00
victimName: args[3],
2020-05-15 12:42:39 -05:00
damage: parseFloat(args[4]),
attackerPlayerController: args[5],
attackerEOSID: args[6],
attackerSteamID: args[7],
weapon: args[9]
2020-05-15 12:42:39 -05:00
};
logParser.eventStore.session[args[3]] = data;
2020-05-15 12:42:39 -05:00
2020-10-05 12:52:01 -05:00
logParser.emit('PLAYER_DIED', data);
2020-05-15 12:42:39 -05:00
}
};