]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/servercommand.cpp
Fix some confusing logic in sanick.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / servercommand.cpp
index 3034eee7aeda8619bd7deeea507ae6742bb8a544..5473ef077143d7f92056436fcbf8df409ea41cbc 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2013 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2018 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013-2015 Attila Molnar <attilamolnar@hush.com>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
 ServerCommand::ServerCommand(Module* Creator, const std::string& Name, unsigned int MinParams, unsigned int MaxParams)
        : CommandBase(Creator, Name, MinParams, MaxParams)
 {
-       this->ServiceProvider::DisableAutoRegister();
-       ModuleSpanningTree* st = static_cast<ModuleSpanningTree*>(Creator);
+}
+
+void ServerCommand::RegisterService()
+{
+       ModuleSpanningTree* st = static_cast<ModuleSpanningTree*>(static_cast<Module*>(creator));
        st->CmdManager.AddCommand(this);
 }
 
-RouteDescriptor ServerCommand::GetRouting(User* user, const std::vector<std::string>& parameters)
+RouteDescriptor ServerCommand::GetRouting(User* user, const Params& parameters)
 {
        // Broadcast server-to-server commands unless overridden
        return ROUTE_BROADCAST;
@@ -37,7 +41,7 @@ RouteDescriptor ServerCommand::GetRouting(User* user, const std::vector<std::str
 
 time_t ServerCommand::ExtractTS(const std::string& tsstr)
 {
-       time_t TS = ConvToInt(tsstr);
+       time_t TS = ConvToNum<time_t>(tsstr);
        if (!TS)
                throw ProtocolException("Invalid TS");
        return TS;