unrealircd- supernets unrealircd source & configuration |
git clone git://git.acid.vegas/unrealircd.git |
Log | Files | Refs | Archive | README | LICENSE |
time.c (1639B)
1 /* 2 * Unreal Internet Relay Chat Daemon, src/modules/time.c 3 * (C) 2004 The UnrealIRCd Team 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 1, or (at your option) 8 * any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 */ 19 20 #include "unrealircd.h" 21 22 CMD_FUNC(cmd_time); 23 24 /* Place includes here */ 25 #define MSG_TIME "TIME" 26 27 ModuleHeader MOD_HEADER 28 = { 29 "time", /* Name of module */ 30 "5.0", /* Version */ 31 "command /time", /* Short description of module */ 32 "UnrealIRCd Team", 33 "unrealircd-6", 34 }; 35 36 37 /* This is called on module init, before Server Ready */ 38 MOD_INIT() 39 { 40 CommandAdd(modinfo->handle, MSG_TIME, cmd_time, MAXPARA, CMD_USER); 41 MARK_AS_OFFICIAL_MODULE(modinfo); 42 return MOD_SUCCESS; 43 } 44 45 /* Is first run when server is 100% ready */ 46 MOD_LOAD() 47 { 48 return MOD_SUCCESS; 49 } 50 51 52 /* Called when module is unloaded */ 53 MOD_UNLOAD() 54 { 55 return MOD_SUCCESS; 56 } 57 58 /* 59 ** cmd_time 60 ** parv[1] = servername 61 */ 62 CMD_FUNC(cmd_time) 63 { 64 if (hunt_server(client, recv_mtags, "TIME", 1, parc, parv) == HUNTED_ISME) 65 sendnumeric(client, RPL_TIME, me.name, long_date(0)); 66 }