update
This commit is contained in:
parent
7d9bf97bd0
commit
56f6cce2b6
@ -47,8 +47,8 @@
|
|||||||
},
|
},
|
||||||
"_scale": {
|
"_scale": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0.607421875,
|
"x": 0.58453369140625,
|
||||||
"y": 0.607421875,
|
"y": 0.58453369140625,
|
||||||
"z": 1
|
"z": 1
|
||||||
},
|
},
|
||||||
"_quat": {
|
"_quat": {
|
||||||
|
File diff suppressed because one or more lines are too long
1250
assets/resources/prefabs/tips/pb_servernoopen.prefab
Normal file
1250
assets/resources/prefabs/tips/pb_servernoopen.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.1",
|
||||||
|
"uuid": "a6a91bd2-50f6-4438-b4c5-d3361cd7911a",
|
||||||
|
"optimizationPolicy": "AUTO",
|
||||||
|
"asyncLoadAssets": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
@ -471,7 +471,7 @@
|
|||||||
"__id__": 13
|
"__id__": 13
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": false,
|
||||||
"_level": 3,
|
"_level": 3,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
@ -882,7 +882,7 @@
|
|||||||
"__id__": 25
|
"__id__": 25
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": false,
|
||||||
"_level": 4,
|
"_level": 4,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
|
@ -25,16 +25,12 @@ window.connectOK = (account) => {
|
|||||||
tmpaccount = `0x${account}`;
|
tmpaccount = `0x${account}`;
|
||||||
}
|
}
|
||||||
window.account = tmpaccount;
|
window.account = tmpaccount;
|
||||||
// localStorage.setItem('walletaccount', tmpaccount);
|
|
||||||
// cc.Notifier.emit('hasConnectWallet', tmpaccount);
|
|
||||||
jclogin.getNonce();
|
jclogin.getNonce();
|
||||||
};
|
};
|
||||||
|
|
||||||
window.signApp = (sign) => {
|
window.signApp = (sign) => {
|
||||||
jcgamelog.addOperation(OperationType.WALLET, 'signature success');
|
jcgamelog.addOperation(OperationType.WALLET, 'signature success');
|
||||||
window.hasWallet = true;
|
|
||||||
localStorage.setItem('walletaccount', window.account);
|
|
||||||
cc.Notifier.emit('hasConnectWallet', window.account);
|
|
||||||
var tmpsigm = sign;
|
var tmpsigm = sign;
|
||||||
if (cc.sys.os == cc.sys.OS_ANDROID) {
|
if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||||
tmpsigm = `0x${sign}`;
|
tmpsigm = `0x${sign}`;
|
||||||
@ -55,6 +51,11 @@ window.signApp = (sign) => {
|
|||||||
|
|
||||||
showLoading();
|
showLoading();
|
||||||
cc.director.loadScene('MainScene');
|
cc.director.loadScene('MainScene');
|
||||||
|
|
||||||
|
//
|
||||||
|
window.hasWallet = true;
|
||||||
|
localStorage.setItem('walletaccount', window.account);
|
||||||
|
cc.Notifier.emit('hasConnectWallet', window.account);
|
||||||
});
|
});
|
||||||
|
|
||||||
var node = cc.director.getScene().getComponentInChildren('UILogin');
|
var node = cc.director.getScene().getComponentInChildren('UILogin');
|
||||||
@ -266,8 +267,9 @@ cc.Class({
|
|||||||
|
|
||||||
getSwitch(() => {
|
getSwitch(() => {
|
||||||
if (!Config.isTest) {
|
if (!Config.isTest) {
|
||||||
// debug
|
// 非提审状态
|
||||||
if (localStorage.getItem('walletaccount')) {
|
if (localStorage.getItem('walletaccount')) {
|
||||||
|
// 本地记录了钱包地址
|
||||||
this.btn_tourist.active = false;
|
this.btn_tourist.active = false;
|
||||||
this.btn_wallet.active = false;
|
this.btn_wallet.active = false;
|
||||||
window.hasWallet = true;
|
window.hasWallet = true;
|
||||||
@ -287,11 +289,13 @@ cc.Class({
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// 本地没有记录钱包地址
|
||||||
this.btn_tourist.active = true;
|
this.btn_tourist.active = true;
|
||||||
this.btn_wallet.active = true;
|
this.btn_wallet.active = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// test
|
// test
|
||||||
|
// 提审
|
||||||
this.btn_tourist.active = true;
|
this.btn_tourist.active = true;
|
||||||
this.btn_wallet.active = false;
|
this.btn_wallet.active = false;
|
||||||
this.btn_tourist.position = new cc.v2(0, this.btn_tourist.y);
|
this.btn_tourist.position = new cc.v2(0, this.btn_tourist.y);
|
||||||
|
@ -9,13 +9,14 @@
|
|||||||
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
|
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
|
||||||
//var httpclient = require("httpclient");
|
//var httpclient = require("httpclient");
|
||||||
//var urlbuilder = require("urlbuilder");
|
//var urlbuilder = require("urlbuilder");
|
||||||
var httpclient = require("httpclient");
|
var httpclient = require('httpclient');
|
||||||
var urlbuilder = require("urlbuilder");
|
var urlbuilder = require('urlbuilder');
|
||||||
const BaseNet = require("../../BaseNet");
|
const BaseNet = require('../../BaseNet');
|
||||||
const Config = require("../../Config");
|
const Config = require('../../Config');
|
||||||
const { isTesting } = require("../../Config");
|
const { isTesting } = require('../../Config');
|
||||||
const { WhitelistTip } = require("../../tips/WhitelistTip");
|
const { default: ServerNotOpenTip } = require('../../tips/ServerNotOpenTip');
|
||||||
const { uimanger } = require("../../UI/UIManger");
|
const { WhitelistTip } = require('../../tips/WhitelistTip');
|
||||||
|
const { uimanger } = require('../../UI/UIManger');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// LIFE-CYCLE CALLBACKS:
|
// LIFE-CYCLE CALLBACKS:
|
||||||
@ -37,69 +38,69 @@ module.exports = {
|
|||||||
) {
|
) {
|
||||||
if (window.canAutoLogin == true) {
|
if (window.canAutoLogin == true) {
|
||||||
this.autoLogin(
|
this.autoLogin(
|
||||||
localStorage.getItem("loginaccount"),
|
localStorage.getItem('loginaccount'),
|
||||||
localStorage.getItem("loginsession"),
|
localStorage.getItem('loginsession'),
|
||||||
(res) => {
|
(res) => {
|
||||||
console.log("auto login res===" + res);
|
console.log('auto login res===' + res);
|
||||||
var obj = httpclient.JSON_parse(res);
|
var obj = httpclient.JSON_parse(res);
|
||||||
// console.log("[__login]success!" + JSON.stringify(obj));
|
// console.log("[__login]success!" + JSON.stringify(obj));
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
cc.Notifier.emit("autologinsuccess");
|
cc.Notifier.emit('autologinsuccess');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(BaseNet.getNormalApiUrl("login"));
|
console.log(BaseNet.getNormalApiUrl('login'));
|
||||||
|
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "Login")
|
.addKV('c', 'Login')
|
||||||
.addKV("a", "auth")
|
.addKV('a', 'auth')
|
||||||
.addKV("gameid", gameid);
|
.addKV('gameid', gameid);
|
||||||
if (cc.appPlatformID) {
|
if (cc.appPlatformID) {
|
||||||
channelid = cc.appPlatformID;
|
channelid = cc.appPlatformID;
|
||||||
console.log("PlatformID==", channelid);
|
console.log('PlatformID==', channelid);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.urlbd.addKV("channel", channelid);
|
this.urlbd.addKV('channel', channelid);
|
||||||
|
|
||||||
if (cc.sdkdata) {
|
if (cc.sdkdata) {
|
||||||
this.urlbd.addKV("openid", cc.sdkdata.openid);
|
this.urlbd.addKV('openid', cc.sdkdata.openid);
|
||||||
// this.urlbd.addKV('token', cc.sdkdata.token);
|
// this.urlbd.addKV('token', cc.sdkdata.token);
|
||||||
|
|
||||||
this.urlbd.addKV("poly_sdk_channel", 8001);
|
this.urlbd.addKV('poly_sdk_channel', 8001);
|
||||||
this.urlbd.addKV(
|
this.urlbd.addKV(
|
||||||
"poly_sdk_subchannel",
|
'poly_sdk_subchannel',
|
||||||
cc.sdkdata.poly_sdk_subchannel
|
cc.sdkdata.poly_sdk_subchannel
|
||||||
);
|
);
|
||||||
} else if (cc.sdkData2) {
|
} else if (cc.sdkData2) {
|
||||||
console.log("SDKData3==", JSON.stringify(cc.sdkData2));
|
console.log('SDKData3==', JSON.stringify(cc.sdkData2));
|
||||||
this.urlbd.addKV("openid", cc.sdkData2.openid);
|
this.urlbd.addKV('openid', cc.sdkData2.openid);
|
||||||
// this.urlbd.addKV('token', cc.sdkData2.token);
|
// this.urlbd.addKV('token', cc.sdkData2.token);
|
||||||
} else {
|
} else {
|
||||||
if (openid && openid != "") {
|
if (openid && openid != '') {
|
||||||
this.urlbd.addKV("openid", openid);
|
this.urlbd.addKV('openid', openid);
|
||||||
} else {
|
} else {
|
||||||
this.urlbd.addKV("openid", tokencode);
|
this.urlbd.addKV('openid', tokencode);
|
||||||
}
|
}
|
||||||
this.urlbd.addKV("token", tokencode);
|
this.urlbd.addKV('token', tokencode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.env) {
|
if (this.env) {
|
||||||
this.urlbd.addKV("env", this.env);
|
this.urlbd.addKV('env', this.env);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channelid == "6516") {
|
if (channelid == '6516') {
|
||||||
this.urlbd.addKV("account", window.account);
|
this.urlbd.addKV('account', window.account);
|
||||||
this.urlbd.addKV("net_id", "321");
|
this.urlbd.addKV('net_id', '321');
|
||||||
// getNounce
|
// getNounce
|
||||||
this.urlbd.addKV("nonce", window.nonce);
|
this.urlbd.addKV('nonce', window.nonce);
|
||||||
this.urlbd.addKV("signature", window.appsign);
|
this.urlbd.addKV('signature', window.appsign);
|
||||||
this.urlbd.addKV("tips", "sign request");
|
this.urlbd.addKV('tips', 'sign request');
|
||||||
|
|
||||||
// reset token
|
// reset token
|
||||||
var tmpToken = "";
|
var tmpToken = '';
|
||||||
if (cc.sdkdata) {
|
if (cc.sdkdata) {
|
||||||
tmpToken = cc.sdkdata.token;
|
tmpToken = cc.sdkdata.token;
|
||||||
} else if (cc.sdkData2) {
|
} else if (cc.sdkData2) {
|
||||||
@ -111,12 +112,12 @@ module.exports = {
|
|||||||
token = {
|
token = {
|
||||||
token: tmpToken,
|
token: tmpToken,
|
||||||
account: window.account,
|
account: window.account,
|
||||||
tips: "sign request",
|
tips: 'sign request',
|
||||||
nonce: window.nonce,
|
nonce: window.nonce,
|
||||||
signature: window.appsign,
|
signature: window.appsign,
|
||||||
net_id: 321,
|
net_id: 321,
|
||||||
};
|
};
|
||||||
this.urlbd.addKV("type", 0);
|
this.urlbd.addKV('type', 0);
|
||||||
|
|
||||||
// if (cc.sys.os == cc.sys.OS_ANDROID) {
|
// if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||||
// token = {
|
// token = {
|
||||||
@ -141,12 +142,12 @@ module.exports = {
|
|||||||
|
|
||||||
console.log(`TOKEN --- ${JSON.stringify(token)}`);
|
console.log(`TOKEN --- ${JSON.stringify(token)}`);
|
||||||
|
|
||||||
this.urlbd.addKV("token", JSON.stringify(token));
|
this.urlbd.addKV('token', JSON.stringify(token));
|
||||||
} else {
|
} else {
|
||||||
if (cc.sdkdata) {
|
if (cc.sdkdata) {
|
||||||
this.urlbd.addKV("token", cc.sdkdata.token);
|
this.urlbd.addKV('token', cc.sdkdata.token);
|
||||||
} else if (cc.sdkData2) {
|
} else if (cc.sdkData2) {
|
||||||
this.urlbd.addKV("token", cc.sdkData2.token);
|
this.urlbd.addKV('token', cc.sdkData2.token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,28 +157,41 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
console.log(`login res --${restext}`);
|
console.log(`login res --${restext}`);
|
||||||
|
|
||||||
console.log("errcode----" + obj.errcode);
|
console.log('errcode----' + obj.errcode);
|
||||||
|
|
||||||
if (obj.errcode == 66) {
|
if (obj.errcode == 66) {
|
||||||
console.log("用户不在白名单中");
|
console.log('用户不在白名单中');
|
||||||
uimanger.showUI(WhitelistTip.prefabPath);
|
uimanger.showUI(WhitelistTip.prefabPath);
|
||||||
localStorage.removeItem("walletaccount");
|
if (localStorage.getItem('walletaccount')) {
|
||||||
|
localStorage.removeItem('walletaccount');
|
||||||
|
}
|
||||||
window.hasWallet = false;
|
window.hasWallet = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (obj.errcode == 103) {
|
||||||
|
console.log('服务器未开启');
|
||||||
|
uimanger.showUI(ServerNotOpenTip.prefabPath);
|
||||||
|
if (localStorage.getItem('walletaccount')) {
|
||||||
|
localStorage.removeItem('walletaccount');
|
||||||
|
}
|
||||||
|
window.hasWallet = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log("[__login]success!" + JSON.stringify(obj));
|
console.log('[__login]success!' + JSON.stringify(obj));
|
||||||
cc.subchannel = obj.channel;
|
cc.subchannel = obj.channel;
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
"[__login]failed!" + obj.errcode + ":" + obj.errmsg
|
'[__login]failed!' + obj.errcode + ':' + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log("[__login]failed!" + errcode + ":" + errmsg);
|
console.log('[__login]failed!' + errcode + ':' + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -196,36 +210,36 @@ module.exports = {
|
|||||||
) {
|
) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "Login")
|
.addKV('c', 'Login')
|
||||||
.addKV("a", "activateWeiXinUser")
|
.addKV('a', 'activateWeiXinUser')
|
||||||
.addKV("gameid", gameid)
|
.addKV('gameid', gameid)
|
||||||
.addKV("account_id", accountid)
|
.addKV('account_id', accountid)
|
||||||
.addKV("session_id", sessionid)
|
.addKV('session_id', sessionid)
|
||||||
.addKV("rawdata", raw)
|
.addKV('rawdata', raw)
|
||||||
.addKV("signature", sign)
|
.addKV('signature', sign)
|
||||||
.addKV("encrypted_data", encyptdata)
|
.addKV('encrypted_data', encyptdata)
|
||||||
.addKV("iv", iv);
|
.addKV('iv', iv);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (restext) {
|
function (restext) {
|
||||||
if (restext == "") {
|
if (restext == '') {
|
||||||
failcb && failcb(0, -1, "restext is nullstring!");
|
failcb && failcb(0, -1, 'restext is nullstring!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj && obj.errcode == 0) {
|
if (obj && obj.errcode == 0) {
|
||||||
console.log("[__activeWX]success!" + JSON.stringify(obj));
|
console.log('[__activeWX]success!' + JSON.stringify(obj));
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
"[__activeWX]failed!" + obj.errcode + ":" + obj.errmsg
|
'[__activeWX]failed!' + obj.errcode + ':' + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log("[__activeWX]failed!" + errcode + ":" + errmsg);
|
console.log('[__activeWX]failed!' + errcode + ':' + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -234,19 +248,19 @@ module.exports = {
|
|||||||
__updateInfo(accountid, sessionid, usrinfo, successcb, failcb) {
|
__updateInfo(accountid, sessionid, usrinfo, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "Login")
|
.addKV('c', 'Login')
|
||||||
.addKV("a", "updateUserInfo")
|
.addKV('a', 'updateUserInfo')
|
||||||
.addKV("account_id", accountid)
|
.addKV('account_id', accountid)
|
||||||
.addKV("session_id", sessionid)
|
.addKV('session_id', sessionid)
|
||||||
.addKV("nickname", usrinfo.nickname)
|
.addKV('nickname', usrinfo.nickname)
|
||||||
.addKV("city", usrinfo.city)
|
.addKV('city', usrinfo.city)
|
||||||
.addKV("province", usrinfo.province)
|
.addKV('province', usrinfo.province)
|
||||||
.addKV("avatar_url", usrinfo.avatar_url)
|
.addKV('avatar_url', usrinfo.avatar_url)
|
||||||
.addKV("country", usrinfo.country)
|
.addKV('country', usrinfo.country)
|
||||||
.addKV("sex", usrinfo.sex)
|
.addKV('sex', usrinfo.sex)
|
||||||
.addKV("birthday", usrinfo.birthday)
|
.addKV('birthday', usrinfo.birthday)
|
||||||
.addKV("phone", usrinfo.phone)
|
.addKV('phone', usrinfo.phone)
|
||||||
.addKV("location", usrinfo.location);
|
.addKV('location', usrinfo.location);
|
||||||
// if(!this.isoffical){
|
// if(!this.isoffical){
|
||||||
// console.log(this.urlbd.baseurl);
|
// console.log(this.urlbd.baseurl);
|
||||||
// }
|
// }
|
||||||
@ -255,17 +269,17 @@ module.exports = {
|
|||||||
function (restext) {
|
function (restext) {
|
||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log("[__updateInfo]success!" + JSON.stringify(obj));
|
console.log('[__updateInfo]success!' + JSON.stringify(obj));
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
"[__updateInfo]failed!" + obj.errcode + ":" + obj.errmsg
|
'[__updateInfo]failed!' + obj.errcode + ':' + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log("[__updateInfo]failed!" + errcode + ":" + errmsg);
|
console.log('[__updateInfo]failed!' + errcode + ':' + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -274,11 +288,11 @@ module.exports = {
|
|||||||
__generalSignature(accountid, sessionid, signdata, successcb, failcb) {
|
__generalSignature(accountid, sessionid, signdata, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "Login")
|
.addKV('c', 'Login')
|
||||||
.addKV("a", "signature")
|
.addKV('a', 'signature')
|
||||||
.addKV("account_id", accountid)
|
.addKV('account_id', accountid)
|
||||||
.addKV("session_id", sessionid)
|
.addKV('session_id', sessionid)
|
||||||
.addKV("params", signdata);
|
.addKV('params', signdata);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
@ -286,14 +300,14 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log(
|
console.log(
|
||||||
"[__generalSignature]success!" + JSON.stringify(obj)
|
'[__generalSignature]success!' + JSON.stringify(obj)
|
||||||
);
|
);
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
"[__generalSignature]failed!" +
|
'[__generalSignature]failed!' +
|
||||||
obj.errcode +
|
obj.errcode +
|
||||||
":" +
|
':' +
|
||||||
obj.errmsg
|
obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
@ -301,7 +315,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log(
|
console.log(
|
||||||
"[__generalSignature]failed!" + errcode + ":" + errmsg
|
'[__generalSignature]failed!' + errcode + ':' + errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
@ -311,11 +325,11 @@ module.exports = {
|
|||||||
__generalToken(accountid, sessionid, sceneid, successcb, failcb) {
|
__generalToken(accountid, sessionid, sceneid, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "Login")
|
.addKV('c', 'Login')
|
||||||
.addKV("a", "getAccessToken")
|
.addKV('a', 'getAccessToken')
|
||||||
.addKV("account_id", accountid)
|
.addKV('account_id', accountid)
|
||||||
.addKV("session_id", sessionid)
|
.addKV('session_id', sessionid)
|
||||||
.addKV("scene", sceneid);
|
.addKV('scene', sceneid);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
@ -323,21 +337,21 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log(
|
console.log(
|
||||||
"[__generalToken]success!" + JSON.stringify(obj)
|
'[__generalToken]success!' + JSON.stringify(obj)
|
||||||
);
|
);
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
"[__generalToken]failed!" +
|
'[__generalToken]failed!' +
|
||||||
obj.errcode +
|
obj.errcode +
|
||||||
":" +
|
':' +
|
||||||
obj.errmsg
|
obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log("[__generalToken]failed!" + errcode + ":" + errmsg);
|
console.log('[__generalToken]failed!' + errcode + ':' + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -346,10 +360,10 @@ module.exports = {
|
|||||||
__getAnnouncement(channelid, gameid, successcb, failcb) {
|
__getAnnouncement(channelid, gameid, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "Annc")
|
.addKV('c', 'Annc')
|
||||||
.addKV("a", "getAnnouncement")
|
.addKV('a', 'getAnnouncement')
|
||||||
.addKV("gameid", gameid)
|
.addKV('gameid', gameid)
|
||||||
.addKV("channel", channelid);
|
.addKV('channel', channelid);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
@ -357,14 +371,14 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log(
|
console.log(
|
||||||
"[__getAnnouncement]success!" + JSON.stringify(obj)
|
'[__getAnnouncement]success!' + JSON.stringify(obj)
|
||||||
);
|
);
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
"[__getAnnouncement]failed!" +
|
'[__getAnnouncement]failed!' +
|
||||||
obj.errcode +
|
obj.errcode +
|
||||||
":" +
|
':' +
|
||||||
obj.errmsg
|
obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
@ -372,7 +386,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log(
|
console.log(
|
||||||
"[__getAnnouncement]failed!" + errcode + ":" + errmsg
|
'[__getAnnouncement]failed!' + errcode + ':' + errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
@ -382,13 +396,13 @@ module.exports = {
|
|||||||
__getServerList(channelid, gameid, successcb, failcb) {
|
__getServerList(channelid, gameid, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "SrvList")
|
.addKV('c', 'SrvList')
|
||||||
.addKV("a", "getSrvList")
|
.addKV('a', 'getSrvList')
|
||||||
.addKV("gameid", gameid)
|
.addKV('gameid', gameid)
|
||||||
.addKV("channel", channelid);
|
.addKV('channel', channelid);
|
||||||
|
|
||||||
if (this.env) {
|
if (this.env) {
|
||||||
this.urlbd.addKV("env", this.env);
|
this.urlbd.addKV('env', this.env);
|
||||||
}
|
}
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
@ -397,14 +411,14 @@ module.exports = {
|
|||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log(
|
console.log(
|
||||||
"[__getServerList]success!" + JSON.stringify(obj)
|
'[__getServerList]success!' + JSON.stringify(obj)
|
||||||
);
|
);
|
||||||
successcb && successcb(obj.server_list);
|
successcb && successcb(obj.server_list);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
"[__getServerList]failed!" +
|
'[__getServerList]failed!' +
|
||||||
obj.errcode +
|
obj.errcode +
|
||||||
":" +
|
':' +
|
||||||
obj.errmsg
|
obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
@ -412,7 +426,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log(
|
console.log(
|
||||||
"[__getServerList]failed!" + errcode + ":" + errmsg
|
'[__getServerList]failed!' + errcode + ':' + errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
@ -422,28 +436,28 @@ module.exports = {
|
|||||||
__loginYoume(accountid, sessionid, nickname, successcb, failcb) {
|
__loginYoume(accountid, sessionid, nickname, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "YouMe")
|
.addKV('c', 'YouMe')
|
||||||
.addKV("a", "login")
|
.addKV('a', 'login')
|
||||||
.addKV("account_id", accountid)
|
.addKV('account_id', accountid)
|
||||||
.addKV("session_id", sessionid)
|
.addKV('session_id', sessionid)
|
||||||
.addKV("nickname", nickname);
|
.addKV('nickname', nickname);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (restext) {
|
function (restext) {
|
||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log("[__loginYoume]success!" + JSON.stringify(obj));
|
console.log('[__loginYoume]success!' + JSON.stringify(obj));
|
||||||
successcb && successcb(obj.token);
|
successcb && successcb(obj.token);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
"[__loginYoume]failed!" + obj.errcode + ":" + obj.errmsg
|
'[__loginYoume]failed!' + obj.errcode + ':' + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log("[__loginYoume]failed!" + errcode + ":" + errmsg);
|
console.log('[__loginYoume]failed!' + errcode + ':' + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -530,7 +544,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
console.log("[_loadLocalInfo]finish");
|
console.log('[_loadLocalInfo]finish');
|
||||||
this._localinfoloaded = true;
|
this._localinfoloaded = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -560,56 +574,56 @@ module.exports = {
|
|||||||
this.svuserinfo.birthday = info.birthday;
|
this.svuserinfo.birthday = info.birthday;
|
||||||
this.svuserinfo.phone = info.phone;
|
this.svuserinfo.phone = info.phone;
|
||||||
this.svuserinfo.location = info.location;
|
this.svuserinfo.location = info.location;
|
||||||
console.log("[_loadServerInfo]finish");
|
console.log('[_loadServerInfo]finish');
|
||||||
this._svinfoloaded = true;
|
this._svinfoloaded = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
_combineInfo(svinfo, lcinfo) {
|
_combineInfo(svinfo, lcinfo) {
|
||||||
let bupdated = false;
|
let bupdated = false;
|
||||||
if (lcinfo.nickname && svinfo.nickname != lcinfo.nickname) {
|
if (lcinfo.nickname && svinfo.nickname != lcinfo.nickname) {
|
||||||
console.log("[nickname]" + svinfo.nickName + "|" + lcinfo.nickname);
|
console.log('[nickname]' + svinfo.nickName + '|' + lcinfo.nickname);
|
||||||
svinfo.nickname = lcinfo.nickname;
|
svinfo.nickname = lcinfo.nickname;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.city && svinfo.city != lcinfo.city) {
|
if (lcinfo.city && svinfo.city != lcinfo.city) {
|
||||||
console.log("[city]" + svinfo.city + "|" + lcinfo.city);
|
console.log('[city]' + svinfo.city + '|' + lcinfo.city);
|
||||||
svinfo.city = lcinfo.city;
|
svinfo.city = lcinfo.city;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.province && svinfo.province != lcinfo.province) {
|
if (lcinfo.province && svinfo.province != lcinfo.province) {
|
||||||
console.log("[province]" + svinfo.province + "|" + lcinfo.province);
|
console.log('[province]' + svinfo.province + '|' + lcinfo.province);
|
||||||
svinfo.province = lcinfo.province;
|
svinfo.province = lcinfo.province;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.country && svinfo.country != lcinfo.country) {
|
if (lcinfo.country && svinfo.country != lcinfo.country) {
|
||||||
console.log("[country]" + svinfo.country + "|" + lcinfo.country);
|
console.log('[country]' + svinfo.country + '|' + lcinfo.country);
|
||||||
svinfo.country = lcinfo.country;
|
svinfo.country = lcinfo.country;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.avatar_url && svinfo.avatar_url != lcinfo.avatar_url) {
|
if (lcinfo.avatar_url && svinfo.avatar_url != lcinfo.avatar_url) {
|
||||||
console.log(
|
console.log(
|
||||||
"[avatar_url]" + svinfo.avatar_url + "|" + lcinfo.avatar_url
|
'[avatar_url]' + svinfo.avatar_url + '|' + lcinfo.avatar_url
|
||||||
);
|
);
|
||||||
svinfo.avatar_url = lcinfo.avatar_url;
|
svinfo.avatar_url = lcinfo.avatar_url;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.sex && svinfo.sex != lcinfo.sex) {
|
if (lcinfo.sex && svinfo.sex != lcinfo.sex) {
|
||||||
console.log("[sex]" + svinfo.sex + "|" + lcinfo.sex);
|
console.log('[sex]' + svinfo.sex + '|' + lcinfo.sex);
|
||||||
svinfo.sex = lcinfo.sex;
|
svinfo.sex = lcinfo.sex;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.birthday && svinfo.birthday != lcinfo.birthday) {
|
if (lcinfo.birthday && svinfo.birthday != lcinfo.birthday) {
|
||||||
console.log("[birthday]" + svinfo.birthday + "|" + lcinfo.birthday);
|
console.log('[birthday]' + svinfo.birthday + '|' + lcinfo.birthday);
|
||||||
svinfo.birthday = lcinfo.birthday;
|
svinfo.birthday = lcinfo.birthday;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.phone && svinfo.phone != lcinfo.phone) {
|
if (lcinfo.phone && svinfo.phone != lcinfo.phone) {
|
||||||
console.log("[phone]" + svinfo.phone + "|" + lcinfo.phone);
|
console.log('[phone]' + svinfo.phone + '|' + lcinfo.phone);
|
||||||
svinfo.phone = lcinfo.phone;
|
svinfo.phone = lcinfo.phone;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
if (lcinfo.location && svinfo.location != lcinfo.location) {
|
if (lcinfo.location && svinfo.location != lcinfo.location) {
|
||||||
console.log("[location]" + svinfo.location + "|" + lcinfo.location);
|
console.log('[location]' + svinfo.location + '|' + lcinfo.location);
|
||||||
svinfo.location = lcinfo.location;
|
svinfo.location = lcinfo.location;
|
||||||
bupdated = true;
|
bupdated = true;
|
||||||
}
|
}
|
||||||
@ -621,15 +635,15 @@ module.exports = {
|
|||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this.channelid = channelid;
|
this.channelid = channelid;
|
||||||
this.gameid = gameid;
|
this.gameid = gameid;
|
||||||
this.sessionid = this.sessionid ? this.sessionid : "";
|
this.sessionid = this.sessionid ? this.sessionid : '';
|
||||||
this.accountid = this.accountid ? this.accountid : "";
|
this.accountid = this.accountid ? this.accountid : '';
|
||||||
this.openid = this.openid ? this.openid : "";
|
this.openid = this.openid ? this.openid : '';
|
||||||
this.env = env;
|
this.env = env;
|
||||||
this.isoffical = isoffical;
|
this.isoffical = isoffical;
|
||||||
this.logined = this.logined ? this.logined : false;
|
this.logined = this.logined ? this.logined : false;
|
||||||
this.urlbd = new urlbuilder(BaseNet.getNormalApiUrl("login"));
|
this.urlbd = new urlbuilder(BaseNet.getNormalApiUrl('login'));
|
||||||
console.log(
|
console.log(
|
||||||
"[jclogin]init:" + gameid + "|" + channelid + "|" + isoffical
|
'[jclogin]init:' + gameid + '|' + channelid + '|' + isoffical
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -678,12 +692,12 @@ module.exports = {
|
|||||||
//
|
//
|
||||||
let self = this;
|
let self = this;
|
||||||
let openId = BK.getSystemInfoSync().openId;
|
let openId = BK.getSystemInfoSync().openId;
|
||||||
console.log("loginQQ openid:" + openId);
|
console.log('loginQQ openid:' + openId);
|
||||||
// BK.Script.loadlib("GameRes://qqPlayCore.js") //预加载bricks js层接口
|
// BK.Script.loadlib("GameRes://qqPlayCore.js") //预加载bricks js层接口
|
||||||
BK.QQ.fetchOpenKey(function (errCode, cmd, data) {
|
BK.QQ.fetchOpenKey(function (errCode, cmd, data) {
|
||||||
if (errCode == 0) {
|
if (errCode == 0) {
|
||||||
let openKey = data.openKey;
|
let openKey = data.openKey;
|
||||||
console.log("loginQQ openKey:" + openKey);
|
console.log('loginQQ openKey:' + openKey);
|
||||||
self.login(openKey, successcb, failcb, openId);
|
self.login(openKey, successcb, failcb, openId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -691,12 +705,12 @@ module.exports = {
|
|||||||
break;
|
break;
|
||||||
case 6003:
|
case 6003:
|
||||||
{
|
{
|
||||||
console.log("[qg.login]BEGIN:" + exparam);
|
console.log('[qg.login]BEGIN:' + exparam);
|
||||||
if (typeof qg != "undefined") {
|
if (typeof qg != 'undefined') {
|
||||||
qg.login({
|
qg.login({
|
||||||
pkgName: exparam,
|
pkgName: exparam,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log("[qg.login]success");
|
console.log('[qg.login]success');
|
||||||
console.log(JSON.stringify(res));
|
console.log(JSON.stringify(res));
|
||||||
this.login(
|
this.login(
|
||||||
res.token,
|
res.token,
|
||||||
@ -707,7 +721,7 @@ module.exports = {
|
|||||||
this.updateuserinfo(res);
|
this.updateuserinfo(res);
|
||||||
},
|
},
|
||||||
fail: (res) => {
|
fail: (res) => {
|
||||||
console.log("[qg.login]fail");
|
console.log('[qg.login]fail');
|
||||||
console.log(JSON.stringify(res));
|
console.log(JSON.stringify(res));
|
||||||
failcb && failcb();
|
failcb && failcb();
|
||||||
},
|
},
|
||||||
@ -722,7 +736,7 @@ module.exports = {
|
|||||||
qg.getProfile({
|
qg.getProfile({
|
||||||
token: vivotoken,
|
token: vivotoken,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
console.log("[vivo.login]success");
|
console.log('[vivo.login]success');
|
||||||
self.login(
|
self.login(
|
||||||
vivotoken,
|
vivotoken,
|
||||||
successcb,
|
successcb,
|
||||||
@ -732,20 +746,20 @@ module.exports = {
|
|||||||
self.updateuserinfo(data);
|
self.updateuserinfo(data);
|
||||||
},
|
},
|
||||||
fail: function (data, code) {
|
fail: function (data, code) {
|
||||||
console.log("[vivo.login]fail");
|
console.log('[vivo.login]fail');
|
||||||
failcb && failcb();
|
failcb && failcb();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
qg.authorize({
|
qg.authorize({
|
||||||
type: "token",
|
type: 'token',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
console.log("vivoAuthorize success");
|
console.log('vivoAuthorize success');
|
||||||
vivoGetUserInfo(data.accessToken);
|
vivoGetUserInfo(data.accessToken);
|
||||||
},
|
},
|
||||||
fail: function (data, code) {
|
fail: function (data, code) {
|
||||||
console.log("vivoAuthorize fail");
|
console.log('vivoAuthorize fail');
|
||||||
failcb && failcb();
|
failcb && failcb();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -767,16 +781,16 @@ module.exports = {
|
|||||||
this._loginstarttime = new Date().getTime();
|
this._loginstarttime = new Date().getTime();
|
||||||
wx.login({
|
wx.login({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log("[wx]login success!" + res.code);
|
console.log('[wx]login success!' + res.code);
|
||||||
self.login(res.code, successcb, failcb);
|
self.login(res.code, successcb, failcb);
|
||||||
},
|
},
|
||||||
fail: function (res) {
|
fail: function (res) {
|
||||||
console.log("[wx]login fail!");
|
console.log('[wx]login fail!');
|
||||||
failcb && failcb(0, res.errcode, res.errmsg);
|
failcb && failcb(0, res.errcode, res.errmsg);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
failcb && failcb(-1, 0, "not weixin platform!");
|
failcb && failcb(-1, 0, 'not weixin platform!');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -861,10 +875,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
AccountID(openid) {
|
AccountID(openid) {
|
||||||
if (this.accountid && this.accountid != "") {
|
if (this.accountid && this.accountid != '') {
|
||||||
return this.accountid;
|
return this.accountid;
|
||||||
}
|
}
|
||||||
return this.channelid + "_" + this.gameid + "_" + openid;
|
return this.channelid + '_' + this.gameid + '_' + openid;
|
||||||
},
|
},
|
||||||
|
|
||||||
setAccountID(accountid, sessionid) {
|
setAccountID(accountid, sessionid) {
|
||||||
@ -890,44 +904,44 @@ module.exports = {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "Login")
|
.addKV('c', 'Login')
|
||||||
.addKV("a", "getNonce")
|
.addKV('a', 'getNonce')
|
||||||
.addKV("gameid", this.gameid)
|
.addKV('gameid', this.gameid)
|
||||||
.addKV("account", window.account);
|
.addKV('account', window.account);
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (res) {
|
function (res) {
|
||||||
window.nonce = httpclient.JSON_parse(res).nonce;
|
window.nonce = httpclient.JSON_parse(res).nonce;
|
||||||
if (cc.sys.os == cc.sys.OS_IOS) {
|
if (cc.sys.os == cc.sys.OS_IOS) {
|
||||||
jsb.reflection.callStaticMethod(
|
jsb.reflection.callStaticMethod(
|
||||||
"AppController",
|
'AppController',
|
||||||
"signApp:",
|
'signApp:',
|
||||||
window.nonce
|
window.nonce
|
||||||
);
|
);
|
||||||
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
|
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||||
var signData = {
|
var signData = {
|
||||||
types: {
|
types: {
|
||||||
EIP712Domain: [
|
EIP712Domain: [
|
||||||
{ name: "name", type: "string" },
|
{ name: 'name', type: 'string' },
|
||||||
{ name: "version", type: "string" },
|
{ name: 'version', type: 'string' },
|
||||||
],
|
],
|
||||||
set: [
|
set: [
|
||||||
{ name: "tips", type: "string" },
|
{ name: 'tips', type: 'string' },
|
||||||
{ name: "nonce", type: "string" },
|
{ name: 'nonce', type: 'string' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
primaryType: "set",
|
primaryType: 'set',
|
||||||
domain: { name: "Auth", version: "1" },
|
domain: { name: 'Auth', version: '1' },
|
||||||
message: {
|
message: {
|
||||||
tips: "sign request",
|
tips: 'sign request',
|
||||||
nonce: window.nonce,
|
nonce: window.nonce,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
jsb.reflection.callStaticMethod(
|
jsb.reflection.callStaticMethod(
|
||||||
"org/cocos2dx/javascript/AppActivity",
|
'org/cocos2dx/javascript/AppActivity',
|
||||||
"signApp",
|
'signApp',
|
||||||
"(Ljava/lang/String;)V",
|
'(Ljava/lang/String;)V',
|
||||||
JSON.stringify(signData)
|
JSON.stringify(signData)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -944,20 +958,20 @@ module.exports = {
|
|||||||
autoLogin(accountid, sessionid, successcb) {
|
autoLogin(accountid, sessionid, successcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "Login")
|
.addKV('c', 'Login')
|
||||||
.addKV("a", "sessionAuth")
|
.addKV('a', 'sessionAuth')
|
||||||
.addKV("account_id", accountid)
|
.addKV('account_id', accountid)
|
||||||
.addKV("session_id", sessionid);
|
.addKV('session_id', sessionid);
|
||||||
|
|
||||||
console.log("auto....");
|
console.log('auto....');
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (res) {
|
function (res) {
|
||||||
console.log("login success");
|
console.log('login success');
|
||||||
successcb && successcb(res);
|
successcb && successcb(res);
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log("login err" + errcode + errmsg);
|
console.log('login err' + errcode + errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -965,15 +979,15 @@ module.exports = {
|
|||||||
getSwitch(cb) {
|
getSwitch(cb) {
|
||||||
const tmpUrlBd = new urlbuilder(BaseNet.getExaminingUrl());
|
const tmpUrlBd = new urlbuilder(BaseNet.getExaminingUrl());
|
||||||
tmpUrlBd
|
tmpUrlBd
|
||||||
.addKV("c", "ServerSwitch")
|
.addKV('c', 'ServerSwitch')
|
||||||
.addKV("a", "getSwitch")
|
.addKV('a', 'getSwitch')
|
||||||
.addKV("gameid", 2006);
|
.addKV('gameid', 2006);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
tmpUrlBd.baseurl,
|
tmpUrlBd.baseurl,
|
||||||
function (res) {
|
function (res) {
|
||||||
var obj = httpclient.JSON_parse(res);
|
var obj = httpclient.JSON_parse(res);
|
||||||
if (obj.examining == "1") {
|
if (obj.examining == '1') {
|
||||||
Config.isTest = true;
|
Config.isTest = true;
|
||||||
} else {
|
} else {
|
||||||
Config.isTest = false;
|
Config.isTest = false;
|
||||||
@ -987,29 +1001,29 @@ module.exports = {
|
|||||||
getVoipSign(group_id, successcb, failcb) {
|
getVoipSign(group_id, successcb, failcb) {
|
||||||
this.urlbd.clear();
|
this.urlbd.clear();
|
||||||
this.urlbd
|
this.urlbd
|
||||||
.addKV("c", "Login")
|
.addKV('c', 'Login')
|
||||||
.addKV("a", "getVoipSign")
|
.addKV('a', 'getVoipSign')
|
||||||
.addKV("gameid", this.gameid)
|
.addKV('gameid', this.gameid)
|
||||||
.addKV("account_id", this.accountid)
|
.addKV('account_id', this.accountid)
|
||||||
.addKV("session_id", this.sessionid)
|
.addKV('session_id', this.sessionid)
|
||||||
.addKV("group_id", group_id);
|
.addKV('group_id', group_id);
|
||||||
|
|
||||||
httpclient.httpGet(
|
httpclient.httpGet(
|
||||||
this.urlbd.baseurl,
|
this.urlbd.baseurl,
|
||||||
function (restext) {
|
function (restext) {
|
||||||
var obj = httpclient.JSON_parse(restext);
|
var obj = httpclient.JSON_parse(restext);
|
||||||
if (obj.errcode == 0) {
|
if (obj.errcode == 0) {
|
||||||
console.log("[getVoipSign]success!" + JSON.stringify(obj));
|
console.log('[getVoipSign]success!' + JSON.stringify(obj));
|
||||||
successcb && successcb(obj);
|
successcb && successcb(obj);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
"[getVoipSign]failed!" + obj.errcode + ":" + obj.errmsg
|
'[getVoipSign]failed!' + obj.errcode + ':' + obj.errmsg
|
||||||
);
|
);
|
||||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (errcode, errmsg) {
|
function (errcode, errmsg) {
|
||||||
console.log("[getVoipSign]failed!" + errcode + ":" + errmsg);
|
console.log('[getVoipSign]failed!' + errcode + ':' + errmsg);
|
||||||
failcb && failcb(errcode, 0, errmsg);
|
failcb && failcb(errcode, 0, errmsg);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
28
assets/scripts/tips/ServerNotOpenTip.ts
Normal file
28
assets/scripts/tips/ServerNotOpenTip.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// Learn TypeScript:
|
||||||
|
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html
|
||||||
|
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
|
||||||
|
// Learn Attribute:
|
||||||
|
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
|
||||||
|
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
|
||||||
|
// Learn life-cycle callbacks:
|
||||||
|
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
|
||||||
|
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
|
||||||
|
|
||||||
|
const { ccclass, property } = cc._decorator;
|
||||||
|
|
||||||
|
@ccclass
|
||||||
|
export default class ServerNotOpenTip extends cc.Component {
|
||||||
|
public static prefabPath = 'prefabs/tips/pb_servernoopen';
|
||||||
|
|
||||||
|
init(data: any) {
|
||||||
|
// throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
onClickOK() {
|
||||||
|
this.node.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
onClose() {
|
||||||
|
this.node.destroy();
|
||||||
|
}
|
||||||
|
}
|
9
assets/scripts/tips/ServerNotOpenTip.ts.meta
Normal file
9
assets/scripts/tips/ServerNotOpenTip.ts.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.5",
|
||||||
|
"uuid": "68652536-bbb9-4ed4-840f-19bb59062a75",
|
||||||
|
"isPlugin": false,
|
||||||
|
"loadPluginInWeb": true,
|
||||||
|
"loadPluginInNative": true,
|
||||||
|
"loadPluginInEditor": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
{"packageUrl":"https://test.kingsome.cn/game2006/test/slim/","remoteManifestUrl":"https://test.kingsome.cn/game2006/test/slim/project.manifest","remoteVersionUrl":"https://test.kingsome.cn/game2006/test/slim/version.manifest","version":"0.3.0"}
|
{"packageUrl":"https://www.cebg.games/pubgv4/","remoteManifestUrl":"https://www.cebg.games/pubgv4/project.manifest","remoteVersionUrl":"https://www.cebg.games/pubgv4/version.manifest","version":"0.1.0"}
|
@ -3,8 +3,7 @@ var path = require('path');
|
|||||||
var crypto = require('crypto');
|
var crypto = require('crypto');
|
||||||
|
|
||||||
//远程服务器所在的url
|
//远程服务器所在的url
|
||||||
|
var url = 'https://www.cebg.games/pubgv4/';
|
||||||
var url = 'https://test.kingsome.cn/game2006/test/slim/';
|
|
||||||
|
|
||||||
var manifest = {
|
var manifest = {
|
||||||
packageUrl: url,
|
packageUrl: url,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user