UNALERTCommand.cc \
UNBLOCKCommand.cc \
UNSUSPENDCommand.cc \
+ USERSCORESCommand.cc \
USETCommand.cc \
WHOGROUPCommand.cc \
WHOISCommand.cc \
libchanfix_la-STATUSCommand.lo libchanfix_la-SUSPENDCommand.lo \
libchanfix_la-UNALERTCommand.lo \
libchanfix_la-UNBLOCKCommand.lo \
- libchanfix_la-UNSUSPENDCommand.lo libchanfix_la-USETCommand.lo \
- libchanfix_la-WHOGROUPCommand.lo libchanfix_la-WHOISCommand.lo \
- libchanfix_la-sqlChanOp.lo libchanfix_la-sqlChannel.lo \
- libchanfix_la-sqlManager.lo libchanfix_la-sqlUser.lo
+ libchanfix_la-UNSUSPENDCommand.lo \
+ libchanfix_la-USERSCORESCommand.lo \
+ libchanfix_la-USETCommand.lo libchanfix_la-WHOGROUPCommand.lo \
+ libchanfix_la-WHOISCommand.lo libchanfix_la-sqlChanOp.lo \
+ libchanfix_la-sqlChannel.lo libchanfix_la-sqlManager.lo \
+ libchanfix_la-sqlUser.lo
libchanfix_la_OBJECTS = $(am_libchanfix_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
UNALERTCommand.cc \
UNBLOCKCommand.cc \
UNSUSPENDCommand.cc \
+ USERSCORESCommand.cc \
USETCommand.cc \
WHOGROUPCommand.cc \
WHOISCommand.cc \
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-UNALERTCommand.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-UNBLOCKCommand.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-UNSUSPENDCommand.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-USERSCORESCommand.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-USETCommand.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-WHOGROUPCommand.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-WHOISCommand.Plo@am__quote@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchanfix_la_CXXFLAGS) $(CXXFLAGS) -c -o libchanfix_la-UNSUSPENDCommand.lo `test -f 'UNSUSPENDCommand.cc' || echo '$(srcdir)/'`UNSUSPENDCommand.cc
+libchanfix_la-USERSCORESCommand.lo: USERSCORESCommand.cc
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchanfix_la_CXXFLAGS) $(CXXFLAGS) -MT libchanfix_la-USERSCORESCommand.lo -MD -MP -MF "$(DEPDIR)/libchanfix_la-USERSCORESCommand.Tpo" -c -o libchanfix_la-USERSCORESCommand.lo `test -f 'USERSCORESCommand.cc' || echo '$(srcdir)/'`USERSCORESCommand.cc; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libchanfix_la-USERSCORESCommand.Tpo" "$(DEPDIR)/libchanfix_la-USERSCORESCommand.Plo"; else rm -f "$(DEPDIR)/libchanfix_la-USERSCORESCommand.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='USERSCORESCommand.cc' object='libchanfix_la-USERSCORESCommand.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchanfix_la_CXXFLAGS) $(CXXFLAGS) -c -o libchanfix_la-USERSCORESCommand.lo `test -f 'USERSCORESCommand.cc' || echo '$(srcdir)/'`USERSCORESCommand.cc
+
libchanfix_la-USETCommand.lo: USETCommand.cc
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchanfix_la_CXXFLAGS) $(CXXFLAGS) -MT libchanfix_la-USETCommand.lo -MD -MP -MF "$(DEPDIR)/libchanfix_la-USETCommand.Tpo" -c -o libchanfix_la-USETCommand.lo `test -f 'USETCommand.cc' || echo '$(srcdir)/'`USETCommand.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libchanfix_la-USETCommand.Tpo" "$(DEPDIR)/libchanfix_la-USETCommand.Plo"; else rm -f "$(DEPDIR)/libchanfix_la-USETCommand.Tpo"; exit 1; fi
--- /dev/null
+/**
+ * SCORECommand.cc
+ *
+ * 03/06/2006 - Wouter Coekaerts <wouter@coekaerts.be>
+ * Initial Version
+ *
+ * Shows all the channels <user> has a score in
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *
+ * $Id$
+ */
+
+#include <sstream>
+#include <vector>
+
+#include "gnuworld_config.h"
+
+#include "chanfix.h"
+#include "responses.h"
+#include "StringTokenizer.h"
+#include "sqlChanOp.h"
+#include "sqlUser.h"
+
+RCSTAG("$Id$");
+
+namespace gnuworld
+{
+
+namespace cf
+{
+
+void USERSCORESCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+{
+StringTokenizer st(Message);
+
+std::string firstop;
+std::string lastop;
+bool foundOne = false;
+
+for (chanfix::sqlChanOpsType::iterator ptr = bot->sqlChanOps.begin();
+ ptr != bot->sqlChanOps.end(); ptr++) {
+ chanfix::sqlChanOpsType::mapped_type::iterator chanOp = ptr->second.find(st[1]);
+
+ if (chanOp != ptr->second.end()) {
+ if (!foundOne) {
+ // print header
+ foundOne = true;
+ bot->SendTo(theClient,
+ bot->getResponse(theUser,
+ language::userscores_header,
+ std::string("Channel Score -- Time first opped / Time last opped.")).c_str());
+ }
+
+ sqlChanOp* curOp = chanOp->second;
+ firstop = bot->tsToDateTime(curOp->getTimeFirstOpped(), false);
+ lastop = bot->tsToDateTime(curOp->getTimeLastOpped(), true);
+ bot->SendTo(theClient, "%s %d -- %s / %s", ptr->first.c_str(),
+ curOp->getPoints(), firstop.c_str(), lastop.c_str());
+ }
+}
+
+if (!foundOne) {
+ bot->SendTo(theClient,
+ bot->getResponse(theUser,
+ language::userscores_noscore,
+ std::string("Account %s doesn't have any scores in the database.")).c_str(),
+ st[1].c_str());
+}
+
+bot->logAdminMessage("%s (%s) USERSCORES %s",
+ theUser ? theUser->getUserName().c_str() : "!NOT-LOGGED-IN!",
+ theClient->getRealNickUserHost().c_str(),
+ st[1].c_str());
+
+return;
+}
+} // namespace cf
+} // namespace gnuworld
2,
sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
));
+RegisterCommand(new USERSCORESCommand(this, "USERSCORES",
+ "<account>",
+ 2,
+ sqlUser::F_LOGGEDIN
+ ));
RegisterCommand(new USETCommand(this, "USET",
"[username] <option> <value>",
3,
# not to the network.
chanServName = channels.undernet.org
+# The full server name of the euworld service. This is used to
+# detect whether euworld has performed a mode and should halt
+# autofixing for a brief period on the channel.
+ccontrolServer = uworld.eu.undernet.org
+
# ---------------------------------------------------------------------
# Interface settings
/* Logged-in commands */
DECLARE_COMMAND( CHECK )
DECLARE_COMMAND( LISTHOSTS )
+DECLARE_COMMAND( USERSCORES )
DECLARE_COMMAND( USET )
DECLARE_COMMAND( WHOIS )
1 191 %d channels blocked. 31337 0
1 192 Current fix has been running for %s 31337 0
1 193 Current fix is on hold (waiting for ops to join) 31337 0
+1 194 Channel Score -- Time first opped / Time last opped. 31337 0
+1 195 Account %s doesn't have any scores in the database. 31337 0
\.
const int user_not_suspended = 126;
const int user_unsuspended = 127;
+ /* USERSCORES */
+ const int userscores_header = 194;
+ const int userscores_noscore = 195;
+
/* USET */
const int lang_set_to = 128;
const int send_notices = 129;