kich0
-
Posts
144 -
Joined
-
Last visited
-
Donations
0.00 GBP
Content Type
Profiles
Bug Tracker
Wiki
Release Notes
Forums
Downloads
Blogs
Events
Posts posted by kich0
-
-
pets stats cannot be all 0...there is SQL file in the patch for pet levelstats and pet spell auras.
-
SpellEffects.cpp :
@@ -2769,6 +2773,12 @@ void Spell::EffectTriggerSpell(SpellEffectIndex effIndex) pet->CastSpell(pet, 28305, true); return; } + // Empower Rune Weapon + case 53258: + { + m_caster->ModifyPower(POWER_RUNIC_POWER, 25); + return; + } } // normal case
-
just remove the lines in red starting with "-" and add lines in green starting with "+"
-
ps is it only me seeing code box with only one line in forst post?
better now ) ?
-
you can pretty much figure it out from file names example SpellAuras.cpp is in relation with auras, SpellEffects.cpp is where spell effects are implemented.
-
yep repacks are no-no here...check out install & compile guides.
-
search for "realm loop" or check console for errors.
-
there will be a topic in News&Announcement forum when its officially supported. until then you are free to use 3.3.5 branch but don't ask for the support here for any problems you encounter.
-
yes but I think I saw development topic somewhere on this forum...
-
this is more sd2 question then a MaNGOS one...
-
I am using this one by pasdVn & selector without any problems. http://github.com/kicho/mangos/commit/3af63f1fbc4b4e13070ce6db06240649fc14b01d.patch
-
ddos its not problem c++/sql interaction, problem is that i cannot see the way of converting HashMapHolder getplayers to sql SELECT COUNT
-
Xees 1) the reason why those hacks are working on mangos: Hacks are client side related , not server side...
2) why they don't work on bl1zz4rd: warden
-
DBC editing is illegal and won't be disscussed here.
-
yes thats probably because of HashMapHolder<Player> bad exception code
needs more work...
-
anyone interested in testing this..?
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index bf03a30..5126203 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -73,187 +73,40 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data ) DEBUG_LOG( "WORLD: Recvd CMSG_WHO Message" ); //recv_data.hexlike(); - uint32 clientcount = 0; - - uint32 level_min, level_max, racemask, classmask, zones_count, str_count; - uint32 zoneids[10]; // 10 is client limit - std::string player_name, guild_name; - - recv_data >> level_min; // maximal player level, default 0 - recv_data >> level_max; // minimal player level, default 100 (MAX_LEVEL) - recv_data >> player_name; // player name, case sensitive... - - recv_data >> guild_name; // guild name, case sensitive... - - recv_data >> racemask; // race mask - recv_data >> classmask; // class mask - recv_data >> zones_count; // zones count, client limit=10 (2.0.10) - - if(zones_count > 10) - return; // can't be received from real client or broken packet - - for(uint32 i = 0; i < zones_count; ++i) - { - uint32 temp; - recv_data >> temp; // zone id, 0 if zone is unknown... - zoneids[i] = temp; - DEBUG_LOG("Zone %u: %u", i, zoneids[i]); - } - - recv_data >> str_count; // user entered strings count, client limit=4 (checked on 2.0.10) - - if(str_count > 4) - return; // can't be received from real client or broken packet - - DEBUG_LOG("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count); - - std::wstring str[4]; // 4 is client limit - for(uint32 i = 0; i < str_count; ++i) - { - std::string temp; - recv_data >> temp; // user entered string, it used as universal search pattern(guild+player name)? - - if(!Utf8toWStr(temp,str[i])) - continue; - - wstrToLower(str[i]); - - DEBUG_LOG("String %u: %s", i, temp.c_str()); - } - - std::wstring wplayer_name; - std::wstring wguild_name; - if(!(Utf8toWStr(player_name, wplayer_name) && Utf8toWStr(guild_name, wguild_name))) - return; - wstrToLower(wplayer_name); - wstrToLower(wguild_name); - - // client send in case not set max level value 100 but mangos support 255 max level, - // update it to show GMs with characters after 100 level - if(level_max >= MAX_LEVEL) - level_max = STRONG_MAX_LEVEL; - - uint32 team = _player->GetTeam(); - uint32 security = GetSecurity(); - bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST); - AccountTypes gmLevelInWhoList = (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST); - + //KICHO: Who List Player Stats 0 1 2 3 4 5 6 7 + QueryResult *result = CharacterDatabase.PQuery("SELECT guid,name,race,class,gender,level,zone,COUNT(guid) FROM characters WHERE online!=0"); + Field *fields = result->Fetch(); + + //uint32 + uint32 clientcount = fields[7].GetUInt32(); //online count (player number) + uint32 race = fields[2].GetUInt32(); //player race + uint32 class_ = fields[3].GetUInt32(); //player class + uint32 lvl = fields[5].GetUInt32(); //player level + uint32 pzoneid = fields[6].GetUInt32(); //player in zone + //string + std::string pname = fields[1].GetCppString(); //player name + std::string gname = fields[1].GetCppString(); //guild name (not implemented yet) + + //KICHO: World Packet WorldPacket data( SMSG_WHO, 50 ); // guess size data << uint32(clientcount); // clientcount place holder, listed count data << uint32(clientcount); // clientcount place holder, online count - // TODO: Guard Player map - HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers(); - for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) - { - if (security == SEC_PLAYER) - { - // player can see member of other team only if CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST - if (itr->second->GetTeam() != team && !allowTwoSideWhoList ) - continue; - - // player can see MODERATOR, GAME MASTER, ADMINISTRATOR only if CONFIG_GM_IN_WHO_LIST - if (itr->second->GetSession()->GetSecurity() > gmLevelInWhoList) - continue; - } - - // do not process players which are not in world - if(!(itr->second->IsInWorld())) - continue; - - // check if target is globally visible for player - if (!(itr->second->IsVisibleGloballyFor(_player))) - continue; - - // check if target's level is in level range - uint32 lvl = itr->second->getLevel(); - if (lvl < level_min || lvl > level_max) - continue; - - // check if class matches classmask - uint32 class_ = itr->second->getClass(); - if (!(classmask & (1 << class_))) - continue; - - // check if race matches racemask - uint32 race = itr->second->getRace(); - if (!(racemask & (1 << race))) - continue; - - uint32 pzoneid = itr->second->GetZoneId(); - - bool z_show = true; - for(uint32 i = 0; i < zones_count; ++i) - { - if(zoneids[i] == pzoneid) - { - z_show = true; - break; - } - - z_show = false; - } - if (!z_show) - continue; - - std::string pname = itr->second->GetName(); - std::wstring wpname; - if(!Utf8toWStr(pname,wpname)) - continue; - wstrToLower(wpname); - - if (!(wplayer_name.empty() || wpname.find(wplayer_name) != std::wstring::npos)) - continue; - - std::string gname = sObjectMgr.GetGuildNameById(itr->second->GetGuildId()); - std::wstring wgname; - if(!Utf8toWStr(gname,wgname)) - continue; - wstrToLower(wgname); - - if (!(wguild_name.empty() || wgname.find(wguild_name) != std::wstring::npos)) - continue; - - std::string aname; - if(AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(itr->second->GetZoneId())) - aname = areaEntry->area_name[GetSessionDbcLocale()]; - - bool s_show = true; - for(uint32 i = 0; i < str_count; ++i) - { - if (!str[i].empty()) - { - if (wgname.find(str[i]) != std::wstring::npos || - wpname.find(str[i]) != std::wstring::npos || - Utf8FitTo(aname, str[i]) ) - { - s_show = true; - break; - } - s_show = false; - } - } - if (!s_show) - continue; - data << pname; // player name - data << gname; // guild name + data << gname; // guild name (not implemented yet) data << uint32( lvl ); // player level data << uint32( class_ ); // player class data << uint32( race ); // player race data << uint8(0); // new 2.4.0 data << uint32( pzoneid ); // player zone id - // 50 is maximum player count sent to client - if ((++clientcount) == 50) - break; - } - - uint32 count = m.size(); data.put( 0, clientcount ); // insert right count, listed count - data.put( 4, count > 50 ? count : clientcount ); // insert right count, online count + data.put( 4, clientcount ); // insert right count, online count SendPacket(&data); + + delete result; + DEBUG_LOG( "WORLD: Send SMSG_WHO Message" ); }
-
yep, after 80 you're on your own
-
Its a simple possibility to create couple of characters , but the goal is not the simplicity ,you need stuff your fake characters its take more time and at the end , the real player will see that couple of characters are fake because if its all the time the same characters are online and in the same zone (player say : they don't move?),the same level, i think we must choose between simplicity:basic way or difficulty but advanced way . With difficulty way , the fakeplayers are true player so they move zone change ,level change ,stuff change whithout that you lost more time . I will help you as soon as I have time , its a good project .
Best regards
maybe something like this should work ? but needs more work or it will corrupt DB
WorldSession.cpp
//No SQL injection as AccountId is uint32 - CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = '%u'", + CharacterDatabase.PExecute("UPDATE characters SET online = 2 WHERE account = '%u'", GetAccountId()); DEBUG_LOG( "SESSION: Sent SMSG_LOGOUT_COMPLETE Message" );
-
actually I believe I do since I've only declared clientcount
QueryResult *resultClient = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE online!=0"); Field *fields2 = resultClient->Fetch(); uint32 clientcount = fields2[0].GetUInt32();
-
if I get what you mean right...why not just create couple of characters which will not be used by anyone and set online=2 (doesn't have to be 1 just different from 0)
btw you tested it ? does it work?
-
what about somethign like this?
if ((damagetype == DIRECT_DAMAGE || damagetype == SPELL_DIRECT_DAMAGE) &&
-
seems like all files got deleted - reuploaded
here is my first attempt, I haven't tested it, if anyone interested please test...doesn't require any additional SQL just set online=1 to few chars in your DB
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index a598130..ef573cc 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -73,169 +73,71 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data ) sLog.outDebug( "WORLD: Recvd CMSG_WHO Message" ); //recv_data.hexlike(); - uint32 clientcount = 0; +/*//KICHO: GUILD selection (still in progress - not implemented yet) + QueryResult *resultGuild = CharacterDatabase.PQuery("SELECT guildid FROM guild_member WHERE guid IN (SELECT guid FROM characters WHERE online!=0 order by guid)"); - uint32 level_min, level_max, racemask, classmask, zones_count, str_count; - uint32 zoneids[10]; // 10 is client limit - std::string player_name, guild_name; + Field *fields3 = resultGuild->Fetch(); + + std::string guild_name = fields3[0].GetCppString(); + std::string wguild_name = fields3[0].GetCppString(); + std::string gname = fields3[0].GetCppString(); + std::string wgname = fields3[0].GetCppString();*/ - recv_data >> level_min; // maximal player level, default 0 - recv_data >> level_max; // minimal player level, default 100 (MAX_LEVEL) - recv_data >> player_name; // player name, case sensitive... - - recv_data >> guild_name; // guild name, case sensitive... - - recv_data >> racemask; // race mask - recv_data >> classmask; // class mask - recv_data >> zones_count; // zones count, client limit=10 (2.0.10) - - if(zones_count > 10) - return; // can't be received from real client or broken packet - - for(uint32 i = 0; i < zones_count; ++i) - { - uint32 temp; - recv_data >> temp; // zone id, 0 if zone is unknown... - zoneids[i] = temp; - sLog.outDebug("Zone %u: %u", i, zoneids[i]); - } +//KICHO: count "online" players via DB + QueryResult *resultClient = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE online!=0"); - recv_data >> str_count; // user entered strings count, client limit=4 (checked on 2.0.10) + Field *fields2 = resultClient->Fetch(); - if(str_count > 4) - return; // can't be received from real client or broken packet + uint32 clientcount = fields2[0].GetUInt32(); - sLog.outDebug("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count); +//KICHO: Get "online" players stats for who list 0 1 2 3 4 5 6 + QueryResult *result = CharacterDatabase.PQuery("SELECT guid,name,race,class,gender,level,zone FROM characters WHERE guid IN (SELECT guid FROM characters WHERE online!=0 order by guid)"); - std::wstring str[4]; // 4 is client limit - for(uint32 i = 0; i < str_count; ++i) - { - std::string temp; - recv_data >> temp; // user entered string, it used as universal search pattern(guild+player name)? + Field *fields = result->Fetch(); - if(!Utf8toWStr(temp,str[i])) - continue; + //KICHO: values taken from query + uint32 level_min = fields[5].GetUInt32(); + uint32 level_max = fields[5].GetUInt32(); + uint32 racemask = fields[2].GetUInt32(); + uint32 classmask = fields[3].GetUInt32(); + uint32 zones_count = fields[6].GetUInt32(); - wstrToLower(str[i]); + std::string player_name = fields[1].GetCppString(); //player name + std::string guild_name = fields[1].GetCppString(); //guild name (not implemented yet) - sLog.outDebug("String %u: %s", i, temp.c_str()); - } + //KICHO: recv_data + recv_data >> level_min; // maximal player level, default 0 + recv_data >> level_max; // minimal player level, default 100 (MAX_LEVEL) + recv_data >> player_name; // player name, case sensitive... - std::wstring wplayer_name; - std::wstring wguild_name; - if(!(Utf8toWStr(player_name, wplayer_name) && Utf8toWStr(guild_name, wguild_name))) - return; - wstrToLower(wplayer_name); - wstrToLower(wguild_name); + recv_data >> guild_name; // guild name, case sensitive... - // client send in case not set max level value 100 but mangos support 255 max level, - // update it to show GMs with characters after 100 level - if(level_max >= MAX_LEVEL) - level_max = STRONG_MAX_LEVEL; + recv_data >> racemask; // race mask + recv_data >> classmask; // class mask + recv_data >> zones_count; // zones count, client limit=10 (2.0.10) - uint32 team = _player->GetTeam(); - uint32 security = GetSecurity(); - bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST); - AccountTypes gmLevelInWhoList = (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST); + //KICHO: more string values + std::string wplayer_name = fields[1].GetCppString(); //player name + std::string wguild_name = fields[1].GetCppString(); //guild name (not implemented yet) + //KICHO: client count packet WorldPacket data( SMSG_WHO, 50 ); // guess size data << uint32(clientcount); // clientcount place holder, listed count data << uint32(clientcount); // clientcount place holder, online count - // TODO: Guard Player map - HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers(); - for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) - { - if (security == SEC_PLAYER) - { - // player can see member of other team only if CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST - if (itr->second->GetTeam() != team && !allowTwoSideWhoList ) - continue; + //KICHO: values taken from query + uint32 race = fields[2].GetUInt32(); //player race + uint32 class_ = fields[3].GetUInt32(); //player class + uint32 lvl = fields[5].GetUInt32(); //player level + uint32 pzoneid = fields[6].GetUInt32(); //player in zone - // player can see MODERATOR, GAME MASTER, ADMINISTRATOR only if CONFIG_GM_IN_WHO_LIST - if (itr->second->GetSession()->GetSecurity() > gmLevelInWhoList) - continue; - } - - // do not process players which are not in world - if(!(itr->second->IsInWorld())) - continue; - - // check if target is globally visible for player - if (!(itr->second->IsVisibleGloballyFor(_player))) - continue; - - // check if target's level is in level range - uint32 lvl = itr->second->getLevel(); - if (lvl < level_min || lvl > level_max) - continue; - - // check if class matches classmask - uint32 class_ = itr->second->getClass(); - if (!(classmask & (1 << class_))) - continue; - - // check if race matches racemask - uint32 race = itr->second->getRace(); - if (!(racemask & (1 << race))) - continue; - - uint32 pzoneid = itr->second->GetZoneId(); - - bool z_show = true; - for(uint32 i = 0; i < zones_count; ++i) - { - if(zoneids[i] == pzoneid) - { - z_show = true; - break; - } - - z_show = false; - } - if (!z_show) - continue; - - std::string pname = itr->second->GetName(); - std::wstring wpname; - if(!Utf8toWStr(pname,wpname)) - continue; - wstrToLower(wpname); - - if (!(wplayer_name.empty() || wpname.find(wplayer_name) != std::wstring::npos)) - continue; - - std::string gname = sObjectMgr.GetGuildNameById(itr->second->GetGuildId()); - std::wstring wgname; - if(!Utf8toWStr(gname,wgname)) - continue; - wstrToLower(wgname); - - if (!(wguild_name.empty() || wgname.find(wguild_name) != std::wstring::npos)) - continue; - - std::string aname; - if(AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(itr->second->GetZoneId())) - aname = areaEntry->area_name[GetSessionDbcLocale()]; - - bool s_show = true; - for(uint32 i = 0; i < str_count; ++i) - { - if (!str[i].empty()) - { - if (wgname.find(str[i]) != std::wstring::npos || - wpname.find(str[i]) != std::wstring::npos || - Utf8FitTo(aname, str[i]) ) - { - s_show = true; - break; - } - s_show = false; - } - } - if (!s_show) - continue; + //KICHO: more string values + std::string pname = fields[1].GetCppString(); //player name + std::string gname = fields[1].GetCppString(); //guild name (not implemented yet) + std::string wpname = fields[1].GetCppString(); //player name + std::string wgname = fields[1].GetCppString(); //guild name (not implemented yet) + //KICHO: sending data from query data << pname; // player name data << gname; // guild name data << uint32( lvl ); // player level @@ -244,14 +146,9 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data ) data << uint8(0); // new 2.4.0 data << uint32( pzoneid ); // player zone id - // 50 is maximum player count sent to client - if ((++clientcount) == 50) - break; - } - uint32 count = m.size(); - data.put( 0, clientcount ); // insert right count, listed count - data.put( 4, count > 50 ? count : clientcount ); // insert right count, online count + data.put( 0, clientcount ); // insert right count, listed count + data.put( 4, clientcount ); // insert right count, online count SendPacket(&data); sLog.outDebug( "WORLD: Send SMSG_WHO Message" );
-
here is my first attempt, I haven't tested it, if anyone interested please test...
doesn't require any additional SQL just set online=1 to few chars in your DB
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index a598130..ef573cc 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -73,169 +73,71 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data ) sLog.outDebug( "WORLD: Recvd CMSG_WHO Message" ); //recv_data.hexlike(); - uint32 clientcount = 0; +/*//KICHO: GUILD selection (still in progress - not implemented yet) + QueryResult *resultGuild = CharacterDatabase.PQuery("SELECT guildid FROM guild_member WHERE guid IN (SELECT guid FROM characters WHERE online!=0 order by guid)"); - uint32 level_min, level_max, racemask, classmask, zones_count, str_count; - uint32 zoneids[10]; // 10 is client limit - std::string player_name, guild_name; + Field *fields3 = resultGuild->Fetch(); + + std::string guild_name = fields3[0].GetCppString(); + std::string wguild_name = fields3[0].GetCppString(); + std::string gname = fields3[0].GetCppString(); + std::string wgname = fields3[0].GetCppString();*/ - recv_data >> level_min; // maximal player level, default 0 - recv_data >> level_max; // minimal player level, default 100 (MAX_LEVEL) - recv_data >> player_name; // player name, case sensitive... - - recv_data >> guild_name; // guild name, case sensitive... - - recv_data >> racemask; // race mask - recv_data >> classmask; // class mask - recv_data >> zones_count; // zones count, client limit=10 (2.0.10) - - if(zones_count > 10) - return; // can't be received from real client or broken packet - - for(uint32 i = 0; i < zones_count; ++i) - { - uint32 temp; - recv_data >> temp; // zone id, 0 if zone is unknown... - zoneids[i] = temp; - sLog.outDebug("Zone %u: %u", i, zoneids[i]); - } +//KICHO: count "online" players via DB + QueryResult *resultClient = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE online!=0"); - recv_data >> str_count; // user entered strings count, client limit=4 (checked on 2.0.10) + Field *fields2 = resultClient->Fetch(); - if(str_count > 4) - return; // can't be received from real client or broken packet + uint32 clientcount = fields2[0].GetUInt32(); - sLog.outDebug("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count); +//KICHO: Get "online" players stats for who list 0 1 2 3 4 5 6 + QueryResult *result = CharacterDatabase.PQuery("SELECT guid,name,race,class,gender,level,zone FROM characters WHERE guid IN (SELECT guid FROM characters WHERE online!=0 order by name)"); - std::wstring str[4]; // 4 is client limit - for(uint32 i = 0; i < str_count; ++i) - { - std::string temp; - recv_data >> temp; // user entered string, it used as universal search pattern(guild+player name)? + Field *fields = result->Fetch(); - if(!Utf8toWStr(temp,str[i])) - continue; + //KICHO: values taken from query + uint32 level_min = fields[5].GetUInt32(); + uint32 level_max = fields[5].GetUInt32(); + uint32 racemask = fields[2].GetUInt32(); + uint32 classmask = fields[3].GetUInt32(); + uint32 zones_count = fields[6].GetUInt32(); - wstrToLower(str[i]); + std::string player_name = fields[1].GetCppString(); //player name + std::string guild_name = fields[1].GetCppString(); //guild name (not implemented yet) - sLog.outDebug("String %u: %s", i, temp.c_str()); - } + //KICHO: recv_data + recv_data >> level_min; // maximal player level, default 0 + recv_data >> level_max; // minimal player level, default 100 (MAX_LEVEL) + recv_data >> player_name; // player name, case sensitive... - std::wstring wplayer_name; - std::wstring wguild_name; - if(!(Utf8toWStr(player_name, wplayer_name) && Utf8toWStr(guild_name, wguild_name))) - return; - wstrToLower(wplayer_name); - wstrToLower(wguild_name); + recv_data >> guild_name; // guild name, case sensitive... - // client send in case not set max level value 100 but mangos support 255 max level, - // update it to show GMs with characters after 100 level - if(level_max >= MAX_LEVEL) - level_max = STRONG_MAX_LEVEL; + recv_data >> racemask; // race mask + recv_data >> classmask; // class mask + recv_data >> zones_count; // zones count, client limit=10 (2.0.10) - uint32 team = _player->GetTeam(); - uint32 security = GetSecurity(); - bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST); - AccountTypes gmLevelInWhoList = (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST); + //KICHO: more string values + std::string wplayer_name = fields[1].GetCppString(); //player name + std::string wguild_name = fields[1].GetCppString(); //guild name (not implemented yet) + //KICHO: client count packet WorldPacket data( SMSG_WHO, 50 ); // guess size data << uint32(clientcount); // clientcount place holder, listed count data << uint32(clientcount); // clientcount place holder, online count - // TODO: Guard Player map - HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers(); - for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) - { - if (security == SEC_PLAYER) - { - // player can see member of other team only if CONFIG_BOOL_ALLOW_TWO_SIDE_WHO_LIST - if (itr->second->GetTeam() != team && !allowTwoSideWhoList ) - continue; + //KICHO: values taken from query + uint32 race = fields[2].GetUInt32(); //player race + uint32 class_ = fields[3].GetUInt32(); //player class + uint32 lvl = fields[5].GetUInt32(); //player level + uint32 pzoneid = fields[6].GetUInt32(); //player in zone - // player can see MODERATOR, GAME MASTER, ADMINISTRATOR only if CONFIG_GM_IN_WHO_LIST - if (itr->second->GetSession()->GetSecurity() > gmLevelInWhoList) - continue; - } - - // do not process players which are not in world - if(!(itr->second->IsInWorld())) - continue; - - // check if target is globally visible for player - if (!(itr->second->IsVisibleGloballyFor(_player))) - continue; - - // check if target's level is in level range - uint32 lvl = itr->second->getLevel(); - if (lvl < level_min || lvl > level_max) - continue; - - // check if class matches classmask - uint32 class_ = itr->second->getClass(); - if (!(classmask & (1 << class_))) - continue; - - // check if race matches racemask - uint32 race = itr->second->getRace(); - if (!(racemask & (1 << race))) - continue; - - uint32 pzoneid = itr->second->GetZoneId(); - - bool z_show = true; - for(uint32 i = 0; i < zones_count; ++i) - { - if(zoneids[i] == pzoneid) - { - z_show = true; - break; - } - - z_show = false; - } - if (!z_show) - continue; - - std::string pname = itr->second->GetName(); - std::wstring wpname; - if(!Utf8toWStr(pname,wpname)) - continue; - wstrToLower(wpname); - - if (!(wplayer_name.empty() || wpname.find(wplayer_name) != std::wstring::npos)) - continue; - - std::string gname = sObjectMgr.GetGuildNameById(itr->second->GetGuildId()); - std::wstring wgname; - if(!Utf8toWStr(gname,wgname)) - continue; - wstrToLower(wgname); - - if (!(wguild_name.empty() || wgname.find(wguild_name) != std::wstring::npos)) - continue; - - std::string aname; - if(AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(itr->second->GetZoneId())) - aname = areaEntry->area_name[GetSessionDbcLocale()]; - - bool s_show = true; - for(uint32 i = 0; i < str_count; ++i) - { - if (!str[i].empty()) - { - if (wgname.find(str[i]) != std::wstring::npos || - wpname.find(str[i]) != std::wstring::npos || - Utf8FitTo(aname, str[i]) ) - { - s_show = true; - break; - } - s_show = false; - } - } - if (!s_show) - continue; + //KICHO: more string values + std::string pname = fields[1].GetCppString(); //player name + std::string gname = fields[1].GetCppString(); //guild name (not implemented yet) + std::string wpname = fields[1].GetCppString(); //player name + std::string wgname = fields[1].GetCppString(); //guild name (not implemented yet) + //KICHO: sending data from query data << pname; // player name data << gname; // guild name data << uint32( lvl ); // player level @@ -244,14 +146,9 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data ) data << uint8(0); // new 2.4.0 data << uint32( pzoneid ); // player zone id - // 50 is maximum player count sent to client - if ((++clientcount) == 50) - break; - } - uint32 count = m.size(); - data.put( 0, clientcount ); // insert right count, listed count - data.put( 4, count > 50 ? count : clientcount ); // insert right count, online count + data.put( 0, clientcount ); // insert right count, listed count + data.put( 4, clientcount ); // insert right count, online count SendPacket(&data); sLog.outDebug( "WORLD: Send SMSG_WHO Message" );
-
any errors on console?
[10267][Typo] AuctionHouseMgr.cpp
in ... acceptedOld
Posted
every bit helps, this can also be usefull for example in code search ...when developer wants to find this line by search and can't because of a typo...