Live
Phone and radio rewrite
A from-scratch rebuild of in-game phones, payphones and radios, with calls that always clean up after themselves.
- Role
- Design and implementation
- Stack
- Lua (GLua)
- Context
- Player communication on Diverge Networks’ roleplay server
- Status
- Live
The problem
The old phone and radio system was unreliable enough that the server asked for a full rewrite: calls that never ended, players stuck in calls that no longer existed, and police radio channels that could be listened in on.
Phones
- Numbers are assigned on first use with a check for numbers already taken, and supporters can pick custom numbers.
- Calls move through explicit states, and unanswered calls close themselves after 30 seconds.
- Leaving a payphone call runs its cleanup in a protected block, so the call is severed and its networked state cleared even if something errors halfway.
- A periodic check finds players marked as being in calls that no longer exist, and releases them.
Screenshot coming soon
The phone interface while dialling.
assets/projects/phone-radio/phone-dial.png (tight crop)
Screenshot coming soon
An incoming call.
assets/projects/phone-radio/phone-incoming.png (tight crop)
Video coming soon
One call from dialling to answering to hanging up, with a second client answering.
assets/projects/phone-radio/phone-call.mp4 (about 15 seconds)
Radios
- Radio channels and frequencies with a new voice bubble, and sounds when someone talks on the radio in voice chat.
- 911 frequencies are police-only, and a way of bypassing that check was closed.
- A cooldown on toggling the radio stops spam through key binds.
- Full support for in-game languages on both phones and radios.
Screenshot coming soon
The radio voice bubble while someone speaks.
assets/projects/phone-radio/radio-bubble.png (tight crop)