added prettier | pnpm workspaces
This commit is contained in:
		
							parent
							
								
									bc08e1c707
								
							
						
					
					
						commit
						0138af71c0
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -2,6 +2,8 @@ | |||||||
| .vscode | .vscode | ||||||
| .idea | .idea | ||||||
| 
 | 
 | ||||||
|  | .git | ||||||
|  | 
 | ||||||
| # Server Files | # Server Files | ||||||
| server/bin | server/bin | ||||||
| server/client_packages | server/client_packages | ||||||
|  | |||||||
| @ -1,8 +1,20 @@ | |||||||
|  | import { fw } from 'rage-fw-cef' | ||||||
|  | import { useEffect } from 'react' | ||||||
|  | 
 | ||||||
| function App() { | function App() { | ||||||
|   return ( |     useEffect(() => { | ||||||
|     <> |         fw.event.register('customCefEvent', ([test]) => { | ||||||
|     </> |             console.log(test) | ||||||
|   ) | 
 | ||||||
|  |             return '' | ||||||
|  |         }) | ||||||
|  |     }, []) | ||||||
|  | 
 | ||||||
|  |     return ( | ||||||
|  |         <> | ||||||
|  |             <h1>Hello World!</h1> | ||||||
|  |         </> | ||||||
|  |     ) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export default App | export default App | ||||||
|  | |||||||
| @ -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!' | ||||||
|  | }) | ||||||
| @ -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}`) | ||||||
|  | }) | ||||||
| @ -1,7 +1,13 @@ | |||||||
| declare module 'rage-fw-shared-types' { | 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 | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user