{"action":"created","comment":{"url":"https://api.github.com/repos/otland/forgottenserver/pulls/comments/88529927","pull_request_review_id":9101070,"id":88529927,"diff_hunk":"@@ -206,6 +207,226 @@ class ItemAttributes\n \t\t\treturn static_cast<ItemDecayState_t>(getIntAttr(ITEM_ATTRIBUTE_DECAYSTATE));\n \t\t}\n \n+\t\tstruct CustomAttributeKey\n+\t\t{\n+\t\t\tunion {\n+\t\t\t\tstd::string* string;\n+\t\t\t\tint64_t integer;\n+\t\t\t} value;\n+\n+\t\t\tcustomAttrTypes type = ATTR_NO_TYPE;\n+\n+\t\t\texplicit CustomAttributeKey(customAttrTypes type) : type(type) {\n+\t\t\t\tmemset(&value, 0, sizeof(value));\n+\t\t\t}\n+\n+\t\t\tCustomAttributeKey(const std::string& v) {\n+\t\t\t\ttype = ATTR_STRING_TYPE;\n+\t\t\t\tvalue.string = new std::string(v);\n+\t\t\t}\n+\n+\t\t\tCustomAttributeKey(const char* v) {\n+\t\t\t\ttype = ATTR_STRING_TYPE;\n+\t\t\t\tvalue.string = new std::string(v);\n+\t\t\t}\n+\n+\t\t\tCustomAttributeKey(int64_t v) {\n+\t\t\t\ttype = ATTR_INTEGER_TYPE;\n+\t\t\t\tvalue.integer = v;\n+\t\t\t}\n+\n+\t\t\tCustomAttributeKey(const CustomAttributeKey& i) {\n+\t\t\t\ttype = i.type;\n+\t\t\t\tswitch (type) {\n+\t\t\t\t\tcase ATTR_STRING_TYPE: {\n+\t\t\t\t\t\tvalue.string = new std::string(*i.value.string);\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tcase ATTR_INTEGER_TYPE: {\n+\t\t\t\t\t\tvalue.integer = i.value.integer;\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tdefault: {\n+\t\t\t\t\t\tmemset(&value, 0, sizeof(value));\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tCustomAttributeKey(CustomAttributeKey&& attribute) : value(attribute.value), type(attribute.type) {\n+\t\t\t\tmemset(&attribute.value, 0, sizeof(value));\n+\t\t\t\tattribute.type = ATTR_NO_TYPE;\n+\t\t\t}\n+\n+\t\t\t~CustomAttributeKey() {\n+\t\t\t\tif (type == ATTR_STRING_TYPE) {\n+\t\t\t\t\tdelete value.string;\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tCustomAttributeKey& operator=(CustomAttributeKey other) {\n+\t\t\t\tCustomAttributeKey::swap(*this, other);\n+\t\t\t\treturn *this;\n+\t\t\t}\n+\n+\t\t\tCustomAttributeKey& operator=(CustomAttributeKey&& other) {\n+\t\t\t\tif (this != &other) {\n+\t\t\t\t\tif (type == ATTR_STRING_TYPE) {\n+\t\t\t\t\t\tdelete value.string;","path":"src/item.h","position":76,"original_position":76,"commit_id":"3d8ff729879c500fec6d6d43ff3fbb5b37f0bff8","original_commit_id":"3d8ff729879c500fec6d6d43ff3fbb5b37f0bff8","user":{"login":"djarek","id":6125067,"avatar_url":"https://avatars.githubusercontent.com/u/6125067?v=3","gravatar_id":"","url":"https://api.github.com/users/djarek","html_url":"https://github.com/djarek","followers_url":"https://api.github.com/users/djarek/followers","following_url":"https://api.github.com/users/djarek/following{/other_user}","gists_url":"https://api.github.com/users/djarek/gists{/gist_id}","starred_url":"https://api.github.com/users/djarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djarek/subscriptions","organizations_url":"https://api.github.com/users/djarek/orgs","repos_url":"https://api.github.com/users/djarek/repos","events_url":"https://api.github.com/users/djarek/events{/privacy}","received_events_url":"https://api.github.com/users/djarek/received_events","type":"User","site_admin":false},"body":"Naked delete.","created_at":"2016-11-17T19:39:39Z","updated_at":"2016-11-17T19:49:13Z","html_url":"https://github.com/otland/forgottenserver/pull/1997#discussion_r88529927","pull_request_url":"https://api.github.com/repos/otland/forgottenserver/pulls/1997","_links":{"self":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/comments/88529927"},"html":{"href":"https://github.com/otland/forgottenserver/pull/1997#discussion_r88529927"},"pull_request":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/1997"}}},"pull_request":{"url":"https://api.github.com/repos/otland/forgottenserver/pulls/1997","id":94176019,"html_url":"https://github.com/otland/forgottenserver/pull/1997","diff_url":"https://github.com/otland/forgottenserver/pull/1997.diff","patch_url":"https://github.com/otland/forgottenserver/pull/1997.patch","issue_url":"https://api.github.com/repos/otland/forgottenserver/issues/1997","number":1997,"state":"open","locked":false,"title":"Item custom attributes","user":{"login":"Mkalo","id":7635617,"avatar_url":"https://avatars.githubusercontent.com/u/7635617?v=3","gravatar_id":"","url":"https://api.github.com/users/Mkalo","html_url":"https://github.com/Mkalo","followers_url":"https://api.github.com/users/Mkalo/followers","following_url":"https://api.github.com/users/Mkalo/following{/other_user}","gists_url":"https://api.github.com/users/Mkalo/gists{/gist_id}","starred_url":"https://api.github.com/users/Mkalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mkalo/subscriptions","organizations_url":"https://api.github.com/users/Mkalo/orgs","repos_url":"https://api.github.com/users/Mkalo/repos","events_url":"https://api.github.com/users/Mkalo/events{/privacy}","received_events_url":"https://api.github.com/users/Mkalo/received_events","type":"User","site_admin":false},"body":"Introducing 3 new methods to Item class to Lua API:\r\n\r\nitem:setCustomAttribute(key, value)\r\nitem:getCustomAttribute(key)\r\nitem:removeCustomAttribute(key)\r\n\r\nKey types: string or number\r\nValue types: string, number, double or boolean.\r\n\r\nOBS: Setting a custom attribute to nil doesn't remove the attribute, it has no effect at all.\r\n\r\nAny suggestion is welcome.","created_at":"2016-11-17T14:20:34Z","updated_at":"2016-11-17T19:49:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"115c77539ad18e9d4ddc48750d37d9f82f0a0236","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/otland/forgottenserver/pulls/1997/commits","review_comments_url":"https://api.github.com/repos/otland/forgottenserver/pulls/1997/comments","review_comment_url":"https://api.github.com/repos/otland/forgottenserver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/otland/forgottenserver/issues/1997/comments","statuses_url":"https://api.github.com/repos/otland/forgottenserver/statuses/3d8ff729879c500fec6d6d43ff3fbb5b37f0bff8","head":{"label":"Mkalo:customattributes","ref":"customattributes","sha":"3d8ff729879c500fec6d6d43ff3fbb5b37f0bff8","user":{"login":"Mkalo","id":7635617,"avatar_url":"https://avatars.githubusercontent.com/u/7635617?v=3","gravatar_id":"","url":"https://api.github.com/users/Mkalo","html_url":"https://github.com/Mkalo","followers_url":"https://api.github.com/users/Mkalo/followers","following_url":"https://api.github.com/users/Mkalo/following{/other_user}","gists_url":"https://api.github.com/users/Mkalo/gists{/gist_id}","starred_url":"https://api.github.com/users/Mkalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mkalo/subscriptions","organizations_url":"https://api.github.com/users/Mkalo/orgs","repos_url":"https://api.github.com/users/Mkalo/repos","events_url":"https://api.github.com/users/Mkalo/events{/privacy}","received_events_url":"https://api.github.com/users/Mkalo/received_events","type":"User","site_admin":false},"repo":{"id":62103937,"name":"forgottenserver","full_name":"Mkalo/forgottenserver","owner":{"login":"Mkalo","id":7635617,"avatar_url":"https://avatars.githubusercontent.com/u/7635617?v=3","gravatar_id":"","url":"https://api.github.com/users/Mkalo","html_url":"https://github.com/Mkalo","followers_url":"https://api.github.com/users/Mkalo/followers","following_url":"https://api.github.com/users/Mkalo/following{/other_user}","gists_url":"https://api.github.com/users/Mkalo/gists{/gist_id}","starred_url":"https://api.github.com/users/Mkalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mkalo/subscriptions","organizations_url":"https://api.github.com/users/Mkalo/orgs","repos_url":"https://api.github.com/users/Mkalo/repos","events_url":"https://api.github.com/users/Mkalo/events{/privacy}","received_events_url":"https://api.github.com/users/Mkalo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mkalo/forgottenserver","description":"A free and open-source MMORPG server emulator written in C++","fork":true,"url":"https://api.github.com/repos/Mkalo/forgottenserver","forks_url":"https://api.github.com/repos/Mkalo/forgottenserver/forks","keys_url":"https://api.github.com/repos/Mkalo/forgottenserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mkalo/forgottenserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mkalo/forgottenserver/teams","hooks_url":"https://api.github.com/repos/Mkalo/forgottenserver/hooks","issue_events_url":"https://api.github.com/repos/Mkalo/forgottenserver/issues/events{/number}","events_url":"https://api.github.com/repos/Mkalo/forgottenserver/events","assignees_url":"https://api.github.com/repos/Mkalo/forgottenserver/assignees{/user}","branches_url":"https://api.github.com/repos/Mkalo/forgottenserver/branches{/branch}","tags_url":"https://api.github.com/repos/Mkalo/forgottenserver/tags","blobs_url":"https://api.github.com/repos/Mkalo/forgottenserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mkalo/forgottenserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mkalo/forgottenserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mkalo/forgottenserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mkalo/forgottenserver/statuses/{sha}","languages_url":"https://api.github.com/repos/Mkalo/forgottenserver/languages","stargazers_url":"https://api.github.com/repos/Mkalo/forgottenserver/stargazers","contributors_url":"https://api.github.com/repos/Mkalo/forgottenserver/contributors","subscribers_url":"https://api.github.com/repos/Mkalo/forgottenserver/subscribers","subscription_url":"https://api.github.com/repos/Mkalo/forgottenserver/subscription","commits_url":"https://api.github.com/repos/Mkalo/forgottenserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mkalo/forgottenserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mkalo/forgottenserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mkalo/forgottenserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mkalo/forgottenserver/contents/{+path}","compare_url":"https://api.github.com/repos/Mkalo/forgottenserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mkalo/forgottenserver/merges","archive_url":"https://api.github.com/repos/Mkalo/forgottenserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mkalo/forgottenserver/downloads","issues_url":"https://api.github.com/repos/Mkalo/forgottenserver/issues{/number}","pulls_url":"https://api.github.com/repos/Mkalo/forgottenserver/pulls{/number}","milestones_url":"https://api.github.com/repos/Mkalo/forgottenserver/milestones{/number}","notifications_url":"https://api.github.com/repos/Mkalo/forgottenserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mkalo/forgottenserver/labels{/name}","releases_url":"https://api.github.com/repos/Mkalo/forgottenserver/releases{/id}","deployments_url":"https://api.github.com/repos/Mkalo/forgottenserver/deployments","created_at":"2016-06-28T02:36:24Z","updated_at":"2016-06-28T02:36:27Z","pushed_at":"2016-11-17T16:07:51Z","git_url":"git://github.com/Mkalo/forgottenserver.git","ssh_url":"git@github.com:Mkalo/forgottenserver.git","clone_url":"https://github.com/Mkalo/forgottenserver.git","svn_url":"https://github.com/Mkalo/forgottenserver","homepage":"","size":15119,"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":"otland:master","ref":"master","sha":"c689b4b027a6b47280a099730f6071387f4c0ac2","user":{"login":"otland","id":4956302,"avatar_url":"https://avatars.githubusercontent.com/u/4956302?v=3","gravatar_id":"","url":"https://api.github.com/users/otland","html_url":"https://github.com/otland","followers_url":"https://api.github.com/users/otland/followers","following_url":"https://api.github.com/users/otland/following{/other_user}","gists_url":"https://api.github.com/users/otland/gists{/gist_id}","starred_url":"https://api.github.com/users/otland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otland/subscriptions","organizations_url":"https://api.github.com/users/otland/orgs","repos_url":"https://api.github.com/users/otland/repos","events_url":"https://api.github.com/users/otland/events{/privacy}","received_events_url":"https://api.github.com/users/otland/received_events","type":"Organization","site_admin":false},"repo":{"id":11081909,"name":"forgottenserver","full_name":"otland/forgottenserver","owner":{"login":"otland","id":4956302,"avatar_url":"https://avatars.githubusercontent.com/u/4956302?v=3","gravatar_id":"","url":"https://api.github.com/users/otland","html_url":"https://github.com/otland","followers_url":"https://api.github.com/users/otland/followers","following_url":"https://api.github.com/users/otland/following{/other_user}","gists_url":"https://api.github.com/users/otland/gists{/gist_id}","starred_url":"https://api.github.com/users/otland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otland/subscriptions","organizations_url":"https://api.github.com/users/otland/orgs","repos_url":"https://api.github.com/users/otland/repos","events_url":"https://api.github.com/users/otland/events{/privacy}","received_events_url":"https://api.github.com/users/otland/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/otland/forgottenserver","description":"A free and open-source MMORPG server emulator written in C++","fork":false,"url":"https://api.github.com/repos/otland/forgottenserver","forks_url":"https://api.github.com/repos/otland/forgottenserver/forks","keys_url":"https://api.github.com/repos/otland/forgottenserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/otland/forgottenserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/otland/forgottenserver/teams","hooks_url":"https://api.github.com/repos/otland/forgottenserver/hooks","issue_events_url":"https://api.github.com/repos/otland/forgottenserver/issues/events{/number}","events_url":"https://api.github.com/repos/otland/forgottenserver/events","assignees_url":"https://api.github.com/repos/otland/forgottenserver/assignees{/user}","branches_url":"https://api.github.com/repos/otland/forgottenserver/branches{/branch}","tags_url":"https://api.github.com/repos/otland/forgottenserver/tags","blobs_url":"https://api.github.com/repos/otland/forgottenserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/otland/forgottenserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/otland/forgottenserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/otland/forgottenserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/otland/forgottenserver/statuses/{sha}","languages_url":"https://api.github.com/repos/otland/forgottenserver/languages","stargazers_url":"https://api.github.com/repos/otland/forgottenserver/stargazers","contributors_url":"https://api.github.com/repos/otland/forgottenserver/contributors","subscribers_url":"https://api.github.com/repos/otland/forgottenserver/subscribers","subscription_url":"https://api.github.com/repos/otland/forgottenserver/subscription","commits_url":"https://api.github.com/repos/otland/forgottenserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/otland/forgottenserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/otland/forgottenserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/otland/forgottenserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/otland/forgottenserver/contents/{+path}","compare_url":"https://api.github.com/repos/otland/forgottenserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/otland/forgottenserver/merges","archive_url":"https://api.github.com/repos/otland/forgottenserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/otland/forgottenserver/downloads","issues_url":"https://api.github.com/repos/otland/forgottenserver/issues{/number}","pulls_url":"https://api.github.com/repos/otland/forgottenserver/pulls{/number}","milestones_url":"https://api.github.com/repos/otland/forgottenserver/milestones{/number}","notifications_url":"https://api.github.com/repos/otland/forgottenserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/otland/forgottenserver/labels{/name}","releases_url":"https://api.github.com/repos/otland/forgottenserver/releases{/id}","deployments_url":"https://api.github.com/repos/otland/forgottenserver/deployments","created_at":"2013-07-01T01:57:06Z","updated_at":"2016-11-17T11:09:45Z","pushed_at":"2016-11-17T16:07:52Z","git_url":"git://github.com/otland/forgottenserver.git","ssh_url":"git@github.com:otland/forgottenserver.git","clone_url":"https://github.com/otland/forgottenserver.git","svn_url":"https://github.com/otland/forgottenserver","homepage":"","size":20816,"stargazers_count":378,"watchers_count":378,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":387,"mirror_url":null,"open_issues_count":171,"forks":387,"open_issues":171,"watchers":378,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/1997"},"html":{"href":"https://github.com/otland/forgottenserver/pull/1997"},"issue":{"href":"https://api.github.com/repos/otland/forgottenserver/issues/1997"},"comments":{"href":"https://api.github.com/repos/otland/forgottenserver/issues/1997/comments"},"review_comments":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/1997/comments"},"review_comment":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/1997/commits"},"statuses":{"href":"https://api.github.com/repos/otland/forgottenserver/statuses/3d8ff729879c500fec6d6d43ff3fbb5b37f0bff8"}}}}
{"actor":{"display_login":"djarek"}}