Broadcast Radius doesnt change for clients if modified by Server

Synirr shared this bug 2 years ago
Reported

Hey,


Myself and another modder wrote a mod that is supposed to modify the HudText and Broadcast radius of beacons based on current thrust of the grid. We wanted it to have server authority and it turns out this is not natively available for BroadcastRadius only HudText.


Attached is the code associated with this report. Please make BroadcastRadius server modifiable so that it syncs to the clients rather than it being only client modifiable.

Replies (2)

photo
1

Hello. James!

Thank you for letting us know.

The issue has been reported into our internal system.

Kind Regards,

Keen Software House: QA Department

photo
1

Stumbled on this with modding, this affects both PB API and mod API.


A PB script to repro if it helps:

Random RNG = new Random();

public void Main(string argument, UpdateType updateSource)
{
    const string BlockName = "Beacon";

    var beacon = GridTerminalSystem.GetBlockWithName(BlockName) as IMyBeacon;
    if(beacon != null)
    {
        float max = beacon.GetMaximum<float>("Radius"); // terminal propID, not C# prop
        float random = 50 + Math.Abs((float)RNG.NextDouble() * 300);
        float oldValue = beacon.Radius;
        float newValue = oldValue + random;
        if(newValue > max)
            newValue = oldValue - random;

        beacon.Radius = newValue;

        Echo($"Changed from {oldValue:0.##} to {newValue:0.##}");
        Echo($"beacon.Radius: {beacon.Radius:0.##}");
    }
    else
    {
        Echo($"Can't find '{BlockName}'!");
    }
}
Grid with a beacon, power and PB, ensure beacon's named Beacon, paste script and every time you run it'll change radius to a random offset and print what it did server-side, then you need to look at the beacon's terminal on your client to see if the radius matches what happend on server.

Leave a Comment
 
Attach a file
You can't vote. Please authorize!