X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2FEventLogger.c;h=77956d799254e639c21a29fc3b8233d4e7713960;hb=f56b36305300f68e68ea0f605e4f9935455154b7;hp=e216633d839301767f6b87b8c4312846e151cca5;hpb=2d9db1adb1946aba00b203f40eff7d5db8163f01;p=NeonServV5.git diff --git a/src/EventLogger.c b/src/EventLogger.c index e216633..77956d7 100644 --- a/src/EventLogger.c +++ b/src/EventLogger.c @@ -1,5 +1,5 @@ -/* EventLogger.c - NeonServ v5.1 - * Copyright (C) 2011 Philipp Kreil (pk910) +/* EventLogger.c - NeonServ v5.6 + * Copyright (C) 2011-2012 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 @@ -24,7 +24,7 @@ static struct Event *first_event = NULL, *last_event = NULL; -struct Event *createEvent(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, char *command, char **args, int argc, int flags) { +struct Event *createEvent(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct cmd_binding *command, char **args, int argc, int flags) { struct Event *event = malloc(sizeof(*event)); if (!event) { @@ -35,7 +35,7 @@ struct Event *createEvent(struct ClientSocket *client, struct UserNode *user, st event->user = user; event->chan = chan; event->event_time = time(0); - event->command = strdup(command); + event->command = command; char arguments[MAXLEN]; int argpos = 0; int i; @@ -57,7 +57,7 @@ struct Event *createEvent(struct ClientSocket *client, struct UserNode *user, st void logEvent(struct Event *event) { char fullcmd[MAXLEN]; - sprintf(fullcmd, "%s %s", event->command, event->arguments); + sprintf(fullcmd, "%s %s", event->command->func->name, event->arguments); if((event->flags & CMDFLAG_LOG) && event->chan) { char *auth = ((event->user->flags & USERFLAG_ISAUTHED) ? event->user->auth : "*"); loadChannelSettings(event->chan); @@ -92,7 +92,6 @@ static void destroyEvent(struct Event *event) { if(last->next == NULL) break; last_event = last; } - free(event->command); free(event->arguments); free(event); }