mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-17 18:41:29 +00:00
SetGroupID converted to StringFormat
This commit is contained in:
parent
61732658f2
commit
1ec7da0f36
@ -1624,13 +1624,13 @@ void Database::AddReport(std::string who, std::string against, std::string lines
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc){
|
void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc){
|
||||||
char *query = nullptr;
|
|
||||||
|
|
||||||
|
std::string query;
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
{
|
{
|
||||||
// removing from group
|
// removing from group
|
||||||
auto results = QueryDatabase(query, MakeAnyLenString(&query, "delete from group_id where charid=%i and name='%s' and ismerc=%i",charid, name, ismerc));
|
query = StringFormat("delete from group_id where charid=%i and name='%s' and ismerc=%i",charid, name, ismerc);
|
||||||
safe_delete_array(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
LogFile->write(EQEMuLog::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str());
|
LogFile->write(EQEMuLog::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str());
|
||||||
@ -1639,8 +1639,8 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism
|
|||||||
}
|
}
|
||||||
|
|
||||||
// adding to group
|
// adding to group
|
||||||
auto results = QueryDatabase(query, MakeAnyLenString(&query, "replace into group_id set charid=%i, groupid=%i, name='%s', ismerc='%i'",charid, id, name, ismerc));
|
query = StringFormat("replace into group_id set charid=%i, groupid=%i, name='%s', ismerc='%i'",charid, id, name, ismerc);
|
||||||
safe_delete_array(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
LogFile->write(EQEMuLog::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str());
|
LogFile->write(EQEMuLog::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user