/* DBHelper.c - NeonServ v5.3
- * Copyright (C) 2011 Philipp Kreil (pk910)
+ * 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
#include "HandleInfoHandler.h"
void _loadUserSettings(struct UserNode *user) {
+ SYNCHRONIZE(cache_sync);
MYSQL_RES *res;
MYSQL_ROW row;
printf_mysql_query("SELECT `user_lang`, `user_reply_privmsg`, `user_god`, `user_id` FROM `users` WHERE `user_user` = '%s'", escape_string(user->auth));
} else
user->language = get_default_language();
user->flags |= USERFLAG_LOADED_SETTINGS;
+ DESYNCHRONIZE(cache_sync);
}
int isGodMode(struct UserNode *user) {
}
void _loadChannelSettings(struct ChanNode *chan) {
+ SYNCHRONIZE(cache_sync);
MYSQL_RES *res;
MYSQL_ROW row;
printf_mysql_query("SELECT `channel_id` FROM `channels` WHERE `channel_name` = '%s'", escape_string(chan->name));
chan->channel_id = atoi(row[0]);
}
chan->flags |= CHANFLAG_REQUESTED_CHANINFO;
+ DESYNCHRONIZE(cache_sync);
}
//TODO: fix performance: we should cache the user access