bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::CharacterCreateInfo const* createInfo){ //FIXME: outfitId not used in player creating /// @todo need more checks against packet modifications Object::_Create(ObjectGuid::Create<HighGuid::Player>(guidlow)); m_name = createInfo->Name; PlayerInfo const* info = sObjectMgr->GetPlayerInfo(createInfo->Race, createInfo->Class); if (!info) { TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking attempt: Account %u tried to create a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.", GetSession()->GetAccountId(), m_name.c_str(), createInfo->Race, createInfo->Class); return false; }
{ uint32 oldMSTime = getMSTime(); // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo"); if (!result) { TC_LOG_ERROR("server.loading", ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty."); exit(1); } else { uint32 count = 0; do { Field* fields = result->Fetch(); uint32 current_race = fields[0].GetUInt8(); uint32 current_class = fields[1].GetUInt8(); uint32 mapId = fields[2].GetUInt16(); uint32 areaId = fields[3].GetUInt32(); // zone float positionX = fields[4].GetFloat(); float positionY = fields[5].GetFloat(); float positionZ = fields[6].GetFloat(); float orientation = fields[7].GetFloat(); if (current_race >= MAX_RACES) { TC_LOG_ERROR("sql.sql", "Wrong race %u in `playercreateinfo` table, ignoring.", current_race); continue; } ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race); if (!rEntry) { TC_LOG_ERROR("sql.sql", "Wrong race %u in `playercreateinfo` table, ignoring.", current_race); continue; } if (current_class >= MAX_CLASSES) { TC_LOG_ERROR("sql.sql", "Wrong class %u in `playercreateinfo` table, ignoring.", current_class); continue; } if (!sChrClassesStore.LookupEntry(current_class)) { TC_LOG_ERROR("sql.sql", "Wrong class %u in `playercreateinfo` table, ignoring.", current_class); continue; } // accept DB data only for valid position (and non instanceable) if (!MapManager::IsValidMapCoord(mapId, positionX, positionY, positionZ, orientation)) { TC_LOG_ERROR("sql.sql", "Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race); continue; } if (sMapStore.LookupEntry(mapId)->Instanceable()) { TC_LOG_ERROR("sql.sql", "Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race); continue; } PlayerInfo* info = new PlayerInfo(); info->mapId = mapId; info->areaId = areaId; info->positionX = positionX; info->positionY = positionY; info->positionZ = positionZ; info->orientation = orientation; info->displayId_m = rEntry->MaleDisplayID; info->displayId_f = rEntry->FemaleDisplayID; _playerInfo[current_race][current_class] = info; ++count; } while (result->NextRow()); TC_LOG_INFO("server.loading", ">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } }
Have you find the error for the "wrong xx race in playercreateinfo.......".I've got the same error with mangos core 3.3.5a rev.12340.