From e162bc7229cdb568880cb37a0fdb6244147e7c31 Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Wed, 20 Jul 2022 17:44:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E8=A1=8Cjs=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9Euuid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes/JcWallet.cpp | 7 +++++-- Classes/JcWallet.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Classes/JcWallet.cpp b/Classes/JcWallet.cpp index f245870..fb6cafb 100644 --- a/Classes/JcWallet.cpp +++ b/Classes/JcWallet.cpp @@ -9,6 +9,7 @@ #include "scripting/js-bindings/event/EventDispatcher.h" #include "scripting/js-bindings/manual/jsb_conversions.hpp" #include "platform/CCApplication.h" +#include "scrypt/native-crypto.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) #include "AppDelegate.h" @@ -146,10 +147,12 @@ NS_CC_BEGIN } } - char *runWalletMethod(const char *methodName, int paramCount, char **paramList) { + const char *runWalletMethod(const char *methodName, int paramCount, char **paramList) { JSMethodParam *data = new JSMethodParam(); std::string methodNameStr(methodName); data->methodName = methodNameStr; + data -> funId = uuid_v4(); + data->paramCount = paramCount; for (int i = 0; i < paramCount; i++) { char *arg = *(paramList + i); @@ -157,7 +160,7 @@ NS_CC_BEGIN } std::shared_ptr params(data); RUN_IN_SERVERTHREAD(JcWallet::getInstance()->runJsMethod(params)); - return "1"; + return data->funId.c_str(); } } diff --git a/Classes/JcWallet.h b/Classes/JcWallet.h index 114f547..eaf3b96 100644 --- a/Classes/JcWallet.h +++ b/Classes/JcWallet.h @@ -12,6 +12,7 @@ NS_CC_BEGIN struct JSMethodParam { std::string methodName; + std::string funId; int paramCount; se::ValueArray args; };