godarklight/DarkMultiPlayer — pull request #141 by JoshBlake (2014-06-24 06:10:35+00:00)
Title: In memory config node serialization

Now with less dodgey!

Implemented in-memory ConfigNode serialization/deserialization to replace the temp file save method.

Uses reflection but includes the temp file method as a fallback (such as if a new KSP version changes things.) The reflection creates the delegates once (per ConfigNodeSerializer instance, which you only need one right now in NetworkWorker) and uses delegates from there on, which are fast.

The delegates and methods used are the largely same as the insides of the ConfigNode.Save/Load methods except for using MemoryStream instead of Files. There is no functional change.

This method should be more reliable and faster than the temp file method. It may also be an important stepping stone towards doing diff or compression of updates.