X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_randquote.cpp;h=988d82a85ea38528a0b2a4fe0d4853472971bb3d;hb=495ea4be05859f46cbf99c10541210fa3590f01a;hp=0353ae939bdf45fa8fd00c06f0320df673921674;hpb=ef79134812eb0f3ef024fe57519dce05ec4fb401;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index 0353ae939..988d82a85 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -31,7 +31,7 @@ class CommandRandquote : public Command this->source = "m_randquote.so"; } - CmdResult Handle (const char* const* parameters, int pcntl, User *user) + CmdResult Handle (const std::vector& parameters, User *user) { std::string str; int fsize; @@ -40,11 +40,11 @@ class CommandRandquote : public Command { fsize = quotes->FileSize(); str = quotes->GetLine(rand() % fsize); - user->WriteServ("NOTICE %s :%s%s%s",user->nick,prefix.c_str(),str.c_str(),suffix.c_str()); + user->WriteServ("NOTICE %s :%s%s%s",user->nick.c_str(),prefix.c_str(),str.c_str(),suffix.c_str()); } else { - user->WriteServ("NOTICE %s :Your administrator specified an invalid quotes file, please bug them about this.", user->nick); + user->WriteServ("NOTICE %s :Your administrator specified an invalid quotes file, please bug them about this.", user->nick.c_str()); return CMD_FAILURE; } @@ -61,10 +61,10 @@ class ModuleRandQuote : public Module ModuleRandQuote(InspIRCd* Me) : Module(Me) { - + conf = new ConfigReader(ServerInstance); // Sort the Randomizer thingie.. - srand(time(NULL)); + srand(ServerInstance->Time()); q_file = conf->ReadValue("randquote","file",0); prefix = conf->ReadValue("randquote","prefix",0); @@ -92,22 +92,22 @@ class ModuleRandQuote : public Module ServerInstance->Modules->Attach(eventlist, this, 1); } - + virtual ~ModuleRandQuote() { delete conf; delete quotes; } - + virtual Version GetVersion() { - return Version(1,2,0,1,VF_VENDOR,API_VERSION); + return Version("$Id$",VF_VENDOR,API_VERSION); } - + virtual void OnUserConnect(User* user) { if (mycommand) - mycommand->Handle(NULL, 0, user); + mycommand->Handle(std::vector(), user); } };