本文整理汇总了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);
}
}
}
示例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;
}
示例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());
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
}
示例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());
}
}
}
}
示例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);
}
}
}