Page MenuHomeFeedback Tracker

NonSerialized also not writing to ScriptRPC since 1.22
Assigned, UrgentPublic

Description

I have been using ScriptRPCs to sync configs between server and client and I did not want to have some values in my json files, so I used [NonSerialized()] infront of the variable declaration and then computed the values when loading the json file. Before 1.22, these variables would also be written to the ScriptRPC, but now it seems like the [NonSerialized()] Attribute also prevents the value from being written to ScriptRPC.
I did not see any changelog for that change and wonder if it's intended and how I would fix the problem here now ?

Details

Severity
Block
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
General
Steps To Reproduce
class TestContent {
    string myContent;
    void TestContent(string content) {
        myContent = content;
    }
}
class TestSyncClass {
    ref TestContent testContentWorking = new TestContent("I'm synced");
    [NonSerialized()]
    ref TestContent testContentNotWorking = new TestContent("I'm not synced");
}

Then send the TestSyncClass to the Client via

ScriptRPC rpc = new ScriptRPC();
TestSyncClass data = new TestSyncClass();
rpc.Write(data);
rpc.Send(...);

Event Timeline

LBmaster created this task.Sep 1 2023, 2:18 PM
Geez changed the task status from New to Assigned.Sep 4 2023, 11:02 AM