{"action":"created","comment":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/93945610","pull_request_review_id":14476805,"id":93945610,"diff_hunk":"@@ -0,0 +1,65 @@\n+/*\n+* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>\n+*\n+* This program is free software; you can redistribute it and/or modify it\n+* under the terms of the GNU General Public License as published by the\n+* Free Software Foundation; either version 2 of the License, or (at your\n+* option) any later version.\n+*\n+* This program is distributed in the hope that it will be useful, but WITHOUT\n+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n+* more details.\n+*\n+* You should have received a copy of the GNU General Public License along\n+* with this program. If not, see <http://www.gnu.org/licenses/>.\n+*/\n+\n+#include \"WhoListStorage.h\"\n+#include \"World.h\"\n+#include \"ObjectAccessor.h\"\n+#include \"Player.h\"\n+#include \"GuildMgr.h\"\n+#include \"WorldSession.h\"\n+\n+WhoListStorageMgr* WhoListStorageMgr::instance()\n+{\n+    static WhoListStorageMgr instance;\n+    return &instance;\n+}\n+\n+void WhoListStorageMgr::Update()\n+{\n+    // clear current list\n+    _whoListStorage.clear();\n+    _whoListStorage.reserve(sWorld->GetPlayerCount()+1);\n+\n+    boost::shared_lock<boost::shared_mutex> lock(*HashMapHolder<Player>::GetLock());\n+\n+    HashMapHolder<Player>::MapType const& m = ObjectAccessor::GetPlayers();\n+    for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)\n+    {\n+        if (!itr->second->FindMap() || itr->second->GetSession()->PlayerLoading())\n+            continue;\n+\n+        std::string pname = itr->second->GetName();\n+        std::wstring wpname;\n+        if (!Utf8toWStr(pname, wpname))\n+            continue;\n+        wstrToLower(wpname);\n+\n+        std::string gname = sGuildMgr->GetGuildNameById(itr->second->GetGuildId());\n+        std::wstring wgname;\n+        if (!Utf8toWStr(gname, wgname))\n+            continue;\n+        wstrToLower(wgname);\n+\n+        std::string aname;\n+        if (AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(itr->second->GetZoneId()))\n+            aname = areaEntry->area_name[sWorld->GetDefaultDbcLocale()];","path":"src/server/game/Storages/WhoListStorage.cpp","position":59,"original_position":59,"commit_id":"ab20d3e90edbb2bf90ae7a549566d0e5a68bc318","original_commit_id":"ab20d3e90edbb2bf90ae7a549566d0e5a68bc318","user":{"login":"Shauren","id":297439,"avatar_url":"https://avatars.githubusercontent.com/u/297439?v=3","gravatar_id":"","url":"https://api.github.com/users/Shauren","html_url":"https://github.com/Shauren","followers_url":"https://api.github.com/users/Shauren/followers","following_url":"https://api.github.com/users/Shauren/following{/other_user}","gists_url":"https://api.github.com/users/Shauren/gists{/gist_id}","starred_url":"https://api.github.com/users/Shauren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shauren/subscriptions","organizations_url":"https://api.github.com/users/Shauren/orgs","repos_url":"https://api.github.com/users/Shauren/repos","events_url":"https://api.github.com/users/Shauren/events{/privacy}","received_events_url":"https://api.github.com/users/Shauren/received_events","type":"User","site_admin":false},"body":"you must not store the area name, this will break lookups in other locales","created_at":"2016-12-27T16:10:27Z","updated_at":"2016-12-27T16:13:03Z","html_url":"https://github.com/TrinityCore/TrinityCore/pull/18636#discussion_r93945610","pull_request_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/18636","_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/93945610"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/18636#discussion_r93945610"},"pull_request":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/18636"}}},"pull_request":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/18636","id":99459051,"html_url":"https://github.com/TrinityCore/TrinityCore/pull/18636","diff_url":"https://github.com/TrinityCore/TrinityCore/pull/18636.diff","patch_url":"https://github.com/TrinityCore/TrinityCore/pull/18636.patch","issue_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/18636","number":18636,"state":"open","locked":false,"title":"Remade who list processing","user":{"login":"xinef1","id":2781353,"avatar_url":"https://avatars.githubusercontent.com/u/2781353?v=3","gravatar_id":"","url":"https://api.github.com/users/xinef1","html_url":"https://github.com/xinef1","followers_url":"https://api.github.com/users/xinef1/followers","following_url":"https://api.github.com/users/xinef1/following{/other_user}","gists_url":"https://api.github.com/users/xinef1/gists{/gist_id}","starred_url":"https://api.github.com/users/xinef1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xinef1/subscriptions","organizations_url":"https://api.github.com/users/xinef1/orgs","repos_url":"https://api.github.com/users/xinef1/repos","events_url":"https://api.github.com/users/xinef1/events{/privacy}","received_events_url":"https://api.github.com/users/xinef1/received_events","type":"User","site_admin":false},"body":"**Target branch(es):** 3.3.5\r\n\r\n- [x] 3.3.5\r\n\r\n**Issues addressed:** References #14274\r\n\r\n**Tests performed:** Compiles and basic ingame tests\r\n\r\nRequests are now processed in maps. Player entries are now copied every 5 seconds to dedicated storage (avoids usage of hashmapholder mutex)\r\n\r\n**Improvements:** Move processing to separate thread","created_at":"2016-12-27T16:04:29Z","updated_at":"2016-12-27T16:13:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"927e834b7dd785820cb73f42f712c24728b8f9e8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/18636/commits","review_comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/18636/comments","review_comment_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/18636/comments","statuses_url":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/ab20d3e90edbb2bf90ae7a549566d0e5a68bc318","head":{"label":"xinef1:3.3.5who","ref":"3.3.5who","sha":"ab20d3e90edbb2bf90ae7a549566d0e5a68bc318","user":{"login":"xinef1","id":2781353,"avatar_url":"https://avatars.githubusercontent.com/u/2781353?v=3","gravatar_id":"","url":"https://api.github.com/users/xinef1","html_url":"https://github.com/xinef1","followers_url":"https://api.github.com/users/xinef1/followers","following_url":"https://api.github.com/users/xinef1/following{/other_user}","gists_url":"https://api.github.com/users/xinef1/gists{/gist_id}","starred_url":"https://api.github.com/users/xinef1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xinef1/subscriptions","organizations_url":"https://api.github.com/users/xinef1/orgs","repos_url":"https://api.github.com/users/xinef1/repos","events_url":"https://api.github.com/users/xinef1/events{/privacy}","received_events_url":"https://api.github.com/users/xinef1/received_events","type":"User","site_admin":false},"repo":{"id":77341514,"name":"TrinityCore","full_name":"xinef1/TrinityCore","owner":{"login":"xinef1","id":2781353,"avatar_url":"https://avatars.githubusercontent.com/u/2781353?v=3","gravatar_id":"","url":"https://api.github.com/users/xinef1","html_url":"https://github.com/xinef1","followers_url":"https://api.github.com/users/xinef1/followers","following_url":"https://api.github.com/users/xinef1/following{/other_user}","gists_url":"https://api.github.com/users/xinef1/gists{/gist_id}","starred_url":"https://api.github.com/users/xinef1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xinef1/subscriptions","organizations_url":"https://api.github.com/users/xinef1/orgs","repos_url":"https://api.github.com/users/xinef1/repos","events_url":"https://api.github.com/users/xinef1/events{/privacy}","received_events_url":"https://api.github.com/users/xinef1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xinef1/TrinityCore","description":"TrinityCore Open Source MMO Framework","fork":true,"url":"https://api.github.com/repos/xinef1/TrinityCore","forks_url":"https://api.github.com/repos/xinef1/TrinityCore/forks","keys_url":"https://api.github.com/repos/xinef1/TrinityCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xinef1/TrinityCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xinef1/TrinityCore/teams","hooks_url":"https://api.github.com/repos/xinef1/TrinityCore/hooks","issue_events_url":"https://api.github.com/repos/xinef1/TrinityCore/issues/events{/number}","events_url":"https://api.github.com/repos/xinef1/TrinityCore/events","assignees_url":"https://api.github.com/repos/xinef1/TrinityCore/assignees{/user}","branches_url":"https://api.github.com/repos/xinef1/TrinityCore/branches{/branch}","tags_url":"https://api.github.com/repos/xinef1/TrinityCore/tags","blobs_url":"https://api.github.com/repos/xinef1/TrinityCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xinef1/TrinityCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xinef1/TrinityCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/xinef1/TrinityCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xinef1/TrinityCore/statuses/{sha}","languages_url":"https://api.github.com/repos/xinef1/TrinityCore/languages","stargazers_url":"https://api.github.com/repos/xinef1/TrinityCore/stargazers","contributors_url":"https://api.github.com/repos/xinef1/TrinityCore/contributors","subscribers_url":"https://api.github.com/repos/xinef1/TrinityCore/subscribers","subscription_url":"https://api.github.com/repos/xinef1/TrinityCore/subscription","commits_url":"https://api.github.com/repos/xinef1/TrinityCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/xinef1/TrinityCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/xinef1/TrinityCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/xinef1/TrinityCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/xinef1/TrinityCore/contents/{+path}","compare_url":"https://api.github.com/repos/xinef1/TrinityCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xinef1/TrinityCore/merges","archive_url":"https://api.github.com/repos/xinef1/TrinityCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xinef1/TrinityCore/downloads","issues_url":"https://api.github.com/repos/xinef1/TrinityCore/issues{/number}","pulls_url":"https://api.github.com/repos/xinef1/TrinityCore/pulls{/number}","milestones_url":"https://api.github.com/repos/xinef1/TrinityCore/milestones{/number}","notifications_url":"https://api.github.com/repos/xinef1/TrinityCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xinef1/TrinityCore/labels{/name}","releases_url":"https://api.github.com/repos/xinef1/TrinityCore/releases{/id}","deployments_url":"https://api.github.com/repos/xinef1/TrinityCore/deployments","created_at":"2016-12-25T20:20:13Z","updated_at":"2016-12-25T20:20:30Z","pushed_at":"2016-12-27T16:07:46Z","git_url":"git://github.com/xinef1/TrinityCore.git","ssh_url":"git@github.com:xinef1/TrinityCore.git","clone_url":"https://github.com/xinef1/TrinityCore.git","svn_url":"https://github.com/xinef1/TrinityCore","homepage":"http://www.trinitycore.org","size":396358,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TrinityCore:3.3.5","ref":"3.3.5","sha":"b9146102f1ef573a32ec7b5a88a1e317cf67fa72","user":{"login":"TrinityCore","id":539602,"avatar_url":"https://avatars.githubusercontent.com/u/539602?v=3","gravatar_id":"","url":"https://api.github.com/users/TrinityCore","html_url":"https://github.com/TrinityCore","followers_url":"https://api.github.com/users/TrinityCore/followers","following_url":"https://api.github.com/users/TrinityCore/following{/other_user}","gists_url":"https://api.github.com/users/TrinityCore/gists{/gist_id}","starred_url":"https://api.github.com/users/TrinityCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrinityCore/subscriptions","organizations_url":"https://api.github.com/users/TrinityCore/orgs","repos_url":"https://api.github.com/users/TrinityCore/repos","events_url":"https://api.github.com/users/TrinityCore/events{/privacy}","received_events_url":"https://api.github.com/users/TrinityCore/received_events","type":"Organization","site_admin":false},"repo":{"id":1204412,"name":"TrinityCore","full_name":"TrinityCore/TrinityCore","owner":{"login":"TrinityCore","id":539602,"avatar_url":"https://avatars.githubusercontent.com/u/539602?v=3","gravatar_id":"","url":"https://api.github.com/users/TrinityCore","html_url":"https://github.com/TrinityCore","followers_url":"https://api.github.com/users/TrinityCore/followers","following_url":"https://api.github.com/users/TrinityCore/following{/other_user}","gists_url":"https://api.github.com/users/TrinityCore/gists{/gist_id}","starred_url":"https://api.github.com/users/TrinityCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrinityCore/subscriptions","organizations_url":"https://api.github.com/users/TrinityCore/orgs","repos_url":"https://api.github.com/users/TrinityCore/repos","events_url":"https://api.github.com/users/TrinityCore/events{/privacy}","received_events_url":"https://api.github.com/users/TrinityCore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TrinityCore/TrinityCore","description":"TrinityCore Open Source MMO Framework","fork":false,"url":"https://api.github.com/repos/TrinityCore/TrinityCore","forks_url":"https://api.github.com/repos/TrinityCore/TrinityCore/forks","keys_url":"https://api.github.com/repos/TrinityCore/TrinityCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TrinityCore/TrinityCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TrinityCore/TrinityCore/teams","hooks_url":"https://api.github.com/repos/TrinityCore/TrinityCore/hooks","issue_events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/events{/number}","events_url":"https://api.github.com/repos/TrinityCore/TrinityCore/events","assignees_url":"https://api.github.com/repos/TrinityCore/TrinityCore/assignees{/user}","branches_url":"https://api.github.com/repos/TrinityCore/TrinityCore/branches{/branch}","tags_url":"https://api.github.com/repos/TrinityCore/TrinityCore/tags","blobs_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/{sha}","languages_url":"https://api.github.com/repos/TrinityCore/TrinityCore/languages","stargazers_url":"https://api.github.com/repos/TrinityCore/TrinityCore/stargazers","contributors_url":"https://api.github.com/repos/TrinityCore/TrinityCore/contributors","subscribers_url":"https://api.github.com/repos/TrinityCore/TrinityCore/subscribers","subscription_url":"https://api.github.com/repos/TrinityCore/TrinityCore/subscription","commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/TrinityCore/TrinityCore/contents/{+path}","compare_url":"https://api.github.com/repos/TrinityCore/TrinityCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TrinityCore/TrinityCore/merges","archive_url":"https://api.github.com/repos/TrinityCore/TrinityCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TrinityCore/TrinityCore/downloads","issues_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues{/number}","pulls_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls{/number}","milestones_url":"https://api.github.com/repos/TrinityCore/TrinityCore/milestones{/number}","notifications_url":"https://api.github.com/repos/TrinityCore/TrinityCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TrinityCore/TrinityCore/labels{/name}","releases_url":"https://api.github.com/repos/TrinityCore/TrinityCore/releases{/id}","deployments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/deployments","created_at":"2010-12-28T23:40:07Z","updated_at":"2016-12-27T08:32:41Z","pushed_at":"2016-12-27T16:07:48Z","git_url":"git://github.com/TrinityCore/TrinityCore.git","ssh_url":"git@github.com:TrinityCore/TrinityCore.git","clone_url":"https://github.com/TrinityCore/TrinityCore.git","svn_url":"https://github.com/TrinityCore/TrinityCore","homepage":"http://www.trinitycore.org","size":396231,"stargazers_count":3574,"watchers_count":3574,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3620,"mirror_url":null,"open_issues_count":1303,"forks":3620,"open_issues":1303,"watchers":3574,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/18636"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/18636"},"issue":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/18636"},"comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/18636/comments"},"review_comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/18636/comments"},"review_comment":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/18636/commits"},"statuses":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/ab20d3e90edbb2bf90ae7a549566d0e5a68bc318"}}}}
{"actor":{"display_login":"Shauren"}}