X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d25555ce9c6e09344356868780e678c75bbbd164..0b158a63459d05698a01b444fe0272e0a7053aba:/projects/stargazer/corps_impl.cpp?ds=inline diff --git a/projects/stargazer/corps_impl.cpp b/projects/stargazer/corps_impl.cpp index 456523dc..a366f466 100644 --- a/projects/stargazer/corps_impl.cpp +++ b/projects/stargazer/corps_impl.cpp @@ -33,7 +33,9 @@ CORPORATIONS_IMPL::CORPORATIONS_IMPL(STORE * st) store(st), WriteServLog(GetStgLogger()), searchDescriptors(), - handle(0) + handle(0), + mutex(), + strError() { pthread_mutex_init(&mutex, NULL); Read(); @@ -46,7 +48,7 @@ const PRIV * priv = admin->GetPriv(); if (!priv->corpChg) { - string s = admin->GetLogStr() + " Add corporation \'" + corp.name + "\'. Access denied."; + std::string s = admin->GetLogStr() + " Add corporation \'" + corp.name + "\'. Access denied."; strError = "Access denied."; WriteServLog(s.c_str()); return -1; @@ -77,14 +79,14 @@ WriteServLog("%s %s", admin->GetLogStr().c_str(), strError.c_str()); return -1; } //----------------------------------------------------------------------------- -int CORPORATIONS_IMPL::Del(const string & name, const ADMIN * admin) +int CORPORATIONS_IMPL::Del(const std::string & name, const ADMIN * admin) { STG_LOCKER lock(&mutex, __FILE__, __LINE__); const PRIV * priv = admin->GetPriv(); if (!priv->corpChg) { - string s = admin->GetLogStr() + " Delete corporation \'" + name + "\'. Access denied."; + std::string s = admin->GetLogStr() + " Delete corporation \'" + name + "\'. Access denied."; strError = "Access denied."; WriteServLog(s.c_str()); return -1; @@ -99,7 +101,7 @@ if (si == data.end()) return -1; } -map::iterator csi; +std::map::iterator csi; csi = searchDescriptors.begin(); while (csi != searchDescriptors.end()) { @@ -128,7 +130,7 @@ const PRIV * priv = admin->GetPriv(); if (!priv->corpChg) { - string s = admin->GetLogStr() + " Change corporation \'" + corp.name + "\'. Access denied."; + std::string s = admin->GetLogStr() + " Change corporation \'" + corp.name + "\'. Access denied."; strError = "Access denied."; WriteServLog(s.c_str()); return -1; @@ -160,7 +162,7 @@ return 0; bool CORPORATIONS_IMPL::Read() { STG_LOCKER lock(&mutex, __FILE__, __LINE__); -vector corpsList; +std::vector corpsList; if (store->GetCorpsList(&corpsList) < 0) { WriteServLog(store->GetStrError().c_str()); @@ -182,7 +184,7 @@ for (size_t i = 0; i < corpsList.size(); i++) return false; } //----------------------------------------------------------------------------- -bool CORPORATIONS_IMPL::Find(const string & name, CORP_CONF * corp) +bool CORPORATIONS_IMPL::Find(const std::string & name, CORP_CONF * corp) { assert(corp != NULL && "Pointer to corporation is not null"); @@ -201,7 +203,7 @@ if (si != data.end()) return true; } //----------------------------------------------------------------------------- -bool CORPORATIONS_IMPL::Exists(const string & name) const +bool CORPORATIONS_IMPL::Exists(const std::string & name) const { STG_LOCKER lock(&mutex, __FILE__, __LINE__); if (data.empty())