当前位置: 首页>>代码示例>>C++>>正文


C++ PluginProtocol::getPluginName方法代码示例

本文整理汇总了C++中PluginProtocol::getPluginName方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginProtocol::getPluginName方法的具体用法?C++ PluginProtocol::getPluginName怎么用?C++ PluginProtocol::getPluginName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PluginProtocol的用法示例。


在下文中一共展示了PluginProtocol::getPluginName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

	JNIEXPORT void JNICALL Java_org_cocos2dx_plugin_InterfaceAds_nativeOnPlayerGetPoints(JNIEnv*  env, jobject thiz, jobject obj, jint points) {
		PluginProtocol* pPlugin = PluginUtils::getPluginPtr(obj);
		LOGD("nativeOnPlayerGetPoints(), Get plugin ptr : %p", pPlugin);
		if (pPlugin != NULL)
		{
			LOGD("nativeOnPlayerGetPoints(), Get plugin name : %s", pPlugin->getPluginName());
			ProtocolAds* pAds = dynamic_cast<ProtocolAds*>(pPlugin);
			if (pAds != NULL)
			{
				pAds->onPlayerGetPoints(points);
			}
		}
	}
开发者ID:SpycWolf,项目名称:cocos2d-x-1,代码行数:13,代码来源:ProtocolAds.cpp

示例2:

 JNIEXPORT jobject JNICALL Java_com_opensdk_framework_NativeInvoker_nativeGetLoginInfo(JNIEnv*  env, jobject thiz, jstring pluginKey)
 {
     std::string strPluginKey = PluginJniHelper::jstring2string(pluginKey);
     PluginProtocol* pPlugin = PluginUtils::getPluginPtr(strPluginKey);
     PluginUtils::outputLog("ProtocolUser", "nativeOnActionResult(), Get plugin ptr : %p", pPlugin);
     UserObject* userObject = dynamic_cast<UserObject*>(pPlugin);
     jobject loginInfo;
     if (userObject != NULL)
     {
         loginInfo=PluginUtils::createJavaMapObject(userObject->getLoginInfo());
     }else{           
         PluginUtils::outputLog("ProtocolUser", "plugin %s is null", pPlugin->getPluginName());
         loginInfo=PluginUtils::createJavaMapObject(NULL);
     }
     
     return loginInfo;
 }
开发者ID:trarck,项目名称:opensdk,代码行数:17,代码来源:Java_com_opensdk_framework_User.cpp

示例3:

    JNIEXPORT void JNICALL Java_com_opensdk_framework_NativeInvoker_nativeOnSocialResult(JNIEnv*  env, jobject thiz, jstring pluginKey, jint ret, jstring msg)
    {
        std::string strMsg = PluginJniHelper::jstring2string(msg);
        std::string strPluginKey = PluginJniHelper::jstring2string(pluginKey);
        PluginProtocol* pPlugin = PluginUtils::getPluginPtr(strPluginKey);
        PluginUtils::outputLog("ProtocolSocial", "nativeOnSocialResult(), Get plugin ptr : %p", pPlugin);
        SocialObject* socialObject = dynamic_cast<SocialObject*>(pPlugin);
        if (socialObject != NULL)
        {
            PluginUtils::outputLog("ProtocolSocial", "nativeOnSocialResult(), Get plugin name : %s", pPlugin->getPluginName());            
    
            SocialListener* pListener = socialObject->getListener();
            if (NULL != pListener)
            {
                pListener->onSocialResult((SocialRetCode) ret, strMsg.c_str());
            }
            else
            {
                SocialActionResult result={
                    (SocialRetCode)ret,
                    strMsg,
                    strPluginKey
                };
                
                SocialObject::pushActionResult(result);
                PluginUtils::outputLog("ProtocolSocial", "Can't find the nativeOnSocialResult listener of plugin %s", pPlugin->getPluginName());
            }

        }else{
            
            SocialActionResult result={
                (SocialRetCode)ret,
                strMsg,
                strPluginKey
            };
            
            SocialObject::pushActionResult(result);
            
            PluginUtils::outputLog("ProtocolSocial", "plugin %s is null", pPlugin->getPluginName());
        }
    }
开发者ID:trarck,项目名称:opensdk,代码行数:41,代码来源:Java_com_opensdk_framework_Social.cpp

示例4:

JNIEXPORT void JNICALL Java_org_cocos2dx_plugin_IAPWrapper_nativeOnRequestOwnedProductsResult
        (JNIEnv* env, jobject thiz, jstring className, jint ret, jobjectArray plist)
{
    std::string strClassName = PluginJniHelper::jstring2string(className);
    PluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);
    PluginUtils::outputLog("ProtocolIAP", "onRequestOwnedProductsResult(), Get plugin ptr : %p", pPlugin);

    if (pPlugin != NULL)
    {
        PluginUtils::outputLog("ProtocolIAP", "onRequestOwnedProductsResult(), Get plugin name : %s", pPlugin->getPluginName());
        ProtocolIAP* pIAP = dynamic_cast<ProtocolIAP*>(pPlugin);

        if (pIAP != NULL)
        {
            std::vector<std::string> pplist;

            if(plist != NULL)
            {
                int stringCount = env->GetArrayLength(plist);

                for (int i=0; i<stringCount; i++)
                {
                    jstring string = (jstring) env->GetObjectArrayElement(plist, i);
                    const char* chars = env->GetStringUTFChars(string, NULL);

                    pplist.push_back(chars);
                    env->ReleaseStringUTFChars(string, chars);
                    env->DeleteLocalRef(string);
                }
            }

            pIAP->onRequestOwnedProductsResult((IAPProductRequest)ret, pplist);
        }
    }
}
开发者ID:colaholicu,项目名称:custom-cocos2dx,代码行数:35,代码来源:ProtocolIAP.cpp

示例5: callback

JNIEXPORT void JNICALL Java_org_cocos2dx_plugin_IAPWrapper_nativeOnPayResult(JNIEnv*  env, jobject thiz, jstring className, jint ret, jstring msg)
{
    std::string strMsg = PluginJniHelper::jstring2string(msg);
    std::string strClassName = PluginJniHelper::jstring2string(className);
    PluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);
    PluginUtils::outputLog("ProtocolIAP", "nativeOnPayResult(), Get plugin ptr : %p", pPlugin);
    if (pPlugin != NULL)
    {
        PluginUtils::outputLog("ProtocolIAP", "nativeOnPayResult(), Get plugin name : %s", pPlugin->getPluginName());
        ProtocolIAP* pIAP = dynamic_cast<ProtocolIAP*>(pPlugin);
        if (pIAP != NULL)
        {
            pIAP->onPayResult((PayResultCode) ret, strMsg.c_str());
        }
        else
        {
            ProtocolIAP::ProtocolIAPCallback callback = pIAP->getCallback();
            if(callback)
                callback(ret, strMsg);
        }
    }
}
开发者ID:colaholicu,项目名称:custom-cocos2dx,代码行数:22,代码来源:ProtocolIAP.cpp

示例6:

	JNIEXPORT void JNICALL Java_org_cocos2dx_plugin_AdsAdColonyWrapper_nativeOnPlayerGetPoints(JNIEnv*  env, jobject thiz, jstring className, jstring zoneID, jboolean success, jstring name, jint points) {

		std::string strClassName = PluginJniHelper::jstring2string(className);
		std::string strZoneIds = PluginJniHelper::jstring2string(zoneID);
		std::string strName = PluginJniHelper::jstring2string(name);
		PluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);
		PluginUtils::outputLog("ProtocolAds", "nativeOnPlayerGetPoints(), Get plugin ptr : %p", pPlugin);
		if (pPlugin != NULL)
		{
			PluginUtils::outputLog("ProtocolAds", "nativeOnPlayerGetPoints(), Get plugin name : %s", pPlugin->getPluginName());
			ProtocolAds* pAds = dynamic_cast<ProtocolAds*>(pPlugin);
			if (pAds != NULL)
			{
				AdColonyAdsIntenelListener* listener = (AdColonyAdsIntenelListener*)pAds->getAdsListener();
                if (listener)
                {
                    listener->onPlayerGetPoints(pAds, strZoneIds.c_str(), success, strName.c_str(), points);
                }
			}
		}

	}
开发者ID:ken4500,项目名称:zoo,代码行数:22,代码来源:JniProtocolAdColonyAds.cpp

示例7: if

    JNIEXPORT void JNICALL Java_org_cocos2dx_plugin_ShareWrapper_nativeOnShareResult(JNIEnv*  env, jobject thiz, jstring className, jint ret, jstring msg)
    {
        std::string strMsg = PluginJniHelper::jstring2string(msg);
        std::string strClassName = PluginJniHelper::jstring2string(className);
        PluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);
        PluginUtils::outputLog("ProtocolShare", "nativeOnShareResult(), Get plugin ptr : %p", pPlugin);
        if (pPlugin != NULL)
        {
            PluginUtils::outputLog("ProtocolShare", "nativeOnShareResult(), Get plugin name : %s", pPlugin->getPluginName());
            ProtocolShare* pShare = dynamic_cast<ProtocolShare*>(pPlugin);
            if (pShare != NULL)
            {
                ShareResultListener* listener = pShare->getResultListener();
                ProtocolShare::ProtocolShareCallback callback = pShare->getListener();
                if (NULL != listener)
                {
                    ShareResultCode cRet = (ShareResultCode) ret;
                    listener->onShareResult(cRet, strMsg.c_str());
                }else if(callback){
                    callback(ret, strMsg);
                }else
                {
                    PluginUtils::outputLog("ProtocolShare", "Can't find the listener of plugin %s", pPlugin->getPluginName());
                }
            }

        }
    }
开发者ID:cocoTM,项目名称:xumc_demos,代码行数:28,代码来源:ProtocolShare.cpp

示例8:

	JNIEXPORT void JNICALL Java_org_cocos2dx_plugin_AdsWrapper_nativeOnPlayerGetPoints(JNIEnv*  env, jobject thiz, jstring className, jint points) {
		std::string strClassName = PluginJniHelper::jstring2string(className);
		PluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);
		PluginUtils::outputLog("ProtocolAds", "nativeOnPlayerGetPoints(), Get plugin ptr : %p", pPlugin);
		if (pPlugin != NULL)
		{
			PluginUtils::outputLog("ProtocolAds", "nativeOnPlayerGetPoints(), Get plugin name : %s", pPlugin->getPluginName());
			ProtocolAds* pAds = dynamic_cast<ProtocolAds*>(pPlugin);
			if (pAds != NULL)
			{
				pAds->onPlayerGetPoints(points);
			}
		}
	}
开发者ID:bassarisse,项目名称:LostInCaves,代码行数:14,代码来源:ProtocolAds.cpp


注:本文中的PluginProtocol::getPluginName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。