{"action":"created","issue":{"url":"https://api.github.com/repos/haxball/haxball-issues/issues/634","repository_url":"https://api.github.com/repos/haxball/haxball-issues","labels_url":"https://api.github.com/repos/haxball/haxball-issues/issues/634/labels{/name}","comments_url":"https://api.github.com/repos/haxball/haxball-issues/issues/634/comments","events_url":"https://api.github.com/repos/haxball/haxball-issues/issues/634/events","html_url":"https://github.com/haxball/haxball-issues/issues/634","id":384247993,"node_id":"MDU6SXNzdWUzODQyNDc5OTM=","number":634,"title":"Handler in onGameTick with id","user":{"login":"LGosh","id":44095179,"node_id":"MDQ6VXNlcjQ0MDk1MTc5","avatar_url":"https://avatars3.githubusercontent.com/u/44095179?v=4","gravatar_id":"","url":"https://api.github.com/users/LGosh","html_url":"https://github.com/LGosh","followers_url":"https://api.github.com/users/LGosh/followers","following_url":"https://api.github.com/users/LGosh/following{/other_user}","gists_url":"https://api.github.com/users/LGosh/gists{/gist_id}","starred_url":"https://api.github.com/users/LGosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LGosh/subscriptions","organizations_url":"https://api.github.com/users/LGosh/orgs","repos_url":"https://api.github.com/users/LGosh/repos","events_url":"https://api.github.com/users/LGosh/events{/privacy}","received_events_url":"https://api.github.com/users/LGosh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-11-26T09:46:05Z","updated_at":"2018-11-26T12:49:53Z","closed_at":null,"author_association":"NONE","body":"I'm trying to handle the players that have not moved for a while. What I've done so far does not work, it does not send a chat message, neither logs any errors in console. Any ideas? Thanks\r\n\r\n\r\n```\r\nconst activities = {};\r\nlet id;\r\nroom.onGameTick = function () {\r\n    activities[room.getPlayer(id)] = Date.now();\r\n\r\n\r\n    let now = Date.now();\r\n    for (let id in activities) {\r\n        if (now - activities[id] > 5000) {\r\n          room.sendChat(room.getPlayer(id) + 'has not moved for a while');\r\n        } else if (now - activities[id] > 8000) {\r\n          room.sendChat(room.getPlayer(id) + 'has not moved for even longer');\r\n        }\r\n    }\r\n"},"comment":{"url":"https://api.github.com/repos/haxball/haxball-issues/issues/comments/441627593","html_url":"https://github.com/haxball/haxball-issues/issues/634#issuecomment-441627593","issue_url":"https://api.github.com/repos/haxball/haxball-issues/issues/634","id":441627593,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTYyNzU5Mw==","user":{"login":"olegmisar","id":29802592,"node_id":"MDQ6VXNlcjI5ODAyNTky","avatar_url":"https://avatars0.githubusercontent.com/u/29802592?v=4","gravatar_id":"","url":"https://api.github.com/users/olegmisar","html_url":"https://github.com/olegmisar","followers_url":"https://api.github.com/users/olegmisar/followers","following_url":"https://api.github.com/users/olegmisar/following{/other_user}","gists_url":"https://api.github.com/users/olegmisar/gists{/gist_id}","starred_url":"https://api.github.com/users/olegmisar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olegmisar/subscriptions","organizations_url":"https://api.github.com/users/olegmisar/orgs","repos_url":"https://api.github.com/users/olegmisar/repos","events_url":"https://api.github.com/users/olegmisar/events{/privacy}","received_events_url":"https://api.github.com/users/olegmisar/received_events","type":"User","site_admin":false},"created_at":"2018-11-26T12:49:53Z","updated_at":"2018-11-26T12:49:53Z","author_association":"NONE","body":"Just remove `room.sendChat` from `onGameTick`"}}
{"actor":{"display_login":"olegmisar"}}