예제 #1
0
파일: IAP.cpp 프로젝트: kun-g/client
void IAPJSDelegate::onPaymentResult(PaymentResult result, int product, string message)
{
    JSCallback *callback = JSCallback::alloc(mFunc, 3, mObject);
    callback->setArgumentInt(0, result);
    callback->setArgumentInt(1, product);
    callback->setArgumentString(2, message);
    CallbackManager::getInstance()->postCallback(callback);
    callback->release();
}
예제 #2
0
파일: TCP.cpp 프로젝트: kun-g/client
void recvCallback(string &data, TCPState state, void* userData)
{
    TCPFD* pfd = (TCPFD*)userData;
    //CCLog("PTR(%d) CALL = %p", pfd->fd, pfd);//debug
    
    //recv callback
    JSCallback* call = JSCallback::alloc(pfd->func, 3, pfd->obj);
    call->setArgumentInt(0, pfd->fd);
    call->setArgumentString(1, data);
    call->setArgumentInt(2, state);
    CallbackManager::getInstance()->postCallback(call);
    //call->setDebugTag(data.c_str());//test
    call->release();
}
예제 #3
0
void JSAlertDelegate::onAlertResult(int button)
{
    JSCallback *call = JSCallback::alloc(mpFunc, 1, mpObject);
    call->setArgumentInt(0, button);
    CallbackManager::getInstance()->postCallback(call);
    call->release();
}
예제 #4
0
 void friendListRetrived()
 {
     if( sGCCB != NULL )
     {
         JSCallback* call = JSCallback::alloc(sGCCB, 1);
         call->setArgumentInt(0, 1);
         CallbackManager::getInstance()->postCallback(call);
         call->release();
     }
 }
예제 #5
0
 void localPlayerAuthenticated()
 {
     if( sGCCB != NULL )
     {
         JSCallback* call = JSCallback::alloc(sGCCB, 1);
         call->setArgumentInt(0, 0);
         CallbackManager::getInstance()->postCallback(call);
         call->release();
     }
 }