diff options
| author | Azazel <azazel.kon@gmail.com> | 2011-03-11 17:18:17 +0600 |
|---|---|---|
| committer | Azazel <azazel.kon@gmail.com> | 2011-03-11 17:18:17 +0600 |
| commit | 3973d1b45444c0c8fcd7aa1e033be4329dce05ae (patch) | |
| tree | 48a785ae8bbdaf7b49eaf6a832d0a0ea2f577014 /src/server/game/Chat/Commands | |
| parent | 20b44e82d5a0ba86e1b8819e5d7cad4681ba36f5 (diff) | |
CharDB Schema/Cleanup: cleanup channels table:
* rename columns (remove m_ prefix and convert to lowerCamel case);
* rename prepared statements to conform to standards (there is no CLEAN statement).
Diffstat (limited to 'src/server/game/Chat/Commands')
| -rwxr-xr-x | src/server/game/Chat/Commands/Level3.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index a50fae33b19..88e4e2912d2 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -4431,14 +4431,20 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args) { if(chn) chn->SetOwnership(true); - CharacterDatabase.PExecute("UPDATE channels SET m_ownership = 1 WHERE m_name LIKE '%s'", channel); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP); + stmt->setUInt8 (0, 1); + stmt->setString(1, channel); + CharacterDatabase.Execute(stmt); PSendSysMessage(LANG_CHANNEL_ENABLE_OWNERSHIP, channel); } else if (strcmp(argstr, "off") == 0) { if(chn) chn->SetOwnership(false); - CharacterDatabase.PExecute("UPDATE channels SET m_ownership = 0 WHERE m_name LIKE '%s'", channel); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP); + stmt->setUInt8 (0, 0); + stmt->setString(1, channel); + CharacterDatabase.Execute(stmt); PSendSysMessage(LANG_CHANNEL_DISABLE_OWNERSHIP, channel); } else |
