]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_time.cpp
Fixed m_saquit to direct the command to the user's server and from there send a QUIT...
[user/henk/code/inspircd.git] / src / cmd_time.cpp
index 272a0ce820035513cc79655eafb047fc9ecfd104..d34a1eed5f3c57a833eaa62db950377572166957 100644 (file)
@@ -1 +1,38 @@
-/*       +------------------------------------+\r *       | Inspire Internet Relay Chat Daemon |\r *       +------------------------------------+\r *\r *  InspIRCd: (C) 2002-2007 InspIRCd Development Team\r * See: http://www.inspircd.org/wiki/index.php/Credits\r *\r * This program is free but copyrighted software; see\r *            the file COPYING for details.\r *\r * ---------------------------------------------------\r */\r\r#include "inspircd.h"\r#include "configreader.h"\r#include "users.h"\r#include "commands/cmd_time.h"\r\r\r\rextern "C" DllExport command_t* init_command(InspIRCd* Instance)\r{\r   return new cmd_time(Instance);\r}\r\rCmdResult cmd_time::Handle (const char** parameters, int pcnt, userrec *user)\r{\r      struct tm* timeinfo;\r   time_t local = ServerInstance->Time();\r\r        timeinfo = localtime(&local);\r\r char tms[26];\r  snprintf(tms,26,"%s",asctime(timeinfo));\r       tms[24] = 0;\r\r  user->WriteServ("391 %s %s :%s",user->nick,ServerInstance->Config->ServerName,tms);\r\r   return CMD_SUCCESS;\r}\r
\ No newline at end of file
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#include "inspircd.h"
+#include "commands/cmd_time.h"
+
+
+
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+{
+       return new cmd_time(Instance);
+}
+
+CmdResult cmd_time::Handle (const char** parameters, int pcnt, userrec *user)
+{
+       struct tm* timeinfo;
+       time_t local = ServerInstance->Time();
+
+       timeinfo = localtime(&local);
+
+       char tms[26];
+       snprintf(tms,26,"%s",asctime(timeinfo));
+       tms[24] = 0;
+
+       user->WriteServ("391 %s %s :%s",user->nick,ServerInstance->Config->ServerName,tms);
+
+       return CMD_SUCCESS;
+}