Skip to content

Commit

Permalink
Update Server Version (and console information)
Browse files Browse the repository at this point in the history
  • Loading branch information
Codinablack committed Dec 29, 2024
1 parent 19c8fa6 commit 131244b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
6 changes: 4 additions & 2 deletions src/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
#define FS_DEFINITIONS_H

static constexpr auto STATUS_SERVER_NAME = "Black Tek Server";
static constexpr auto STATUS_SERVER_VERSION = "Pre-Alpha 0.0.1";
static constexpr auto STATUS_SERVER_DEVELOPERS = "Black Tek Server Team";
static constexpr auto STATUS_SERVER_VERSION = "1.0";
static constexpr auto STATUS_SERVER_DEVELOPERS = "BlackTek";
static constexpr auto STATUS_SERVER_MAINTAINER = "[email protected]";
static constexpr auto STATUS_SERVER_COMMUNITY_LINK = "http://example.com/support";

static constexpr auto CLIENT_VERSION_MIN = 1097;
static constexpr auto CLIENT_VERSION_MAX = 1098;
Expand Down
55 changes: 27 additions & 28 deletions src/otserv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,44 +98,42 @@ int main(int argc, char* argv[])
return 0;
}

#include <fmt/color.h>
#include <fmt/core.h>

void printServerVersion()
{
#if defined(GIT_RETRIEVED_STATE) && GIT_RETRIEVED_STATE
std::cout << STATUS_SERVER_NAME << " - Version " << GIT_DESCRIBE << std::endl;
std::cout << "Git SHA1 " << GIT_SHORT_SHA1 << " dated " << GIT_COMMIT_DATE_ISO8601 << std::endl;
#if GIT_IS_DIRTY
std::cout << "*** DIRTY - NOT OFFICIAL RELEASE ***" << std::endl;
#endif
#else
std::cout << STATUS_SERVER_NAME << " - Version " << STATUS_SERVER_VERSION << std::endl;
std::cout << STATUS_SERVER_NAME << std::endl;
std::cout << " Version: " << GIT_DESCRIBE << std::endl;
std::cout << " Git SHA1 " << GIT_SHORT_SHA1 << " dated " << GIT_COMMIT_DATE_ISO8601 << std::endl;
#if GIT_IS_DIRTY
std::cout << " Status: Unofficial (dirty version)" << std::endl;
#endif
std::cout << std::endl;

std::cout << "Compiled with " << BOOST_COMPILER << std::endl;
std::cout << "Compiled on " << __DATE__ << ' ' << __TIME__ << " for platform ";
#if defined(__amd64__) || defined(_M_X64)
std::cout << "x64" << std::endl;
#elif defined(__i386__) || defined(_M_IX86) || defined(_X86_)
std::cout << "x86" << std::endl;
#elif defined(__arm__)
std::cout << "ARM" << std::endl;
#else
std::cout << "unknown" << std::endl;
std::cout << "|| " << STATUS_SERVER_NAME << " ||" << std::endl;
std::cout << " Version: " << STATUS_SERVER_VERSION << std::endl;
std::cout << " Status: Official (clean version)" << std::endl;
#endif
#if defined(LUAJIT_VERSION)
std::cout << "Linked with " << LUAJIT_VERSION << " for Lua support" << std::endl;
#else
std::cout << "Linked with " << LUA_RELEASE << " for Lua support" << std::endl;
#endif
std::cout << std::endl;

std::cout << "A server developed by " << STATUS_SERVER_DEVELOPERS << std::endl;
std::cout << std::endl;
// todo: make a function.. printPlatformInfo()

std::cout << " Compiler: " << BOOST_COMPILER << std::endl;
std::cout << " Date: " << __DATE__ << ' ' << __TIME__ << " " << std::endl;

// Todo: determine if there is more information worth having here.
std::cout << " Developer: " << STATUS_SERVER_DEVELOPERS << std::endl;
std::cout << " Maintainer: " << STATUS_SERVER_MAINTAINER << std::endl;
std::cout << " Community: " << STATUS_SERVER_COMMUNITY_LINK << std::endl;
std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
}

void mainLoader(int, char*[], ServiceManager* services)
{
//dispatcher thread
{ // Todo : Rewrite all the loading prints to print confirmation.
// : write timings for each thing and all things.
// : colorize all the prints.

// dispatcher thread
g_game.setGameState(GAME_STATE_STARTUP);

srand(static_cast<unsigned int>(OTSYS_TIME()));
Expand Down Expand Up @@ -169,6 +167,7 @@ void mainLoader(int, char*[], ServiceManager* services)
}

// read global config
std::cout << ":: Initializing Game Server..." << std::endl;
std::cout << ">> Loading config" << std::endl;
if (!g_config.load()) {
startupErrorMessage("Unable to load " + configFile + "!");
Expand Down

0 comments on commit 131244b

Please sign in to comment.