{"action":"created","comment":{"url":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/comments/53569046","id":53569046,"diff_hunk":"@@ -0,0 +1,99 @@\n+/*\n+===========================================================================\n+Daemon BSD Source Code\n+Copyright (c) 2013-2016, Daemon Developers\n+All rights reserved.\n+\n+Redistribution and use in source and binary forms, with or without\n+modification, are permitted provided that the following conditions are met:\n+    * Redistributions of source code must retain the above copyright\n+      notice, this list of conditions and the following disclaimer.\n+    * Redistributions in binary form must reproduce the above copyright\n+      notice, this list of conditions and the following disclaimer in the\n+      documentation and/or other materials provided with the distribution.\n+    * Neither the name of the Daemon developers nor the\n+      names of its contributors may be used to endorse or promote products\n+      derived from this software without specific prior written permission.\n+\n+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY\n+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+===========================================================================\n+*/\n+#ifndef COMMON_RCON_H_\n+#define COMMON_RCON_H_\n+\n+#include <string>\n+#include \"common/Cvar.h\"\n+\n+namespace Rcon {\n+\n+/*\n+ * Secure RCon algorithm\n+ */\n+enum class Secure {\n+\tUnencrypted,        // Allow unencrypted rcon\n+\tEncryptedPlain,     // Require encryption\n+\tEncryptedChallenge, // Require encryption and challege check\n+\tInvalid             // Invalid protocol\n+};\n+\n+/*\n+ * RCon message sent from a client to a server\n+ */\n+class Message","path":"daemon/src/engine/framework/Rcon.h","position":51,"original_position":51,"commit_id":"82648841c48f19eefd3faf24a604be3f3b7322bd","original_commit_id":"82648841c48f19eefd3faf24a604be3f3b7322bd","user":{"login":"Kangz","id":472810,"avatar_url":"https://avatars.githubusercontent.com/u/472810?v=3","gravatar_id":"","url":"https://api.github.com/users/Kangz","html_url":"https://github.com/Kangz","followers_url":"https://api.github.com/users/Kangz/followers","following_url":"https://api.github.com/users/Kangz/following{/other_user}","gists_url":"https://api.github.com/users/Kangz/gists{/gist_id}","starred_url":"https://api.github.com/users/Kangz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kangz/subscriptions","organizations_url":"https://api.github.com/users/Kangz/orgs","repos_url":"https://api.github.com/users/Kangz/repos","events_url":"https://api.github.com/users/Kangz/events{/privacy}","received_events_url":"https://api.github.com/users/Kangz/received_events","type":"User","site_admin":false},"body":"I'm not a fan of your approach here: it seems to me that Message does to much and there is no clear separation between what is received, errors, etc. From what I understand you did this to have all the Rcon code at the same place, right? Message should be a method-less structure and the various methods should be changed to functions operating on that structure.\r\n\r\nFor example Acceptable would become bool Rcon::IsAcceptable(const Message& message, std::string* error);\r\nThe code using that function might have to do a bit more work to create the answer from the error string, but it would still be cleaner.","created_at":"2016-02-21T16:36:24Z","updated_at":"2016-02-21T16:36:24Z","html_url":"https://github.com/Unvanquished/Unvanquished/pull/828#discussion_r53569046","pull_request_url":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/828","_links":{"self":{"href":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/comments/53569046"},"html":{"href":"https://github.com/Unvanquished/Unvanquished/pull/828#discussion_r53569046"},"pull_request":{"href":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/828"}}},"pull_request":{"url":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/828","id":49474020,"html_url":"https://github.com/Unvanquished/Unvanquished/pull/828","diff_url":"https://github.com/Unvanquished/Unvanquished/pull/828.diff","patch_url":"https://github.com/Unvanquished/Unvanquished/pull/828.patch","issue_url":"https://api.github.com/repos/Unvanquished/Unvanquished/issues/828","number":828,"state":"open","locked":false,"title":"Connectionless commands, rcon and encryption","user":{"login":"mbasaglia","id":2465791,"avatar_url":"https://avatars.githubusercontent.com/u/2465791?v=3","gravatar_id":"","url":"https://api.github.com/users/mbasaglia","html_url":"https://github.com/mbasaglia","followers_url":"https://api.github.com/users/mbasaglia/followers","following_url":"https://api.github.com/users/mbasaglia/following{/other_user}","gists_url":"https://api.github.com/users/mbasaglia/gists{/gist_id}","starred_url":"https://api.github.com/users/mbasaglia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbasaglia/subscriptions","organizations_url":"https://api.github.com/users/mbasaglia/orgs","repos_url":"https://api.github.com/users/mbasaglia/repos","events_url":"https://api.github.com/users/mbasaglia/events{/privacy}","received_events_url":"https://api.github.com/users/mbasaglia/received_events","type":"User","site_admin":false},"body":"The purpose of this branch is to improve interoperability with remote scripts and to refactor certain parts of the networking code.\r\n\r\n### Details\r\n* Improved OOB **getstatus** and **getinfo**\r\n* Added the **ping** OOB command, so scripts can just check if a server is online. (This is more lightweight that getinfo)\r\n* New challenge system, improved, thread-safe, flexible and with nicer challenges. This new system can be set up to have a configurable challenge size, the challenge is stored as binary data and displayed as a hexadecimal string. Challenge representations always end up having the same length unlike the current signed integer representation.\r\n* Higher-level wrappers around nettle for encryption, hashing and similar.\r\n* Secure rcon command (**srcon**), which supports challenges and encryption\r\n* C++ alternative for info string manipulation, used by the connectionless commands, other parts of the code still use the old C version.\r\n* Server-side cvars to configure the requirements for **rcon** and **srcon**\r\n* A command for auto-discovery of rcon settings, so a client only have to know the server password \r\n* Used MAX_MSGLEN for rcon environment\r\n* Re-written the low-level out of band networking functions\r\n* Improved the **status** server command\r\n* Added server-side **listmaps** command\r\n* Fixed some misc networking bugs\r\n* Cvar server.private replaces server.lanOnly to allow finer control\r\n* Refactored how the engine keeps track of master servers\r\n* Fix localhost name lookup.\r\n\r\n### Compatibility\r\n* New clients are still compatible with older servers\r\n* Old clients may have a hard time connecting to new servers as the challenge format has changed\r\n\r\n### Things to do\r\n* Client-side rcon autoconfiguration\r\n* Fix CI build errors\r\n\r\n### Testing the new protocols\r\nTo test the new OOB commands you can use [this bash script](https://raw.githubusercontent.com/Evil-Ant-Colony/Xonotic-EAC-Scripts/master/server/rcon).\r\n\r\n","created_at":"2015-11-02T19:27:25Z","updated_at":"2016-02-21T16:36:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d44e836d02945f83c2fd02f0993fef76260eba8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/828/commits","review_comments_url":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/828/comments","review_comment_url":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Unvanquished/Unvanquished/issues/828/comments","statuses_url":"https://api.github.com/repos/Unvanquished/Unvanquished/statuses/82648841c48f19eefd3faf24a604be3f3b7322bd","head":{"label":"Unvanquished:connectionless_packet","ref":"connectionless_packet","sha":"82648841c48f19eefd3faf24a604be3f3b7322bd","user":{"login":"Unvanquished","id":1360713,"avatar_url":"https://avatars.githubusercontent.com/u/1360713?v=3","gravatar_id":"","url":"https://api.github.com/users/Unvanquished","html_url":"https://github.com/Unvanquished","followers_url":"https://api.github.com/users/Unvanquished/followers","following_url":"https://api.github.com/users/Unvanquished/following{/other_user}","gists_url":"https://api.github.com/users/Unvanquished/gists{/gist_id}","starred_url":"https://api.github.com/users/Unvanquished/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unvanquished/subscriptions","organizations_url":"https://api.github.com/users/Unvanquished/orgs","repos_url":"https://api.github.com/users/Unvanquished/repos","events_url":"https://api.github.com/users/Unvanquished/events{/privacy}","received_events_url":"https://api.github.com/users/Unvanquished/received_events","type":"Organization","site_admin":false},"repo":{"id":2490468,"name":"Unvanquished","full_name":"Unvanquished/Unvanquished","owner":{"login":"Unvanquished","id":1360713,"avatar_url":"https://avatars.githubusercontent.com/u/1360713?v=3","gravatar_id":"","url":"https://api.github.com/users/Unvanquished","html_url":"https://github.com/Unvanquished","followers_url":"https://api.github.com/users/Unvanquished/followers","following_url":"https://api.github.com/users/Unvanquished/following{/other_user}","gists_url":"https://api.github.com/users/Unvanquished/gists{/gist_id}","starred_url":"https://api.github.com/users/Unvanquished/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unvanquished/subscriptions","organizations_url":"https://api.github.com/users/Unvanquished/orgs","repos_url":"https://api.github.com/users/Unvanquished/repos","events_url":"https://api.github.com/users/Unvanquished/events{/privacy}","received_events_url":"https://api.github.com/users/Unvanquished/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Unvanquished/Unvanquished","description":"An FPS/RTS hybrid game powered by the Daemon engine (a combination of ioq3 and XreaL)","fork":false,"url":"https://api.github.com/repos/Unvanquished/Unvanquished","forks_url":"https://api.github.com/repos/Unvanquished/Unvanquished/forks","keys_url":"https://api.github.com/repos/Unvanquished/Unvanquished/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Unvanquished/Unvanquished/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Unvanquished/Unvanquished/teams","hooks_url":"https://api.github.com/repos/Unvanquished/Unvanquished/hooks","issue_events_url":"https://api.github.com/repos/Unvanquished/Unvanquished/issues/events{/number}","events_url":"https://api.github.com/repos/Unvanquished/Unvanquished/events","assignees_url":"https://api.github.com/repos/Unvanquished/Unvanquished/assignees{/user}","branches_url":"https://api.github.com/repos/Unvanquished/Unvanquished/branches{/branch}","tags_url":"https://api.github.com/repos/Unvanquished/Unvanquished/tags","blobs_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/refs{/sha}","trees_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Unvanquished/Unvanquished/statuses/{sha}","languages_url":"https://api.github.com/repos/Unvanquished/Unvanquished/languages","stargazers_url":"https://api.github.com/repos/Unvanquished/Unvanquished/stargazers","contributors_url":"https://api.github.com/repos/Unvanquished/Unvanquished/contributors","subscribers_url":"https://api.github.com/repos/Unvanquished/Unvanquished/subscribers","subscription_url":"https://api.github.com/repos/Unvanquished/Unvanquished/subscription","commits_url":"https://api.github.com/repos/Unvanquished/Unvanquished/commits{/sha}","git_commits_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/commits{/sha}","comments_url":"https://api.github.com/repos/Unvanquished/Unvanquished/comments{/number}","issue_comment_url":"https://api.github.com/repos/Unvanquished/Unvanquished/issues/comments{/number}","contents_url":"https://api.github.com/repos/Unvanquished/Unvanquished/contents/{+path}","compare_url":"https://api.github.com/repos/Unvanquished/Unvanquished/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Unvanquished/Unvanquished/merges","archive_url":"https://api.github.com/repos/Unvanquished/Unvanquished/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Unvanquished/Unvanquished/downloads","issues_url":"https://api.github.com/repos/Unvanquished/Unvanquished/issues{/number}","pulls_url":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls{/number}","milestones_url":"https://api.github.com/repos/Unvanquished/Unvanquished/milestones{/number}","notifications_url":"https://api.github.com/repos/Unvanquished/Unvanquished/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Unvanquished/Unvanquished/labels{/name}","releases_url":"https://api.github.com/repos/Unvanquished/Unvanquished/releases{/id}","deployments_url":"https://api.github.com/repos/Unvanquished/Unvanquished/deployments","created_at":"2011-09-30T16:44:44Z","updated_at":"2016-02-19T12:37:05Z","pushed_at":"2016-02-21T09:59:22Z","git_url":"git://github.com/Unvanquished/Unvanquished.git","ssh_url":"git@github.com:Unvanquished/Unvanquished.git","clone_url":"https://github.com/Unvanquished/Unvanquished.git","svn_url":"https://github.com/Unvanquished/Unvanquished","homepage":"http://unvanquished.net","size":175152,"stargazers_count":248,"watchers_count":248,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"open_issues_count":182,"forks":79,"open_issues":182,"watchers":248,"default_branch":"master"}},"base":{"label":"Unvanquished:master","ref":"master","sha":"a25add42cc3f441730a5e350e6a8027c556d58b8","user":{"login":"Unvanquished","id":1360713,"avatar_url":"https://avatars.githubusercontent.com/u/1360713?v=3","gravatar_id":"","url":"https://api.github.com/users/Unvanquished","html_url":"https://github.com/Unvanquished","followers_url":"https://api.github.com/users/Unvanquished/followers","following_url":"https://api.github.com/users/Unvanquished/following{/other_user}","gists_url":"https://api.github.com/users/Unvanquished/gists{/gist_id}","starred_url":"https://api.github.com/users/Unvanquished/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unvanquished/subscriptions","organizations_url":"https://api.github.com/users/Unvanquished/orgs","repos_url":"https://api.github.com/users/Unvanquished/repos","events_url":"https://api.github.com/users/Unvanquished/events{/privacy}","received_events_url":"https://api.github.com/users/Unvanquished/received_events","type":"Organization","site_admin":false},"repo":{"id":2490468,"name":"Unvanquished","full_name":"Unvanquished/Unvanquished","owner":{"login":"Unvanquished","id":1360713,"avatar_url":"https://avatars.githubusercontent.com/u/1360713?v=3","gravatar_id":"","url":"https://api.github.com/users/Unvanquished","html_url":"https://github.com/Unvanquished","followers_url":"https://api.github.com/users/Unvanquished/followers","following_url":"https://api.github.com/users/Unvanquished/following{/other_user}","gists_url":"https://api.github.com/users/Unvanquished/gists{/gist_id}","starred_url":"https://api.github.com/users/Unvanquished/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unvanquished/subscriptions","organizations_url":"https://api.github.com/users/Unvanquished/orgs","repos_url":"https://api.github.com/users/Unvanquished/repos","events_url":"https://api.github.com/users/Unvanquished/events{/privacy}","received_events_url":"https://api.github.com/users/Unvanquished/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Unvanquished/Unvanquished","description":"An FPS/RTS hybrid game powered by the Daemon engine (a combination of ioq3 and XreaL)","fork":false,"url":"https://api.github.com/repos/Unvanquished/Unvanquished","forks_url":"https://api.github.com/repos/Unvanquished/Unvanquished/forks","keys_url":"https://api.github.com/repos/Unvanquished/Unvanquished/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Unvanquished/Unvanquished/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Unvanquished/Unvanquished/teams","hooks_url":"https://api.github.com/repos/Unvanquished/Unvanquished/hooks","issue_events_url":"https://api.github.com/repos/Unvanquished/Unvanquished/issues/events{/number}","events_url":"https://api.github.com/repos/Unvanquished/Unvanquished/events","assignees_url":"https://api.github.com/repos/Unvanquished/Unvanquished/assignees{/user}","branches_url":"https://api.github.com/repos/Unvanquished/Unvanquished/branches{/branch}","tags_url":"https://api.github.com/repos/Unvanquished/Unvanquished/tags","blobs_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/refs{/sha}","trees_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Unvanquished/Unvanquished/statuses/{sha}","languages_url":"https://api.github.com/repos/Unvanquished/Unvanquished/languages","stargazers_url":"https://api.github.com/repos/Unvanquished/Unvanquished/stargazers","contributors_url":"https://api.github.com/repos/Unvanquished/Unvanquished/contributors","subscribers_url":"https://api.github.com/repos/Unvanquished/Unvanquished/subscribers","subscription_url":"https://api.github.com/repos/Unvanquished/Unvanquished/subscription","commits_url":"https://api.github.com/repos/Unvanquished/Unvanquished/commits{/sha}","git_commits_url":"https://api.github.com/repos/Unvanquished/Unvanquished/git/commits{/sha}","comments_url":"https://api.github.com/repos/Unvanquished/Unvanquished/comments{/number}","issue_comment_url":"https://api.github.com/repos/Unvanquished/Unvanquished/issues/comments{/number}","contents_url":"https://api.github.com/repos/Unvanquished/Unvanquished/contents/{+path}","compare_url":"https://api.github.com/repos/Unvanquished/Unvanquished/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Unvanquished/Unvanquished/merges","archive_url":"https://api.github.com/repos/Unvanquished/Unvanquished/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Unvanquished/Unvanquished/downloads","issues_url":"https://api.github.com/repos/Unvanquished/Unvanquished/issues{/number}","pulls_url":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls{/number}","milestones_url":"https://api.github.com/repos/Unvanquished/Unvanquished/milestones{/number}","notifications_url":"https://api.github.com/repos/Unvanquished/Unvanquished/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Unvanquished/Unvanquished/labels{/name}","releases_url":"https://api.github.com/repos/Unvanquished/Unvanquished/releases{/id}","deployments_url":"https://api.github.com/repos/Unvanquished/Unvanquished/deployments","created_at":"2011-09-30T16:44:44Z","updated_at":"2016-02-19T12:37:05Z","pushed_at":"2016-02-21T09:59:22Z","git_url":"git://github.com/Unvanquished/Unvanquished.git","ssh_url":"git@github.com:Unvanquished/Unvanquished.git","clone_url":"https://github.com/Unvanquished/Unvanquished.git","svn_url":"https://github.com/Unvanquished/Unvanquished","homepage":"http://unvanquished.net","size":175152,"stargazers_count":248,"watchers_count":248,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"open_issues_count":182,"forks":79,"open_issues":182,"watchers":248,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/828"},"html":{"href":"https://github.com/Unvanquished/Unvanquished/pull/828"},"issue":{"href":"https://api.github.com/repos/Unvanquished/Unvanquished/issues/828"},"comments":{"href":"https://api.github.com/repos/Unvanquished/Unvanquished/issues/828/comments"},"review_comments":{"href":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/828/comments"},"review_comment":{"href":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Unvanquished/Unvanquished/pulls/828/commits"},"statuses":{"href":"https://api.github.com/repos/Unvanquished/Unvanquished/statuses/82648841c48f19eefd3faf24a604be3f3b7322bd"}}}}