GitHub PullRequestReviewCommentEvent at 2014-12-29 06:21:05
Repository: cocos2d-x
Actor: wezhang
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/comments/22303653","id":22303653,"diff_hunk":"@@ -0,0 +1,80 @@\n+/*\n+ Copyright (c) 2014, LambdaCloud\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+ \n+ 1. Redistributions of source code must retain the above copyright notice, this\n+ list of conditions and the following disclaimer.\n+ \n+ 2. Redistributions in binary form must reproduce the above copyright notice,\n+ this list of conditions and the following disclaimer in the documentation\n+ and/or other materials provided with the distribution.\n+ \n+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+\n+#include \"LambdaDevice.h\"\n+#import <CoreTelephony/CTTelephonyNetworkInfo.h>\n+#import <CoreTelephony/CTCarrier.h>\n+#import \"ReachabilityIOSMac.h\"\n+#import \"platform/CCApplication.h\"\n+#import \"sys/utsname.h\"\n+\n+using namespace lambdacloud;\n+\n+std::string LambdaDevice::getCarrierName(void)\n+{\n+    CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init];\n+    CTCarrier *carrier = [netinfo subscriberCellularProvider];\n+    return [[carrier carrierName] UTF8String];\n+}\n+\n+int LambdaDevice::getNetworkStatus(void)\n+{\n+    NetworkStatus status = [[ReachabilityIOSMac reachabilityForInternetConnection] currentReachabilityStatus];\n+    if (status == ReachableViaWiFi) return lambdaNetworkStatusReachableViaWiFi;\n+    if (status == ReachableViaWWAN) return lambdaNetworkStatusReachableViaWWAN;\n+    return lambdaNetworkStatusNotReachable;\n+}\n+\n+int LambdaDevice::getApplicationPlatform(void)\n+{\n+    auto app = cocos2d::Application::getInstance();\n+    auto platform = app->getTargetPlatform();\n+    if (platform == cocos2d::ApplicationProtocol::Platform::OS_ANDROID)\n+        return lambdaPlatformAndroid;\n+    else if (platform == cocos2d::ApplicationProtocol::Platform::OS_IPHONE)\n+        return lambdaPlatformIPhone;\n+    else if (platform == cocos2d::ApplicationProtocol::Platform::OS_IPAD)\n+        return lambdaPlatformIPad;\n+    else if (platform == cocos2d::ApplicationProtocol::Platform::OS_WP8)\n+        return lambdaPlatformWp;\n+    else if (platform == cocos2d::ApplicationProtocol::Platform::OS_WINDOWS)\n+        return lambdaPlatformWin;\n+    else if (platform == cocos2d::ApplicationProtocol::Platform::OS_WINRT)","path":"cocos/lambdacloud/LambdaDeviceIOSMac.mm","position":67,"original_position":67,"commit_id":"967d262b7f334f4b1aa4eafc0752f8f349664fc6","original_commit_id":"967d262b7f334f4b1aa4eafc0752f8f349664fc6","user":{"login":"wezhang","id":7385667,"avatar_url":"https://avatars.githubusercontent.com/u/7385667?v=3","gravatar_id":"","url":"https://api.github.com/users/wezhang","html_url":"https://github.com/wezhang","followers_url":"https://api.github.com/users/wezhang/followers","following_url":"https://api.github.com/users/wezhang/following{/other_user}","gists_url":"https://api.github.com/users/wezhang/gists{/gist_id}","starred_url":"https://api.github.com/users/wezhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wezhang/subscriptions","organizations_url":"https://api.github.com/users/wezhang/orgs","repos_url":"https://api.github.com/users/wezhang/repos","events_url":"https://api.github.com/users/wezhang/events{/privacy}","received_events_url":"https://api.github.com/users/wezhang/received_events","type":"User","site_admin":false},"body":"可以只用判断IOS/MAC系列","created_at":"2014-12-29T06:21:05Z","updated_at":"2014-12-29T06:21:05Z","html_url":"https://github.com/lambdacloud/cocos2d-x/pull/4#discussion_r22303653","pull_request_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/comments/22303653"},"html":{"href":"https://github.com/lambdacloud/cocos2d-x/pull/4#discussion_r22303653"},"pull_request":{"href":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/4","id":26622570,"html_url":"https://github.com/lambdacloud/cocos2d-x/pull/4","diff_url":"https://github.com/lambdacloud/cocos2d-x/pull/4.diff","patch_url":"https://github.com/lambdacloud/cocos2d-x/pull/4.patch","issue_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/issues/4","number":4,"state":"open","locked":false,"title":"Class to retrieve basic device info for IOSAndroid","user":{"login":"sky4star","id":10058436,"avatar_url":"https://avatars.githubusercontent.com/u/10058436?v=3","gravatar_id":"","url":"https://api.github.com/users/sky4star","html_url":"https://github.com/sky4star","followers_url":"https://api.github.com/users/sky4star/followers","following_url":"https://api.github.com/users/sky4star/following{/other_user}","gists_url":"https://api.github.com/users/sky4star/gists{/gist_id}","starred_url":"https://api.github.com/users/sky4star/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sky4star/subscriptions","organizations_url":"https://api.github.com/users/sky4star/orgs","repos_url":"https://api.github.com/users/sky4star/repos","events_url":"https://api.github.com/users/sky4star/events{/privacy}","received_events_url":"https://api.github.com/users/sky4star/received_events","type":"User","site_admin":false},"body":"Retrieve the following info:\r\ndevice name, carrier name, current network state and platform name","created_at":"2014-12-28T10:14:01Z","updated_at":"2014-12-29T06:21:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cd84912b131f7fbc51413e5f2c8e04945e5e845","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/4/commits","review_comments_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/4/comments","review_comment_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/comments/{number}","comments_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/issues/4/comments","statuses_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/statuses/967d262b7f334f4b1aa4eafc0752f8f349664fc6","head":{"label":"sky4star:v3","ref":"v3","sha":"967d262b7f334f4b1aa4eafc0752f8f349664fc6","user":{"login":"sky4star","id":10058436,"avatar_url":"https://avatars.githubusercontent.com/u/10058436?v=3","gravatar_id":"","url":"https://api.github.com/users/sky4star","html_url":"https://github.com/sky4star","followers_url":"https://api.github.com/users/sky4star/followers","following_url":"https://api.github.com/users/sky4star/following{/other_user}","gists_url":"https://api.github.com/users/sky4star/gists{/gist_id}","starred_url":"https://api.github.com/users/sky4star/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sky4star/subscriptions","organizations_url":"https://api.github.com/users/sky4star/orgs","repos_url":"https://api.github.com/users/sky4star/repos","events_url":"https://api.github.com/users/sky4star/events{/privacy}","received_events_url":"https://api.github.com/users/sky4star/received_events","type":"User","site_admin":false},"repo":{"id":28468138,"name":"cocos2d-x","full_name":"sky4star/cocos2d-x","owner":{"login":"sky4star","id":10058436,"avatar_url":"https://avatars.githubusercontent.com/u/10058436?v=3","gravatar_id":"","url":"https://api.github.com/users/sky4star","html_url":"https://github.com/sky4star","followers_url":"https://api.github.com/users/sky4star/followers","following_url":"https://api.github.com/users/sky4star/following{/other_user}","gists_url":"https://api.github.com/users/sky4star/gists{/gist_id}","starred_url":"https://api.github.com/users/sky4star/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sky4star/subscriptions","organizations_url":"https://api.github.com/users/sky4star/orgs","repos_url":"https://api.github.com/users/sky4star/repos","events_url":"https://api.github.com/users/sky4star/events{/privacy}","received_events_url":"https://api.github.com/users/sky4star/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sky4star/cocos2d-x","description":"cocos2d-x for C++","fork":true,"url":"https://api.github.com/repos/sky4star/cocos2d-x","forks_url":"https://api.github.com/repos/sky4star/cocos2d-x/forks","keys_url":"https://api.github.com/repos/sky4star/cocos2d-x/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sky4star/cocos2d-x/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sky4star/cocos2d-x/teams","hooks_url":"https://api.github.com/repos/sky4star/cocos2d-x/hooks","issue_events_url":"https://api.github.com/repos/sky4star/cocos2d-x/issues/events{/number}","events_url":"https://api.github.com/repos/sky4star/cocos2d-x/events","assignees_url":"https://api.github.com/repos/sky4star/cocos2d-x/assignees{/user}","branches_url":"https://api.github.com/repos/sky4star/cocos2d-x/branches{/branch}","tags_url":"https://api.github.com/repos/sky4star/cocos2d-x/tags","blobs_url":"https://api.github.com/repos/sky4star/cocos2d-x/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sky4star/cocos2d-x/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sky4star/cocos2d-x/git/refs{/sha}","trees_url":"https://api.github.com/repos/sky4star/cocos2d-x/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sky4star/cocos2d-x/statuses/{sha}","languages_url":"https://api.github.com/repos/sky4star/cocos2d-x/languages","stargazers_url":"https://api.github.com/repos/sky4star/cocos2d-x/stargazers","contributors_url":"https://api.github.com/repos/sky4star/cocos2d-x/contributors","subscribers_url":"https://api.github.com/repos/sky4star/cocos2d-x/subscribers","subscription_url":"https://api.github.com/repos/sky4star/cocos2d-x/subscription","commits_url":"https://api.github.com/repos/sky4star/cocos2d-x/commits{/sha}","git_commits_url":"https://api.github.com/repos/sky4star/cocos2d-x/git/commits{/sha}","comments_url":"https://api.github.com/repos/sky4star/cocos2d-x/comments{/number}","issue_comment_url":"https://api.github.com/repos/sky4star/cocos2d-x/issues/comments/{number}","contents_url":"https://api.github.com/repos/sky4star/cocos2d-x/contents/{+path}","compare_url":"https://api.github.com/repos/sky4star/cocos2d-x/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sky4star/cocos2d-x/merges","archive_url":"https://api.github.com/repos/sky4star/cocos2d-x/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sky4star/cocos2d-x/downloads","issues_url":"https://api.github.com/repos/sky4star/cocos2d-x/issues{/number}","pulls_url":"https://api.github.com/repos/sky4star/cocos2d-x/pulls{/number}","milestones_url":"https://api.github.com/repos/sky4star/cocos2d-x/milestones{/number}","notifications_url":"https://api.github.com/repos/sky4star/cocos2d-x/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sky4star/cocos2d-x/labels{/name}","releases_url":"https://api.github.com/repos/sky4star/cocos2d-x/releases{/id}","created_at":"2014-12-25T02:32:35Z","updated_at":"2014-12-28T15:17:39Z","pushed_at":"2014-12-28T15:17:39Z","git_url":"git://github.com/sky4star/cocos2d-x.git","ssh_url":"git@github.com:sky4star/cocos2d-x.git","clone_url":"https://github.com/sky4star/cocos2d-x.git","svn_url":"https://github.com/sky4star/cocos2d-x","homepage":"http://www.cocos2d-x.org","size":148587,"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":"v3"}},"base":{"label":"lambdacloud:v3","ref":"v3","sha":"cc09fc5ca6a185e397a0d192bc7a838301041c42","user":{"login":"lambdacloud","id":7385683,"avatar_url":"https://avatars.githubusercontent.com/u/7385683?v=3","gravatar_id":"","url":"https://api.github.com/users/lambdacloud","html_url":"https://github.com/lambdacloud","followers_url":"https://api.github.com/users/lambdacloud/followers","following_url":"https://api.github.com/users/lambdacloud/following{/other_user}","gists_url":"https://api.github.com/users/lambdacloud/gists{/gist_id}","starred_url":"https://api.github.com/users/lambdacloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lambdacloud/subscriptions","organizations_url":"https://api.github.com/users/lambdacloud/orgs","repos_url":"https://api.github.com/users/lambdacloud/repos","events_url":"https://api.github.com/users/lambdacloud/events{/privacy}","received_events_url":"https://api.github.com/users/lambdacloud/received_events","type":"Organization","site_admin":false},"repo":{"id":28467728,"name":"cocos2d-x","full_name":"lambdacloud/cocos2d-x","owner":{"login":"lambdacloud","id":7385683,"avatar_url":"https://avatars.githubusercontent.com/u/7385683?v=3","gravatar_id":"","url":"https://api.github.com/users/lambdacloud","html_url":"https://github.com/lambdacloud","followers_url":"https://api.github.com/users/lambdacloud/followers","following_url":"https://api.github.com/users/lambdacloud/following{/other_user}","gists_url":"https://api.github.com/users/lambdacloud/gists{/gist_id}","starred_url":"https://api.github.com/users/lambdacloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lambdacloud/subscriptions","organizations_url":"https://api.github.com/users/lambdacloud/orgs","repos_url":"https://api.github.com/users/lambdacloud/repos","events_url":"https://api.github.com/users/lambdacloud/events{/privacy}","received_events_url":"https://api.github.com/users/lambdacloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lambdacloud/cocos2d-x","description":"cocos2d-x for C++","fork":true,"url":"https://api.github.com/repos/lambdacloud/cocos2d-x","forks_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/forks","keys_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/teams","hooks_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/hooks","issue_events_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/issues/events{/number}","events_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/events","assignees_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/assignees{/user}","branches_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/branches{/branch}","tags_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/tags","blobs_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/git/refs{/sha}","trees_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/statuses/{sha}","languages_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/languages","stargazers_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/stargazers","contributors_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/contributors","subscribers_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/subscribers","subscription_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/subscription","commits_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/commits{/sha}","git_commits_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/git/commits{/sha}","comments_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/comments{/number}","issue_comment_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/issues/comments/{number}","contents_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/contents/{+path}","compare_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/merges","archive_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/downloads","issues_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/issues{/number}","pulls_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls{/number}","milestones_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/milestones{/number}","notifications_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/labels{/name}","releases_url":"https://api.github.com/repos/lambdacloud/cocos2d-x/releases{/id}","created_at":"2014-12-25T02:14:21Z","updated_at":"2014-12-26T06:46:33Z","pushed_at":"2014-12-26T06:46:32Z","git_url":"git://github.com/lambdacloud/cocos2d-x.git","ssh_url":"git@github.com:lambdacloud/cocos2d-x.git","clone_url":"https://github.com/lambdacloud/cocos2d-x.git","svn_url":"https://github.com/lambdacloud/cocos2d-x","homepage":"http://www.cocos2d-x.org","size":148739,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":0,"default_branch":"v3"}},"_links":{"self":{"href":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/4"},"html":{"href":"https://github.com/lambdacloud/cocos2d-x/pull/4"},"issue":{"href":"https://api.github.com/repos/lambdacloud/cocos2d-x/issues/4"},"comments":{"href":"https://api.github.com/repos/lambdacloud/cocos2d-x/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/lambdacloud/cocos2d-x/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/lambdacloud/cocos2d-x/statuses/967d262b7f334f4b1aa4eafc0752f8f349664fc6"}}}}