diff --git a/CMakeLists.txt b/CMakeLists.txt index 61ef9a6..843882e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ ENDIF() SET(CMAKE_CXX_STANDARD 17) IF (NOT WIN32) - MESSAGE(FATAL_ERROR "This is not supposed to be run on non-Windows platforms!") + MESSAGE(FATAL_ERROR "This is not supposed to be run on non-Windows platforms!") ENDIF() @@ -19,7 +19,8 @@ ELSE() ENDIF() ADD_EXECUTABLE(brokenithm - src/main.cpp) + src/main.cpp + src/resources.rc) INCLUDE_DIRECTORIES(src) LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}) diff --git a/src/main.cpp b/src/main.cpp index 92f96a2..8d1dceb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,9 +2,11 @@ #include #include #include +#include #include "socket.h" #include "defer.h" +#include "version.h" #include std::string remote_address; @@ -219,15 +221,15 @@ void updatePacketId(uint32_t newPacketId) { if(last_input_packet_id > newPacketId) { - fprintf(stderr, "[WARN] Packet #%zu came too late\n", newPacketId); + fprintf(stderr, "[WARN] Packet #%" PRIu32 " came too late\n", newPacketId); } else if(newPacketId > last_input_packet_id + 1) { - fprintf(stderr, "[WARN] Packets between #%zu and #%zu total %zu packet(s) are missing, probably too late or dropped\n", last_input_packet_id, newPacketId, newPacketId - last_input_packet_id - 1); + fprintf(stderr, "[WARN] Packets between #%" PRIu32 " and #%" PRIu32 " total %" PRIu32 " packet(s) are missing, probably too late or dropped\n", last_input_packet_id, newPacketId, newPacketId - last_input_packet_id - 1); } else if(newPacketId == last_input_packet_id) { - fprintf(stderr, "[WARN] Packet #%zu duplicated\n", newPacketId); + fprintf(stderr, "[WARN] Packet #%" PRIu32 " duplicated\n", newPacketId); } last_input_packet_id = newPacketId; } @@ -352,7 +354,7 @@ void printInfo() printf("=================================================\n"); printf("= Brokenithm-Evolved-Android: =\n"); printf("= Brokenithm with full IO over network =\n"); - printf("= v0.1 by XTindy =\n"); + printf("= " VERSION " by XTindy =\n"); printf("= Original: esterTion =\n"); printf("=================================================\n\n"); } diff --git a/src/resources.rc b/src/resources.rc new file mode 100644 index 0000000..4b068f7 --- /dev/null +++ b/src/resources.rc @@ -0,0 +1,50 @@ +// +// Include the necessary resources +// +#include +#include + +#include "version.h" + +#ifdef RC_INVOKED + +// +// Set up debug information +// +#if DBG +#define VER_DBG VS_FF_DEBUG +#else +#define VER_DBG 0 +#endif + +// ------- version info ------------------------------------------------------- + +VS_VERSION_INFO VERSIONINFO +FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS VER_DBG +FILEOS VOS_NT +FILETYPE VFT_DRV +FILESUBTYPE VFT2_DRV_SYSTEM +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Brokenithm-Evolved" + VALUE "FileDescription", "Brokenithm-Evolved-Android Server" + VALUE "FileVersion", VERSION + VALUE "InternalName", "Brokenithm-Evolved-Android Server" + VALUE "LegalCopyright", "(C)2021 XTindy" + VALUE "OriginalFilename", "brokenithm_server.exe" + VALUE "ProductName", "Brokenithm-Evolved" + VALUE "ProductVersion", VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409,1200 + END +END +#endif diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..6843723 --- /dev/null +++ b/src/version.h @@ -0,0 +1,10 @@ +#ifndef VERSION_H_INCLUDED +#define VERSION_H_INCLUDED + +#define VERSION "V0.2.0" + +#define VERSION_MAJOR 0 +#define VERSION_MINOR 2 +#define VERSION_PATCH 0 + +#endif // VERSION_H_INCLUDED