]> git.stg.codes - stg.git/commitdiff
Fixed merge issues.
authorMaxim Mamontov <faust.madf@gmail.com>
Mon, 6 Jan 2014 19:18:55 +0000 (21:18 +0200)
committerMaxim Mamontov <faust.madf@gmail.com>
Mon, 6 Jan 2014 19:18:55 +0000 (21:18 +0200)
include/stg/user_traff.h
projects/stargazer/plugins/store/firebird/firebird_store.cpp
projects/stargazer/plugins/store/firebird/firebird_store_users.cpp
projects/stargazer/plugins/store/mysql/mysql_store.cpp
projects/stargazer/plugins/store/postgresql/postgresql_store.cpp
projects/stargazer/user_impl.h

index 48843a49945a38c2472c390063ea7cf7300b08ef..e1176b90fdcc3c4ed00169bbf6bd413c0dc8bff9 100644 (file)
 #ifndef USER_TRAFF_H
 #define USER_TRAFF_H
 
-#include <iostream>
-#include <vector>
-
+#include "resetable.h"
 #include "const.h"
 #include "os_int.h"
 
+#include <iostream>
+#include <vector>
+
 enum TRAFF_DIRECTION {TRAFF_UPLOAD, TRAFF_DOWNLOAD};
 
 class DIR_TRAFF
index 8e3c9d90f0432bd70c0c716c04a1e37a14677682..37b5184f8aabedfc6c2b8dee2b0a2bd4d2342644 100644 (file)
@@ -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)
index e48fd0d89dacb6effa5d245996b4480d9ad7265e..3f00b16bbd8517b0b81a852bb9844f34f372eadf 100644 (file)
@@ -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
             {
index 11c2def3b5c1d2ca0dc3b82fb036fa6afcc00e71..53de158aa660986ab6f09e83477f3277bfa0b4bd 100644 (file)
@@ -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(&param, " D%d=%lld,", i, stat.down[i]);
+    strprintf(&param, " D%d=%lld,", i, stat.monthDown[i]);
     res += param;
 
-    strprintf(&param, " U%d=%lld,", i, stat.up[i]);
+    strprintf(&param, " 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(&param, " U%d=%lld,", i, stat.up[i]); 
+    strprintf(&param, " U%d=%lld,", i, stat.monthUp[i]); 
     res += param;
 
-    strprintf(&param, " D%d=%lld,", i, stat.down[i]);        
+    strprintf(&param, " D%d=%lld,", i, stat.monthDown[i]);        
     res += param;
     }
     
index 49f0e8088f8f5dc06370dc947beb4b56067eeaf2..37ff6dbdda10207f30a81ca520b8cc0234b1e6a0 100644 (file)
@@ -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;
 }
index 90ae01b96669043dfd2a1facf3afa9e0f88668d7..150f2a8bcf1fe8de324127b391f87f46c852e5e2 100644 (file)
@@ -247,7 +247,6 @@ private:
     int             id;
     bool            __connected;
     USER_PROPERTY<bool> connected;
-    std::string     lastDisconnectReason;
 
     bool            enabledDirs[DIR_NUM];