diff options
| author | Nay <dnpd.dd@gmail.com> | 2012-01-07 17:13:42 +0000 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2012-01-07 17:13:42 +0000 |
| commit | 9c26ce8da559e1d7cd83011885f84f83360819fc (patch) | |
| tree | 3eb0164d9f93ccecf6ca737a902489a679b36b5b /src/server/game/Chat | |
| parent | ccf8b3889b8a67c18d5c5c79ce3c0cd32d7647f6 (diff) | |
| parent | a79ea3dcdfc865896bd120edc864105685fc43f4 (diff) | |
Merge branch 'master' into 4.x
Conflicts:
src/server/game/Achievements/AchievementMgr.cpp
src/server/game/Achievements/AchievementMgr.h
src/server/game/Entities/Corpse/Corpse.cpp
src/server/game/Entities/Unit/Unit.cpp
src/server/game/Quests/QuestDef.cpp
src/server/shared/Database/Implementation/CharacterDatabase.cpp
src/server/shared/Database/Implementation/CharacterDatabase.h
Diffstat (limited to 'src/server/game/Chat')
| -rwxr-xr-x | src/server/game/Chat/Channels/Channel.cpp | 10 | ||||
| -rwxr-xr-x | src/server/game/Chat/Channels/Channel.h | 2 | ||||
| -rwxr-xr-x | src/server/game/Chat/Channels/ChannelMgr.cpp | 2 | ||||
| -rwxr-xr-x | src/server/game/Chat/Channels/ChannelMgr.h | 2 | ||||
| -rwxr-xr-x | src/server/game/Chat/Chat.cpp | 10 | ||||
| -rwxr-xr-x | src/server/game/Chat/Chat.h | 2 | ||||
| -rw-r--r-- | src/server/game/Chat/ChatLink.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Chat/ChatLink.h | 2 | ||||
| -rwxr-xr-x | src/server/game/Chat/Commands/Level0.cpp | 2 | ||||
| -rwxr-xr-x | src/server/game/Chat/Commands/Level1.cpp | 2 | ||||
| -rwxr-xr-x | src/server/game/Chat/Commands/Level2.cpp | 44 | ||||
| -rwxr-xr-x | src/server/game/Chat/Commands/Level3.cpp | 24 | ||||
| -rwxr-xr-x | src/server/game/Chat/Commands/TicketCommands.cpp | 2 |
13 files changed, 59 insertions, 47 deletions
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 244c05ec0ad..b6e9dd30d28 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) // If storing custom channels in the db is enabled either load or save the channel if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS)) { - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_CHANNEL); + PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHANNEL); stmt->setString(0, name); stmt->setUInt32(1, m_Team); PreparedQueryResult result = CharacterDatabase.Query(stmt); @@ -85,7 +85,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) } else // save { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_CHANNEL); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHANNEL); stmt->setString(0, name); stmt->setUInt32(1, m_Team); CharacterDatabase.Execute(stmt); @@ -108,7 +108,7 @@ void Channel::UpdateChannelInDB() const std::string banListStr = banlist.str(); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL); stmt->setBool(0, m_announce); stmt->setBool(1, m_ownership); stmt->setString(2, m_password); @@ -124,7 +124,7 @@ void Channel::UpdateChannelInDB() const void Channel::UpdateChannelUseageInDB() const { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_USAGE); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_USAGE); stmt->setString(0, m_name); stmt->setUInt32(1, m_Team); CharacterDatabase.Execute(stmt); diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h index 8ce13a6afa1..9564dbb381e 100755 --- a/src/server/game/Chat/Channels/Channel.h +++ b/src/server/game/Chat/Channels/Channel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp index 651e5d15647..75436e1eb5f 100755 --- a/src/server/game/Chat/Channels/ChannelMgr.cpp +++ b/src/server/game/Chat/Channels/ChannelMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h index f46f8d360c1..ac030ffb73f 100755 --- a/src/server/game/Chat/Channels/ChannelMgr.h +++ b/src/server/game/Chat/Channels/ChannelMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 185ac487481..035fbaf5b78 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -885,11 +885,11 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand* table, char const* cmd, ch std::string list; for (uint32 i = 0; table[i].Name != NULL; ++i) { - // must be available (ignore handler existence for show command with possibe avalable subcomands + // must be available (ignore handler existence for show command with possible available subcommands) if (!isAvailable(table[i])) continue; - /// for empty subcmd show all available + // for empty subcmd show all available if (*subcmd && !hasStringAbbr(table[i].Name, subcmd)) continue; @@ -924,7 +924,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd) { for (uint32 i = 0; table[i].Name != NULL; ++i) { - // must be available (ignore handler existence for show command with possibe avalable subcomands + // must be available (ignore handler existence for show command with possible available subcommands) if (!isAvailable(table[i])) continue; @@ -954,7 +954,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd) { for (uint32 i = 0; table[i].Name != NULL; ++i) { - // must be available (ignore handler existence for show command with possibe avalable subcomands + // must be available (ignore handler existence for show command with possible available subcommands) if (!isAvailable(table[i])) continue; diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index d9190265bbb..2311f4b8e5e 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index dade99c7dc7..6860426c3eb 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * * 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 the diff --git a/src/server/game/Chat/ChatLink.h b/src/server/game/Chat/ChatLink.h index 51cc023f0d4..2301dc09f29 100644 --- a/src/server/game/Chat/ChatLink.h +++ b/src/server/game/Chat/ChatLink.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * * 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 the diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp index 7ff7a82bf58..6d33a5761f4 100755 --- a/src/server/game/Chat/Commands/Level0.cpp +++ b/src/server/game/Chat/Commands/Level0.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index 042630409e3..5c51d2b1bb5 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index d33e248121f..ef91d39e6cb 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -76,7 +76,7 @@ bool ChatHandler::HandleMuteCommand(const char* args) if (HasLowerSecurity (target, target_guid, true)) return false; - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_MUTE_TIME); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); if (target) { @@ -139,7 +139,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args) target->GetSession()->m_muteTime = 0; } - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPDATE_MUTE_TIME); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); stmt->setInt64(0, 0); stmt->setUInt32(1, accountId); @@ -481,7 +481,7 @@ bool ChatHandler::HandleCharacterRenameCommand(const char* args) PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid)); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_RENAME)); stmt->setUInt32(1, GUID_LOPART(targetGuid)); @@ -501,7 +501,7 @@ bool ChatHandler::HandleCharacterCustomizeCommand(const char* args) if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) return false; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE)); @@ -535,7 +535,7 @@ bool ChatHandler::HandleCharacterChangeFactionCommand(const char* args) if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) return false; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION)); @@ -568,9 +568,9 @@ bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args) if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) return false; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); - stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION)); + stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE)); if (target) { @@ -709,19 +709,31 @@ bool ChatHandler::HandleCombatStopCommand(const char* args) bool ChatHandler::HandleLookupPlayerIpCommand(const char* args) { + std::string ip; + int32 limit; + char* limit_str; - if (!*args) - return false; + Player *chr = getSelectedPlayer(); + if (chr == NULL) + { + if (!*args) + return false; - std::string ip = strtok ((char*)args, " "); - char* limit_str = strtok (NULL, " "); - int32 limit = limit_str ? atoi (limit_str) : -1; + ip = strtok ((char*)args, " "); + limit_str = strtok (NULL, " "); + limit = limit_str ? atoi (limit_str) : -1; + } + else + { + ip = chr->GetSession()->GetRemoteAddress(); + limit = -1; + } - LoginDatabase.EscapeString (ip); + LoginDatabase.EscapeString(ip); - QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str ()); + QueryResult result = LoginDatabase.PQuery("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str()); - return LookupPlayerSearchCommand (result, limit); + return LookupPlayerSearchCommand(result, limit); } bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args) diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 855cced3a9e..ee07c034b15 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -2198,7 +2198,7 @@ void ChatHandler::HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 else { // Update level and reset XP, everything else will be updated at login - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_LEVEL); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL); stmt->setUInt8(0, uint8(newLevel)); stmt->setUInt32(1, GUID_LOPART(playerGuid)); @@ -2583,7 +2583,7 @@ bool ChatHandler::HandleResetSpellsCommand(const char* args) } else { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_RESET_SPELLS)); stmt->setUInt32(1, GUID_LOPART(targetGuid)); @@ -2641,7 +2641,7 @@ bool ChatHandler::HandleResetTalentsCommand(const char* args) } else if (targetGuid) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_AT_LOGIN_FLAG); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->setUInt16(0, uint16(AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS)); stmt->setUInt32(1, GUID_LOPART(targetGuid)); @@ -2689,7 +2689,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args) return false; } - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPDATE_ALL_AT_LOGIN_FLAGS); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ALL_AT_LOGIN_FLAGS); stmt->setUInt16(0, uint16(atLogin)); @@ -3110,7 +3110,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args) if (!target) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUID_BY_NAME); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME); stmt->setString(0, name); PreparedQueryResult resultCharacter = CharacterDatabase.Query(stmt); @@ -3125,7 +3125,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args) else target_guid = target->GetGUIDLow(); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_BANINFO); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO); stmt->setUInt32(0, target_guid); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -3220,7 +3220,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args) return false; std::string filter(cFilter); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUID_BY_NAME_FILTER); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER); stmt->setString(0, filter.c_str()); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) @@ -3237,7 +3237,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args) do { Field* fields = result->Fetch(); - PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_GET_BANNED_NAME); + PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANNED_NAME); stmt2->setUInt32(0, fields[0].GetUInt32()); PreparedQueryResult banresult = CharacterDatabase.Query(stmt2); if (banresult) @@ -3259,7 +3259,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args) std::string char_name = fields[1].GetString(); - PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_GET_BANINFO_LIST); + PreparedStatement* stmt2 = CharacterDatabase.GetPreparedStatement(CHAR_SEL_BANINFO_LIST); stmt2->setUInt32(0, fields[0].GetUInt32()); PreparedQueryResult banInfo = CharacterDatabase.Query(stmt2); if (banInfo) @@ -4465,7 +4465,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args) { if (chn) chn->SetOwnership(true); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP); stmt->setUInt8 (0, 1); stmt->setString(1, channel); CharacterDatabase.Execute(stmt); @@ -4475,7 +4475,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args) { if (chn) chn->SetOwnership(false); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP); stmt->setUInt8 (0, 0); stmt->setString(1, channel); CharacterDatabase.Execute(stmt); diff --git a/src/server/game/Chat/Commands/TicketCommands.cpp b/src/server/game/Chat/Commands/TicketCommands.cpp index d38da9eb97c..138466f9623 100755 --- a/src/server/game/Chat/Commands/TicketCommands.cpp +++ b/src/server/game/Chat/Commands/TicketCommands.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * * 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 the |
