{"action":"created","comment":{"url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/comments/129794031","pull_request_review_id":52602699,"id":129794031,"diff_hunk":"@@ -0,0 +1,36 @@\n+package com.spanish_inquisition.battleship.server;\n+\n+import com.spanish_inquisition.battleship.common.AppLogger;\n+import com.spanish_inquisition.battleship.common.Header;\n+\n+import java.util.List;\n+import java.util.logging.Level;\n+\n+import static com.spanish_inquisition.battleship.common.AppLogger.DEFAULT_LEVEL;\n+import static com.spanish_inquisition.battleship.common.AppLogger.logger;\n+import static com.spanish_inquisition.battleship.server.BattleshipServer.requestBus;\n+\n+public class BattleshipGame {\n+    List<ClientConnectionHandler> players;\n+    boolean gameIsRunning = true;\n+\n+    public BattleshipGame(List<ClientConnectionHandler> clients) {\n+        players = clients;\n+    }\n+\n+    public void proceed() {\n+        while(gameIsRunning) {\n+            for (ClientConnectionHandler player: players) {\n+                System.out.println(\"checking message from player \" + player.getPlayerName());\n+                int playerId = player.getClientId();\n+                if(requestBus.haveMessageFromSender(playerId)){\n+                    String message = requestBus.getMessageFromSender(playerId).getMessage();\n+                    if(message.contains(Header.MOVE_REGULAR.name())) {\n+                        logger.log(DEFAULT_LEVEL, \"Player clicked on field:\" + message.substring(message.indexOf(\":\") + 1, message.length()));","path":"src/main/java/com/spanish_inquisition/battleship/server/BattleshipGame.java","position":29,"original_position":29,"commit_id":"ee8944a756b92226ecdd7828cfd9492e61031c06","original_commit_id":"ee8944a756b92226ecdd7828cfd9492e61031c06","user":{"login":"mprtcz","id":17063143,"avatar_url":"https://avatars3.githubusercontent.com/u/17063143?v=4","gravatar_id":"","url":"https://api.github.com/users/mprtcz","html_url":"https://github.com/mprtcz","followers_url":"https://api.github.com/users/mprtcz/followers","following_url":"https://api.github.com/users/mprtcz/following{/other_user}","gists_url":"https://api.github.com/users/mprtcz/gists{/gist_id}","starred_url":"https://api.github.com/users/mprtcz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mprtcz/subscriptions","organizations_url":"https://api.github.com/users/mprtcz/orgs","repos_url":"https://api.github.com/users/mprtcz/repos","events_url":"https://api.github.com/users/mprtcz/events{/privacy}","received_events_url":"https://api.github.com/users/mprtcz/received_events","type":"User","site_admin":false},"body":"Create some class that will parse a message in the future.","created_at":"2017-07-27T09:30:25Z","updated_at":"2017-07-27T09:30:25Z","html_url":"https://github.com/spanish-inquisition-4/Battleship_v2/pull/10#discussion_r129794031","pull_request_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/comments/129794031"},"html":{"href":"https://github.com/spanish-inquisition-4/Battleship_v2/pull/10#discussion_r129794031"},"pull_request":{"href":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/10","id":132703179,"html_url":"https://github.com/spanish-inquisition-4/Battleship_v2/pull/10","diff_url":"https://github.com/spanish-inquisition-4/Battleship_v2/pull/10.diff","patch_url":"https://github.com/spanish-inquisition-4/Battleship_v2/pull/10.patch","issue_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues/10","number":10,"state":"open","locked":false,"title":"button clicked seen in server code review","user":{"login":"yakisoba0","id":8348498,"avatar_url":"https://avatars2.githubusercontent.com/u/8348498?v=4","gravatar_id":"","url":"https://api.github.com/users/yakisoba0","html_url":"https://github.com/yakisoba0","followers_url":"https://api.github.com/users/yakisoba0/followers","following_url":"https://api.github.com/users/yakisoba0/following{/other_user}","gists_url":"https://api.github.com/users/yakisoba0/gists{/gist_id}","starred_url":"https://api.github.com/users/yakisoba0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yakisoba0/subscriptions","organizations_url":"https://api.github.com/users/yakisoba0/orgs","repos_url":"https://api.github.com/users/yakisoba0/repos","events_url":"https://api.github.com/users/yakisoba0/events{/privacy}","received_events_url":"https://api.github.com/users/yakisoba0/received_events","type":"User","site_admin":false},"body":"See commit messages for changes in this feuture. Don't mind with changed port in tests. No tests due to code quota exceeded. They will be added later.","created_at":"2017-07-27T09:23:45Z","updated_at":"2017-07-27T09:30:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[{"login":"agawda","id":7873947,"avatar_url":"https://avatars3.githubusercontent.com/u/7873947?v=4","gravatar_id":"","url":"https://api.github.com/users/agawda","html_url":"https://github.com/agawda","followers_url":"https://api.github.com/users/agawda/followers","following_url":"https://api.github.com/users/agawda/following{/other_user}","gists_url":"https://api.github.com/users/agawda/gists{/gist_id}","starred_url":"https://api.github.com/users/agawda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agawda/subscriptions","organizations_url":"https://api.github.com/users/agawda/orgs","repos_url":"https://api.github.com/users/agawda/repos","events_url":"https://api.github.com/users/agawda/events{/privacy}","received_events_url":"https://api.github.com/users/agawda/received_events","type":"User","site_admin":false},{"login":"arturAR","id":18446697,"avatar_url":"https://avatars1.githubusercontent.com/u/18446697?v=4","gravatar_id":"","url":"https://api.github.com/users/arturAR","html_url":"https://github.com/arturAR","followers_url":"https://api.github.com/users/arturAR/followers","following_url":"https://api.github.com/users/arturAR/following{/other_user}","gists_url":"https://api.github.com/users/arturAR/gists{/gist_id}","starred_url":"https://api.github.com/users/arturAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arturAR/subscriptions","organizations_url":"https://api.github.com/users/arturAR/orgs","repos_url":"https://api.github.com/users/arturAR/repos","events_url":"https://api.github.com/users/arturAR/events{/privacy}","received_events_url":"https://api.github.com/users/arturAR/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/10/commits","review_comments_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/10/comments","review_comment_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues/10/comments","statuses_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/statuses/ee8944a756b92226ecdd7828cfd9492e61031c06","head":{"label":"spanish-inquisition-4:button-click-seen-in-server","ref":"button-click-seen-in-server","sha":"ee8944a756b92226ecdd7828cfd9492e61031c06","user":{"login":"spanish-inquisition-4","id":30144634,"avatar_url":"https://avatars0.githubusercontent.com/u/30144634?v=4","gravatar_id":"","url":"https://api.github.com/users/spanish-inquisition-4","html_url":"https://github.com/spanish-inquisition-4","followers_url":"https://api.github.com/users/spanish-inquisition-4/followers","following_url":"https://api.github.com/users/spanish-inquisition-4/following{/other_user}","gists_url":"https://api.github.com/users/spanish-inquisition-4/gists{/gist_id}","starred_url":"https://api.github.com/users/spanish-inquisition-4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spanish-inquisition-4/subscriptions","organizations_url":"https://api.github.com/users/spanish-inquisition-4/orgs","repos_url":"https://api.github.com/users/spanish-inquisition-4/repos","events_url":"https://api.github.com/users/spanish-inquisition-4/events{/privacy}","received_events_url":"https://api.github.com/users/spanish-inquisition-4/received_events","type":"User","site_admin":false},"repo":{"id":98204306,"name":"Battleship_v2","full_name":"spanish-inquisition-4/Battleship_v2","owner":{"login":"spanish-inquisition-4","id":30144634,"avatar_url":"https://avatars0.githubusercontent.com/u/30144634?v=4","gravatar_id":"","url":"https://api.github.com/users/spanish-inquisition-4","html_url":"https://github.com/spanish-inquisition-4","followers_url":"https://api.github.com/users/spanish-inquisition-4/followers","following_url":"https://api.github.com/users/spanish-inquisition-4/following{/other_user}","gists_url":"https://api.github.com/users/spanish-inquisition-4/gists{/gist_id}","starred_url":"https://api.github.com/users/spanish-inquisition-4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spanish-inquisition-4/subscriptions","organizations_url":"https://api.github.com/users/spanish-inquisition-4/orgs","repos_url":"https://api.github.com/users/spanish-inquisition-4/repos","events_url":"https://api.github.com/users/spanish-inquisition-4/events{/privacy}","received_events_url":"https://api.github.com/users/spanish-inquisition-4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spanish-inquisition-4/Battleship_v2","description":"Java implementation of Battleship game (client-server architecture with simple GUI in JavaFX). See game rules: https://en.wikipedia.org/wiki/Battleship_(game)","fork":false,"url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2","forks_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/forks","keys_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/teams","hooks_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/hooks","issue_events_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues/events{/number}","events_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/events","assignees_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/assignees{/user}","branches_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/branches{/branch}","tags_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/tags","blobs_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/refs{/sha}","trees_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/statuses/{sha}","languages_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/languages","stargazers_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/stargazers","contributors_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/contributors","subscribers_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/subscribers","subscription_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/subscription","commits_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/commits{/sha}","git_commits_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/commits{/sha}","comments_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/comments{/number}","issue_comment_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues/comments{/number}","contents_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/contents/{+path}","compare_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/merges","archive_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/downloads","issues_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues{/number}","pulls_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls{/number}","milestones_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/milestones{/number}","notifications_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/labels{/name}","releases_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/releases{/id}","deployments_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/deployments","created_at":"2017-07-24T15:11:52Z","updated_at":"2017-07-25T13:40:45Z","pushed_at":"2017-07-27T09:23:46Z","git_url":"git://github.com/spanish-inquisition-4/Battleship_v2.git","ssh_url":"git@github.com:spanish-inquisition-4/Battleship_v2.git","clone_url":"https://github.com/spanish-inquisition-4/Battleship_v2.git","svn_url":"https://github.com/spanish-inquisition-4/Battleship_v2","homepage":null,"size":60,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"spanish-inquisition-4:master","ref":"master","sha":"d9668547caadd43e4b24ca3dbfcce0a89bb1522a","user":{"login":"spanish-inquisition-4","id":30144634,"avatar_url":"https://avatars0.githubusercontent.com/u/30144634?v=4","gravatar_id":"","url":"https://api.github.com/users/spanish-inquisition-4","html_url":"https://github.com/spanish-inquisition-4","followers_url":"https://api.github.com/users/spanish-inquisition-4/followers","following_url":"https://api.github.com/users/spanish-inquisition-4/following{/other_user}","gists_url":"https://api.github.com/users/spanish-inquisition-4/gists{/gist_id}","starred_url":"https://api.github.com/users/spanish-inquisition-4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spanish-inquisition-4/subscriptions","organizations_url":"https://api.github.com/users/spanish-inquisition-4/orgs","repos_url":"https://api.github.com/users/spanish-inquisition-4/repos","events_url":"https://api.github.com/users/spanish-inquisition-4/events{/privacy}","received_events_url":"https://api.github.com/users/spanish-inquisition-4/received_events","type":"User","site_admin":false},"repo":{"id":98204306,"name":"Battleship_v2","full_name":"spanish-inquisition-4/Battleship_v2","owner":{"login":"spanish-inquisition-4","id":30144634,"avatar_url":"https://avatars0.githubusercontent.com/u/30144634?v=4","gravatar_id":"","url":"https://api.github.com/users/spanish-inquisition-4","html_url":"https://github.com/spanish-inquisition-4","followers_url":"https://api.github.com/users/spanish-inquisition-4/followers","following_url":"https://api.github.com/users/spanish-inquisition-4/following{/other_user}","gists_url":"https://api.github.com/users/spanish-inquisition-4/gists{/gist_id}","starred_url":"https://api.github.com/users/spanish-inquisition-4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spanish-inquisition-4/subscriptions","organizations_url":"https://api.github.com/users/spanish-inquisition-4/orgs","repos_url":"https://api.github.com/users/spanish-inquisition-4/repos","events_url":"https://api.github.com/users/spanish-inquisition-4/events{/privacy}","received_events_url":"https://api.github.com/users/spanish-inquisition-4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spanish-inquisition-4/Battleship_v2","description":"Java implementation of Battleship game (client-server architecture with simple GUI in JavaFX). See game rules: https://en.wikipedia.org/wiki/Battleship_(game)","fork":false,"url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2","forks_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/forks","keys_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/teams","hooks_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/hooks","issue_events_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues/events{/number}","events_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/events","assignees_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/assignees{/user}","branches_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/branches{/branch}","tags_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/tags","blobs_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/refs{/sha}","trees_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/statuses/{sha}","languages_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/languages","stargazers_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/stargazers","contributors_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/contributors","subscribers_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/subscribers","subscription_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/subscription","commits_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/commits{/sha}","git_commits_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/git/commits{/sha}","comments_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/comments{/number}","issue_comment_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues/comments{/number}","contents_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/contents/{+path}","compare_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/merges","archive_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/downloads","issues_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues{/number}","pulls_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls{/number}","milestones_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/milestones{/number}","notifications_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/labels{/name}","releases_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/releases{/id}","deployments_url":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/deployments","created_at":"2017-07-24T15:11:52Z","updated_at":"2017-07-25T13:40:45Z","pushed_at":"2017-07-27T09:23:46Z","git_url":"git://github.com/spanish-inquisition-4/Battleship_v2.git","ssh_url":"git@github.com:spanish-inquisition-4/Battleship_v2.git","clone_url":"https://github.com/spanish-inquisition-4/Battleship_v2.git","svn_url":"https://github.com/spanish-inquisition-4/Battleship_v2","homepage":null,"size":60,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/10"},"html":{"href":"https://github.com/spanish-inquisition-4/Battleship_v2/pull/10"},"issue":{"href":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues/10"},"comments":{"href":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/spanish-inquisition-4/Battleship_v2/statuses/ee8944a756b92226ecdd7828cfd9492e61031c06"}}}}
{"actor":{"display_login":"mprtcz"}}