client/index.ts
import { RpgClient, RpgModule, RpgClientEngine } from '@rpgjs/client'
@RpgModule<RpgClient>({
engine: {
onStart(rpgEngine: RpgClientEngine) {
console.log('ok')
}
}
})
export default class RpgClientModuleEngine {}
**server/player.ts**
import { RpgPlayer, RpgPlayerHooks } from "@rpgjs/server"
export const player: RpgPlayerHooks = {
onConnected(player: RpgPlayer) {
console.log('play')
}
}
**server/index.ts**
import { RpgServer, RpgModule } from '@rpgjs/server'
import { player } from './player'
@RpgModule<RpgServer>({
player, // optional
maps: [] // optional
})
export default class RpgServerEngine {}
**rpg.toml**
name = 'My Game'
modules = [
'./main',
'./temod',
'@rpgjs/default-gui',
'@rpgjs/save',
'@rpgjs/plugin-emotion-bubbles',
'@rpgjs/title-screen',
'@rpgjs/chat'
]
[start]
map = 'simplemap'
graphic = 'hero'
hitbox = [16, 16]
[titleScreen]
mongodb = "mongodb://localhost:27017/test"
```js