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