Merge branch 'unity' of git.kingsome.cn:tools/cocos_android into unity
This commit is contained in:
commit
9f3895502c
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@ -0,0 +1 @@
|
|||||||
|
HeadlessCocos
|
2
.idea/compiler.xml
generated
2
.idea/compiler.xml
generated
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="1.8" />
|
<bytecodeTargetLevel target="11" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
3
.idea/gradle.xml
generated
3
.idea/gradle.xml
generated
@ -8,11 +8,12 @@
|
|||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleHome" value="/usr/local/Cellar/gradle/3.5/libexec" />
|
<option name="gradleHome" value="/usr/local/Cellar/gradle/3.5/libexec" />
|
||||||
|
<option name="gradleJvm" value="Embedded JDK" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="$PROJECT_DIR$/app" />
|
||||||
<option value="$PROJECT_DIR$/../../cocos/cocos2d-x/cocos/platform/android/libcocos2dx" />
|
<option value="$PROJECT_DIR$/../cocos_js/cocos/platform/android/libcocos2dx" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
|
||||||
<component name="DesignSurface">
|
<component name="DesignSurface">
|
||||||
<option name="filePathToZoomLevelMap">
|
<option name="filePathToZoomLevelMap">
|
||||||
<map>
|
<map>
|
||||||
@ -14,6 +15,7 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
||||||
|
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
92
js/main.js
92
js/main.js
@ -6,9 +6,8 @@ console.log(">>begin load wallet main file");
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
function initWallet(funId, type, chain) {
|
function initWallet(funId, type, chain) {
|
||||||
// chain = chain || 80001
|
type = parseInt(type)
|
||||||
type = 0
|
chain = parseInt(chain)
|
||||||
chain = 1338
|
|
||||||
try {
|
try {
|
||||||
var wallet;
|
var wallet;
|
||||||
if (!window.jc || !jc.wallet) {
|
if (!window.jc || !jc.wallet) {
|
||||||
@ -379,6 +378,8 @@ function signOutGoogle(funId) {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
function buyNft721(funId, addresses, values, signature) {
|
function buyNft721(funId, addresses, values, signature) {
|
||||||
|
addresses = JSON.parse(addresses)
|
||||||
|
values = JSON.parse(values)
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.buyNft721({
|
.buyNft721({
|
||||||
addresses,
|
addresses,
|
||||||
@ -390,7 +391,7 @@ function buyNft721(funId, addresses, values, signature) {
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -400,6 +401,11 @@ function buyNft721(funId, addresses, values, signature) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buyNft1155(funId, addresses, values, ids, amounts, signature) {
|
function buyNft1155(funId, addresses, values, ids, amounts, signature) {
|
||||||
|
addresses = JSON.parse(addresses)
|
||||||
|
values = JSON.parse(values)
|
||||||
|
ids = JSON.parse(ids)
|
||||||
|
amounts = JSON.parse(amounts)
|
||||||
|
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.buyNft1155({
|
.buyNft1155({
|
||||||
addresses,
|
addresses,
|
||||||
@ -413,7 +419,7 @@ function buyNft1155(funId, addresses, values, ids, amounts, signature) {
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -430,7 +436,7 @@ function evolveNft721(
|
|||||||
nonce,
|
nonce,
|
||||||
signature
|
signature
|
||||||
) {
|
) {
|
||||||
{
|
tokenIds = JSON.parse(tokenIds)
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.evolve721NFT({
|
.evolve721NFT({
|
||||||
nftAddress,
|
nftAddress,
|
||||||
@ -444,17 +450,17 @@ function evolveNft721(
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function evolveChip(funId, tokenIds, startTime, nonce, signature) {
|
function evolveChip(funId, tokenIds, startTime, nonce, signature) {
|
||||||
|
tokenIds = JSON.parse(tokenIds)
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.evolveChip({
|
.evolveChip({
|
||||||
tokenIds,
|
tokenIds,
|
||||||
@ -467,7 +473,7 @@ function evolveChip(funId, tokenIds, startTime, nonce, signature) {
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -484,6 +490,9 @@ function mintShardBatchUser(
|
|||||||
nonce,
|
nonce,
|
||||||
signature
|
signature
|
||||||
) {
|
) {
|
||||||
|
tokenIds = JSON.parse(tokenIds)
|
||||||
|
amounts = JSON.parse(amounts)
|
||||||
|
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.mintShardBatchUser({
|
.mintShardBatchUser({
|
||||||
tokenIds,
|
tokenIds,
|
||||||
@ -497,7 +506,7 @@ function mintShardBatchUser(
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -518,6 +527,9 @@ function shardMixByUser(
|
|||||||
nonce,
|
nonce,
|
||||||
signature
|
signature
|
||||||
) {
|
) {
|
||||||
|
ids = JSON.parse(ids)
|
||||||
|
amounts = JSON.parse(amounts)
|
||||||
|
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.shardMixByUser({
|
.shardMixByUser({
|
||||||
tokenId,
|
tokenId,
|
||||||
@ -535,7 +547,7 @@ function shardMixByUser(
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -544,44 +556,66 @@ function shardMixByUser(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// addresses: [nftId, chip, sign_address]
|
||||||
|
// values: [token_id,salt_nonce,startTime]
|
||||||
|
// chipIds: [...chipIds]
|
||||||
function pluginChip(
|
function pluginChip(
|
||||||
funId,
|
funId,
|
||||||
nftAddress,
|
addresses,
|
||||||
chipAddress,
|
values,
|
||||||
nftId,
|
chipIds,
|
||||||
chipIds
|
slots,
|
||||||
|
signature
|
||||||
) {
|
) {
|
||||||
|
addresses = JSON.parse(addresses)
|
||||||
|
values = JSON.parse(values)
|
||||||
|
chipIds = JSON.parse(chipIds)
|
||||||
|
slots = JSON.parse(slots)
|
||||||
|
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.pluginChip({
|
.pluginChip({
|
||||||
nftAddress,
|
addresses,
|
||||||
chipAddress,
|
values,
|
||||||
nftId,
|
chipIds,
|
||||||
chipIds
|
slots,
|
||||||
|
signature
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
jsb.jcCallback(funId,JSON.stringify({errcode: 0,data: result}));
|
jsb.jcCallback(funId,JSON.stringify({errcode: 0,data: JSON.stringify(result)}));
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// addresses: [nftId, chip, sign_address]
|
||||||
|
// values: [token_id,salt_nonce,startTime]
|
||||||
|
// chipIds: [...chipIds]
|
||||||
function unplugChip(
|
function unplugChip(
|
||||||
funId,
|
funId,
|
||||||
nftAddress,
|
addresses,
|
||||||
chipAddress,
|
values,
|
||||||
nftId,
|
chipIds,
|
||||||
chipIds
|
slots,
|
||||||
|
signature
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
addresses = JSON.parse(addresses)
|
||||||
|
values = JSON.parse(values)
|
||||||
|
chipIds = JSON.parse(chipIds)
|
||||||
|
slots = JSON.parse(slots)
|
||||||
|
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.unplugChip({
|
.unplugChip({
|
||||||
nftAddress,
|
addresses,
|
||||||
chipAddress,
|
values,
|
||||||
nftId,
|
chipIds,
|
||||||
chipIds
|
slots,
|
||||||
|
signature
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
jsb.jcCallback(funId,JSON.stringify({errcode: 0,data: result}));
|
jsb.jcCallback(funId,JSON.stringify({errcode: 0,data: JSON.stringify(result)}));
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user