Page MenuHomeFeedback Tracker

ItemTransmitter.EnableBroadcast doesn't work
Closed, ResolvedPublic

Description

I'm trying to add the possibility to enable/disable the talking into the transmitters (so that you can speak to people near you, but not on the radio) and it's not working.
ItemTransmitter.EnableBroadcast has no effect, client AND serverside.

Details

Severity
Feature
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

GrosTon1 created this task.Jun 20 2020, 7:42 PM
Geez changed the task status from New to Assigned.Jun 22 2020, 11:46 AM
mdc added a subscriber: mdc.Sep 30 2020, 12:01 AM

Unfortunately I can also confirm this bug.

Is it possible that the natives are merely stubs at this point? And if so, can we have them properly implemented?

broman added a subscriber: broman.Sep 30 2020, 3:23 AM
Geez changed the task status from Assigned to Acknowledged.Sep 30 2020, 10:46 AM
Geez added a subscriber: Geez.

Thank you for the report GrosTon1.
This is an issue we are aware of as EnableBroadcast/EnableReceive is currently not implemented.
Regards,
Geez

Can they be implemented please? @Geez

Geez closed this task as Resolved.Oct 29 2020, 10:44 AM
Geez claimed this task.

Hello everyone.
The EnableBroadcast/EnableReceive has been implemented and will appear in the next experimental patch.
Regards,
Geez

Hello Geez,

It seems to still not be working for PersonalRadio for example, which is a ItemTransmitter.
I'm seeing that Land_Radio_PanelBig extends the new class StaticTransmitter, and uses EnableBroadcast and EnableReceive in Land_Radio_PanelBig .OnWorkStart().
So my guess is that it's only been implemented for StaticTransmitter class and not ItemTransmitter... which doesn't include PersonalRadio for example.

And I just also found out that the frequencies aren't even working properly, I guess I'll need to link the game and Discord then.

mdc added a comment.Dec 5 2020, 4:26 PM

GrosTon1,

I can confirm that it *does* work; we implemented Push To Talk on Kinship the day 1.10 was released. You need to ensure that you're calling SetSynchDirty() on the transmitter after setting the broadcast states.

ClientSide :

ItemBase handItem = PlayerBase.Cast(GetGame().GetPlayer()).GetItemInHands();
                        if (!handItem) {
                            return;
                        }
                        TransmitterBase transmitter = TransmitterBase.Cast(handItem);
                        if (!transmitter) {
                            return;
                        }
                        GetRPCManager().SendRPC( "ProjetAthena", "ChooseFrequency", null, true, null, transmitter );

ServerSide :

void ChooseFrequency( CallType type, ref ParamsReadContext ctx, ref PlayerIdentity sender, ref Object target )
    {        
        if( type == CallType.Server )
        {
            TransmitterBase transmitter = TransmitterBase.Cast(target);
            if (!transmitter) {
                return;
            }
            bool newState = !transmitter.IsBroadcasting();
            transmitter.EnableBroadcast(newState);
            transmitter.SetSynchDirty();
        }
    }

Is not working for me. I even tried syncing itmyself by sending back a RPC from Server to Client, and it didn't mattered.

mdc added a comment.Dec 5 2020, 6:32 PM

Hmmm, what exactly are you trying to do?

With ours, we're handling the enable/disable of broadcast and receive on TransmitterBase itself, then calling SetSynchDirty after making the adjustment. No RPCs involved here, although if you're attempting to *remotely* activate the reception of broadcasts, I imagine you'd also have to turn the device on first. My advice would be to create a function in TransmitterBase which does the required work internally instead of calling transmitter.EnableBroadcast.