Editor join: Serialize reference as INI

On FreeBSD, the binary serialization doesn't work for IPv4 addresses,
and we never serialize game references as binary anywhere else.
master
Lukas Werling 2018-02-18 00:30:08 +01:00
parent 55a81ea76a
commit 5b21505efd
2 changed files with 3 additions and 3 deletions

View File

@ -3215,10 +3215,10 @@ bool C4Game::InitNetworkFromReferenceFile(const char *temp_filename)
// Load reference from temp file + delete the temp file
bool success = false;
C4Network2Reference ref;
StdBuf join_data;
StdStrBuf join_data;
if (join_data.LoadFromFile(temp_filename))
{
CompileFromBuf<StdCompilerBinRead>(ref, join_data);
CompileFromBuf<StdCompilerINIRead>(mkNamingAdapt(ref, "Reference"), join_data);
success = true;
}
EraseFile(temp_filename);

View File

@ -1134,7 +1134,7 @@ bool C4StartupNetDlg::DoOK()
// (QProcessEnvironment? But then there's a Qt dependency in the network init code))
StdStrBuf tmpfn(Config.AtTempPath("ocjoin"), true);
MakeTempFilename(&tmpfn);
StdBuf join_data = DecompileToBuf<StdCompilerBinWrite>(*pRef);
StdStrBuf join_data = DecompileToBuf<StdCompilerINIWrite>(mkNamingAdapt(*pRef, "Reference"));
if (join_data.getSize())
{
if (join_data.SaveToFile(tmpfn.getData()))