From 0b3f54e8d9366b135697ac1d96c15a85f55fcb62 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 6 Jan 2014 21:18:55 +0200 Subject: [PATCH] Fixed merge issues. --- include/stg/user_traff.h | 7 ++++--- .../plugins/store/firebird/firebird_store.cpp | 4 ++-- .../store/firebird/firebird_store_users.cpp | 8 ++++---- .../plugins/store/mysql/mysql_store.cpp | 16 ++++++++-------- .../store/postgresql/postgresql_store.cpp | 2 +- projects/stargazer/user_impl.h | 1 - 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/stg/user_traff.h b/include/stg/user_traff.h index 48843a49..e1176b90 100644 --- a/include/stg/user_traff.h +++ b/include/stg/user_traff.h @@ -27,12 +27,13 @@ #ifndef USER_TRAFF_H #define USER_TRAFF_H -#include -#include - +#include "resetable.h" #include "const.h" #include "os_int.h" +#include +#include + enum TRAFF_DIRECTION {TRAFF_UPLOAD, TRAFF_DOWNLOAD}; class DIR_TRAFF diff --git a/projects/stargazer/plugins/store/firebird/firebird_store.cpp b/projects/stargazer/plugins/store/firebird/firebird_store.cpp index 8e3c9d90..37b5184f 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store.cpp @@ -140,7 +140,7 @@ int FIREBIRD_STORE::CheckVersion() IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr); IBPP::Statement st = IBPP::StatementFactory(db, tr); -string name; +std::string name; try { @@ -157,7 +157,7 @@ try st->Get(1, schemaVersion); } tr->Commit(); - WriteServLog("FIREBIRD_STORE: Current DB schema version: %d", schemaVersion); + logger("FIREBIRD_STORE: Current DB schema version: %d", schemaVersion); } catch (IBPP::Exception & ex) diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp b/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp index e48fd0d8..3f00b16b 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp @@ -204,8 +204,8 @@ try upload = ?, \ download = ? \ where fk_stat = ? and dir_num = ?"); - st->Set(1, (int64_t)stat.up[i]); - st->Set(2, (int64_t)stat.down[i]); + st->Set(1, (int64_t)stat.monthUp[i]); + st->Set(2, (int64_t)stat.monthDown[i]); st->Set(3, sid); st->Set(4, i); st->Execute(); @@ -421,8 +421,8 @@ try if (st->Fetch()) { st->Get(3, dir); - st->Get(5, (int64_t &)stat->up[dir]); - st->Get(4, (int64_t &)stat->down[dir]); + st->Get(5, (int64_t &)stat->monthUp[dir]); + st->Get(4, (int64_t &)stat->monthDown[dir]); } else { diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.cpp b/projects/stargazer/plugins/store/mysql/mysql_store.cpp index 11c2def3..53de158a 100644 --- a/projects/stargazer/plugins/store/mysql/mysql_store.cpp +++ b/projects/stargazer/plugins/store/mysql/mysql_store.cpp @@ -243,7 +243,7 @@ else } if (!ret) { - WriteServLog("MYSQL_STORE: Current DB schema version: %d", schemaVersion); + logger("MYSQL_STORE: Current DB schema version: %d", schemaVersion); MakeUpdates(sock); } mysql_close(sock); @@ -600,7 +600,7 @@ if (schemaVersion < 1) return -1; } schemaVersion = 1; - WriteServLog("MYSQL_STORE: Updated DB schema to version %d", schemaVersion); + logger("MYSQL_STORE: Updated DB schema to version %d", schemaVersion); } return 0; } @@ -903,7 +903,7 @@ for (int i = 0; i < DIR_NUM; i++) mysql_close(sock); return -1; } - stat->down[i] = traff; + stat->monthDown[i] = traff; sprintf(s, "U%d", i); if (GetULongLongInt(row[startPos+i*2+1], &traff, 0) != 0) @@ -913,7 +913,7 @@ for (int i = 0; i < DIR_NUM; i++) mysql_close(sock); return -1; } - stat->up[i] = traff; + stat->monthUp[i] = traff; }//for startPos += (2*DIR_NUM); @@ -1033,10 +1033,10 @@ res = "UPDATE users SET"; for (int i = 0; i < DIR_NUM; i++) { - strprintf(¶m, " D%d=%lld,", i, stat.down[i]); + strprintf(¶m, " D%d=%lld,", i, stat.monthDown[i]); res += param; - strprintf(¶m, " U%d=%lld,", i, stat.up[i]); + strprintf(¶m, " U%d=%lld,", i, stat.monthUp[i]); res += param; } @@ -1196,10 +1196,10 @@ strprintf(&res, "INSERT INTO stat SET login='%s', month=%d, year=%d,", for (int i = 0; i < DIR_NUM; i++) { - strprintf(¶m, " U%d=%lld,", i, stat.up[i]); + strprintf(¶m, " U%d=%lld,", i, stat.monthUp[i]); res += param; - strprintf(¶m, " D%d=%lld,", i, stat.down[i]); + strprintf(¶m, " D%d=%lld,", i, stat.monthDown[i]); res += param; } diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store.cpp index 49f0e808..37ff6dbd 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store.cpp @@ -224,7 +224,7 @@ if (CommitTransaction()) return -1; } -WriteServLog("POSTGRESQL_STORE: Current DB schema version: %d", version); +logger("POSTGRESQL_STORE: Current DB schema version: %d", version); return 0; } diff --git a/projects/stargazer/user_impl.h b/projects/stargazer/user_impl.h index 90ae01b9..150f2a8b 100644 --- a/projects/stargazer/user_impl.h +++ b/projects/stargazer/user_impl.h @@ -247,7 +247,6 @@ private: int id; bool __connected; USER_PROPERTY connected; - std::string lastDisconnectReason; bool enabledDirs[DIR_NUM]; -- 2.44.2