The whole thing was made in the most simple way possible, and currenlty is in early "alpha", so expect some bugs.
Game Server dumps player locations in a log files, then Voice Chat Server grabs that data and shares it among the connected players who are in the same location.
On the client-side it's basicaly a tab in a browser that handles all the audio streaming, while players can mute and unmute themselves direclty from the game (thanks to the new NUI support)
Websockets (with socket.io), WebRTC (with peer.js), Three.js (for proximity sound), node.js + express.js as a webserver, tail and chokidar to watch log files.
- Install
node
andnpm
for your OS - git clone this repository
- Put absolute path to your server's log.0 directory in server/config.json
- Generate certificates (or use letsencrypt if you have a domain name)
cd server/cert && chmod +x generate-certificates && ./generate-certificates.sh
- Create/Edit your module and add scripts from module-scrips folder to your module
- Attach
onClientEnter
andonClientLeave
scripts to their respective events - Inside
onClientEnter
script, changeVC_URL
to your domain or server ip with 3000 port. It will be shown to players - Run the Game Server with your module
- Build and launch the Voice Chat Server
cd server
npm i
npm run build
npm run start
- Join the server that has this voice chat plugin installed
- Notice the floating "Voice chat" window
Alt+Tab
and open a new firefox/safari/etc tab with the url you saw in the floating window- Enter the 4 digit pin number you saw in the floating window
- Return to the game and press "On" button so others could hear you
It will not work in Chrome or any Chrome-based browsers like Brave, Edge, etc. Use Firefox.