]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugin_runner.cpp
[NY] Simplified SERVCONF interface.
[stg.git] / projects / stargazer / plugin_runner.cpp
index be43e1ec0fa83097c00053ba603aacb99d565029..3083352c41b8c08b12e1022c970c384abca9e8c6 100644 (file)
 #include <dlfcn.h>
 #include <unistd.h>
 
+#include "stg/common.h"
+#include "stg/traffcounter.h"
 #include "plugin_runner.h"
-#include "common.h"
 #include "settings_impl.h"
 #include "admins_impl.h"
 #include "tariffs_impl.h"
 #include "users_impl.h"
-#include "traffcounter.h"
+#include "services_impl.h"
+#include "corps_impl.h"
 
 //-----------------------------------------------------------------------------
 PLUGIN_RUNNER::PLUGIN_RUNNER(const std::string & pFileName,
@@ -41,6 +43,8 @@ PLUGIN_RUNNER::PLUGIN_RUNNER(const std::string & pFileName,
                              ADMINS_IMPL * a,
                              TARIFFS_IMPL * t,
                              USERS_IMPL * u,
+                             SERVICES_IMPL * svc,
+                             CORPORATIONS_IMPL * crp,
                              TRAFFCOUNTER * tc,
                              STORE * st,
                              const SETTINGS_IMPL * s)
@@ -54,6 +58,8 @@ PLUGIN_RUNNER::PLUGIN_RUNNER(const std::string & pFileName,
       admins(a),
       tariffs(t),
       users(u),
+      services(svc),
+      corps(crp),
       store(st),
       traffCnt(tc),
       stgSettings(s),
@@ -72,6 +78,8 @@ PLUGIN_RUNNER::PLUGIN_RUNNER(const PLUGIN_RUNNER & rvalue)
       admins(rvalue.admins),
       tariffs(rvalue.tariffs),
       users(rvalue.users),
+      services(rvalue.services),
+      corps(rvalue.corps),
       store(rvalue.store),
       traffCnt(rvalue.traffCnt),
       stgSettings(rvalue.stgSettings),
@@ -91,6 +99,8 @@ isRunning = rvalue.isRunning;
 admins = rvalue.admins;
 tariffs = rvalue.tariffs;
 users = rvalue.users;
+services = rvalue.services;
+corps = rvalue.corps;
 store = rvalue.store;
 traffCnt = rvalue.traffCnt;
 stgSettings = rvalue.stgSettings;
@@ -137,6 +147,8 @@ if (!plugin)
 plugin->SetTariffs(tariffs);
 plugin->SetAdmins(admins);
 plugin->SetUsers(users);
+plugin->SetServices(services);
+plugin->SetCorporations(corps);
 plugin->SetTraffcounter(traffCnt);
 plugin->SetStore(store);
 plugin->SetStgSettings(stgSettings);
@@ -166,9 +178,7 @@ if (!plugin)
     return -1;
     }
 
-plugin->Stop();
-
-return 0;
+return plugin->Stop();
 }
 //-----------------------------------------------------------------------------
 int PLUGIN_RUNNER::Reload()