{"action":"created","issue":{"url":"https://api.github.com/repos/j-e-k/poketrainer/issues/300","repository_url":"https://api.github.com/repos/j-e-k/poketrainer","labels_url":"https://api.github.com/repos/j-e-k/poketrainer/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/j-e-k/poketrainer/issues/300/comments","events_url":"https://api.github.com/repos/j-e-k/poketrainer/issues/300/events","html_url":"https://github.com/j-e-k/poketrainer/pull/300","id":168472282,"number":300,"title":"Sniping, multi-threaded locking mechanism","user":{"login":"guyz","id":1300663,"avatar_url":"https://avatars.githubusercontent.com/u/1300663?v=3","gravatar_id":"","url":"https://api.github.com/users/guyz","html_url":"https://github.com/guyz","followers_url":"https://api.github.com/users/guyz/followers","following_url":"https://api.github.com/users/guyz/following{/other_user}","gists_url":"https://api.github.com/users/guyz/gists{/gist_id}","starred_url":"https://api.github.com/users/guyz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyz/subscriptions","organizations_url":"https://api.github.com/users/guyz/orgs","repos_url":"https://api.github.com/users/guyz/repos","events_url":"https://api.github.com/users/guyz/events{/privacy}","received_events_url":"https://api.github.com/users/guyz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-30T15:20:55Z","updated_at":"2016-07-30T22:37:37Z","closed_at":"2016-07-30T17:15:48Z","pull_request":{"url":"https://api.github.com/repos/j-e-k/poketrainer/pulls/300","html_url":"https://github.com/j-e-k/poketrainer/pull/300","diff_url":"https://github.com/j-e-k/poketrainer/pull/300.diff","patch_url":"https://github.com/j-e-k/poketrainer/pull/300.patch"},"body":"The main added feature is Sniping, that can be controlled through the UI by inputting coordinates. Another important changes under the hood that could help in the future:\r\n\r\n- Locking/unlocking. The way the bot is set up currently is that there's a single 'main' background thread (greenlet) for the bot. Before any new server call, the bot now locks/unlocks using cond_lock() and cond_release(). These make sure that there aren't double locking/deadlocks happening.\r\n\r\n- Locking also has the ability to persist a lock. For example, when sniping, we want the entire sniping flow to run before the bot resumes. This is useful for other stuff as well that requires multiple server calls.\r\n\r\n- Per thread _req_method_list - this way when a thread waits for a lock, another thread won't overwrite its request list right before a server call.\r\n\r\n-  Simple JSON interaction. Instead of refreshing the page, the result of the sniping is returned via AJAX. If we go with a client-side library like AngularJS, then this is redundant, but for now it provides an easy way to create UI interactions without refreshing the page."},"comment":{"url":"https://api.github.com/repos/j-e-k/poketrainer/issues/comments/236393685","html_url":"https://github.com/j-e-k/poketrainer/pull/300#issuecomment-236393685","issue_url":"https://api.github.com/repos/j-e-k/poketrainer/issues/300","id":236393685,"user":{"login":"sftwninja","id":8016121,"avatar_url":"https://avatars.githubusercontent.com/u/8016121?v=3","gravatar_id":"","url":"https://api.github.com/users/sftwninja","html_url":"https://github.com/sftwninja","followers_url":"https://api.github.com/users/sftwninja/followers","following_url":"https://api.github.com/users/sftwninja/following{/other_user}","gists_url":"https://api.github.com/users/sftwninja/gists{/gist_id}","starred_url":"https://api.github.com/users/sftwninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sftwninja/subscriptions","organizations_url":"https://api.github.com/users/sftwninja/orgs","repos_url":"https://api.github.com/users/sftwninja/repos","events_url":"https://api.github.com/users/sftwninja/events{/privacy}","received_events_url":"https://api.github.com/users/sftwninja/received_events","type":"User","site_admin":false},"created_at":"2016-07-30T22:37:37Z","updated_at":"2016-07-30T22:37:37Z","body":"Played with this for a few hours. Very nice! Thanks for the great PR :)"}}
{"actor":{"display_login":"sftwninja"}}