mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-11 02:52:26 +00:00
RemoveFriendOrIgnore converted to QueryDatabase
This commit is contained in:
parent
9d5f427f57
commit
c1469a3a8e
@ -564,21 +564,17 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::RemoveFriendOrIgnore(int CharID, int Type, std::string Name) {
|
void Database::RemoveFriendOrIgnore(int charID, int type, std::string name) {
|
||||||
|
|
||||||
const char *FriendsQuery="DELETE FROM `friends` WHERE `charid`=%i AND `type`=%i and `name`='%s'";
|
std::string query = StringFormat("DELETE FROM `friends` WHERE `charid` = %i "
|
||||||
|
"AND `type` = %i AND `name` = '%s'",
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
charID, type, CapitaliseName(name).c_str());
|
||||||
char* query = 0;
|
auto results = QueryDatabase(query);
|
||||||
|
if(!results.Success())
|
||||||
if(!RunQuery(query, MakeAnyLenString(&query, FriendsQuery, CharID, Type, CapitaliseName(Name).c_str()), errbuf, 0, 0))
|
_log(UCS__ERROR, "Error removing friend/ignore, query was %s", query.c_str());
|
||||||
_log(UCS__ERROR, "Error removing friend/ignore, query was %s", query);
|
|
||||||
else
|
else
|
||||||
_log(UCS__TRACE, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.",
|
_log(UCS__TRACE, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str());
|
||||||
CharID, Type, Name.c_str());
|
|
||||||
|
|
||||||
|
|
||||||
safe_delete_array(query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::GetFriendsAndIgnore(int CharID, std::vector<std::string> &Friends, std::vector<std::string> &Ignorees) {
|
void Database::GetFriendsAndIgnore(int CharID, std::vector<std::string> &Friends, std::vector<std::string> &Ignorees) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user