X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2FEventLogger.c;h=184bab8e15028c46301b696cbd5b2d36da195749;hb=95fed4deda0319bee515e44ceec0c77061a2c04e;hp=d0b61bde6f42999711b72103204dd6a3ac713ab1;hpb=0f1dc61921eef1db8e404a5a82372e2d1cd55daa;p=NeonServV5.git diff --git a/src/EventLogger.c b/src/EventLogger.c index d0b61bd..184bab8 100644 --- a/src/EventLogger.c +++ b/src/EventLogger.c @@ -1,3 +1,19 @@ +/* EventLogger.c - NeonServ v5.0 + * Copyright (C) 2011 Philipp Kreil (pk910) + * + * 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 3 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, see . + */ #include "EventLogger.h" #include "modcmd.h" @@ -59,9 +75,11 @@ void logEvent(struct Event *event) { userid = 0; else userid = atoi(row[0]); - loadChannelSettings(event->chan); - if((event->chan->flags & CHANFLAG_CHAN_REGISTERED)) - printf_mysql_query("INSERT INTO `godlog` (`godlog_cid`, `godlog_uid`, `godlog_time`, `godlog_cmd`) VALUES ('%d', '%d', UNIX_TIMESTAMP(), '%s')", event->chan->channel_id, userid, escape_string(fullcmd)); + if(event->chan) { + loadChannelSettings(event->chan); + if((event->chan->flags & CHANFLAG_CHAN_REGISTERED)) + printf_mysql_query("INSERT INTO `godlog` (`godlog_cid`, `godlog_uid`, `godlog_time`, `godlog_cmd`) VALUES ('%d', '%d', UNIX_TIMESTAMP(), '%s')", event->chan->channel_id, userid, escape_string(fullcmd)); + } } }