{"action":"created","issue":{"url":"https://api.github.com/repos/cs340tabyu/cs340fall2016/issues/297","repository_url":"https://api.github.com/repos/cs340tabyu/cs340fall2016","labels_url":"https://api.github.com/repos/cs340tabyu/cs340fall2016/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/cs340tabyu/cs340fall2016/issues/297/comments","events_url":"https://api.github.com/repos/cs340tabyu/cs340fall2016/issues/297/events","html_url":"https://github.com/cs340tabyu/cs340fall2016/issues/297","id":185551407,"number":297,"title":"Domestic trade button is enabled even when it isn't the user's turn","user":{"login":"athompson909","id":16737040,"avatar_url":"https://avatars.githubusercontent.com/u/16737040?v=3","gravatar_id":"","url":"https://api.github.com/users/athompson909","html_url":"https://github.com/athompson909","followers_url":"https://api.github.com/users/athompson909/followers","following_url":"https://api.github.com/users/athompson909/following{/other_user}","gists_url":"https://api.github.com/users/athompson909/gists{/gist_id}","starred_url":"https://api.github.com/users/athompson909/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athompson909/subscriptions","organizations_url":"https://api.github.com/users/athompson909/orgs","repos_url":"https://api.github.com/users/athompson909/repos","events_url":"https://api.github.com/users/athompson909/events{/privacy}","received_events_url":"https://api.github.com/users/athompson909/received_events","type":"User","site_admin":false},"labels":[{"id":468084086,"url":"https://api.github.com/repos/cs340tabyu/cs340fall2016/labels/P4:%20Incorrect%20behavior%20that%20doesn't%20affect%20gameplay","name":"P4: Incorrect behavior that doesn't affect gameplay","color":"fef2c0","default":false},{"id":468085125,"url":"https://api.github.com/repos/cs340tabyu/cs340fall2016/labels/Phase%202","name":"Phase 2","color":"c5def5","default":false},{"id":468086050,"url":"https://api.github.com/repos/cs340tabyu/cs340fall2016/labels/Team%2012","name":"Team 12","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"lastmjs","id":7000719,"avatar_url":"https://avatars.githubusercontent.com/u/7000719?v=3","gravatar_id":"","url":"https://api.github.com/users/lastmjs","html_url":"https://github.com/lastmjs","followers_url":"https://api.github.com/users/lastmjs/followers","following_url":"https://api.github.com/users/lastmjs/following{/other_user}","gists_url":"https://api.github.com/users/lastmjs/gists{/gist_id}","starred_url":"https://api.github.com/users/lastmjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastmjs/subscriptions","organizations_url":"https://api.github.com/users/lastmjs/orgs","repos_url":"https://api.github.com/users/lastmjs/repos","events_url":"https://api.github.com/users/lastmjs/events{/privacy}","received_events_url":"https://api.github.com/users/lastmjs/received_events","type":"User","site_admin":false},"assignees":[{"login":"lastmjs","id":7000719,"avatar_url":"https://avatars.githubusercontent.com/u/7000719?v=3","gravatar_id":"","url":"https://api.github.com/users/lastmjs","html_url":"https://github.com/lastmjs","followers_url":"https://api.github.com/users/lastmjs/followers","following_url":"https://api.github.com/users/lastmjs/following{/other_user}","gists_url":"https://api.github.com/users/lastmjs/gists{/gist_id}","starred_url":"https://api.github.com/users/lastmjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lastmjs/subscriptions","organizations_url":"https://api.github.com/users/lastmjs/orgs","repos_url":"https://api.github.com/users/lastmjs/repos","events_url":"https://api.github.com/users/lastmjs/events{/privacy}","received_events_url":"https://api.github.com/users/lastmjs/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-10-27T01:25:59Z","updated_at":"2016-10-31T16:50:49Z","closed_at":null,"body":"the domestic trade button should be disabled if it isn't the user's turn\n"},"comment":{"url":"https://api.github.com/repos/cs340tabyu/cs340fall2016/issues/comments/257349748","html_url":"https://github.com/cs340tabyu/cs340fall2016/issues/297#issuecomment-257349748","issue_url":"https://api.github.com/repos/cs340tabyu/cs340fall2016/issues/297","id":257349748,"user":{"login":"xaves","id":5455419,"avatar_url":"https://avatars.githubusercontent.com/u/5455419?v=3","gravatar_id":"","url":"https://api.github.com/users/xaves","html_url":"https://github.com/xaves","followers_url":"https://api.github.com/users/xaves/followers","following_url":"https://api.github.com/users/xaves/following{/other_user}","gists_url":"https://api.github.com/users/xaves/gists{/gist_id}","starred_url":"https://api.github.com/users/xaves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xaves/subscriptions","organizations_url":"https://api.github.com/users/xaves/orgs","repos_url":"https://api.github.com/users/xaves/repos","events_url":"https://api.github.com/users/xaves/events{/privacy}","received_events_url":"https://api.github.com/users/xaves/received_events","type":"User","site_admin":false},"created_at":"2016-10-31T16:50:49Z","updated_at":"2016-10-31T16:50:49Z","body":"Here's our current code:\r\n```\r\nint currentTurn = (int) getIn(clientModel, \"turnTracker\", \"currentTurn\");\r\nboolean isClientPlayerTurn = eq(clientPlayerIndex, currentTurn);\r\ngetTradeView().enableDomesticTrade(isClientPlayerTurn);\r\n```\r\nSo, we are are checking to see if it is the user's turn. \r\n\r\nI think the problem is that the current turn starts out as 0. So, if you're signed in as the first player then your index matches and so the button appears enabled while you are waiting for the game to start. That's the only place where I'm not seeing the button behave like it's supposed to.\r\n\r\nSo, I think the fix for this is to simply add another check that makes sure that the game is in the playing state. With both those checks we should be in good shape."}}
{"actor":{"display_login":"xaves"}}