From 846ba60d46729c50ce3d757777876c0db59a2219 Mon Sep 17 00:00:00 2001 From: Lukas Werling Date: Sun, 18 Feb 2018 00:30:08 +0100 Subject: [PATCH] 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. --- src/game/C4Game.cpp | 4 ++-- src/gui/C4StartupNetDlg.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/C4Game.cpp b/src/game/C4Game.cpp index 6c521c05b..50c468c09 100644 --- a/src/game/C4Game.cpp +++ b/src/game/C4Game.cpp @@ -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(ref, join_data); + CompileFromBuf(mkNamingAdapt(ref, "Reference"), join_data); success = true; } EraseFile(temp_filename); diff --git a/src/gui/C4StartupNetDlg.cpp b/src/gui/C4StartupNetDlg.cpp index 162800990..72c087f10 100644 --- a/src/gui/C4StartupNetDlg.cpp +++ b/src/gui/C4StartupNetDlg.cpp @@ -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(*pRef); + StdStrBuf join_data = DecompileToBuf(mkNamingAdapt(*pRef, "Reference")); if (join_data.getSize()) { if (join_data.SaveToFile(tmpfn.getData()))