import { events } from '@rage-fw/shared'
import { rpc } from './lib'

rpc.register('playerJoin', async (player: PlayerMp) => {
    console.log(`[Server] ${player.socialClub} connected`)
})

rpc.register(
    events.server.customServerEvent,
    async (player: PlayerMp, args: string) => {
        console.log(args)
        const res = await rpc.callClient(
            player,
            events.client.customClientEvent,
            ['hello from server'],
        )
        console.log(res)
        return 'response from server'
    },
)
