{"action":"created","comment":{"url":"https://api.github.com/repos/Arcana/node-dota2/pulls/comments/130728926","pull_request_review_id":53637017,"id":130728926,"diff_hunk":"@@ -30,15 +29,54 @@ var cacheTypeIDs = {\n     CSODOTALobbyInvite : 2011\n };\n \n+\n+\n // Handlers\n+function handleCreateType(obj_type, object_data) {\n+    switch(obj_type) {\n+        case cacheTypeIDs.CSOEconItem:\n+            this.Logger.debug(\"Got an item traded\");\n+            var item = Dota2.schema.lookupType(\"CSOEconItem\").decode(object_data);\n+            this.emit(\"gotItem\", item);\n+            this.Inventory.push(item);\n+            break;\n+    }\n+}\n+\n+function handleDestroyType(obj_type, object_data) {\n+    switch(obj_type) {\n+        case cacheTypeIDs.CSODOTAPartyInvite:\n+            this.Logger.debug(\"Party invite cleared\");\n+            this.PartyInvite = null;\n+            this.emit(\"partyInviteCleared\");\n+            break;\n+        case cacheTypeIDs.CSODOTALobbyInvite:\n+            this.Logger.debug(\"Lobby invite cleared\");\n+            this.LobbyInvite = null;\n+            this.emit(\"lobbyInviteCleared\");\n+            break;\n+        case cacheTypeIDs.CSOEconItem:\n+            this.Logger.debug(\"Traded item away\");\n+            var item = Dota2.schema.lookupType(\"CSOEconItem\").decode(object_data);\n+            this.Inventory = this.Inventory.filter(i => item.id.equals(i.id));","path":"handlers/cache.js","position":42,"original_position":42,"commit_id":"4e44db352f807faac3f41e9f6159af2f0344303c","original_commit_id":"4e44db352f807faac3f41e9f6159af2f0344303c","user":{"login":"Ne3tCode","id":16063669,"avatar_url":"https://avatars3.githubusercontent.com/u/16063669?v=4","gravatar_id":"","url":"https://api.github.com/users/Ne3tCode","html_url":"https://github.com/Ne3tCode","followers_url":"https://api.github.com/users/Ne3tCode/followers","following_url":"https://api.github.com/users/Ne3tCode/following{/other_user}","gists_url":"https://api.github.com/users/Ne3tCode/gists{/gist_id}","starred_url":"https://api.github.com/users/Ne3tCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ne3tCode/subscriptions","organizations_url":"https://api.github.com/users/Ne3tCode/orgs","repos_url":"https://api.github.com/users/Ne3tCode/repos","events_url":"https://api.github.com/users/Ne3tCode/events{/privacy}","received_events_url":"https://api.github.com/users/Ne3tCode/received_events","type":"User","site_admin":false},"body":"Use `notEquals` (or `! equals`) if you want to remove a _single_ item from an array.\r\n\r\nIn addition:\r\n> Note that the `Inventory` property will be the old value until after this event completes to allow comparison between the two.\r\n\r\nSo you probably have to call `emit` _before_ `filter`.","created_at":"2017-08-01T21:08:15Z","updated_at":"2017-08-01T21:09:32Z","html_url":"https://github.com/Arcana/node-dota2/pull/521#discussion_r130728926","pull_request_url":"https://api.github.com/repos/Arcana/node-dota2/pulls/521","_links":{"self":{"href":"https://api.github.com/repos/Arcana/node-dota2/pulls/comments/130728926"},"html":{"href":"https://github.com/Arcana/node-dota2/pull/521#discussion_r130728926"},"pull_request":{"href":"https://api.github.com/repos/Arcana/node-dota2/pulls/521"}}},"pull_request":{"url":"https://api.github.com/repos/Arcana/node-dota2/pulls/521","id":133554409,"html_url":"https://github.com/Arcana/node-dota2/pull/521","diff_url":"https://github.com/Arcana/node-dota2/pull/521.diff","patch_url":"https://github.com/Arcana/node-dota2/pull/521.patch","issue_url":"https://api.github.com/repos/Arcana/node-dota2/issues/521","number":521,"state":"open","locked":false,"title":"Fixing fantasy cards, trading items and make account transforms more resilient","user":{"login":"Crazy-Duck","id":11719463,"avatar_url":"https://avatars0.githubusercontent.com/u/11719463?v=4","gravatar_id":"","url":"https://api.github.com/users/Crazy-Duck","html_url":"https://github.com/Crazy-Duck","followers_url":"https://api.github.com/users/Crazy-Duck/followers","following_url":"https://api.github.com/users/Crazy-Duck/following{/other_user}","gists_url":"https://api.github.com/users/Crazy-Duck/gists{/gist_id}","starred_url":"https://api.github.com/users/Crazy-Duck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Crazy-Duck/subscriptions","organizations_url":"https://api.github.com/users/Crazy-Duck/orgs","repos_url":"https://api.github.com/users/Crazy-Duck/repos","events_url":"https://api.github.com/users/Crazy-Duck/events{/privacy}","received_events_url":"https://api.github.com/users/Crazy-Duck/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-01T19:38:27Z","updated_at":"2017-08-01T21:09:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59e919a2d8306793d6de546a4a77090874fb1697","assignee":{"login":"Crazy-Duck","id":11719463,"avatar_url":"https://avatars0.githubusercontent.com/u/11719463?v=4","gravatar_id":"","url":"https://api.github.com/users/Crazy-Duck","html_url":"https://github.com/Crazy-Duck","followers_url":"https://api.github.com/users/Crazy-Duck/followers","following_url":"https://api.github.com/users/Crazy-Duck/following{/other_user}","gists_url":"https://api.github.com/users/Crazy-Duck/gists{/gist_id}","starred_url":"https://api.github.com/users/Crazy-Duck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Crazy-Duck/subscriptions","organizations_url":"https://api.github.com/users/Crazy-Duck/orgs","repos_url":"https://api.github.com/users/Crazy-Duck/repos","events_url":"https://api.github.com/users/Crazy-Duck/events{/privacy}","received_events_url":"https://api.github.com/users/Crazy-Duck/received_events","type":"User","site_admin":false},"assignees":[{"login":"Crazy-Duck","id":11719463,"avatar_url":"https://avatars0.githubusercontent.com/u/11719463?v=4","gravatar_id":"","url":"https://api.github.com/users/Crazy-Duck","html_url":"https://github.com/Crazy-Duck","followers_url":"https://api.github.com/users/Crazy-Duck/followers","following_url":"https://api.github.com/users/Crazy-Duck/following{/other_user}","gists_url":"https://api.github.com/users/Crazy-Duck/gists{/gist_id}","starred_url":"https://api.github.com/users/Crazy-Duck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Crazy-Duck/subscriptions","organizations_url":"https://api.github.com/users/Crazy-Duck/orgs","repos_url":"https://api.github.com/users/Crazy-Duck/repos","events_url":"https://api.github.com/users/Crazy-Duck/events{/privacy}","received_events_url":"https://api.github.com/users/Crazy-Duck/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Arcana/node-dota2/pulls/521/commits","review_comments_url":"https://api.github.com/repos/Arcana/node-dota2/pulls/521/comments","review_comment_url":"https://api.github.com/repos/Arcana/node-dota2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Arcana/node-dota2/issues/521/comments","statuses_url":"https://api.github.com/repos/Arcana/node-dota2/statuses/4e44db352f807faac3f41e9f6159af2f0344303c","head":{"label":"Arcana:inventory","ref":"inventory","sha":"4e44db352f807faac3f41e9f6159af2f0344303c","user":{"login":"Arcana","id":7682895,"avatar_url":"https://avatars1.githubusercontent.com/u/7682895?v=4","gravatar_id":"","url":"https://api.github.com/users/Arcana","html_url":"https://github.com/Arcana","followers_url":"https://api.github.com/users/Arcana/followers","following_url":"https://api.github.com/users/Arcana/following{/other_user}","gists_url":"https://api.github.com/users/Arcana/gists{/gist_id}","starred_url":"https://api.github.com/users/Arcana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arcana/subscriptions","organizations_url":"https://api.github.com/users/Arcana/orgs","repos_url":"https://api.github.com/users/Arcana/repos","events_url":"https://api.github.com/users/Arcana/events{/privacy}","received_events_url":"https://api.github.com/users/Arcana/received_events","type":"Organization","site_admin":false},"repo":{"id":11098955,"name":"node-dota2","full_name":"Arcana/node-dota2","owner":{"login":"Arcana","id":7682895,"avatar_url":"https://avatars1.githubusercontent.com/u/7682895?v=4","gravatar_id":"","url":"https://api.github.com/users/Arcana","html_url":"https://github.com/Arcana","followers_url":"https://api.github.com/users/Arcana/followers","following_url":"https://api.github.com/users/Arcana/following{/other_user}","gists_url":"https://api.github.com/users/Arcana/gists{/gist_id}","starred_url":"https://api.github.com/users/Arcana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arcana/subscriptions","organizations_url":"https://api.github.com/users/Arcana/orgs","repos_url":"https://api.github.com/users/Arcana/repos","events_url":"https://api.github.com/users/Arcana/events{/privacy}","received_events_url":"https://api.github.com/users/Arcana/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Arcana/node-dota2","description":"A node-steam plugin for Dota 2.","fork":false,"url":"https://api.github.com/repos/Arcana/node-dota2","forks_url":"https://api.github.com/repos/Arcana/node-dota2/forks","keys_url":"https://api.github.com/repos/Arcana/node-dota2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Arcana/node-dota2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Arcana/node-dota2/teams","hooks_url":"https://api.github.com/repos/Arcana/node-dota2/hooks","issue_events_url":"https://api.github.com/repos/Arcana/node-dota2/issues/events{/number}","events_url":"https://api.github.com/repos/Arcana/node-dota2/events","assignees_url":"https://api.github.com/repos/Arcana/node-dota2/assignees{/user}","branches_url":"https://api.github.com/repos/Arcana/node-dota2/branches{/branch}","tags_url":"https://api.github.com/repos/Arcana/node-dota2/tags","blobs_url":"https://api.github.com/repos/Arcana/node-dota2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Arcana/node-dota2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Arcana/node-dota2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Arcana/node-dota2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Arcana/node-dota2/statuses/{sha}","languages_url":"https://api.github.com/repos/Arcana/node-dota2/languages","stargazers_url":"https://api.github.com/repos/Arcana/node-dota2/stargazers","contributors_url":"https://api.github.com/repos/Arcana/node-dota2/contributors","subscribers_url":"https://api.github.com/repos/Arcana/node-dota2/subscribers","subscription_url":"https://api.github.com/repos/Arcana/node-dota2/subscription","commits_url":"https://api.github.com/repos/Arcana/node-dota2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Arcana/node-dota2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Arcana/node-dota2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Arcana/node-dota2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Arcana/node-dota2/contents/{+path}","compare_url":"https://api.github.com/repos/Arcana/node-dota2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Arcana/node-dota2/merges","archive_url":"https://api.github.com/repos/Arcana/node-dota2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Arcana/node-dota2/downloads","issues_url":"https://api.github.com/repos/Arcana/node-dota2/issues{/number}","pulls_url":"https://api.github.com/repos/Arcana/node-dota2/pulls{/number}","milestones_url":"https://api.github.com/repos/Arcana/node-dota2/milestones{/number}","notifications_url":"https://api.github.com/repos/Arcana/node-dota2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Arcana/node-dota2/labels{/name}","releases_url":"https://api.github.com/repos/Arcana/node-dota2/releases{/id}","deployments_url":"https://api.github.com/repos/Arcana/node-dota2/deployments","created_at":"2013-07-01T15:30:09Z","updated_at":"2017-07-29T22:51:00Z","pushed_at":"2017-08-01T19:38:28Z","git_url":"git://github.com/Arcana/node-dota2.git","ssh_url":"git@github.com:Arcana/node-dota2.git","clone_url":"https://github.com/Arcana/node-dota2.git","svn_url":"https://github.com/Arcana/node-dota2","homepage":"","size":1375,"stargazers_count":313,"watchers_count":313,"language":"Protocol Buffer","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":125,"mirror_url":null,"open_issues_count":28,"forks":125,"open_issues":28,"watchers":313,"default_branch":"staging"}},"base":{"label":"Arcana:staging","ref":"staging","sha":"017dd13702f7a45774344bcb615c3112a5e6024e","user":{"login":"Arcana","id":7682895,"avatar_url":"https://avatars1.githubusercontent.com/u/7682895?v=4","gravatar_id":"","url":"https://api.github.com/users/Arcana","html_url":"https://github.com/Arcana","followers_url":"https://api.github.com/users/Arcana/followers","following_url":"https://api.github.com/users/Arcana/following{/other_user}","gists_url":"https://api.github.com/users/Arcana/gists{/gist_id}","starred_url":"https://api.github.com/users/Arcana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arcana/subscriptions","organizations_url":"https://api.github.com/users/Arcana/orgs","repos_url":"https://api.github.com/users/Arcana/repos","events_url":"https://api.github.com/users/Arcana/events{/privacy}","received_events_url":"https://api.github.com/users/Arcana/received_events","type":"Organization","site_admin":false},"repo":{"id":11098955,"name":"node-dota2","full_name":"Arcana/node-dota2","owner":{"login":"Arcana","id":7682895,"avatar_url":"https://avatars1.githubusercontent.com/u/7682895?v=4","gravatar_id":"","url":"https://api.github.com/users/Arcana","html_url":"https://github.com/Arcana","followers_url":"https://api.github.com/users/Arcana/followers","following_url":"https://api.github.com/users/Arcana/following{/other_user}","gists_url":"https://api.github.com/users/Arcana/gists{/gist_id}","starred_url":"https://api.github.com/users/Arcana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arcana/subscriptions","organizations_url":"https://api.github.com/users/Arcana/orgs","repos_url":"https://api.github.com/users/Arcana/repos","events_url":"https://api.github.com/users/Arcana/events{/privacy}","received_events_url":"https://api.github.com/users/Arcana/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Arcana/node-dota2","description":"A node-steam plugin for Dota 2.","fork":false,"url":"https://api.github.com/repos/Arcana/node-dota2","forks_url":"https://api.github.com/repos/Arcana/node-dota2/forks","keys_url":"https://api.github.com/repos/Arcana/node-dota2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Arcana/node-dota2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Arcana/node-dota2/teams","hooks_url":"https://api.github.com/repos/Arcana/node-dota2/hooks","issue_events_url":"https://api.github.com/repos/Arcana/node-dota2/issues/events{/number}","events_url":"https://api.github.com/repos/Arcana/node-dota2/events","assignees_url":"https://api.github.com/repos/Arcana/node-dota2/assignees{/user}","branches_url":"https://api.github.com/repos/Arcana/node-dota2/branches{/branch}","tags_url":"https://api.github.com/repos/Arcana/node-dota2/tags","blobs_url":"https://api.github.com/repos/Arcana/node-dota2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Arcana/node-dota2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Arcana/node-dota2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Arcana/node-dota2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Arcana/node-dota2/statuses/{sha}","languages_url":"https://api.github.com/repos/Arcana/node-dota2/languages","stargazers_url":"https://api.github.com/repos/Arcana/node-dota2/stargazers","contributors_url":"https://api.github.com/repos/Arcana/node-dota2/contributors","subscribers_url":"https://api.github.com/repos/Arcana/node-dota2/subscribers","subscription_url":"https://api.github.com/repos/Arcana/node-dota2/subscription","commits_url":"https://api.github.com/repos/Arcana/node-dota2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Arcana/node-dota2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Arcana/node-dota2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Arcana/node-dota2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Arcana/node-dota2/contents/{+path}","compare_url":"https://api.github.com/repos/Arcana/node-dota2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Arcana/node-dota2/merges","archive_url":"https://api.github.com/repos/Arcana/node-dota2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Arcana/node-dota2/downloads","issues_url":"https://api.github.com/repos/Arcana/node-dota2/issues{/number}","pulls_url":"https://api.github.com/repos/Arcana/node-dota2/pulls{/number}","milestones_url":"https://api.github.com/repos/Arcana/node-dota2/milestones{/number}","notifications_url":"https://api.github.com/repos/Arcana/node-dota2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Arcana/node-dota2/labels{/name}","releases_url":"https://api.github.com/repos/Arcana/node-dota2/releases{/id}","deployments_url":"https://api.github.com/repos/Arcana/node-dota2/deployments","created_at":"2013-07-01T15:30:09Z","updated_at":"2017-07-29T22:51:00Z","pushed_at":"2017-08-01T19:38:28Z","git_url":"git://github.com/Arcana/node-dota2.git","ssh_url":"git@github.com:Arcana/node-dota2.git","clone_url":"https://github.com/Arcana/node-dota2.git","svn_url":"https://github.com/Arcana/node-dota2","homepage":"","size":1375,"stargazers_count":313,"watchers_count":313,"language":"Protocol Buffer","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":125,"mirror_url":null,"open_issues_count":28,"forks":125,"open_issues":28,"watchers":313,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/Arcana/node-dota2/pulls/521"},"html":{"href":"https://github.com/Arcana/node-dota2/pull/521"},"issue":{"href":"https://api.github.com/repos/Arcana/node-dota2/issues/521"},"comments":{"href":"https://api.github.com/repos/Arcana/node-dota2/issues/521/comments"},"review_comments":{"href":"https://api.github.com/repos/Arcana/node-dota2/pulls/521/comments"},"review_comment":{"href":"https://api.github.com/repos/Arcana/node-dota2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Arcana/node-dota2/pulls/521/commits"},"statuses":{"href":"https://api.github.com/repos/Arcana/node-dota2/statuses/4e44db352f807faac3f41e9f6159af2f0344303c"}}}}
{"actor":{"display_login":"Ne3tCode"}}