{"action":"created","comment":{"url":"https://api.github.com/repos/minetest/minetest/pulls/comments/55314882","id":55314882,"diff_hunk":"@@ -555,6 +565,13 @@ void ServerEnvironment::loadMeta()\n \t\t// If missing, do as if clearObjects was never called\n \t\tm_last_clear_objects_time = 0;\n \t}\n+\n+\ttry {\n+\t\tm_day_count = args.getU64(\"day_count\");\n+\t} catch (SettingNotFoundException &e) {\n+\t\t// If missing, start the day counter\n+\t\tm_day_count = 0;\n+\t}","path":"src/environment.cpp","position":null,"original_position":51,"commit_id":"431cafa67b1312b3e218da0192f94cd665a83760","original_commit_id":"ad177ba692f123d5d239f5c027121cbaa392b6b7","user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"body":"I cleaned up this and 2 more of the settings readers as well in a second patch.","created_at":"2016-03-08T04:24:39Z","updated_at":"2016-03-08T04:24:39Z","html_url":"https://github.com/minetest/minetest/pull/3820#discussion_r55314882","pull_request_url":"https://api.github.com/repos/minetest/minetest/pulls/3820","_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest/pulls/comments/55314882"},"html":{"href":"https://github.com/minetest/minetest/pull/3820#discussion_r55314882"},"pull_request":{"href":"https://api.github.com/repos/minetest/minetest/pulls/3820"}}},"pull_request":{"url":"https://api.github.com/repos/minetest/minetest/pulls/3820","id":61853285,"html_url":"https://github.com/minetest/minetest/pull/3820","diff_url":"https://github.com/minetest/minetest/pull/3820.diff","patch_url":"https://github.com/minetest/minetest/pull/3820.patch","issue_url":"https://api.github.com/repos/minetest/minetest/issues/3820","number":3820,"state":"open","locked":false,"title":"Add consistent monotic day counter - get_daycount()","user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"body":"I've written several experimental bits of code that revolve\r\naround the need for a consistent calendar, but implementing one\r\nis extremely hard in mods due to time changes and mods overriding\r\ncore.get_timeofday(), which will conflict.\r\n\r\nThe second part of the problem is that doing this from a mod\r\nrequires constant maintenance of a settings file.\r\n\r\nAn implementation in core is trivial, however, and solves all of\r\nthese problems at virtually no cost: No extra branches in server\r\nsteps, and a single branch when minetest.set_time_of_day(), which\r\nis entirely reasonable.\r\n\r\nWe store the day_count value in env_meta.txt.\r\n\r\nThe use case is obvious: This change allows mods to create an\r\nactual virtual calendar, or properly account for seasonal changes,\r\netc..","created_at":"2016-03-06T20:11:53Z","updated_at":"2016-03-08T04:24:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d4dc4c757ac230a2db8574230d010b86001f5d0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/minetest/minetest/pulls/3820/commits","review_comments_url":"https://api.github.com/repos/minetest/minetest/pulls/3820/comments","review_comment_url":"https://api.github.com/repos/minetest/minetest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/3820/comments","statuses_url":"https://api.github.com/repos/minetest/minetest/statuses/431cafa67b1312b3e218da0192f94cd665a83760","head":{"label":"sofar:get_daycount","ref":"get_daycount","sha":"431cafa67b1312b3e218da0192f94cd665a83760","user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"repo":{"id":29793579,"name":"minetest","full_name":"sofar/minetest","owner":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sofar/minetest","description":"Minetest, an open source infinite-world block sandbox game with survival and crafting. [also https://github.com/minetest/minetest_game]","fork":true,"url":"https://api.github.com/repos/sofar/minetest","forks_url":"https://api.github.com/repos/sofar/minetest/forks","keys_url":"https://api.github.com/repos/sofar/minetest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sofar/minetest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sofar/minetest/teams","hooks_url":"https://api.github.com/repos/sofar/minetest/hooks","issue_events_url":"https://api.github.com/repos/sofar/minetest/issues/events{/number}","events_url":"https://api.github.com/repos/sofar/minetest/events","assignees_url":"https://api.github.com/repos/sofar/minetest/assignees{/user}","branches_url":"https://api.github.com/repos/sofar/minetest/branches{/branch}","tags_url":"https://api.github.com/repos/sofar/minetest/tags","blobs_url":"https://api.github.com/repos/sofar/minetest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sofar/minetest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sofar/minetest/git/refs{/sha}","trees_url":"https://api.github.com/repos/sofar/minetest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sofar/minetest/statuses/{sha}","languages_url":"https://api.github.com/repos/sofar/minetest/languages","stargazers_url":"https://api.github.com/repos/sofar/minetest/stargazers","contributors_url":"https://api.github.com/repos/sofar/minetest/contributors","subscribers_url":"https://api.github.com/repos/sofar/minetest/subscribers","subscription_url":"https://api.github.com/repos/sofar/minetest/subscription","commits_url":"https://api.github.com/repos/sofar/minetest/commits{/sha}","git_commits_url":"https://api.github.com/repos/sofar/minetest/git/commits{/sha}","comments_url":"https://api.github.com/repos/sofar/minetest/comments{/number}","issue_comment_url":"https://api.github.com/repos/sofar/minetest/issues/comments{/number}","contents_url":"https://api.github.com/repos/sofar/minetest/contents/{+path}","compare_url":"https://api.github.com/repos/sofar/minetest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sofar/minetest/merges","archive_url":"https://api.github.com/repos/sofar/minetest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sofar/minetest/downloads","issues_url":"https://api.github.com/repos/sofar/minetest/issues{/number}","pulls_url":"https://api.github.com/repos/sofar/minetest/pulls{/number}","milestones_url":"https://api.github.com/repos/sofar/minetest/milestones{/number}","notifications_url":"https://api.github.com/repos/sofar/minetest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sofar/minetest/labels{/name}","releases_url":"https://api.github.com/repos/sofar/minetest/releases{/id}","deployments_url":"https://api.github.com/repos/sofar/minetest/deployments","created_at":"2015-01-24T22:13:18Z","updated_at":"2015-01-24T22:13:20Z","pushed_at":"2016-03-08T04:24:15Z","git_url":"git://github.com/sofar/minetest.git","ssh_url":"git@github.com:sofar/minetest.git","clone_url":"https://github.com/sofar/minetest.git","svn_url":"https://github.com/sofar/minetest","homepage":"http://minetest.net/","size":45697,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"minetest:master","ref":"master","sha":"3ce6642a26d43fd368c24cdfc5460557258fb44f","user":{"login":"minetest","id":2624745,"avatar_url":"https://avatars.githubusercontent.com/u/2624745?v=3","gravatar_id":"","url":"https://api.github.com/users/minetest","html_url":"https://github.com/minetest","followers_url":"https://api.github.com/users/minetest/followers","following_url":"https://api.github.com/users/minetest/following{/other_user}","gists_url":"https://api.github.com/users/minetest/gists{/gist_id}","starred_url":"https://api.github.com/users/minetest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minetest/subscriptions","organizations_url":"https://api.github.com/users/minetest/orgs","repos_url":"https://api.github.com/users/minetest/repos","events_url":"https://api.github.com/users/minetest/events{/privacy}","received_events_url":"https://api.github.com/users/minetest/received_events","type":"Organization","site_admin":false},"repo":{"id":2168780,"name":"minetest","full_name":"minetest/minetest","owner":{"login":"minetest","id":2624745,"avatar_url":"https://avatars.githubusercontent.com/u/2624745?v=3","gravatar_id":"","url":"https://api.github.com/users/minetest","html_url":"https://github.com/minetest","followers_url":"https://api.github.com/users/minetest/followers","following_url":"https://api.github.com/users/minetest/following{/other_user}","gists_url":"https://api.github.com/users/minetest/gists{/gist_id}","starred_url":"https://api.github.com/users/minetest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minetest/subscriptions","organizations_url":"https://api.github.com/users/minetest/orgs","repos_url":"https://api.github.com/users/minetest/repos","events_url":"https://api.github.com/users/minetest/events{/privacy}","received_events_url":"https://api.github.com/users/minetest/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/minetest/minetest","description":"Minetest, an open source infinite-world block sandbox game with survival and crafting. [also https://github.com/minetest/minetest_game]","fork":false,"url":"https://api.github.com/repos/minetest/minetest","forks_url":"https://api.github.com/repos/minetest/minetest/forks","keys_url":"https://api.github.com/repos/minetest/minetest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minetest/minetest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minetest/minetest/teams","hooks_url":"https://api.github.com/repos/minetest/minetest/hooks","issue_events_url":"https://api.github.com/repos/minetest/minetest/issues/events{/number}","events_url":"https://api.github.com/repos/minetest/minetest/events","assignees_url":"https://api.github.com/repos/minetest/minetest/assignees{/user}","branches_url":"https://api.github.com/repos/minetest/minetest/branches{/branch}","tags_url":"https://api.github.com/repos/minetest/minetest/tags","blobs_url":"https://api.github.com/repos/minetest/minetest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minetest/minetest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minetest/minetest/git/refs{/sha}","trees_url":"https://api.github.com/repos/minetest/minetest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minetest/minetest/statuses/{sha}","languages_url":"https://api.github.com/repos/minetest/minetest/languages","stargazers_url":"https://api.github.com/repos/minetest/minetest/stargazers","contributors_url":"https://api.github.com/repos/minetest/minetest/contributors","subscribers_url":"https://api.github.com/repos/minetest/minetest/subscribers","subscription_url":"https://api.github.com/repos/minetest/minetest/subscription","commits_url":"https://api.github.com/repos/minetest/minetest/commits{/sha}","git_commits_url":"https://api.github.com/repos/minetest/minetest/git/commits{/sha}","comments_url":"https://api.github.com/repos/minetest/minetest/comments{/number}","issue_comment_url":"https://api.github.com/repos/minetest/minetest/issues/comments{/number}","contents_url":"https://api.github.com/repos/minetest/minetest/contents/{+path}","compare_url":"https://api.github.com/repos/minetest/minetest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minetest/minetest/merges","archive_url":"https://api.github.com/repos/minetest/minetest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minetest/minetest/downloads","issues_url":"https://api.github.com/repos/minetest/minetest/issues{/number}","pulls_url":"https://api.github.com/repos/minetest/minetest/pulls{/number}","milestones_url":"https://api.github.com/repos/minetest/minetest/milestones{/number}","notifications_url":"https://api.github.com/repos/minetest/minetest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minetest/minetest/labels{/name}","releases_url":"https://api.github.com/repos/minetest/minetest/releases{/id}","deployments_url":"https://api.github.com/repos/minetest/minetest/deployments","created_at":"2011-08-07T13:48:36Z","updated_at":"2016-03-07T20:12:22Z","pushed_at":"2016-03-08T04:24:16Z","git_url":"git://github.com/minetest/minetest.git","ssh_url":"git@github.com:minetest/minetest.git","clone_url":"https://github.com/minetest/minetest.git","svn_url":"https://github.com/minetest/minetest","homepage":"http://minetest.net/","size":92998,"stargazers_count":1838,"watchers_count":1838,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":600,"mirror_url":null,"open_issues_count":743,"forks":600,"open_issues":743,"watchers":1838,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/minetest/minetest/pulls/3820"},"html":{"href":"https://github.com/minetest/minetest/pull/3820"},"issue":{"href":"https://api.github.com/repos/minetest/minetest/issues/3820"},"comments":{"href":"https://api.github.com/repos/minetest/minetest/issues/3820/comments"},"review_comments":{"href":"https://api.github.com/repos/minetest/minetest/pulls/3820/comments"},"review_comment":{"href":"https://api.github.com/repos/minetest/minetest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/minetest/minetest/pulls/3820/commits"},"statuses":{"href":"https://api.github.com/repos/minetest/minetest/statuses/431cafa67b1312b3e218da0192f94cd665a83760"}}}}