diff options
author | Unknown <fireice2@o2.pl> | 2017-11-10 20:39:25 +0000 |
---|---|---|
committer | Unknown <fireice2@o2.pl> | 2017-11-10 20:39:25 +0000 |
commit | 8f52eb85b3c39601704560263722a86b2265da05 (patch) | |
tree | 86f20ed55c3c28c4ea41d3eb2830b745fee861b7 /xmrstak | |
parent | 0bae47a75488e2fd1bcab8b141976763e4d81e95 (diff) | |
download | xmr-stak-8f52eb85b3c39601704560263722a86b2265da05.zip xmr-stak-8f52eb85b3c39601704560263722a86b2265da05.tar.gz |
Versioning final version
Diffstat (limited to 'xmrstak')
-rw-r--r-- | xmrstak/cli/cli-miner.cpp | 13 | ||||
-rw-r--r-- | xmrstak/net/jpsock.cpp | 4 | ||||
-rw-r--r-- | xmrstak/version.cpp | 53 | ||||
-rw-r--r-- | xmrstak/version.hpp | 24 |
4 files changed, 74 insertions, 20 deletions
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index d103293..6a6191b 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -85,7 +85,7 @@ void help() cout<<" -u, --user USERNAME pool user name or wallet address"<<endl; cout<<" -p, --pass PASSWD pool password, in the most cases x or empty \"\""<<endl; cout<<" \n"<<endl; - cout<<XMR_STAK_NAME << " " << XMR_STAK_VERSION << " " << GIT_COMMIT_HASH << " " << GIT_BRANCH << endl; + cout<< "Version: " << get_version_str_short() << endl; cout<<"Brought to by fireice_uk and psychocrypt under GPLv3."<<endl; } @@ -433,17 +433,18 @@ int main(int argc, char *argv[]) #endif printer::inst()->print_str("-------------------------------------------------------------------\n"); - printer::inst()->print_str( XMR_STAK_NAME" " XMR_STAK_VERSION " mining software.\n"); + printer::inst()->print_str(get_version_str_short().c_str()); + printer::inst()->print_str("\n\n"); + printer::inst()->print_str("Brought to you by fireice_uk and psychocrypt under GPLv3.\n"); printer::inst()->print_str("Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).\n"); #ifndef CONF_NO_CUDA - printer::inst()->print_str("NVIDIA mining code was written by KlausT and psychocrypt.\n"); + printer::inst()->print_str("Original NVIDIA mining code was written by KlausT and psychocrypt.\n"); #endif #ifndef CONF_NO_OPENCL - printer::inst()->print_str("AMD mining code was written by wolf9466.\n"); + printer::inst()->print_str("Original mining code was written by wolf9466.\n"); #endif - printer::inst()->print_str("Brought to you by fireice_uk and psychocrypt under GPLv3.\n\n"); char buffer[64]; - snprintf(buffer, sizeof(buffer), "Configurable dev donation level is set to %.1f %%\n\n", fDevDonationLevel * 100.0); + snprintf(buffer, sizeof(buffer), "\nConfigurable dev donation level is set to %.1f%%\n\n", fDevDonationLevel * 100.0); printer::inst()->print_str(buffer); printer::inst()->print_str("You can use following keys to display reports:\n"); printer::inst()->print_str("'h' - hashrate\n"); diff --git a/xmrstak/net/jpsock.cpp b/xmrstak/net/jpsock.cpp index f6f5c1f..cb586d2 100644 --- a/xmrstak/net/jpsock.cpp +++ b/xmrstak/net/jpsock.cpp @@ -509,8 +509,8 @@ bool jpsock::cmd_login() { char cmd_buffer[1024]; - snprintf(cmd_buffer, sizeof(cmd_buffer), "{\"method\":\"login\",\"params\":{\"login\":\"%s\",\"pass\":\"%s\",\"agent\":\"" AGENTID_STR "\"},\"id\":1}\n", - usr_login.c_str(), usr_pass.c_str()); + snprintf(cmd_buffer, sizeof(cmd_buffer), "{\"method\":\"login\",\"params\":{\"login\":\"%s\",\"pass\":\"%s\",\"agent\":\"%s\"},\"id\":1}\n", + usr_login.c_str(), usr_pass.c_str(), get_version_str().c_str()); opq_json_val oResult(nullptr); diff --git a/xmrstak/version.cpp b/xmrstak/version.cpp new file mode 100644 index 0000000..2308580 --- /dev/null +++ b/xmrstak/version.cpp @@ -0,0 +1,53 @@ +#include "version.hpp" + +//! git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ +#if defined(GIT_ARCHIVE) && !defined(GIT_COMMIT_HASH) +#define GIT_COMMIT_HASH "$Format:%h$" +#endif + +#ifndef GIT_COMMIT_HASH +#define GIT_COMMIT_HASH "0000000" +#endif + +#ifndef GIT_BRANCH +#define GIT_BRANCH "unknown" +#endif + +#define XMR_STAK_NAME "xmr-stak" +#define XMR_STAK_VERSION "2.0.0" + +#if defined(_WIN32) +#define OS_TYPE "win" +#elif defined(__APPLE__) +#define OS_TYPE "mac" +#elif defined(__FreeBSD__) +#define OS_TYPE "bsd" +#elif defined(__linux__) +#define OS_TYPE "lin" +#else +#define OS_TYPE "unk" +#endif + +#if !defined(CONF_NO_CUDA) && !defined(CONF_NO_OPENCL) +#define BACKEND_TYPE "cpu-nvidia-amd" +#elif !defined(CONF_NO_OPENCL) +#define BACKEND_TYPE "cpu-amd" +#elif !defined(CONF_NO_CUDA) +#define BACKEND_TYPE "cpu-nvidia" +#else +#define BACKEND_TYPE "cpu" +#endif + +#if defined(CONF_NO_AEON) +#define COIN_TYPE "monero" +#elif defined(CONF_NO_MONERO) +#define COIN_TYPE "aeon" +#else +#define COIN_TYPE "aeon-monero" +#endif + +#define VERSION_LONG XMR_STAK_NAME "/" XMR_STAK_VERSION "/" GIT_COMMIT_HASH "/" GIT_BRANCH "/" OS_TYPE "/" BACKEND_TYPE "/" COIN_TYPE "/" +#define VERSION_SHORT XMR_STAK_NAME " " XMR_STAK_VERSION " " GIT_COMMIT_HASH + +const char ver_long[] = VERSION_LONG; +const char ver_short[] = VERSION_SHORT; diff --git a/xmrstak/version.hpp b/xmrstak/version.hpp index 4267c75..72df50b 100644 --- a/xmrstak/version.hpp +++ b/xmrstak/version.hpp @@ -1,17 +1,17 @@ #pragma once -//! git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ -#if defined(GIT_ARCHIVE) && !defined(GIT_COMMIT_HASH) -#define GIT_COMMIT_HASH "$Format:%h$" -#endif +#include <string> +#include "donate-level.hpp" -#ifndef GIT_COMMIT_HASH -#define GIT_COMMIT_HASH "0000000" -#endif +extern const char ver_long[]; +extern const char ver_short[]; -#ifndef GIT_BRANCH -#define GIT_BRANCH "unknown" -#endif +inline std::string get_version_str() +{ + return std::string(ver_long) + std::to_string(uint(fDevDonationLevel * 1000)) ; +} -#define XMR_STAK_NAME "xmr-stak" -#define XMR_STAK_VERSION "2.0.0-predev" +inline std::string get_version_str_short() +{ + return std::string(ver_short); +} |