Changeset 272 for trunk/src/game/CharacterHandler.cpp
- Timestamp:
- 11/22/08 00:35:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/CharacterHandler.cpp
r262 r272 11 11 * This program is distributed in the hope that it will be useful, 12 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 * GNU General Public License for more details. 15 15 * 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 20 … … 65 65 res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT leaderGuid FROM group_member WHERE memberGuid ='%u'", GUID_LOPART(m_guid)); 66 66 res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid)); 67 res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_index, stackcount,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid));67 res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_index,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid)); 68 68 res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, "SELECT spell,slot,active,disabled FROM character_spell WHERE guid = '%u'", GUID_LOPART(m_guid)); 69 69 res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, "SELECT quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4 FROM character_queststatus WHERE guid = '%u'", GUID_LOPART(m_guid)); … … 181 181 std::string name; 182 182 uint8 race_,class_; 183 184 183 recv_data >> name; 185 184 … … 216 215 ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_); 217 216 ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race_); 218 219 217 if( !classEntry || !raceEntry ) 220 218 { … … 610 608 } 611 609 612 if (! pCurrChar->GetMap()->Add(pCurrChar))610 if (!MapManager::Instance().GetMap(pCurrChar->GetMapId(), pCurrChar)->Add(pCurrChar)) 613 611 { 614 612 AreaTrigger const* at = objmgr.GetGoBackTrigger(pCurrChar->GetMapId()); … … 1002 1000 uint64 guid; 1003 1001 1004 CHECK_PACKET_SIZE(recv_data, 8 );1002 CHECK_PACKET_SIZE(recv_data, 8+6); 1005 1003 recv_data >> guid; 1006 1004 1007 1005 // not accept declined names for unsupported languages 1008 1006 std::string name; 1009 if(!objmgr.GetPlayerNameByGUID(guid, 1010 { 1011 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 1012 data << uint32(1);1013 data << uint64(guid);1007 if(!objmgr.GetPlayerNameByGUID(guid,name)) 1008 { 1009 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT,4+8); 1010 data << (uint32)1; 1011 data << guid; 1014 1012 SendPacket(&data); 1015 1013 return; … … 1017 1015 1018 1016 std::wstring wname; 1019 if(!Utf8toWStr(name, 1020 { 1021 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 1022 data << uint32(1);1023 data << uint64(guid);1017 if(!Utf8toWStr(name,wname)) 1018 { 1019 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT,4+8); 1020 data << (uint32)1; 1021 data << guid; 1024 1022 SendPacket(&data); 1025 1023 return; … … 1028 1026 if(!isCyrillicCharacter(wname[0])) // name already stored as only single alphabet using 1029 1027 { 1030 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 1031 data << uint32(1);1032 data << uint64(guid);1028 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT,4+8); 1029 data << (uint32)1; 1030 data << guid; 1033 1031 SendPacket(&data); 1034 1032 return; … … 1038 1036 DeclinedName declinedname; 1039 1037 1040 CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);1041 1038 recv_data >> name2; 1042 1039 1043 if(name2 != name)// character have different name1044 { 1045 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 1046 data << uint32(1);1047 data << uint64(guid);1040 if(name2!=name) // character have different name 1041 { 1042 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT,4+8); 1043 data << (uint32)1; 1044 data << guid; 1048 1045 SendPacket(&data); 1049 1046 return; … … 1052 1049 for(int i = 0; i < MAX_DECLINED_NAME_CASES; ++i) 1053 1050 { 1054 CHECK_PACKET_SIZE(recv_data, recv_data.rpos() + 1);1055 1051 recv_data >> declinedname.name[i]; 1056 1052 if(!normalizePlayerName(declinedname.name[i])) 1057 1053 { 1058 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 1059 data << uint32(1);1060 data << uint64(guid);1054 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT,4+8); 1055 data << (uint32)1; 1056 data << guid; 1061 1057 SendPacket(&data); 1062 1058 return; … … 1064 1060 } 1065 1061 1066 if(!ObjectMgr::CheckDeclinedNames(GetMainPartOfName(wname, 0),declinedname))1067 { 1068 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 1069 data << uint32(1);1070 data << uint64(guid);1062 if(!ObjectMgr::CheckDeclinedNames(GetMainPartOfName(wname,0),declinedname)) 1063 { 1064 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT,4+8); 1065 data << (uint32)1; 1066 data << guid; 1071 1067 SendPacket(&data); 1072 1068 return; … … 1079 1075 CharacterDatabase.PExecute("DELETE FROM character_declinedname WHERE guid = '%u'", GUID_LOPART(guid)); 1080 1076 CharacterDatabase.PExecute("INSERT INTO character_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES ('%u','%s','%s','%s','%s','%s')", 1081 GUID_LOPART(guid), declinedname.name[0].c_str(), declinedname.name[1].c_str(), declinedname.name[2].c_str(), declinedname.name[3].c_str(),declinedname.name[4].c_str());1077 GUID_LOPART(guid), declinedname.name[0].c_str(),declinedname.name[1].c_str(),declinedname.name[2].c_str(),declinedname.name[3].c_str(),declinedname.name[4].c_str()); 1082 1078 CharacterDatabase.CommitTransaction(); 1083 1079 1084 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 1085 data << uint32(0); // OK1086 data << uint64(guid);1080 WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT,4+8); 1081 data << (uint32)0; // OK 1082 data << guid; 1087 1083 SendPacket(&data); 1088 1084 }