import { NrPlugin, PluginManager, Log } from '../core/plugin-module';
import { PlayerTracker } from './player-tracker';
import { IPlayerData } from '../models/playerdata';
/*
* The // here is to avoid tagging NRP. Remove it before compiling this plugin.
*/
@//NrPlugin({ name: 'Player Notifier', author: 'Killer Be Killed' })
class PlayerNotifier {
names = [
'Eendi',
'Oshyu',
'Saylt'
];
constructor() {
PluginManager.afterInit(() => {
const tracker = PluginManager.getInstanceOf(PlayerTracker);
tracker.trackAllPlayers();
tracker.on('enter', (player: IPlayerData) => {
if (this.names.indexOf(player.name) > -1) {
Log('Notifier', `${player.name} entered ${player.server}`);
}
});
});
}
}
