nlohmann::json InfoJson = {
{"max_clients", MaxClients},
{"max_players", MaxPlayers},
{"passworded", g_Config.m_Password[0] ? true : false},
{"game_type", GameServer()->GameType()},
{"name", g_Config.m_SvName},
{"map", {{"name", m_aCurrentMap},
{"sha256", aMapSha256},
{"size", m_aCurrentMapSize[MAP_TYPE_SIX]}}},
{"version", GameServer()->Version()},
{"client_score_kind", ScoreKind},
{"requires_login", false},
{"clients", nlohmann::json::array()}};
instead of
CJsonStringWriter JsonWriter;
JsonWriter.BeginObject();
JsonWriter.WriteAttribute("max_clients");
JsonWriter.WriteIntValue(MaxClients);
JsonWriter.WriteAttribute("max_players");
JsonWriter.WriteIntValue(MaxPlayers);
JsonWriter.WriteAttribute("passworded");
JsonWriter.WriteBoolValue(g_Config.m_Password[0]);
JsonWriter.WriteAttribute("game_type");
JsonWriter.WriteStrValue(GameServer()->GameType());
JsonWriter.WriteAttribute("name");
JsonWriter.WriteStrValue(g_Config.m_SvName);
JsonWriter.WriteAttribute("map");
JsonWriter.BeginObject();
JsonWriter.WriteAttribute("name");
JsonWriter.WriteStrValue(m_aCurrentMap);
JsonWriter.WriteAttribute("sha256");
JsonWriter.WriteStrValue(aMapSha256);
JsonWriter.WriteAttribute("size");
JsonWriter.WriteIntValue(m_aCurrentMapSize[MAP_TYPE_SIX]);
JsonWriter.EndObject();
JsonWriter.WriteAttribute("version");
JsonWriter.WriteStrValue(GameServer()->Version());
JsonWriter.WriteAttribute("client_score_kind");
JsonWriter.WriteStrValue(ScoreKind);
JsonWriter.WriteAttribute("requires_login");
JsonWriter.WriteBoolValue(false);
JsonWriter.WriteAttribute("clients");
JsonWriter.BeginArray();