{"action":"created","comment":{"url":"https://api.github.com/repos/sintell/mmo-server/pulls/comments/93592827","pull_request_review_id":14121283,"id":93592827,"diff_hunk":"@@ -0,0 +1,185 @@\n+package game\n+\n+import (\n+\t\"encoding/json\"\n+\t\"errors\"\n+\t\"fmt\"\n+\t\"github.com/sintell/mmo-server/packet\"\n+\t\"io/ioutil\"\n+)\n+\n+const (\n+\tInventoryItemLoss = 0\n+)\n+\n+type ItemFields struct {\n+\tIdentify    int `json:\"identify\"`\n+\tUniqueID    int `json:\"unique_id\"`\n+\tItemID      int `json:\"item_id\"`\n+\tAmount      int `json:\"amount\"`\n+\tTimeOff     int `json:\"time_off\"`\n+\tItemView    int `json:\"item_view\"`\n+\tUseAmount   int `json:\"use_amount\"`\n+\tAccountLock int `json:\"account_lock\"`\n+\tHourUse     int `json:\"hour_use\"`\n+\tLock        int `json:\"lock\"`\n+\tExtension   int `json:\"extension\"`\n+\tRunesOpen   int `json:\"runes_open\"`\n+\tOwner       int `json:\"owner\"`\n+}\n+\n+type ItemsStruct []struct {\n+\tID          int    `json:\"id\"`\n+\tName        string `json:\"name\"`\n+\tMustUnEquip []struct {\n+\t\tSlot       int   `json:\"slot\"`\n+\t\tShowItemID []int `json:\"show_item_id\"`\n+\t} `json:\"must_un_equip\"`\n+\tMustEquip []struct {\n+\t\tSlot       int   `json:\"slot\"`\n+\t\tShowItemID []int `json:\"show_item_id\"`\n+\t} `json:\"must_equip\"`\n+\tShowItemID int    `json:\"show_item_id\"`\n+\tType       string `json:\"type\"`\n+\tEquipType  []int  `json:\"equip_type\"`\n+\tClasses    []int  `json:\"classes\"`\n+\tStats      struct {\n+\t\tDistance         int `json:\"distance\"`\n+\t\tMeleeAccuracy    int `json:\"melee_accuracy\"`\n+\t\tAbsorption       int `json:\"absorption\"`\n+\t\tAbsorptionMelee  int `json:\"absorption_melee\"`\n+\t\tAbsorptionRange  int `json:\"absorption_range\"`\n+\t\tAbsorptionSpell  int `json:\"absorption_spell\"`\n+\t\tEvasion          int `json:\"evasion\"`\n+\t\tEvasionMelee     int `json:\"evasion_melee\"`\n+\t\tEvasionRange     int `json:\"evasion_range\"`\n+\t\tEvasionSpell     int `json:\"evasion_spell\"`\n+\t\tInt              int `json:\"int\"`\n+\t\tAbsorptionPvp    int `json:\"absorption_pvp\"`\n+\t\tEvasionPvp       int `json:\"evasion_pvp\"`\n+\t\tCriticalAbs      int `json:\"critical_abs\"`\n+\t\tStr              int `json:\"str\"`\n+\t\tCritical         int `json:\"critical\"`\n+\t\tRangeAccuracy    int `json:\"range_accuracy\"`\n+\t\tSpellAccuracy    int `json:\"spell_accuracy\"`\n+\t\tMeleeAttack      int `json:\"melee_attack\"`\n+\t\tRangeAttack      int `json:\"range_attack\"`\n+\t\tSpellAttack      int `json:\"spell_attack\"`\n+\t\tSpeedAttack      int `json:\"speed_attack\"`\n+\t\tDex              int `json:\"dex\"`\n+\t\tMaxHp            int `json:\"max_hp\"`\n+\t\tMaxMp            int `json:\"max_mp\"`\n+\t\tRegHp            int `json:\"reg_hp\"`\n+\t\tRegMp            int `json:\"reg_mp\"`\n+\t\tMonsterKiller    int `json:\"monster_killer\"`\n+\t\tHumanKiller      int `json:\"human_killer\"`\n+\t\tMaxWeight        int `json:\"max_weight\"`\n+\t\tSpeedMove        int `json:\"speed_move\"`\n+\t\tMonsterAbs       int `json:\"monster_abs\"`\n+\t\tMpCutPercent     int `json:\"mp_cut_percent\"`\n+\t\tHealthEffect     int `json:\"health_effect\"`\n+\t\tHumanAbs         int `json:\"human_abs\"`\n+\t\tCriticalStr      int `json:\"critical_str\"`\n+\t\tAcidEvasion      int `json:\"acid_evasion\"`\n+\t\tWebEvasion       int `json:\"web_evasion\"`\n+\t\tPalsyEvasion     int `json:\"palsy_evasion\"`\n+\t\tExplosionEvasion int `json:\"explosion_evasion\"`\n+\t\tElectricEvasion  int `json:\"electric_evasion\"`\n+\t} `json:\"stats\"`\n+\tParams struct {\n+\t\tStack     bool   `json:\"stack\"`\n+\t\tWeight    int    `json:\"weight\"`\n+\t\tPrice     int    `json:\"price\"`\n+\t\tBuffs     []int  `json:\"buffs\"`\n+\t\tEnchanter string `json:\"enchanter\"`\n+\t\tTeleport  int    `json:\"teleport\"`\n+\t\tCooldown  int    `json:\"cooldown\"`\n+\t\tTrade     bool   `json:\"trade\"`\n+\t\tHeal      int    `json:\"heal\"`\n+\t\tSkill     struct {\n+\t\t\tID     int  `json:\"id\"`\n+\t\t\tTime   int  `json:\"time\"`\n+\t\t\tIsTree bool `json:\"isTree\"`\n+\t\t} `json:\"skill\"`\n+\t\tLock bool `json:\"lock\"`\n+\t} `json:\"params\"`\n+\tMeleeAttack struct {\n+\t\tMin int `json:\"min\"`\n+\t\tMax int `json:\"max\"`\n+\t} `json:\"melee_attack\"`\n+\tEnchant struct {\n+\t\tNum351  int `json:\"351\"`\n+\t\tNum1170 int `json:\"1170\"`\n+\t\tNum1384 int `json:\"1384\"`\n+\t\tNum2872 int `json:\"2872\"`\n+\t\tNum3500 int `json:\"3500\"`\n+\t\tNum6934 int `json:\"6934\"`\n+\t\tNext    int `json:\"next\"`\n+\t} `json:\"enchant\"`\n+\tScript     string `json:\"script\"`\n+\tBlockEquip []struct {\n+\t\tSlot       int   `json:\"slot\"`\n+\t\tShowItemID []int `json:\"show_item_id\"`\n+\t} `json:\"block_equip\"`\n+\tRestrictions struct {\n+\t\tMin struct {\n+\t\t\tLvl int `json:\"lvl\"`\n+\t\t} `json:\"min\"`\n+\t\tMax struct {\n+\t\t\tLvl int `json:\"lvl\"`\n+\t\t} `json:\"max\"`\n+\t} `json:\"restrictions\"`\n+\tIsArrow     bool `json:\"isArrow\"`\n+\tRangeAttack struct {\n+\t\tMin int `json:\"min\"`\n+\t\tMax int `json:\"max\"`\n+\t} `json:\"range_attack\"`\n+\tBuffs struct {\n+\t\tBuff []int `json:\"buff\"`\n+\t} `json:\"buffs\"`\n+\tSpellAttack struct {\n+\t\tMin int `json:\"min\"`\n+\t\tMax int `json:\"max\"`\n+\t} `json:\"spell_attack\"`\n+\tAutoBuffs struct {\n+\t\tBuff []int `json:\"buff\"`\n+\t} `json:\"auto_buffs\"`\n+}\n+\n+func init() {\n+\tstr := `{\"identify\": 0, \"unique_id\": 8, \"item_id\": 16, \"amount\": 20, \"time_off\": 24, \"item_view\": 28, \"use_amount\": 30, \"account_lock\": 44, \"hour_use\": 48, \"lock\": 52, \"extension\": 53, \"runes_open\": 54, \"owner\": 56}`\n+\tres := ItemFields{}\n+\tjson.Unmarshal([]byte(str), &res)\n+\tfmt.Println(res.Owner)\n+\n+\tdat, _ := ioutil.ReadFile(\"./config/items.cfg\")","path":"game/inventory.go","position":155,"original_position":155,"commit_id":"7092234350d5b5af4b21d16e479ddc90a5c2aec1","original_commit_id":"7092234350d5b5af4b21d16e479ddc90a5c2aec1","user":{"login":"sintell","id":2109007,"avatar_url":"https://avatars.githubusercontent.com/u/2109007?v=3","gravatar_id":"","url":"https://api.github.com/users/sintell","html_url":"https://github.com/sintell","followers_url":"https://api.github.com/users/sintell/followers","following_url":"https://api.github.com/users/sintell/following{/other_user}","gists_url":"https://api.github.com/users/sintell/gists{/gist_id}","starred_url":"https://api.github.com/users/sintell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sintell/subscriptions","organizations_url":"https://api.github.com/users/sintell/orgs","repos_url":"https://api.github.com/users/sintell/repos","events_url":"https://api.github.com/users/sintell/events{/privacy}","received_events_url":"https://api.github.com/users/sintell/received_events","type":"User","site_admin":false},"body":"Можно прям в`mmo-server/config/config.go` - вот такое создать \r\n`package config` и там сделать общий метод для чтения файлов и методы типа\r\n```golang\r\nfunc LoadItems() *ItemFields {\r\n    ...\r\n}\r\nfunc LoadOther() *OtherConfigStruct {\r\n    ...\r\n}\r\n```","created_at":"2016-12-22T09:48:06Z","updated_at":"2016-12-22T09:48:44Z","html_url":"https://github.com/sintell/mmo-server/pull/5#discussion_r93592827","pull_request_url":"https://api.github.com/repos/sintell/mmo-server/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/sintell/mmo-server/pulls/comments/93592827"},"html":{"href":"https://github.com/sintell/mmo-server/pull/5#discussion_r93592827"},"pull_request":{"href":"https://api.github.com/repos/sintell/mmo-server/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/sintell/mmo-server/pulls/5","id":98520234,"html_url":"https://github.com/sintell/mmo-server/pull/5","diff_url":"https://github.com/sintell/mmo-server/pull/5.diff","patch_url":"https://github.com/sintell/mmo-server/pull/5.patch","issue_url":"https://api.github.com/repos/sintell/mmo-server/issues/5","number":5,"state":"open","locked":false,"title":"Remove items","user":{"login":"sintell","id":2109007,"avatar_url":"https://avatars.githubusercontent.com/u/2109007?v=3","gravatar_id":"","url":"https://api.github.com/users/sintell","html_url":"https://github.com/sintell","followers_url":"https://api.github.com/users/sintell/followers","following_url":"https://api.github.com/users/sintell/following{/other_user}","gists_url":"https://api.github.com/users/sintell/gists{/gist_id}","starred_url":"https://api.github.com/users/sintell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sintell/subscriptions","organizations_url":"https://api.github.com/users/sintell/orgs","repos_url":"https://api.github.com/users/sintell/repos","events_url":"https://api.github.com/users/sintell/events{/privacy}","received_events_url":"https://api.github.com/users/sintell/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-19T07:48:02Z","updated_at":"2016-12-22T09:48:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09bcd77153213ee480c592e27eb659eff7d4cbe9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sintell/mmo-server/pulls/5/commits","review_comments_url":"https://api.github.com/repos/sintell/mmo-server/pulls/5/comments","review_comment_url":"https://api.github.com/repos/sintell/mmo-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sintell/mmo-server/issues/5/comments","statuses_url":"https://api.github.com/repos/sintell/mmo-server/statuses/7092234350d5b5af4b21d16e479ddc90a5c2aec1","head":{"label":"sintell:RemoveItems","ref":"RemoveItems","sha":"7092234350d5b5af4b21d16e479ddc90a5c2aec1","user":{"login":"sintell","id":2109007,"avatar_url":"https://avatars.githubusercontent.com/u/2109007?v=3","gravatar_id":"","url":"https://api.github.com/users/sintell","html_url":"https://github.com/sintell","followers_url":"https://api.github.com/users/sintell/followers","following_url":"https://api.github.com/users/sintell/following{/other_user}","gists_url":"https://api.github.com/users/sintell/gists{/gist_id}","starred_url":"https://api.github.com/users/sintell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sintell/subscriptions","organizations_url":"https://api.github.com/users/sintell/orgs","repos_url":"https://api.github.com/users/sintell/repos","events_url":"https://api.github.com/users/sintell/events{/privacy}","received_events_url":"https://api.github.com/users/sintell/received_events","type":"User","site_admin":false},"repo":{"id":70621431,"name":"mmo-server","full_name":"sintell/mmo-server","owner":{"login":"sintell","id":2109007,"avatar_url":"https://avatars.githubusercontent.com/u/2109007?v=3","gravatar_id":"","url":"https://api.github.com/users/sintell","html_url":"https://github.com/sintell","followers_url":"https://api.github.com/users/sintell/followers","following_url":"https://api.github.com/users/sintell/following{/other_user}","gists_url":"https://api.github.com/users/sintell/gists{/gist_id}","starred_url":"https://api.github.com/users/sintell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sintell/subscriptions","organizations_url":"https://api.github.com/users/sintell/orgs","repos_url":"https://api.github.com/users/sintell/repos","events_url":"https://api.github.com/users/sintell/events{/privacy}","received_events_url":"https://api.github.com/users/sintell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sintell/mmo-server","description":"Naive approach to mmo-server in go","fork":false,"url":"https://api.github.com/repos/sintell/mmo-server","forks_url":"https://api.github.com/repos/sintell/mmo-server/forks","keys_url":"https://api.github.com/repos/sintell/mmo-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sintell/mmo-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sintell/mmo-server/teams","hooks_url":"https://api.github.com/repos/sintell/mmo-server/hooks","issue_events_url":"https://api.github.com/repos/sintell/mmo-server/issues/events{/number}","events_url":"https://api.github.com/repos/sintell/mmo-server/events","assignees_url":"https://api.github.com/repos/sintell/mmo-server/assignees{/user}","branches_url":"https://api.github.com/repos/sintell/mmo-server/branches{/branch}","tags_url":"https://api.github.com/repos/sintell/mmo-server/tags","blobs_url":"https://api.github.com/repos/sintell/mmo-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sintell/mmo-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sintell/mmo-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/sintell/mmo-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sintell/mmo-server/statuses/{sha}","languages_url":"https://api.github.com/repos/sintell/mmo-server/languages","stargazers_url":"https://api.github.com/repos/sintell/mmo-server/stargazers","contributors_url":"https://api.github.com/repos/sintell/mmo-server/contributors","subscribers_url":"https://api.github.com/repos/sintell/mmo-server/subscribers","subscription_url":"https://api.github.com/repos/sintell/mmo-server/subscription","commits_url":"https://api.github.com/repos/sintell/mmo-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/sintell/mmo-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/sintell/mmo-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/sintell/mmo-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/sintell/mmo-server/contents/{+path}","compare_url":"https://api.github.com/repos/sintell/mmo-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sintell/mmo-server/merges","archive_url":"https://api.github.com/repos/sintell/mmo-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sintell/mmo-server/downloads","issues_url":"https://api.github.com/repos/sintell/mmo-server/issues{/number}","pulls_url":"https://api.github.com/repos/sintell/mmo-server/pulls{/number}","milestones_url":"https://api.github.com/repos/sintell/mmo-server/milestones{/number}","notifications_url":"https://api.github.com/repos/sintell/mmo-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sintell/mmo-server/labels{/name}","releases_url":"https://api.github.com/repos/sintell/mmo-server/releases{/id}","deployments_url":"https://api.github.com/repos/sintell/mmo-server/deployments","created_at":"2016-10-11T18:05:52Z","updated_at":"2016-10-11T18:12:26Z","pushed_at":"2016-12-22T07:39:33Z","git_url":"git://github.com/sintell/mmo-server.git","ssh_url":"git@github.com:sintell/mmo-server.git","clone_url":"https://github.com/sintell/mmo-server.git","svn_url":"https://github.com/sintell/mmo-server","homepage":null,"size":2936,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"sintell:master","ref":"master","sha":"55b7be07c114a24b9d65d4448f74e61b464e1512","user":{"login":"sintell","id":2109007,"avatar_url":"https://avatars.githubusercontent.com/u/2109007?v=3","gravatar_id":"","url":"https://api.github.com/users/sintell","html_url":"https://github.com/sintell","followers_url":"https://api.github.com/users/sintell/followers","following_url":"https://api.github.com/users/sintell/following{/other_user}","gists_url":"https://api.github.com/users/sintell/gists{/gist_id}","starred_url":"https://api.github.com/users/sintell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sintell/subscriptions","organizations_url":"https://api.github.com/users/sintell/orgs","repos_url":"https://api.github.com/users/sintell/repos","events_url":"https://api.github.com/users/sintell/events{/privacy}","received_events_url":"https://api.github.com/users/sintell/received_events","type":"User","site_admin":false},"repo":{"id":70621431,"name":"mmo-server","full_name":"sintell/mmo-server","owner":{"login":"sintell","id":2109007,"avatar_url":"https://avatars.githubusercontent.com/u/2109007?v=3","gravatar_id":"","url":"https://api.github.com/users/sintell","html_url":"https://github.com/sintell","followers_url":"https://api.github.com/users/sintell/followers","following_url":"https://api.github.com/users/sintell/following{/other_user}","gists_url":"https://api.github.com/users/sintell/gists{/gist_id}","starred_url":"https://api.github.com/users/sintell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sintell/subscriptions","organizations_url":"https://api.github.com/users/sintell/orgs","repos_url":"https://api.github.com/users/sintell/repos","events_url":"https://api.github.com/users/sintell/events{/privacy}","received_events_url":"https://api.github.com/users/sintell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sintell/mmo-server","description":"Naive approach to mmo-server in go","fork":false,"url":"https://api.github.com/repos/sintell/mmo-server","forks_url":"https://api.github.com/repos/sintell/mmo-server/forks","keys_url":"https://api.github.com/repos/sintell/mmo-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sintell/mmo-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sintell/mmo-server/teams","hooks_url":"https://api.github.com/repos/sintell/mmo-server/hooks","issue_events_url":"https://api.github.com/repos/sintell/mmo-server/issues/events{/number}","events_url":"https://api.github.com/repos/sintell/mmo-server/events","assignees_url":"https://api.github.com/repos/sintell/mmo-server/assignees{/user}","branches_url":"https://api.github.com/repos/sintell/mmo-server/branches{/branch}","tags_url":"https://api.github.com/repos/sintell/mmo-server/tags","blobs_url":"https://api.github.com/repos/sintell/mmo-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sintell/mmo-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sintell/mmo-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/sintell/mmo-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sintell/mmo-server/statuses/{sha}","languages_url":"https://api.github.com/repos/sintell/mmo-server/languages","stargazers_url":"https://api.github.com/repos/sintell/mmo-server/stargazers","contributors_url":"https://api.github.com/repos/sintell/mmo-server/contributors","subscribers_url":"https://api.github.com/repos/sintell/mmo-server/subscribers","subscription_url":"https://api.github.com/repos/sintell/mmo-server/subscription","commits_url":"https://api.github.com/repos/sintell/mmo-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/sintell/mmo-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/sintell/mmo-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/sintell/mmo-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/sintell/mmo-server/contents/{+path}","compare_url":"https://api.github.com/repos/sintell/mmo-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sintell/mmo-server/merges","archive_url":"https://api.github.com/repos/sintell/mmo-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sintell/mmo-server/downloads","issues_url":"https://api.github.com/repos/sintell/mmo-server/issues{/number}","pulls_url":"https://api.github.com/repos/sintell/mmo-server/pulls{/number}","milestones_url":"https://api.github.com/repos/sintell/mmo-server/milestones{/number}","notifications_url":"https://api.github.com/repos/sintell/mmo-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sintell/mmo-server/labels{/name}","releases_url":"https://api.github.com/repos/sintell/mmo-server/releases{/id}","deployments_url":"https://api.github.com/repos/sintell/mmo-server/deployments","created_at":"2016-10-11T18:05:52Z","updated_at":"2016-10-11T18:12:26Z","pushed_at":"2016-12-22T07:39:33Z","git_url":"git://github.com/sintell/mmo-server.git","ssh_url":"git@github.com:sintell/mmo-server.git","clone_url":"https://github.com/sintell/mmo-server.git","svn_url":"https://github.com/sintell/mmo-server","homepage":null,"size":2936,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sintell/mmo-server/pulls/5"},"html":{"href":"https://github.com/sintell/mmo-server/pull/5"},"issue":{"href":"https://api.github.com/repos/sintell/mmo-server/issues/5"},"comments":{"href":"https://api.github.com/repos/sintell/mmo-server/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/sintell/mmo-server/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/sintell/mmo-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sintell/mmo-server/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/sintell/mmo-server/statuses/7092234350d5b5af4b21d16e479ddc90a5c2aec1"}}}}
{"actor":{"display_login":"sintell"}}