A simple UDP server library, which can parse data from FH4/FH5.
- Install:
$ npm i forza-horizon
- Import:
import ForzaServer from 'forza-horizon'
const server = new ForzaServer( PORT )
server.on('listening', () => console.log('Listening...'))
server.on('data', data => {
console.log(data)
})
server.bind()
import ForzaServer from 'forza-horizon'
const server = new ForzaServer(3001)
server.on('data', data => {
let isMoving = [data.VelocityX, data.VelocityY, data.VelocityZ].some(v => v > 0.1)
console.log(`Is moving: ${isMoving}`)
})
server.bind()