Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Client
# *****************************************************************************
if (MSVC)
include_directories(${PROJECT_SOURCE_DIR}/src/framework/core)
add_executable(${PROJECT_NAME} "" ../cmake/icon/otcicon.rc)
elseif(ANDROID)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
Expand Down Expand Up @@ -75,6 +76,11 @@ if (ANDROID OR WASM)
set(FRAMEWORK_DEFINITIONS ${FRAMEWORK_DEFINITIONS} -DOPENGL_ES=2)
endif()

target_include_directories(${PROJECT_NAME}
PRIVATE
${PROJECT_SOURCE_DIR}/src/framework/core
)

# Set for use precompiled header
if(TOGGLE_PRE_COMPILED_HEADER)
# === PRECOMPILED HEADER ===
Expand Down Expand Up @@ -175,6 +181,12 @@ add_definitions(-D"BUILD_COMMIT=\\\"${BUILD_COMMIT}\\\"")
message(STATUS "Build revision: ${BUILD_REVISION}")
add_definitions(-D"BUILD_REVISION=\\\"${BUILD_REVISION}\\\"")

# --- Git build info (manual fallback if gitinfo.h is missing) ---
add_definitions(-DGIT_COMMITS=1234)
add_definitions(-DGIT_VERSION="1.0.0")
add_definitions(-DGIT_BRANCH="dev")


# *****************************************************************************
# Packages / Libs
# *****************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions src/client/protocolgameparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "effect.h"
#include "framework/net/inputmessage.h"

#include <fmt/core.h>
#include "attachedeffectmanager.h"
#include "item.h"
#include "localplayer.h"
Expand Down Expand Up @@ -4086,7 +4086,7 @@ void ProtocolGame::parseVirtue(const InputMessagePtr& msg) { // @note: improve n
break;
}
default:
g_logger.error(std::format("Unknown virtue subtype: %d", subtype));
g_logger.error(fmt::format("Unknown virtue subtype: {}", subtype));
break;
}
}
Expand Down
18 changes: 12 additions & 6 deletions src/framework/core/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <framework/proxy/proxy.h>

#include <csignal>
#include <gitinfo.h>
// #include <gitinfo.h>

#define ADD_QUOTES_HELPER(s) #s
#define ADD_QUOTES(s) ADD_QUOTES_HELPER(s)
Expand Down Expand Up @@ -224,9 +224,15 @@ std::string Application::getOs()
// https://stackoverflow.com/a/46448040
std::string Application::getBuildRevision()
{
std::stringstream ss;
ss << std::fixed << std::setprecision(3) << (static_cast<float>(GIT_COMMITS) / 1000);
return ss.str();
return "0.000";
}

std::string Application::getVersion()
{
return "1.0.0";
}

std::string Application::getBuildCommit()
{
return "CrystalServer";
}
std::string Application::getVersion() { return ADD_QUOTES(GIT_VERSION); }
std::string Application::getBuildCommit() { return ADD_QUOTES(GIT_BRANCH); }
4 changes: 4 additions & 0 deletions src/framework/core/gitinfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
#define GIT_COMMITS 1234
#define GIT_HASH "manual"
#define GIT_BRANCH "dev"