dont send message for non serializable stuff

This commit is contained in:
_nebula 2023-08-05 12:50:21 +01:00
parent eaa2f4578a
commit e557cadba0
2 changed files with 6 additions and 1 deletions

View File

@ -55,6 +55,11 @@ public class RequestStateResyncMessage : QSBMessage
// Initial sync of all custom data from APIs
foreach (var kvp in QSBPlayerManager.LocalPlayer._customData)
{
if (!kvp.Value.GetType().IsSerializable)
{
continue;
}
new AddonCustomDataSyncMessage(QSBPlayerManager.LocalPlayerId, kvp.Key, kvp.Value) { To = From }.Send();
}
}

View File

@ -188,7 +188,7 @@ public partial class PlayerInfo
{
_customData[key] = data;
if (!QSBPatch.Remote)
if (!QSBPatch.Remote && typeof(T).IsSerializable)
{
new AddonCustomDataSyncMessage(PlayerId, key, data).Send();
}