9 Months Ago
Serialize Protobuf.Entity on the outbound network thread on the server Deserialize Protobuf.Entity in the inbound decryption thread on the client Change _NetworkCache from MemoryStream -> ProtoBuf.Entity RefCount ProtoBuf.Entity so we can keep it on the main thread as a cache as well as serialize it on network thread Initialize ProtocolParser.staticBuffer on each network thread (can do it automatically later) Remove `netcachesize` convar on the server since we aren't pooling memory streams InvalidateNetworkCache() will now invalidate the Protobuf.Entity ToStreamForNetwork() will Save() then put the ProtoBuf.Entity into the NetWrite ToStream() (normal saving for disk) stays the same Remove PostSave() (easier to remove than reimplement on network thread)