{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/comments/86182942","pull_request_review_id":6852971,"id":86182942,"diff_hunk":"@@ -48,29 +47,39 @@ public class SharingStage : MonoBehaviour\n         /// Provides callbacks when server is discovered or lost.\n         /// </summary>\n         private DiscoveryClientAdapter discoveryClientAdapter;\n+\n+        /// <summary>\n+        /// Provides callbacks for when we connect to a server.\n+        /// </summary>\n+        private NetworkConnectionAdapter networkConnectionAdapter = null;\n+\n+        private NetworkConnection networkConnection = null;\n     \n         private float pingIntervalCurrent = 0;\n         private bool isTryingToFindServer = false;\n \n         private void Awake()\n         {\n-            Instance = this;\n-\n             this.logWriter = new ConsoleLogWriter();\n \n             if (AutoDiscoverServer)\n             {\n                 AutoDiscoverInit();\n             }\n-            else\n+\n+            networkConnectionAdapter = new NetworkConnectionAdapter();\n+        }\n+\n+        private void Start()\n+        {\n+            if (!AutoDiscoverServer)\n             {\n                 Connect();\n             }\n         }\n \n         protected void OnDestroy()\n         {\n-            Instance = null;\n ","path":"Assets/HoloToolkit/Sharing/Scripts/SharingStage.cs","position":62,"original_position":62,"commit_id":"0d5090f1a936499517b32200a7090be85f9014ce","original_commit_id":"0d5090f1a936499517b32200a7090be85f9014ce","user":{"login":"HodgsonSDAS","id":13334553,"avatar_url":"https://avatars.githubusercontent.com/u/13334553?v=3","gravatar_id":"","url":"https://api.github.com/users/HodgsonSDAS","html_url":"https://github.com/HodgsonSDAS","followers_url":"https://api.github.com/users/HodgsonSDAS/followers","following_url":"https://api.github.com/users/HodgsonSDAS/following{/other_user}","gists_url":"https://api.github.com/users/HodgsonSDAS/gists{/gist_id}","starred_url":"https://api.github.com/users/HodgsonSDAS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HodgsonSDAS/subscriptions","organizations_url":"https://api.github.com/users/HodgsonSDAS/orgs","repos_url":"https://api.github.com/users/HodgsonSDAS/repos","events_url":"https://api.github.com/users/HodgsonSDAS/events{/privacy}","received_events_url":"https://api.github.com/users/HodgsonSDAS/received_events","type":"User","site_admin":false},"body":"Nit: Extra line","created_at":"2016-11-02T16:23:42Z","updated_at":"2016-11-02T16:26:24Z","html_url":"https://github.com/Microsoft/HoloToolkit-Unity/pull/306#discussion_r86182942","pull_request_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/306","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/comments/86182942"},"html":{"href":"https://github.com/Microsoft/HoloToolkit-Unity/pull/306#discussion_r86182942"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/306"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/306","id":90592937,"html_url":"https://github.com/Microsoft/HoloToolkit-Unity/pull/306","diff_url":"https://github.com/Microsoft/HoloToolkit-Unity/pull/306.diff","patch_url":"https://github.com/Microsoft/HoloToolkit-Unity/pull/306.patch","issue_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/issues/306","number":306,"state":"open","locked":false,"title":"Sharing fixes","user":{"login":"Holo-Krzysztof","id":22612985,"avatar_url":"https://avatars.githubusercontent.com/u/22612985?v=3","gravatar_id":"","url":"https://api.github.com/users/Holo-Krzysztof","html_url":"https://github.com/Holo-Krzysztof","followers_url":"https://api.github.com/users/Holo-Krzysztof/followers","following_url":"https://api.github.com/users/Holo-Krzysztof/following{/other_user}","gists_url":"https://api.github.com/users/Holo-Krzysztof/gists{/gist_id}","starred_url":"https://api.github.com/users/Holo-Krzysztof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Holo-Krzysztof/subscriptions","organizations_url":"https://api.github.com/users/Holo-Krzysztof/orgs","repos_url":"https://api.github.com/users/Holo-Krzysztof/repos","events_url":"https://api.github.com/users/Holo-Krzysztof/events{/privacy}","received_events_url":"https://api.github.com/users/Holo-Krzysztof/received_events","type":"User","site_admin":false},"body":"This references issue https://github.com/Microsoft/HoloToolkit-Unity/issues/292\n\nThe major fixes here are subscribing to `NetworkConnection` events so that we know when we're connected to the server instead of using `Invoke` with a certain time (which failed when init took more than one second) and using `Singleton<T>` for `SharingStage`, as the previous implementation was broken and an unnecessary duplication of efforts.\n\nMy previous testing showed the Sharing sample scene to work now, which wasn't the case before; I would appreciate if some other people tested and verified this to be true.\n","created_at":"2016-10-24T11:19:48Z","updated_at":"2016-11-02T16:26:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8615545fd8fda16aaf96317e39daeef3d84ea862","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/306/commits","review_comments_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/306/comments","review_comment_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/issues/306/comments","statuses_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/statuses/0d5090f1a936499517b32200a7090be85f9014ce","head":{"label":"Holo-Krzysztof:sharing-fixes","ref":"sharing-fixes","sha":"0d5090f1a936499517b32200a7090be85f9014ce","user":{"login":"Holo-Krzysztof","id":22612985,"avatar_url":"https://avatars.githubusercontent.com/u/22612985?v=3","gravatar_id":"","url":"https://api.github.com/users/Holo-Krzysztof","html_url":"https://github.com/Holo-Krzysztof","followers_url":"https://api.github.com/users/Holo-Krzysztof/followers","following_url":"https://api.github.com/users/Holo-Krzysztof/following{/other_user}","gists_url":"https://api.github.com/users/Holo-Krzysztof/gists{/gist_id}","starred_url":"https://api.github.com/users/Holo-Krzysztof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Holo-Krzysztof/subscriptions","organizations_url":"https://api.github.com/users/Holo-Krzysztof/orgs","repos_url":"https://api.github.com/users/Holo-Krzysztof/repos","events_url":"https://api.github.com/users/Holo-Krzysztof/events{/privacy}","received_events_url":"https://api.github.com/users/Holo-Krzysztof/received_events","type":"User","site_admin":false},"repo":{"id":71780325,"name":"HoloToolkit-Unity","full_name":"Holo-Krzysztof/HoloToolkit-Unity","owner":{"login":"Holo-Krzysztof","id":22612985,"avatar_url":"https://avatars.githubusercontent.com/u/22612985?v=3","gravatar_id":"","url":"https://api.github.com/users/Holo-Krzysztof","html_url":"https://github.com/Holo-Krzysztof","followers_url":"https://api.github.com/users/Holo-Krzysztof/followers","following_url":"https://api.github.com/users/Holo-Krzysztof/following{/other_user}","gists_url":"https://api.github.com/users/Holo-Krzysztof/gists{/gist_id}","starred_url":"https://api.github.com/users/Holo-Krzysztof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Holo-Krzysztof/subscriptions","organizations_url":"https://api.github.com/users/Holo-Krzysztof/orgs","repos_url":"https://api.github.com/users/Holo-Krzysztof/repos","events_url":"https://api.github.com/users/Holo-Krzysztof/events{/privacy}","received_events_url":"https://api.github.com/users/Holo-Krzysztof/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Holo-Krzysztof/HoloToolkit-Unity","description":"This is effectively part of the existing HoloToolkit, but is the repo that will contain all Unity specific components.","fork":true,"url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity","forks_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/forks","keys_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/teams","hooks_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/hooks","issue_events_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/issues/events{/number}","events_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/events","assignees_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/assignees{/user}","branches_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/branches{/branch}","tags_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/tags","blobs_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/git/refs{/sha}","trees_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/statuses/{sha}","languages_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/languages","stargazers_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/stargazers","contributors_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/contributors","subscribers_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/subscribers","subscription_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/subscription","commits_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/commits{/sha}","git_commits_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/git/commits{/sha}","comments_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/comments{/number}","issue_comment_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/issues/comments{/number}","contents_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/contents/{+path}","compare_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/merges","archive_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/downloads","issues_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/issues{/number}","pulls_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/pulls{/number}","milestones_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/milestones{/number}","notifications_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/labels{/name}","releases_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/releases{/id}","deployments_url":"https://api.github.com/repos/Holo-Krzysztof/HoloToolkit-Unity/deployments","created_at":"2016-10-24T11:02:05Z","updated_at":"2016-10-24T11:02:07Z","pushed_at":"2016-11-02T11:04:15Z","git_url":"git://github.com/Holo-Krzysztof/HoloToolkit-Unity.git","ssh_url":"git@github.com:Holo-Krzysztof/HoloToolkit-Unity.git","clone_url":"https://github.com/Holo-Krzysztof/HoloToolkit-Unity.git","svn_url":"https://github.com/Holo-Krzysztof/HoloToolkit-Unity","homepage":"","size":43445,"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":"Microsoft:master","ref":"master","sha":"eaa81e4ccc75c77ed84aaab937f9f965ba96779c","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":50605426,"name":"HoloToolkit-Unity","full_name":"Microsoft/HoloToolkit-Unity","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/HoloToolkit-Unity","description":"This is effectively part of the existing HoloToolkit, but is the repo that will contain all Unity specific components.","fork":false,"url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity","forks_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/forks","keys_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/teams","hooks_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/events","assignees_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/tags","blobs_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/languages","stargazers_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/subscription","commits_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/merges","archive_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/downloads","issues_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/deployments","created_at":"2016-01-28T18:54:58Z","updated_at":"2016-11-02T12:20:58Z","pushed_at":"2016-11-02T11:04:15Z","git_url":"git://github.com/Microsoft/HoloToolkit-Unity.git","ssh_url":"git@github.com:Microsoft/HoloToolkit-Unity.git","clone_url":"https://github.com/Microsoft/HoloToolkit-Unity.git","svn_url":"https://github.com/Microsoft/HoloToolkit-Unity","homepage":"","size":43870,"stargazers_count":351,"watchers_count":351,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":200,"mirror_url":null,"open_issues_count":51,"forks":200,"open_issues":51,"watchers":351,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/306"},"html":{"href":"https://github.com/Microsoft/HoloToolkit-Unity/pull/306"},"issue":{"href":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/issues/306"},"comments":{"href":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/issues/306/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/306/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/pulls/306/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/HoloToolkit-Unity/statuses/0d5090f1a936499517b32200a7090be85f9014ce"}}}}
{"actor":{"display_login":"HodgsonSDAS"}}