forked from Mirrors/openclonk
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.stable-8
parent
e10d4b3bf5
commit
846ba60d46
|
@ -3215,10 +3215,10 @@ bool C4Game::InitNetworkFromReferenceFile(const char *temp_filename)
|
||||||
// Load reference from temp file + delete the temp file
|
// Load reference from temp file + delete the temp file
|
||||||
bool success = false;
|
bool success = false;
|
||||||
C4Network2Reference ref;
|
C4Network2Reference ref;
|
||||||
StdBuf join_data;
|
StdStrBuf join_data;
|
||||||
if (join_data.LoadFromFile(temp_filename))
|
if (join_data.LoadFromFile(temp_filename))
|
||||||
{
|
{
|
||||||
CompileFromBuf<StdCompilerBinRead>(ref, join_data);
|
CompileFromBuf<StdCompilerINIRead>(mkNamingAdapt(ref, "Reference"), join_data);
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
EraseFile(temp_filename);
|
EraseFile(temp_filename);
|
||||||
|
|
|
@ -1134,7 +1134,7 @@ bool C4StartupNetDlg::DoOK()
|
||||||
// (QProcessEnvironment? But then there's a Qt dependency in the network init code))
|
// (QProcessEnvironment? But then there's a Qt dependency in the network init code))
|
||||||
StdStrBuf tmpfn(Config.AtTempPath("ocjoin"), true);
|
StdStrBuf tmpfn(Config.AtTempPath("ocjoin"), true);
|
||||||
MakeTempFilename(&tmpfn);
|
MakeTempFilename(&tmpfn);
|
||||||
StdBuf join_data = DecompileToBuf<StdCompilerBinWrite>(*pRef);
|
StdStrBuf join_data = DecompileToBuf<StdCompilerINIWrite>(mkNamingAdapt(*pRef, "Reference"));
|
||||||
if (join_data.getSize())
|
if (join_data.getSize())
|
||||||
{
|
{
|
||||||
if (join_data.SaveToFile(tmpfn.getData()))
|
if (join_data.SaveToFile(tmpfn.getData()))
|
||||||
|
|
Loading…
Reference in New Issue