Skip to content

Instantly share code, notes, and snippets.

@akehoyayoi
Created August 29, 2015 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akehoyayoi/fc2c04af93554758aa16 to your computer and use it in GitHub Desktop.
Save akehoyayoi/fc2c04af93554758aa16 to your computer and use it in GitHub Desktop.
お手軽な端末時間を進めるチートの対策 ref: http://qiita.com/akehoyayoi@github/items/b6dbfd50ebb86bf80dce
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:
// 通信途絶など
}
}
#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