import { fw } from 'rage-fw-server'

fw.event.register('playerJoin', async ([player]) => {
    fw.system.log.info(`Connected: ${player.socialClub}`)
})

fw.event.register('customServerEvent', async ([player, msg]) => {
    fw.system.log.info(player.socialClub + ' ' + msg)

    const resFromCef = await fw.player.triggerBrowser(
        player,
        'customCefEvent',
        ['from server'],
    )
    fw.system.log.info(player.socialClub + ' ' + resFromCef)

    return 'from server'
})
