SquadJS/squad-server/log-parser/rules/player-possess.js

21 lines
579 B
JavaScript
Raw Normal View History

2020-05-15 12:42:39 -05:00
import {
2020-05-15 14:23:16 -05:00
LOG_PARSER_PLAYER_POSSESS
2020-05-15 12:42:39 -05:00
} from '../../events/log-parser.js';
export default {
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogSquadTrace: \[DedicatedServer](?:ASQPlayerController::)?OnPossess\(\): PC=(.+) Pawn=([A-z0-9_]+)_C/,
onMatch: async (args, logParser) => {
const data = {
raw: args[0],
time: args[1],
chainID: args[2],
player: await logParser.server.getPlayerByName(args[3], true),
possessClassname: args[4]
};
2020-05-15 14:23:16 -05:00
logParser.eventStore[args[3]] = args[2];
2020-05-15 12:42:39 -05:00
2020-05-15 14:23:16 -05:00
logParser.server.emit(LOG_PARSER_PLAYER_POSSESS, data);
2020-05-15 12:42:39 -05:00
}
};