mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #7153 from infclass/for-ddnet4
Mod Support: CMake: Use DDNet_VERSION to construct DDNET_VERSION_NUMBER
This commit is contained in:
commit
b951eab257
|
@ -142,16 +142,16 @@ if(IPO)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if("0${PROJECT_VERSION_PATCH}" GREATER 9)
|
if("0${DDNet_VERSION_PATCH}" GREATER 9)
|
||||||
message(SEND_ERROR "Invalid project patch version (the version is \"${PROJECT_VERSION}\", the patch part must be in range 0-9 if set)")
|
message(SEND_ERROR "Invalid DDNet patch version (the version is \"${DDNet_VERSION}\", the patch part must be in range 0-9 if set)")
|
||||||
endif()
|
endif()
|
||||||
if(${PROJECT_VERSION_MINOR} GREATER 99)
|
if(${DDNet_VERSION_MINOR} GREATER 99)
|
||||||
message(SEND_ERROR "Invalid project minor version (the version is \"${PROJECT_VERSION}\", the minor part must be in range 0-99)")
|
message(SEND_ERROR "Invalid DDNet minor version (the version is \"${DDNet_VERSION}\", the minor part must be in range 0-99)")
|
||||||
endif()
|
endif()
|
||||||
if(${PROJECT_VERSION_MINOR} GREATER 9)
|
if(${DDNet_VERSION_MINOR} GREATER 9)
|
||||||
set(CLIENT_VERSIONNR ${PROJECT_VERSION_MAJOR}${PROJECT_VERSION_MINOR}${PROJECT_VERSION_PATCH})
|
set(DDNET_VERSION_NUMBER ${DDNet_VERSION_MAJOR}${DDNet_VERSION_MINOR}${DDNet_VERSION_PATCH})
|
||||||
else()
|
else()
|
||||||
set(CLIENT_VERSIONNR ${PROJECT_VERSION_MAJOR}0${PROJECT_VERSION_MINOR}${PROJECT_VERSION_PATCH})
|
set(DDNET_VERSION_NUMBER ${DDNet_VERSION_MAJOR}0${DDNet_VERSION_MINOR}${DDNet_VERSION_PATCH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file(src/game/version.h.in ${PROJECT_BINARY_DIR}/src/game/version.h)
|
configure_file(src/game/version.h.in ${PROJECT_BINARY_DIR}/src/game/version.h)
|
||||||
|
@ -2893,7 +2893,7 @@ set(CPACK_SOURCE_GENERATOR ZIP TGZ TBZ2 TXZ)
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
||||||
set(CPACK_PACKAGE_VERSION ${VERSION})
|
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||||
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
||||||
|
|
||||||
if(TARGET_OS AND TARGET_BITS)
|
if(TARGET_OS AND TARGET_BITS)
|
||||||
|
|
|
@ -762,7 +762,7 @@ int CServer::GetClientVersion(int ClientID) const
|
||||||
{
|
{
|
||||||
// Assume latest client version for server demos
|
// Assume latest client version for server demos
|
||||||
if(ClientID == SERVER_DEMO_CLIENT)
|
if(ClientID == SERVER_DEMO_CLIENT)
|
||||||
return CLIENT_VERSIONNR;
|
return DDNET_VERSION_NUMBER;
|
||||||
|
|
||||||
CClientInfo Info;
|
CClientInfo Info;
|
||||||
if(GetClientInfo(ClientID, &Info))
|
if(GetClientInfo(ClientID, &Info))
|
||||||
|
|
|
@ -76,7 +76,7 @@ using namespace std::chrono_literals;
|
||||||
|
|
||||||
const char *CGameClient::Version() const { return GAME_VERSION; }
|
const char *CGameClient::Version() const { return GAME_VERSION; }
|
||||||
const char *CGameClient::NetVersion() const { return GAME_NETVERSION; }
|
const char *CGameClient::NetVersion() const { return GAME_NETVERSION; }
|
||||||
int CGameClient::DDNetVersion() const { return CLIENT_VERSIONNR; }
|
int CGameClient::DDNetVersion() const { return DDNET_VERSION_NUMBER; }
|
||||||
const char *CGameClient::DDNetVersionStr() const { return m_aDDNetVersionStr; }
|
const char *CGameClient::DDNetVersionStr() const { return m_aDDNetVersionStr; }
|
||||||
const char *CGameClient::GetItemName(int Type) const { return m_NetObjHandler.GetObjName(Type); }
|
const char *CGameClient::GetItemName(int Type) const { return m_NetObjHandler.GetObjName(Type); }
|
||||||
|
|
||||||
|
@ -1770,7 +1770,7 @@ void CGameClient::OnNewSnapshot()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
CMsgPacker Msg(NETMSGTYPE_CL_ISDDNETLEGACY, false);
|
CMsgPacker Msg(NETMSGTYPE_CL_ISDDNETLEGACY, false);
|
||||||
Msg.AddInt(CLIENT_VERSIONNR);
|
Msg.AddInt(DDNetVersion());
|
||||||
Client()->SendMsg(i, &Msg, MSGFLAG_VITAL);
|
Client()->SendMsg(i, &Msg, MSGFLAG_VITAL);
|
||||||
m_aDDRaceMsgSent[i] = true;
|
m_aDDRaceMsgSent[i] = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#define GAME_RELEASE_VERSION "${PROJECT_VERSION}"
|
#define GAME_RELEASE_VERSION "${PROJECT_VERSION}"
|
||||||
#define GAME_VERSION "0.6.4, " GAME_RELEASE_VERSION
|
#define GAME_VERSION "0.6.4, " GAME_RELEASE_VERSION
|
||||||
#define GAME_NETVERSION "0.6 626fce9a778df4d4"
|
#define GAME_NETVERSION "0.6 626fce9a778df4d4"
|
||||||
#define CLIENT_VERSIONNR ${CLIENT_VERSIONNR}
|
#define DDNET_VERSION_NUMBER ${DDNET_VERSION_NUMBER}
|
||||||
extern const char *GIT_SHORTREV_HASH;
|
extern const char *GIT_SHORTREV_HASH;
|
||||||
#define GAME_NAME "DDNet"
|
#define GAME_NAME "DDNet"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue