Docs · Engineering reference
Telephone calls (#147)
docs/features/telephone-calls.mdEdit on GitHub
- ✅ Call core (LOGIC
comms/phone-exchange, WORLDcomms/phone-call-world,session.mjs phone-proof). A payphone's Ring the police station (LF_PhoneDialAction) goes throughLF_Payphone.UseAtfirst (coin, cooldowns, duty check,LF_OnServiceCall, so the radio dispatch, the board and the pagers still get it), thenLF_PhoneCallsputs a call in the server table (LF_PhoneExchange: RINGING, CONNECTED, ENDED, MISSED) and rings every idle station telephone of the service (Prefabs/Comms/LF_DispatchPhone.et, the base-game rotary desk phone,Roadmap_Dispatch_Phoneon the dispatch-room desk). Every phone gets a replicated line (Prefabs/Comms/LF_PhoneLine.et, spawned on first use) carrying idle/ringing/busy and the talker's player id: the actions show only when they apply and each client rings a ringing line itself (m_iRingPulseSeconds), so a late joiner or a passer-by hears it. On-duty officers get a toast. Only an on-duty officer picks up the station telephone; anyone picks up a ringing payphone. Hang-up, walking past the cord (m_fCordMeters6), going down, dying, disconnecting, a destroyed phone andm_iMaxCallSeconds(600) end the call;m_iRingSeconds(30) unanswered is MISSED, nobody on duty is MISSED at once with no coin taken. Every transition isLF_OnPhoneCallon the bus and a[LFDebug:Phone]line. Settings:Configs/Comms/LF_Phone.conf(Comms has no owner config section yet). The ring is the radio chirp until a bell sound exists. - ✅ Voice on the call, behind a seam (LOGIC
comms/phone-voice-band, WORLDcomms/phone-voice-world, WORLDcomms/phone-voice-connect-fail,session.mjs phone-proof). On pick-upLF_PhoneVoicegives the call one frequency in a private band no handheld tunes (100001 to 165000 kHz) and one random key, and a transport powers two radios on it:LF_PhoneLineTransport(default) uses the radio on each phone's line entity (LF_PhoneLine.et, range 60 km, off when idle);LF_PhoneHandsetTransportputs a Telephone receiver (Prefabs/Comms/LF_PhoneHandset.et, a radio on the same band) in each talker's inventory and takes it back after.m_iVoiceTransportinLF_Phone.confpicks one. When the second line has no radio,LF_PhoneLineTransport.Connectreturns false and tunes the first line back to the idle frequency and a fresh idle key, so nobody near it hears the next call on that channel. Each talker's machine gets the radio's RplId and adds a Telephone entry to the vanilla voice controller (LF_PhoneVONEntry, made active; a moddedSCR_VONController.SetActiveTransmitpoints it at the transceiver), so the normal radio key talks into the phone and the voice HUD shows it; the radio entry they had comes back at hang-up. No open microphone and no re-assert loop. ⚠️ Whether a listener hears a prop transceiver they do not carry is unproven: the two-microphone human test in the PR decides it; if it fails, setm_iVoiceTransport 1.RadioManagerEntity.GetTransceiversInRangeis never called (it crashed the dedicated server in the spike). - ✅ Call-back requests, the voicemail replacement (LOGIC
comms/phone-callback-book, WORLDcomms/phone-callback-world,session.mjs phone-proof). Script cannot record a voice, so a caller whose call rang out, or found nobody on duty, may leave a request at that payphone form_iCallBackOfferSeconds(120): Leave a message for a call back (shown only to that caller, from the line's replicated offer) opens a paper message slip with an optional typed message (m_iMessageMaxChars120). The server checks the offer, the caller's distance, the length (before and after cleaning out markup and separators) and the comms rate limit (#834), logs the text with the uid like chat, and toasts the officers on duty. At the station telephone Read the message pad opens a paper "While you were out" pad (on-duty only) with one line per request (time, place, how long it rang, the message) and a Ring back button: the payphone rings, anyone there picks up, and the request leaves the pad; a ring-back nobody answers puts it back. One open request per caller, at mostm_iMaxCallBacks(20), expiring with the dispatch board (m_iBoardExpirySeconds); never saved.LF_OnPhoneCallBack(left, rung, answered, expired) on the bus.