• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Problem compiling 8.6

Jeyci

Banned User
Joined
May 6, 2023
Messages
289
Solutions
3
Reaction score
36
I try to compile Commits · moviebr/TFS-1.5-Downgrades (https://github.com/moviebr/TFS-1.5-Downgrades/commits/8.60) or Commits · MillhioreBT/forgottenserver-downgrade (https://github.com/MillhioreBT/forgottenserver-downgrade/commits?author=MillhioreBT)

tools.h below SpellGroup_t stringToSpellGroup(const std::string& value);
Lua:
template <typename E>
auto format_as(E e)
{
    return fmt::underlying(e);
}

#endif // FS_TOOLS_H

iomaserialize.cpp
Code:
bool IOMapSerialize::saveHouseInfo()
{
    Database& db = Database::getInstance();

    DBTransaction transaction;
    if (!transaction.begin()) {
        return false;
    }

    if (!db.executeQuery("DELETE FROM `house_lists`")) {
        return false;
    }

    for (const auto& it : g_game.map.houses.getHouses()) {
        House* house = it.second;
        DBResult_ptr result = db.storeQuery(fmt::format("SELECT `id` FROM `houses` WHERE `id` = {:d}", house->getId()));
        if (result) {
            db.executeQuery(fmt::format("UPDATE `houses` SET `owner` = {:d}, `paid` = {:d}, `warnings` = {:d}, `name` = {:s}, `town_id` = {:d}, `rent` = {:d}, `size` = {:d}, `beds` = {:d} WHERE `id` = {:d}", house->getOwner(), house->getPaidUntil(), house->getPayRentWarnings(), db.escapeString(house->getName()), house->getTownId(), house->getRent(), house->getTiles().size(), house->getBedCount(), house->getId()));
        } else {
            db.executeQuery(fmt::format("INSERT INTO `houses` (`id`, `owner`, `paid`, `warnings`, `name`, `town_id`, `rent`, `size`, `beds`) VALUES ({:d}, {:d}, {:d}, {:d}, {:s}, {:d}, {:d}, {:d}, {:d})", house->getId(), house->getOwner(), house->getPaidUntil(), house->getPayRentWarnings(), db.escapeString(house->getName()), house->getTownId(), house->getRent(), house->getTiles().size(), house->getBedCount()));
        }
    }

    DBInsert stmt("INSERT INTO `house_lists` (`house_id` , `listid` , `list`) VALUES ");

    for (const auto& it : g_game.map.houses.getHouses()) {
        House* house = it.second;

        std::string listText;
        if (house->getAccessList(GUEST_LIST, listText) && !listText.empty()) {
                if (!stmt.addRow(fmt::format("{:d}, {}, {:s}", house->getId(), static_cast<int>(GUEST_LIST), db.escapeString(listText)))) {
                return false;
            }

            listText.clear();
        }

        if (house->getAccessList(SUBOWNER_LIST, listText) && !listText.empty()) {
            if (!stmt.addRow(fmt::format("{:d}, {}, {:s}", house->getId(), static_cast<int>(SUBOWNER_LIST), db.escapeString(listText)))) {
                return false;
            }

            listText.clear();
        }

        for (Door* door : house->getDoors()) {
            if (door->getAccessList(listText) && !listText.empty()) {
                if (!stmt.addRow(fmt::format("{:d}, {:d}, {:s}", house->getId(), door->getDoorId(), db.escapeString(listText)))) {
                    return false;
                }

                listText.clear();
            }
        }
    }

    if (!stmt.execute()) {
        return false;
    }

    return transaction.commit();
}
definitions.h
Code:
#pragma warning(disable : 4275) // can be ignored in Visual C++ if you are deriving from a type in the C++ STL
Lua:
1>C:\Users\pasturry\OneDrive\Documentos\GitHub\TFS-1.5-Downgrades\src\tools.h(102,14): error C2672: 'fmt::v10::underlying': no se encontró una función sobrecargada que coincida (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\format.h(4116,16): message : puede ser 'std::underlying_type<_Ty>::type fmt::v10::underlying(Enum) noexcept' (compilando archivo de origen ..\src\tools.cpp)
1>C:\Users\pasturry\OneDrive\Documentos\GitHub\TFS-1.5-Downgrades\src\tools.h(102,14): message : No se pudo especializar la plantilla de función "std::underlying_type<_Ty>::type fmt::v10::underlying(Enum) noexcept" (compilando archivo de origen ..\src\tools.cpp)
1>C:\Users\pasturry\OneDrive\Documentos\GitHub\TFS-1.5-Downgrades\src\tools.h(102,14): message : Con los siguientes argumentos de plantilla: (compilando archivo de origen ..\src\tools.cpp)
1>C:\Users\pasturry\OneDrive\Documentos\GitHub\TFS-1.5-Downgrades\src\tools.h(102,14): message : 'Enum=E' (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1321): message : Vea la referencia a la creación de una instancia de la función plantilla "auto format_as<S>(E)" que se está compilando
1>        with
1>        [
1>            S=tm,
1>            E=tm
1>        ] (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1479,5): message : Vea la referencia a la creación de una instancia de clase plantilla "fmt::v10::detail::format_as_result<tm>" que se está compilando (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1458,13): message : Vea la referencia a la creación de una instancia de alias plantilla "fmt::v10::detail::format_as_t<tm>" que se está compilando (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1549,32): message : Vea la referencia a la creación de una instancia de alias plantilla "fmt::v10::detail::mapped_type_constant<Arg,Context>" que se está compilando
1>        with
1>        [
1>            Arg=tm,
1>            Context=fmt::v10::format_context
1>        ] (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1797,28): message : Vea la referencia a la creación de una instancia de la función plantilla "unsigned __int64 fmt::v10::detail::encode_types<Context,tm,>(void)" que se está compilando
1>        with
1>        [
1>            Context=fmt::v10::format_context
1>        ] (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(2789): message : Vea la referencia a la creación de una instancia de clase plantilla "fmt::v10::format_arg_store<fmt::v10::format_context,tm>" que se está compilando (compilando archivo de origen ..\src\tools.cpp)
1>C:\Users\pasturry\OneDrive\Documentos\GitHub\TFS-1.5-Downgrades\src\tools.cpp(366,14): message : Vea la referencia a la creación de una instancia de la función plantilla "std::string fmt::v10::format<tm>(fmt::v10::basic_format_string<char,tm>,tm &&)" que se está compilando
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1548): error C2062: tipo 'unknown-type' inesperado (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1548): error C2144: error de sintaxis: 'unknown-type' debe estar precedido de '(' (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1549,68): error C2039: "value": no es un miembro de "`global namespace'" (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1798,56): error C3615: la función "fmt::v10::detail::encode_types" de constexpr no puede dar como resultado una expresión constante (compilando archivo de origen ..\src\tools.cpp)
1>C:\vcpkg\installed\x64-windows\include\fmt\core.h(1801,1): message : el error se debe a que un control alcanzó el final de una función constexpr (compilando archivo de origen ..\src\tools.cp
tried this at tools.h
Code:
namespace tfs {

#if __has_cpp_attribute(__cpp_lib_to_underlying)

    inline constexpr auto to_underlying(auto e) noexcept { return std::to_underlying(e); }

#else

    inline constexpr auto to_underlying(auto e) noexcept { return static_cast<std::underlying_type_t<decltype(e)>>(e); }

#endif

} // namespace tfs

#endif // FS_TOOLS_H
and still not able to compile these sources. can somebody help me?
 
Last edited:
Back
Top