diff options
author | ~login@aussies.space <login@aussies.space> | 2019-09-30 20:06:03 +0000 |
---|---|---|
committer | ~login@aussies.space <login@aussies.space> | 2019-09-30 20:06:03 +0000 |
commit | 74152c106beef37e6794549ad895986b3c2b76e8 (patch) | |
tree | 92158f8b2b136facc222a0e51b475050e28df7b8 /pcoin.cpp | |
parent | 5067e392f13b90b560700dacb9f022e5503fc8b5 (diff) | |
download | tcoin-74152c106beef37e6794549ad895986b3c2b76e8.tar.gz |
Added symbolic constants (flags) to remove integrations
Since not all places where tcoin runs have tildebot, minerbot and daily-adventure, these integrations are now disabled in the code through preprocessor directives (symbolic constants that act as flags)
Diffstat (limited to 'pcoin.cpp')
-rw-r--r-- | pcoin.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/pcoin.cpp b/pcoin.cpp index 5c4273e..57f1faf 100644 --- a/pcoin.cpp +++ b/pcoin.cpp @@ -49,13 +49,24 @@ #define TCOIN_PATH_W_SLASH "/home/login/tcoin/" #define TCOIN_SCRYPT_PATH "/home/login/bin/scrypt" */ + +#define KROWBAR_OFF +#define DA_OFF +#define MINERCOIN_OFF + #define LS_HOME_CMD "/bin/ls /home" #define BIN_ECHO_CMD "/bin/echo $$" -#define KROWBAR_SCORE_PATH "/home/krowbar/Code/irc/data/tildescores.txt" +#ifndef KROWBAR_OFF + #define KROWBAR_SCORE_PATH "/home/krowbar/Code/irc/data/tildescores.txt" +#endif #define WHOAMI_PATH "/usr/bin/whoami" -#define TROIDO_DACOINS_CMD "cd /home/troido/daily_adventure/client/ && /home/troido/daily_adventure/client/daclient printinfo 2>&1 | /bin/grep -oP '(?<=\"Coins\", )\[[:digit:]]+'" -#define MINERCOIN_CMD_PRE_USERNAME "/bin/grep -oP '(?<=\"~" -#define MINERCOIN_CMD_POST_USERNAME "\": )[[:digit:]]+' /home/minerobber/Code/minerbot/minercoin.json" +#ifndef DA_OFF + #define TROIDO_DACOINS_CMD "cd /home/troido/daily_adventure/client/ && /home/troido/daily_adventure/client/daclient printinfo 2>&1 | /bin/grep -oP '(?<=\"Coins\", )\[[:digit:]]+'" +#endif +#ifndef MINERCOIN_OFF + #define MINERCOIN_CMD_PRE_USERNAME "/bin/grep -oP '(?<=\"~" + #define MINERCOIN_CMD_POST_USERNAME "\": )[[:digit:]]+' /home/minerobber/Code/minerbot/minercoin.json" +#endif #define USERNAME_LENGTH_LIMIT 25 void exit_program(const int error_number) @@ -1569,6 +1580,7 @@ int main(int argc, char *argv[]) krowbar_amount = 0; minercoin_amount = 0; + #ifndef KROWBAR_OFF //adding tildebot scores from krowbar to base amount { std::string line; @@ -1607,7 +1619,9 @@ int main(int argc, char *argv[]) delete[] line_c_string; } } + #endif + #ifndef DA_OFF //adding minercoin scores from minerobber to base amount { std::string command_to_exec = std::string(MINERCOIN_CMD_PRE_USERNAME) + get_username() + std::string(MINERCOIN_CMD_POST_USERNAME); @@ -1620,6 +1634,7 @@ int main(int argc, char *argv[]) //multiplied by 100 to convert tildecoins to centitildecoins, which //is the unit used throughout the program (and converted appropriately when displayed) } + #endif user_amount = get_file_value(get_username().c_str()); |