From 66008f44756aeb9da4c4cfef0dc9e346a6c3ab3f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 24 Jan 2015 00:57:36 -0600 Subject: [PATCH] Fix situation where someone will add a player to an instance for sanity sake (twice) and INSERT will fail, this is merely suppressing logsby doing a REPLACE INTO via Database::AddClientToInstance --- common/database.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index e336de437..02f735737 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3847,10 +3847,8 @@ void Database::PurgeExpiredInstances() bool Database::AddClientToInstance(uint16 instance_id, uint32 char_id) { - std::string query = StringFormat("INSERT INTO instance_list_player(id, charid) values(%lu, %lu)", - (unsigned long)instance_id, (unsigned long)char_id); - auto results = QueryDatabase(query); - + std::string query = StringFormat("REPLACE INTO instance_list_player(id, charid) VALUES (%lu, %lu)", (unsigned long)instance_id, (unsigned long)char_id); + auto results = QueryDatabase(query); return results.Success(); }