added prettier | pnpm workspaces

This commit is contained in:
Oleksandr Honcharov 2024-06-13 23:12:40 +03:00
parent bc08e1c707
commit 0138af71c0
5 changed files with 49 additions and 7 deletions

2
.gitignore vendored
View File

@ -2,6 +2,8 @@
.vscode
.idea
.git
# Server Files
server/bin
server/client_packages

View File

@ -1,6 +1,18 @@
import { fw } from 'rage-fw-cef'
import { useEffect } from 'react'
function App() {
useEffect(() => {
fw.event.register('customCefEvent', ([test]) => {
console.log(test)
return ''
})
}, [])
return (
<>
<h1>Hello World!</h1>
</>
)
}

View File

@ -0,0 +1,9 @@
import { fw } from 'rage-fw-client'
fw.event.register('customClientEvent', ([greetings]) => {
fw.system.log.info(greetings)
fw.player.triggerBrowser('customCefEvent', ['str'])
return 'Hola from client!'
})

View File

@ -0,0 +1,13 @@
import { fw } from 'rage-fw-server'
fw.event.register('playerJoin', async ([player]) => {
fw.system.log.info(`Connected: ${player.socialClub}`)
const response = await fw.player.triggerClient(
player,
'customClientEvent',
['Hi from server!'],
)
fw.system.log.info(`Response from client: ${response}`)
})

View File

@ -1,7 +1,13 @@
declare module 'rage-fw-shared-types' {
export interface RageFW_ICustomClientEvent {}
export interface RageFW_ICustomClientEvent {
customClientEvent(greetings: string): string
}
export interface RageFW_ICustomServerEvent {}
export interface RageFW_ICustomServerEvent {
customServerEvent(greetings: string): string
}
export interface RageFW_ICustomCefEvent {}
export interface RageFW_ICustomCefEvent {
customCefEvent(greetings: string): string
}
}