diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-17 02:14:44 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-17 02:14:44 +0000 |
commit | bf6724c049ba0f156544c49aab2008d6280e5ffa (patch) | |
tree | 0c56caccf906b87575dfefe52acc526f38c1fc81 /src/stats.cpp | |
parent | 62a1eab66838294f2b88d5ea94c1678c167d6189 (diff) |
Rewrite ConfigReader again
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11879 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/stats.cpp')
-rw-r--r-- | src/stats.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/stats.cpp b/src/stats.cpp index a512ccc38..eb8fe0e45 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -88,11 +88,9 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results) case 'U': { - char ulined[MAXBUF]; - for (int i = 0; i < this->Config->ConfValueEnum("uline"); i++) + for(std::map<irc::string, bool>::iterator i = Config->ulines.begin(); i != Config->ulines.end(); ++i) { - this->Config->ConfValue("uline","server", i, ulined, MAXBUF); - results.push_back(sn+" 248 "+user->nick+" U "+std::string(ulined)); + results.push_back(sn+" 248 "+user->nick+" U "+std::string(i->first.c_str())); } } break; @@ -236,15 +234,13 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results) /* stats o */ case 'o': - for (int i = 0; i < this->Config->ConfValueEnum("oper"); i++) + for (int i = 0;; i++) { - char LoginName[MAXBUF]; - char HostName[MAXBUF]; - char OperType[MAXBUF]; - this->Config->ConfValue("oper","name", i, LoginName, MAXBUF); - this->Config->ConfValue("oper","host", i, HostName, MAXBUF); - this->Config->ConfValue("oper","type", i, OperType, MAXBUF); - results.push_back(sn+" 243 "+user->nick+" O "+HostName+" * "+LoginName+" "+OperType+" 0"); + ConfigTag* tag = Config->ConfValue("oper", i); + if (!tag) + break; + results.push_back(sn+" 243 "+user->nick+" O "+tag->getString("host")+" * "+ + tag->getString("name") + " " + tag->getString("type")+" 0"); } break; |