Exemple #1
0
void JSAlertDelegate::onAlertResult(int button)
{
    JSCallback *call = JSCallback::alloc(mpFunc, 1, mpObject);
    call->setArgumentInt(0, button);
    CallbackManager::getInstance()->postCallback(call);
    call->release();
}
Exemple #2
0
void UACJSDelegate::onLoggedIn(const string &token)
{
    JSCallback* call = JSCallback::alloc(mObject, "onLoggedIn", 1);
    call->setArgumentString(0, token);
    CallbackManager::getInstance()->postCallback(call);
    call->release();
}
Exemple #3
0
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();
}
Exemple #4
0
 void friendListRetrived()
 {
     if( sGCCB != NULL )
     {
         JSCallback* call = JSCallback::alloc(sGCCB, 1);
         call->setArgumentInt(0, 1);
         CallbackManager::getInstance()->postCallback(call);
         call->release();
     }
 }
Exemple #5
0
 void localPlayerAuthenticated()
 {
     if( sGCCB != NULL )
     {
         JSCallback* call = JSCallback::alloc(sGCCB, 1);
         call->setArgumentInt(0, 0);
         CallbackManager::getInstance()->postCallback(call);
         call->release();
     }
 }
Exemple #6
0
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();
}
Exemple #7
0
void UACJSDelegate::onManageViewClosed()
{
    JSCallback* call = JSCallback::alloc(mObject, "onManageViewClosed", 0);
    CallbackManager::getInstance()->postCallback(call);
    call->release();
}
Exemple #8
0
void UACJSDelegate::onLoggedOut()
{
    JSCallback* call = JSCallback::alloc(mObject, "onLoggedOut", 0);
    CallbackManager::getInstance()->postCallback(call);
    call->release();
}