{"action":"created","comment":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/50730967","id":50730967,"diff_hunk":"@@ -0,0 +1,190 @@\n+/*\n+ * Copyright (C) 2008-2015 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 \"PetPackets.h\"\n+\n+WorldPacket const* WorldPackets::Pets::PetSpells::Write()\n+{\n+    _worldPacket << PetGUID;\n+    _worldPacket << int16(CreatureFamily);\n+    _worldPacket << int16(Specialization);\n+    _worldPacket << int32(TimeLimit);\n+\n+    uint32 petModeAndOrders = ReactState + (CommandState << 8) + (Flag << 16);\n+    _worldPacket << uint32(petModeAndOrders);\n+\n+    for (uint32 actionButton : ActionButtons)\n+        _worldPacket << int32(actionButton);\n+\n+    _worldPacket << int32(Actions.size());\n+    _worldPacket << int32(Cooldowns.size());\n+    _worldPacket << int32(SpellHistory.size());\n+\n+    for (uint32 action : Actions)\n+        _worldPacket << action;\n+\n+    for (PetSpellCooldown const& cooldown : Cooldowns)\n+    {\n+        _worldPacket << int32(cooldown.SpellID);\n+        _worldPacket << int32(cooldown.Duration);\n+        _worldPacket << int32(cooldown.CategoryDuration);\n+        _worldPacket << int16(cooldown.Category);\n+    }\n+\n+    for (PetSpellHistory const& history : SpellHistory)\n+    {\n+        _worldPacket << int32(history.CategoryID);\n+        _worldPacket << int32(history.RecoveryTime);\n+        _worldPacket << int8(history.ConsumedCharges);\n+    }\n+\n+    return &_worldPacket;\n+}\n+\n+WorldPacket const* WorldPackets::Pets::PetStableList::Write()\n+{\n+    _worldPacket << StableMaster;\n+\n+    _worldPacket << Pets.size();\n+    for (PetStableInfo const& pet : Pets)\n+    {\n+        _worldPacket << int32(pet.PetSlot);\n+        _worldPacket << int32(pet.PetNumber);\n+        _worldPacket << int32(pet.CreatureID);\n+        _worldPacket << int32(pet.DisplayID);\n+        _worldPacket << int32(pet.ExperienceLevel);\n+        _worldPacket << int32(pet.PetFlags);\n+\n+        _worldPacket << int8(pet.PetName.length());\n+        _worldPacket.WriteString(pet.PetName);\n+    }\n+\n+    return &_worldPacket;\n+}\n+\n+WorldPacket const* WorldPackets::Pets::PetLearnedSpells::Write()\n+{\n+    _worldPacket << uint32(Spells.size());\n+    for (uint32 spell : Spells)\n+        _worldPacket << int32(spell);\n+    return &_worldPacket;\n+}\n+\n+WorldPacket const* WorldPackets::Pets::PetUnlearnedSpells::Write()\n+{\n+    _worldPacket << uint32(Spells.size());\n+    for (uint32 spell : Spells)\n+        _worldPacket << int32(spell);\n+    return &_worldPacket;\n+}\n+\n+WorldPacket const* WorldPackets::Pets::PetNameInvalid::Write()\n+{\n+    _worldPacket << RenameData.PetGUID;\n+    _worldPacket << int32(RenameData.PetNumber);\n+\n+    _worldPacket << uint8(RenameData.NewName.length());\n+\n+    _worldPacket.WriteBit(RenameData.HasDeclinedNames);\n+    if (RenameData.HasDeclinedNames)\n+    {\n+        for (int i = 0; i < MAX_DECLINED_NAME_CASES; i++)\n+            _worldPacket.WriteBits(RenameData.DeclinedNames.name[i].length(), 7);\n+\n+        for (int i = 0; i < MAX_DECLINED_NAME_CASES; i++)\n+            _worldPacket << RenameData.DeclinedNames.name[i];\n+    }\n+\n+    _worldPacket.WriteString(RenameData.NewName);\n+    return &_worldPacket;\n+}\n+\n+void WorldPackets::Pets::PetRename::Read()\n+{\n+    _worldPacket >> RenameData.PetGUID;\n+    _worldPacket >> RenameData.PetNumber;\n+\n+    int8 nameLen = 0;\n+    _worldPacket >> nameLen;\n+\n+    RenameData.HasDeclinedNames = _worldPacket.ReadBit();\n+    if (RenameData.HasDeclinedNames)\n+    {\n+        int count[MAX_DECLINED_NAME_CASES];\n+        for (int i = 0; i < MAX_DECLINED_NAME_CASES; i++)\n+        {\n+            count[i] = _worldPacket.ReadBits(7);\n+            _worldPacket.FlushBits();\n+        }\n+\n+        for (int i = 0; i < MAX_DECLINED_NAME_CASES; i++)\n+        {\n+            RenameData.DeclinedNames.name[i] = _worldPacket.ReadString(count[i]);\n+            _worldPacket.FlushBits();","path":"src/server/game/Server/Packets/PetPackets.cpp","position":137,"original_position":137,"commit_id":"b2a8385da89f21b0eb3fdb0287fcd4cf5cfdc572","original_commit_id":"b2a8385da89f21b0eb3fdb0287fcd4cf5cfdc572","user":{"login":"MitchesD","id":4765599,"avatar_url":"https://avatars.githubusercontent.com/u/4765599?v=3","gravatar_id":"","url":"https://api.github.com/users/MitchesD","html_url":"https://github.com/MitchesD","followers_url":"https://api.github.com/users/MitchesD/followers","following_url":"https://api.github.com/users/MitchesD/following{/other_user}","gists_url":"https://api.github.com/users/MitchesD/gists{/gist_id}","starred_url":"https://api.github.com/users/MitchesD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MitchesD/subscriptions","organizations_url":"https://api.github.com/users/MitchesD/orgs","repos_url":"https://api.github.com/users/MitchesD/repos","events_url":"https://api.github.com/users/MitchesD/events{/privacy}","received_events_url":"https://api.github.com/users/MitchesD/received_events","type":"User","site_admin":false},"body":"remove it","created_at":"2016-01-25T18:06:22Z","updated_at":"2016-01-25T18:06:22Z","html_url":"https://github.com/TrinityCore/TrinityCore/pull/16387#discussion_r50730967","pull_request_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/16387","_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments/50730967"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/16387#discussion_r50730967"},"pull_request":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/16387"}}},"pull_request":{"url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/16387","id":57107070,"html_url":"https://github.com/TrinityCore/TrinityCore/pull/16387","diff_url":"https://github.com/TrinityCore/TrinityCore/pull/16387.diff","patch_url":"https://github.com/TrinityCore/TrinityCore/pull/16387.patch","issue_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/16387","number":16387,"state":"open","locked":false,"title":"[6.x] Core/PacketIO: Update and enable most pet packets","user":{"login":"myran2","id":196247,"avatar_url":"https://avatars.githubusercontent.com/u/196247?v=3","gravatar_id":"","url":"https://api.github.com/users/myran2","html_url":"https://github.com/myran2","followers_url":"https://api.github.com/users/myran2/followers","following_url":"https://api.github.com/users/myran2/following{/other_user}","gists_url":"https://api.github.com/users/myran2/gists{/gist_id}","starred_url":"https://api.github.com/users/myran2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myran2/subscriptions","organizations_url":"https://api.github.com/users/myran2/orgs","repos_url":"https://api.github.com/users/myran2/repos","events_url":"https://api.github.com/users/myran2/events{/privacy}","received_events_url":"https://api.github.com/users/myran2/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-25T18:02:09Z","updated_at":"2016-01-25T18:06:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63fc0da8d34175f8848d04df7a0684a1a668b0d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/16387/commits","review_comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/16387/comments","review_comment_url":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/16387/comments","statuses_url":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/b2a8385da89f21b0eb3fdb0287fcd4cf5cfdc572","head":{"label":"myran2:pets","ref":"pets","sha":"b2a8385da89f21b0eb3fdb0287fcd4cf5cfdc572","user":{"login":"myran2","id":196247,"avatar_url":"https://avatars.githubusercontent.com/u/196247?v=3","gravatar_id":"","url":"https://api.github.com/users/myran2","html_url":"https://github.com/myran2","followers_url":"https://api.github.com/users/myran2/followers","following_url":"https://api.github.com/users/myran2/following{/other_user}","gists_url":"https://api.github.com/users/myran2/gists{/gist_id}","starred_url":"https://api.github.com/users/myran2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myran2/subscriptions","organizations_url":"https://api.github.com/users/myran2/orgs","repos_url":"https://api.github.com/users/myran2/repos","events_url":"https://api.github.com/users/myran2/events{/privacy}","received_events_url":"https://api.github.com/users/myran2/received_events","type":"User","site_admin":false},"repo":{"id":47720502,"name":"TrinityCore","full_name":"myran2/TrinityCore","owner":{"login":"myran2","id":196247,"avatar_url":"https://avatars.githubusercontent.com/u/196247?v=3","gravatar_id":"","url":"https://api.github.com/users/myran2","html_url":"https://github.com/myran2","followers_url":"https://api.github.com/users/myran2/followers","following_url":"https://api.github.com/users/myran2/following{/other_user}","gists_url":"https://api.github.com/users/myran2/gists{/gist_id}","starred_url":"https://api.github.com/users/myran2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myran2/subscriptions","organizations_url":"https://api.github.com/users/myran2/orgs","repos_url":"https://api.github.com/users/myran2/repos","events_url":"https://api.github.com/users/myran2/events{/privacy}","received_events_url":"https://api.github.com/users/myran2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/myran2/TrinityCore","description":"TrinityCore Open Source MMO Framework","fork":true,"url":"https://api.github.com/repos/myran2/TrinityCore","forks_url":"https://api.github.com/repos/myran2/TrinityCore/forks","keys_url":"https://api.github.com/repos/myran2/TrinityCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/myran2/TrinityCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/myran2/TrinityCore/teams","hooks_url":"https://api.github.com/repos/myran2/TrinityCore/hooks","issue_events_url":"https://api.github.com/repos/myran2/TrinityCore/issues/events{/number}","events_url":"https://api.github.com/repos/myran2/TrinityCore/events","assignees_url":"https://api.github.com/repos/myran2/TrinityCore/assignees{/user}","branches_url":"https://api.github.com/repos/myran2/TrinityCore/branches{/branch}","tags_url":"https://api.github.com/repos/myran2/TrinityCore/tags","blobs_url":"https://api.github.com/repos/myran2/TrinityCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/myran2/TrinityCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/myran2/TrinityCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/myran2/TrinityCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/myran2/TrinityCore/statuses/{sha}","languages_url":"https://api.github.com/repos/myran2/TrinityCore/languages","stargazers_url":"https://api.github.com/repos/myran2/TrinityCore/stargazers","contributors_url":"https://api.github.com/repos/myran2/TrinityCore/contributors","subscribers_url":"https://api.github.com/repos/myran2/TrinityCore/subscribers","subscription_url":"https://api.github.com/repos/myran2/TrinityCore/subscription","commits_url":"https://api.github.com/repos/myran2/TrinityCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/myran2/TrinityCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/myran2/TrinityCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/myran2/TrinityCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/myran2/TrinityCore/contents/{+path}","compare_url":"https://api.github.com/repos/myran2/TrinityCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/myran2/TrinityCore/merges","archive_url":"https://api.github.com/repos/myran2/TrinityCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/myran2/TrinityCore/downloads","issues_url":"https://api.github.com/repos/myran2/TrinityCore/issues{/number}","pulls_url":"https://api.github.com/repos/myran2/TrinityCore/pulls{/number}","milestones_url":"https://api.github.com/repos/myran2/TrinityCore/milestones{/number}","notifications_url":"https://api.github.com/repos/myran2/TrinityCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/myran2/TrinityCore/labels{/name}","releases_url":"https://api.github.com/repos/myran2/TrinityCore/releases{/id}","deployments_url":"https://api.github.com/repos/myran2/TrinityCore/deployments","created_at":"2015-12-09T21:37:23Z","updated_at":"2015-12-09T21:37:37Z","pushed_at":"2016-01-25T18:00:50Z","git_url":"git://github.com/myran2/TrinityCore.git","ssh_url":"git@github.com:myran2/TrinityCore.git","clone_url":"https://github.com/myran2/TrinityCore.git","svn_url":"https://github.com/myran2/TrinityCore","homepage":"http://www.trinitycore.org","size":368072,"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":"6.x"}},"base":{"label":"TrinityCore:6.x","ref":"6.x","sha":"11ad71e2fc322c8e109ffe8cd8c52332a26048bf","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-01-24T11:13:10Z","pushed_at":"2016-01-25T18:02:09Z","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":757808,"stargazers_count":3108,"watchers_count":3108,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3253,"mirror_url":null,"open_issues_count":1355,"forks":3253,"open_issues":1355,"watchers":3108,"default_branch":"6.x"}},"_links":{"self":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/16387"},"html":{"href":"https://github.com/TrinityCore/TrinityCore/pull/16387"},"issue":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/16387"},"comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/16387/comments"},"review_comments":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/16387/comments"},"review_comment":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/pulls/16387/commits"},"statuses":{"href":"https://api.github.com/repos/TrinityCore/TrinityCore/statuses/b2a8385da89f21b0eb3fdb0287fcd4cf5cfdc572"}}}}