X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=HandleInfoHandler.c;h=537cc459c900e870a4471900b7c92b5d806af0fd;hb=b3f4e38758f442e40fc4834469d113f230c7bc04;hp=6673552082fd5992faf8bda1af01e8e492585fd9;hpb=c7b0cd2ecec489f8358d08321d5d26ffb0311f65;p=NeonServV5.git diff --git a/HandleInfoHandler.c b/HandleInfoHandler.c index 6673552..537cc45 100644 --- a/HandleInfoHandler.c +++ b/HandleInfoHandler.c @@ -8,8 +8,11 @@ #define AUTHSERV_NICK "AuthServ" struct HandleInfoQueueEntry { + struct ClientSocket *client; void *callback; void *data; + + struct HandleInfoQueueEntry *next; }; static struct HandleInfoQueueEntry *first_entry = NULL, *last_entry = NULL; @@ -73,29 +76,29 @@ static void recv_notice(struct UserNode *user, struct UserNode *target, char *me if(bot->user == target) break; } if(!bot) return; - char *auth; - int match = 0, exists = 0; + char *auth = NULL; + int do_match = 0, exists = 0; char *tmp; //messages to parse: // Account * has not been registered. // Account information for Skynet: if(!match("Account * has not been registered.", message)) { - match = 1; + do_match = 1; tmp = strstr(message, "\002"); auth = tmp+1; tmp = strstr(auth, "\002"); *tmp = '\0'; } if(!match("Account information for *", message)) { - match = 1; + do_match = 1; exists = 1; tmp = strstr(message, "\002"); auth = tmp+1; tmp = strstr(auth, "\002"); *tmp = '\0'; } - if(match) { - struct HandleInfoQueueEntry* entry = getNextHandleInfoQueueEntry(client, 1); + if(do_match) { + struct HandleInfoQueueEntry* entry = getNextHandleInfoQueueEntry(bot, 1); authlookup_callback_t *callback = entry->callback; callback(auth, exists, entry->data); free(entry);