Created
August 29, 2015 01:52
-
-
Save akehoyayoi/fc2c04af93554758aa16 to your computer and use it in GitHub Desktop.
お手軽な端末時間を進めるチートの対策 ref: http://qiita.com/akehoyayoi@github/items/b6dbfd50ebb86bf80dce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void SampleScene::onEnter() | |
{ | |
〜略〜 | |
// 時間があっているかチェックする | |
NtpChecker::sharedInstance()->check(this, ntpchecker_selector(SampleScene::bonus)); | |
} | |
void SampleScene::bonus(NtpResult result) | |
{ | |
switch(result) { | |
case NtpResult::OK: | |
// TODO:ここにボーナス付与の処理を書く | |
case NtpResult::NG: | |
// チートしてる可能性あり、懲らしめたい人はなんかやって下さい | |
case NtpResult::Unknown: | |
default: | |
// 通信途絶など | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "NtpChecker.h" | |
class SampleScene | |
: public CCLayer | |
〜略〜 | |
void bonus(NtpResult result); // コールバック関数の定義 | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment