update
This commit is contained in:
parent
e09a3e0a4a
commit
319b4c2319
@ -47,8 +47,8 @@
|
||||
},
|
||||
"_scale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0.416015625,
|
||||
"y": 0.416015625,
|
||||
"x": 0.5703125,
|
||||
"y": 0.5703125,
|
||||
"z": 1
|
||||
},
|
||||
"_quat": {
|
||||
@ -12654,7 +12654,7 @@
|
||||
"__id__": 377
|
||||
}
|
||||
],
|
||||
"_active": false,
|
||||
"_active": true,
|
||||
"_level": 2,
|
||||
"_components": [
|
||||
{
|
||||
|
@ -13759,7 +13759,7 @@
|
||||
"__id__": 368
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_level": 3,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
@ -14355,7 +14355,7 @@
|
||||
"__id__": 478
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_level": 3,
|
||||
"_components": [
|
||||
{
|
||||
|
@ -1,15 +1,15 @@
|
||||
var NetManage = require('NetManage');
|
||||
var gameConfig = require('gameConfig');
|
||||
var Utils = require('Utils');
|
||||
const { uimanger, UIManger } = require('./UIManger');
|
||||
const { KeyanMain } = require('./Academy/UIKeyanMain');
|
||||
var NetManage = require("NetManage");
|
||||
var gameConfig = require("gameConfig");
|
||||
var Utils = require("Utils");
|
||||
const { uimanger, UIManger } = require("./UIManger");
|
||||
const { KeyanMain } = require("./Academy/UIKeyanMain");
|
||||
|
||||
const Config = require('../Config');
|
||||
const { default: Loading } = require('../gif/Loading');
|
||||
const { GuestLoginTip } = require('../tips/GuestLoginTip');
|
||||
const { LogoutTip } = require('../tips/LogoutTip');
|
||||
const { operation, OperationType } = require('../Operation/Operation');
|
||||
const jcgamelog = require('../jcfw/service/jcgamelog');
|
||||
const Config = require("../Config");
|
||||
const { default: Loading } = require("../gif/Loading");
|
||||
const { GuestLoginTip } = require("../tips/GuestLoginTip");
|
||||
const { LogoutTip } = require("../tips/LogoutTip");
|
||||
const { operation, OperationType } = require("../Operation/Operation");
|
||||
const jcgamelog = require("../jcfw/service/jcgamelog");
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
|
||||
@ -182,18 +182,18 @@ cc.Class({
|
||||
//
|
||||
|
||||
cc.uiMain = this;
|
||||
cc.Notifier.on('openSelfPlayerInfoUI', this, this.callInfo.bind(this));
|
||||
cc.Notifier.on('joinTeamRoom', this, this.joinTeamRoom.bind(this));
|
||||
cc.Notifier.on("openSelfPlayerInfoUI", this, this.callInfo.bind(this));
|
||||
cc.Notifier.on("joinTeamRoom", this, this.joinTeamRoom.bind(this));
|
||||
// cc.Notifier.on("openheroinfo", this, this.openheroinfo.bind(this));
|
||||
cc.Notifier.on('buyitem', this, this.buyitem.bind(this));
|
||||
cc.Notifier.on("buyitem", this, this.buyitem.bind(this));
|
||||
cc.Notifier.on(
|
||||
'refreshBaseInfo',
|
||||
"refreshBaseInfo",
|
||||
this,
|
||||
this.refreshBaseInfo.bind(this)
|
||||
);
|
||||
cc.Notifier.on('getreward', this, this.callreward.bind(this));
|
||||
cc.Notifier.on("getreward", this, this.callreward.bind(this));
|
||||
cc.Notifier.on(
|
||||
'hasConnectWallet',
|
||||
"hasConnectWallet",
|
||||
this,
|
||||
this.getwalletEvent.bind(this)
|
||||
);
|
||||
@ -236,7 +236,7 @@ cc.Class({
|
||||
|
||||
// 将钱包地址中间字段换成 *****
|
||||
replacepos(text, start, stop) {
|
||||
var mid = '*****';
|
||||
var mid = "*****";
|
||||
let mystr =
|
||||
text.toString().substr(0, start - 1) +
|
||||
mid +
|
||||
@ -245,18 +245,18 @@ cc.Class({
|
||||
},
|
||||
|
||||
onDestroy() {
|
||||
cc.Notifier.off('openSelfPlayerInfoUI', this);
|
||||
cc.Notifier.off('joinTeamRoom', this);
|
||||
cc.Notifier.off("openSelfPlayerInfoUI", this);
|
||||
cc.Notifier.off("joinTeamRoom", this);
|
||||
// cc.Notifier.off("openheroinfo", this);
|
||||
cc.Notifier.off('buyitem', this);
|
||||
cc.Notifier.off('refreshBaseInfo', this);
|
||||
cc.Notifier.off('getreward', this);
|
||||
cc.Notifier.on('hasConnectWallet', this);
|
||||
cc.Notifier.off("buyitem", this);
|
||||
cc.Notifier.off("refreshBaseInfo", this);
|
||||
cc.Notifier.off("getreward", this);
|
||||
cc.Notifier.on("hasConnectWallet", this);
|
||||
},
|
||||
refreshBaseInfo() {
|
||||
var pdata = cc.playerData;
|
||||
this.lb_name.string = pdata.name;
|
||||
this.lb_lv.string = 'LV.' + pdata.level;
|
||||
this.lb_lv.string = "LV." + pdata.level;
|
||||
this.lb_gold.string = pdata.gold;
|
||||
this.lb_diamond.string = pdata.diamond;
|
||||
this.pr_progress.progress = pdata.exp / pdata.max_exp;
|
||||
@ -269,12 +269,12 @@ cc.Class({
|
||||
this.nowheroid = pdata.hero_id;
|
||||
var skinres = cc.playerData.getheroSkinbyId(this.nowheroid, 0);
|
||||
cc.loader.loadRes(
|
||||
'spine/heropic/pic_hero' + skinres,
|
||||
"spine/heropic/pic_hero" + skinres,
|
||||
sp.SkeletonData,
|
||||
function (err, sp) {
|
||||
this.spine_hero.skeletonData = sp;
|
||||
this.spine_hero._updateSkeletonData();
|
||||
this.spine_hero.setAnimation(0, 'animation', true);
|
||||
this.spine_hero.setAnimation(0, "animation", true);
|
||||
}.bind(this)
|
||||
);
|
||||
}
|
||||
@ -299,31 +299,31 @@ cc.Class({
|
||||
},
|
||||
|
||||
onClickOfficial() {
|
||||
this.openUrlinNative('https://www.cebg.games/');
|
||||
this.openUrlinNative("https://www.cebg.games/");
|
||||
},
|
||||
onClickTwitter() {
|
||||
this.openUrlinNative('https://twitter.com/CEBG_GAME');
|
||||
this.openUrlinNative("https://twitter.com/CEBG_GAME");
|
||||
},
|
||||
onClickTelegram() {
|
||||
this.openUrlinNative('https://t.me/CEBG_official');
|
||||
this.openUrlinNative("https://t.me/CEBG_official");
|
||||
},
|
||||
onClickDiscord() {
|
||||
this.openUrlinNative('https://discord.gg/8dWX6jpcME');
|
||||
this.openUrlinNative("https://discord.gg/8dWX6jpcME");
|
||||
},
|
||||
|
||||
openUrlinNative(url) {
|
||||
jcgamelog.addOperation(OperationType.BUTTON, 'openurl', url);
|
||||
jcgamelog.addOperation(OperationType.BUTTON, "openurl", url);
|
||||
if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||
jsb.reflection.callStaticMethod(
|
||||
'org/cocos2dx/javascript/AppActivity',
|
||||
'openSocialUrl',
|
||||
'(Ljava/lang/String;)V',
|
||||
"org/cocos2dx/javascript/AppActivity",
|
||||
"openSocialUrl",
|
||||
"(Ljava/lang/String;)V",
|
||||
url
|
||||
);
|
||||
} else if (cc.sys.os == cc.sys.OS_IOS) {
|
||||
jsb.reflection.callStaticMethod(
|
||||
'AppController',
|
||||
'openSocialUrl:',
|
||||
"AppController",
|
||||
"openSocialUrl:",
|
||||
url
|
||||
);
|
||||
}
|
||||
@ -331,11 +331,11 @@ cc.Class({
|
||||
|
||||
callreward(v) {
|
||||
var nd = cc.instantiate(this.pb_reward1);
|
||||
nd.getComponent('UIReward').initdata(v);
|
||||
nd.getComponent("UIReward").initdata(v);
|
||||
this.node.addChild(nd);
|
||||
},
|
||||
callBattle() {
|
||||
jcgamelog.addOperation(OperationType.BUTTON, 'intobattle');
|
||||
jcgamelog.addOperation(OperationType.BUTTON, "intobattle");
|
||||
if (cc.sys.isNative) {
|
||||
if (Config.isTest) {
|
||||
// 审核
|
||||
@ -357,29 +357,29 @@ cc.Class({
|
||||
}
|
||||
},
|
||||
callChat() {
|
||||
jcgamelog.addOperation(OperationType.BUTTON, 'intochat');
|
||||
jcgamelog.addOperation(OperationType.BUTTON, "intochat");
|
||||
var nd = cc.instantiate(this.pb_chat);
|
||||
this.node.addChild(nd);
|
||||
},
|
||||
callbattlechosehero(opt) {
|
||||
var nd = cc.instantiate(this.pb_chosehero);
|
||||
nd.getComponent('UIChoseHero').initdata(opt);
|
||||
nd.getComponent("UIChoseHero").initdata(opt);
|
||||
this.node.addChild(nd);
|
||||
},
|
||||
callteammatch(teamid) {
|
||||
var nd = cc.instantiate(this.pb_teammatch);
|
||||
nd.getComponent('UITeamMatch').initdata(teamid);
|
||||
nd.getComponent("UITeamMatch").initdata(teamid);
|
||||
this.node.addChild(nd);
|
||||
},
|
||||
onclickinfo() {
|
||||
this.callInfo(NetManage.account_id);
|
||||
},
|
||||
callInfo(v) {
|
||||
jcgamelog.addOperation(OperationType.BUTTON, 'into userinfo');
|
||||
jcgamelog.addOperation(OperationType.BUTTON, "into userinfo");
|
||||
NetManage.getUeserInfo(v, (data) => {
|
||||
if (data.errcode == 0) {
|
||||
var nd = cc.instantiate(this.pb_userinfo);
|
||||
nd.getComponent('UIRoleInfo').initdata(data.info);
|
||||
nd.getComponent("UIRoleInfo").initdata(data.info);
|
||||
this.node.addChild(nd);
|
||||
}
|
||||
});
|
||||
@ -398,7 +398,7 @@ cc.Class({
|
||||
callrole() {
|
||||
NetManage.getHeroList((data) => {
|
||||
var nd = cc.instantiate(this.pb_hero);
|
||||
nd.getComponent('UIHero').initdata(data);
|
||||
nd.getComponent("UIHero").initdata(data);
|
||||
this.node.addChild(nd);
|
||||
});
|
||||
},
|
||||
@ -410,7 +410,7 @@ cc.Class({
|
||||
buyitem(v) {
|
||||
//待扩展其他类型的
|
||||
var nd = cc.instantiate(this.pb_herobuy);
|
||||
nd.getComponent('UIHeroBuy').initdata(v);
|
||||
nd.getComponent("UIHeroBuy").initdata(v);
|
||||
this.node.addChild(nd);
|
||||
},
|
||||
calltop(fnode) {
|
||||
@ -426,14 +426,14 @@ cc.Class({
|
||||
},
|
||||
calleditname(itemid) {
|
||||
var nd = cc.instantiate(this.pb_editname);
|
||||
nd.getComponent('UINameCard').initdata(itemid);
|
||||
nd.getComponent("UINameCard").initdata(itemid);
|
||||
this.node.addChild(nd);
|
||||
},
|
||||
|
||||
callrank() {
|
||||
NetManage.getactivityRankingList(1, (data) => {
|
||||
var nd = cc.instantiate(this.pb_rank);
|
||||
nd.getComponent('UIRank').init(JSON.stringify(data));
|
||||
nd.getComponent("UIRank").init(JSON.stringify(data));
|
||||
this.node.addChild(nd);
|
||||
});
|
||||
|
||||
@ -447,7 +447,7 @@ cc.Class({
|
||||
calltask() {
|
||||
NetManage.missionList(1, (data) => {
|
||||
var nd = cc.instantiate(this.pb_task);
|
||||
nd.getComponent('UITask').initdata(data);
|
||||
nd.getComponent("UITask").initdata(data);
|
||||
this.node.addChild(nd);
|
||||
});
|
||||
},
|
||||
@ -458,7 +458,7 @@ cc.Class({
|
||||
// });
|
||||
NetManage.gunList((data) => {
|
||||
var nd = cc.instantiate(this.pb_gun);
|
||||
nd.getComponent('UIGuns').initdata(data);
|
||||
nd.getComponent("UIGuns").initdata(data);
|
||||
this.node.addChild(nd);
|
||||
});
|
||||
},
|
||||
@ -482,7 +482,7 @@ cc.Class({
|
||||
callseasoncard() {
|
||||
NetManage.seasonCard((data) => {
|
||||
var nd = cc.instantiate(this.pb_seasoncard);
|
||||
nd.getComponent('UISeasonCard').initdata(data);
|
||||
nd.getComponent("UISeasonCard").initdata(data);
|
||||
this.node.addChild(nd);
|
||||
});
|
||||
},
|
||||
@ -501,16 +501,16 @@ cc.Class({
|
||||
},
|
||||
|
||||
logout() {
|
||||
jcgamelog.addOperation(OperationType.BUTTON, 'logout');
|
||||
jcgamelog.addOperation(OperationType.BUTTON, "logout");
|
||||
uimanger.showUI(LogoutTip.prefabPath);
|
||||
},
|
||||
|
||||
connectwalletinmain() {
|
||||
jcgamelog.addOperation(
|
||||
OperationType.BUTTON,
|
||||
'clickwalletconnectinmain'
|
||||
"clickwalletconnectinmain"
|
||||
);
|
||||
localStorage.removeItem('walletaccount');
|
||||
localStorage.removeItem("walletaccount");
|
||||
window.hasWallet = false;
|
||||
cc.game.restart();
|
||||
},
|
||||
|
@ -9,13 +9,13 @@
|
||||
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
|
||||
//var httpclient = require("httpclient");
|
||||
//var urlbuilder = require("urlbuilder");
|
||||
var httpclient = require('httpclient');
|
||||
var urlbuilder = require('urlbuilder');
|
||||
const BaseNet = require('../../BaseNet');
|
||||
const Config = require('../../Config');
|
||||
const { isTesting } = require('../../Config');
|
||||
const { WhitelistTip } = require('../../tips/WhitelistTip');
|
||||
const { uimanger } = require('../../UI/UIManger');
|
||||
var httpclient = require("httpclient");
|
||||
var urlbuilder = require("urlbuilder");
|
||||
const BaseNet = require("../../BaseNet");
|
||||
const Config = require("../../Config");
|
||||
const { isTesting } = require("../../Config");
|
||||
const { WhitelistTip } = require("../../tips/WhitelistTip");
|
||||
const { uimanger } = require("../../UI/UIManger");
|
||||
|
||||
module.exports = {
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
@ -37,69 +37,69 @@ module.exports = {
|
||||
) {
|
||||
if (window.canAutoLogin == true) {
|
||||
this.autoLogin(
|
||||
localStorage.getItem('loginaccount'),
|
||||
localStorage.getItem('loginsession'),
|
||||
localStorage.getItem("loginaccount"),
|
||||
localStorage.getItem("loginsession"),
|
||||
(res) => {
|
||||
console.log('auto login res===' + res);
|
||||
console.log("auto login res===" + res);
|
||||
var obj = httpclient.JSON_parse(res);
|
||||
// console.log("[__login]success!" + JSON.stringify(obj));
|
||||
successcb && successcb(obj);
|
||||
cc.Notifier.emit('autologinsuccess');
|
||||
cc.Notifier.emit("autologinsuccess");
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(BaseNet.getNormalApiUrl('login'));
|
||||
console.log(BaseNet.getNormalApiUrl("login"));
|
||||
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'Login')
|
||||
.addKV('a', 'auth')
|
||||
.addKV('gameid', gameid);
|
||||
.addKV("c", "Login")
|
||||
.addKV("a", "auth")
|
||||
.addKV("gameid", gameid);
|
||||
if (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) {
|
||||
this.urlbd.addKV('openid', cc.sdkdata.openid);
|
||||
this.urlbd.addKV("openid", cc.sdkdata.openid);
|
||||
// this.urlbd.addKV('token', cc.sdkdata.token);
|
||||
|
||||
this.urlbd.addKV('poly_sdk_channel', 8001);
|
||||
this.urlbd.addKV("poly_sdk_channel", 8001);
|
||||
this.urlbd.addKV(
|
||||
'poly_sdk_subchannel',
|
||||
"poly_sdk_subchannel",
|
||||
cc.sdkdata.poly_sdk_subchannel
|
||||
);
|
||||
} else if (cc.sdkData2) {
|
||||
console.log('SDKData3==', JSON.stringify(cc.sdkData2));
|
||||
this.urlbd.addKV('openid', cc.sdkData2.openid);
|
||||
console.log("SDKData3==", JSON.stringify(cc.sdkData2));
|
||||
this.urlbd.addKV("openid", cc.sdkData2.openid);
|
||||
// this.urlbd.addKV('token', cc.sdkData2.token);
|
||||
} else {
|
||||
if (openid && openid != '') {
|
||||
this.urlbd.addKV('openid', openid);
|
||||
if (openid && openid != "") {
|
||||
this.urlbd.addKV("openid", openid);
|
||||
} else {
|
||||
this.urlbd.addKV('openid', tokencode);
|
||||
this.urlbd.addKV("openid", tokencode);
|
||||
}
|
||||
this.urlbd.addKV('token', tokencode);
|
||||
this.urlbd.addKV("token", tokencode);
|
||||
}
|
||||
|
||||
if (this.env) {
|
||||
this.urlbd.addKV('env', this.env);
|
||||
this.urlbd.addKV("env", this.env);
|
||||
}
|
||||
|
||||
if (channelid == '6516') {
|
||||
this.urlbd.addKV('account', window.account);
|
||||
this.urlbd.addKV('net_id', '321');
|
||||
if (channelid == "6516") {
|
||||
this.urlbd.addKV("account", window.account);
|
||||
this.urlbd.addKV("net_id", "321");
|
||||
// getNounce
|
||||
this.urlbd.addKV('nonce', window.nonce);
|
||||
this.urlbd.addKV('signature', window.appsign);
|
||||
this.urlbd.addKV('tips', 'sign request');
|
||||
this.urlbd.addKV("nonce", window.nonce);
|
||||
this.urlbd.addKV("signature", window.appsign);
|
||||
this.urlbd.addKV("tips", "sign request");
|
||||
|
||||
// reset token
|
||||
var tmpToken = '';
|
||||
var tmpToken = "";
|
||||
if (cc.sdkdata) {
|
||||
tmpToken = cc.sdkdata.token;
|
||||
} else if (cc.sdkData2) {
|
||||
@ -111,12 +111,12 @@ module.exports = {
|
||||
token = {
|
||||
token: tmpToken,
|
||||
account: window.account,
|
||||
tips: 'sign request',
|
||||
tips: "sign request",
|
||||
nonce: window.nonce,
|
||||
signature: window.appsign,
|
||||
net_id: 321,
|
||||
};
|
||||
this.urlbd.addKV('type', 0);
|
||||
this.urlbd.addKV("type", 0);
|
||||
|
||||
// if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||
// token = {
|
||||
@ -141,12 +141,12 @@ module.exports = {
|
||||
|
||||
console.log(`TOKEN --- ${JSON.stringify(token)}`);
|
||||
|
||||
this.urlbd.addKV('token', JSON.stringify(token));
|
||||
this.urlbd.addKV("token", JSON.stringify(token));
|
||||
} else {
|
||||
if (cc.sdkdata) {
|
||||
this.urlbd.addKV('token', cc.sdkdata.token);
|
||||
this.urlbd.addKV("token", cc.sdkdata.token);
|
||||
} else if (cc.sdkData2) {
|
||||
this.urlbd.addKV('token', cc.sdkData2.token);
|
||||
this.urlbd.addKV("token", cc.sdkData2.token);
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,28 +156,28 @@ module.exports = {
|
||||
var obj = httpclient.JSON_parse(restext);
|
||||
console.log(`login res --${restext}`);
|
||||
|
||||
console.log('errcode----' + obj.errcode);
|
||||
console.log("errcode----" + obj.errcode);
|
||||
|
||||
if (obj.errcode == 66) {
|
||||
console.log('用户不在白名单中');
|
||||
console.log("用户不在白名单中");
|
||||
uimanger.showUI(WhitelistTip.prefabPath);
|
||||
localStorage.removeItem('walletaccount');
|
||||
localStorage.removeItem("walletaccount");
|
||||
window.hasWallet = false;
|
||||
return;
|
||||
}
|
||||
if (obj.errcode == 0) {
|
||||
console.log('[__login]success!' + JSON.stringify(obj));
|
||||
console.log("[__login]success!" + JSON.stringify(obj));
|
||||
cc.subchannel = obj.channel;
|
||||
successcb && successcb(obj);
|
||||
} else {
|
||||
console.log(
|
||||
'[__login]failed!' + obj.errcode + ':' + obj.errmsg
|
||||
"[__login]failed!" + obj.errcode + ":" + obj.errmsg
|
||||
);
|
||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||
}
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log('[__login]failed!' + errcode + ':' + errmsg);
|
||||
console.log("[__login]failed!" + errcode + ":" + errmsg);
|
||||
failcb && failcb(errcode, 0, errmsg);
|
||||
}
|
||||
);
|
||||
@ -196,36 +196,36 @@ module.exports = {
|
||||
) {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'Login')
|
||||
.addKV('a', 'activateWeiXinUser')
|
||||
.addKV('gameid', gameid)
|
||||
.addKV('account_id', accountid)
|
||||
.addKV('session_id', sessionid)
|
||||
.addKV('rawdata', raw)
|
||||
.addKV('signature', sign)
|
||||
.addKV('encrypted_data', encyptdata)
|
||||
.addKV('iv', iv);
|
||||
.addKV("c", "Login")
|
||||
.addKV("a", "activateWeiXinUser")
|
||||
.addKV("gameid", gameid)
|
||||
.addKV("account_id", accountid)
|
||||
.addKV("session_id", sessionid)
|
||||
.addKV("rawdata", raw)
|
||||
.addKV("signature", sign)
|
||||
.addKV("encrypted_data", encyptdata)
|
||||
.addKV("iv", iv);
|
||||
|
||||
httpclient.httpGet(
|
||||
this.urlbd.baseurl,
|
||||
function (restext) {
|
||||
if (restext == '') {
|
||||
failcb && failcb(0, -1, 'restext is nullstring!');
|
||||
if (restext == "") {
|
||||
failcb && failcb(0, -1, "restext is nullstring!");
|
||||
return;
|
||||
}
|
||||
var obj = httpclient.JSON_parse(restext);
|
||||
if (obj && obj.errcode == 0) {
|
||||
console.log('[__activeWX]success!' + JSON.stringify(obj));
|
||||
console.log("[__activeWX]success!" + JSON.stringify(obj));
|
||||
successcb && successcb(obj);
|
||||
} else {
|
||||
console.log(
|
||||
'[__activeWX]failed!' + obj.errcode + ':' + obj.errmsg
|
||||
"[__activeWX]failed!" + obj.errcode + ":" + obj.errmsg
|
||||
);
|
||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||
}
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log('[__activeWX]failed!' + errcode + ':' + errmsg);
|
||||
console.log("[__activeWX]failed!" + errcode + ":" + errmsg);
|
||||
failcb && failcb(errcode, 0, errmsg);
|
||||
}
|
||||
);
|
||||
@ -234,19 +234,19 @@ module.exports = {
|
||||
__updateInfo(accountid, sessionid, usrinfo, successcb, failcb) {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'Login')
|
||||
.addKV('a', 'updateUserInfo')
|
||||
.addKV('account_id', accountid)
|
||||
.addKV('session_id', sessionid)
|
||||
.addKV('nickname', usrinfo.nickname)
|
||||
.addKV('city', usrinfo.city)
|
||||
.addKV('province', usrinfo.province)
|
||||
.addKV('avatar_url', usrinfo.avatar_url)
|
||||
.addKV('country', usrinfo.country)
|
||||
.addKV('sex', usrinfo.sex)
|
||||
.addKV('birthday', usrinfo.birthday)
|
||||
.addKV('phone', usrinfo.phone)
|
||||
.addKV('location', usrinfo.location);
|
||||
.addKV("c", "Login")
|
||||
.addKV("a", "updateUserInfo")
|
||||
.addKV("account_id", accountid)
|
||||
.addKV("session_id", sessionid)
|
||||
.addKV("nickname", usrinfo.nickname)
|
||||
.addKV("city", usrinfo.city)
|
||||
.addKV("province", usrinfo.province)
|
||||
.addKV("avatar_url", usrinfo.avatar_url)
|
||||
.addKV("country", usrinfo.country)
|
||||
.addKV("sex", usrinfo.sex)
|
||||
.addKV("birthday", usrinfo.birthday)
|
||||
.addKV("phone", usrinfo.phone)
|
||||
.addKV("location", usrinfo.location);
|
||||
// if(!this.isoffical){
|
||||
// console.log(this.urlbd.baseurl);
|
||||
// }
|
||||
@ -255,17 +255,17 @@ module.exports = {
|
||||
function (restext) {
|
||||
var obj = httpclient.JSON_parse(restext);
|
||||
if (obj.errcode == 0) {
|
||||
console.log('[__updateInfo]success!' + JSON.stringify(obj));
|
||||
console.log("[__updateInfo]success!" + JSON.stringify(obj));
|
||||
successcb && successcb(obj);
|
||||
} else {
|
||||
console.log(
|
||||
'[__updateInfo]failed!' + obj.errcode + ':' + obj.errmsg
|
||||
"[__updateInfo]failed!" + obj.errcode + ":" + obj.errmsg
|
||||
);
|
||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||
}
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log('[__updateInfo]failed!' + errcode + ':' + errmsg);
|
||||
console.log("[__updateInfo]failed!" + errcode + ":" + errmsg);
|
||||
failcb && failcb(errcode, 0, errmsg);
|
||||
}
|
||||
);
|
||||
@ -274,11 +274,11 @@ module.exports = {
|
||||
__generalSignature(accountid, sessionid, signdata, successcb, failcb) {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'Login')
|
||||
.addKV('a', 'signature')
|
||||
.addKV('account_id', accountid)
|
||||
.addKV('session_id', sessionid)
|
||||
.addKV('params', signdata);
|
||||
.addKV("c", "Login")
|
||||
.addKV("a", "signature")
|
||||
.addKV("account_id", accountid)
|
||||
.addKV("session_id", sessionid)
|
||||
.addKV("params", signdata);
|
||||
|
||||
httpclient.httpGet(
|
||||
this.urlbd.baseurl,
|
||||
@ -286,14 +286,14 @@ module.exports = {
|
||||
var obj = httpclient.JSON_parse(restext);
|
||||
if (obj.errcode == 0) {
|
||||
console.log(
|
||||
'[__generalSignature]success!' + JSON.stringify(obj)
|
||||
"[__generalSignature]success!" + JSON.stringify(obj)
|
||||
);
|
||||
successcb && successcb(obj);
|
||||
} else {
|
||||
console.log(
|
||||
'[__generalSignature]failed!' +
|
||||
"[__generalSignature]failed!" +
|
||||
obj.errcode +
|
||||
':' +
|
||||
":" +
|
||||
obj.errmsg
|
||||
);
|
||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||
@ -301,7 +301,7 @@ module.exports = {
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log(
|
||||
'[__generalSignature]failed!' + errcode + ':' + errmsg
|
||||
"[__generalSignature]failed!" + errcode + ":" + errmsg
|
||||
);
|
||||
failcb && failcb(errcode, 0, errmsg);
|
||||
}
|
||||
@ -311,11 +311,11 @@ module.exports = {
|
||||
__generalToken(accountid, sessionid, sceneid, successcb, failcb) {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'Login')
|
||||
.addKV('a', 'getAccessToken')
|
||||
.addKV('account_id', accountid)
|
||||
.addKV('session_id', sessionid)
|
||||
.addKV('scene', sceneid);
|
||||
.addKV("c", "Login")
|
||||
.addKV("a", "getAccessToken")
|
||||
.addKV("account_id", accountid)
|
||||
.addKV("session_id", sessionid)
|
||||
.addKV("scene", sceneid);
|
||||
|
||||
httpclient.httpGet(
|
||||
this.urlbd.baseurl,
|
||||
@ -323,21 +323,21 @@ module.exports = {
|
||||
var obj = httpclient.JSON_parse(restext);
|
||||
if (obj.errcode == 0) {
|
||||
console.log(
|
||||
'[__generalToken]success!' + JSON.stringify(obj)
|
||||
"[__generalToken]success!" + JSON.stringify(obj)
|
||||
);
|
||||
successcb && successcb(obj);
|
||||
} else {
|
||||
console.log(
|
||||
'[__generalToken]failed!' +
|
||||
"[__generalToken]failed!" +
|
||||
obj.errcode +
|
||||
':' +
|
||||
":" +
|
||||
obj.errmsg
|
||||
);
|
||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||
}
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log('[__generalToken]failed!' + errcode + ':' + errmsg);
|
||||
console.log("[__generalToken]failed!" + errcode + ":" + errmsg);
|
||||
failcb && failcb(errcode, 0, errmsg);
|
||||
}
|
||||
);
|
||||
@ -346,10 +346,10 @@ module.exports = {
|
||||
__getAnnouncement(channelid, gameid, successcb, failcb) {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'Annc')
|
||||
.addKV('a', 'getAnnouncement')
|
||||
.addKV('gameid', gameid)
|
||||
.addKV('channel', channelid);
|
||||
.addKV("c", "Annc")
|
||||
.addKV("a", "getAnnouncement")
|
||||
.addKV("gameid", gameid)
|
||||
.addKV("channel", channelid);
|
||||
|
||||
httpclient.httpGet(
|
||||
this.urlbd.baseurl,
|
||||
@ -357,14 +357,14 @@ module.exports = {
|
||||
var obj = httpclient.JSON_parse(restext);
|
||||
if (obj.errcode == 0) {
|
||||
console.log(
|
||||
'[__getAnnouncement]success!' + JSON.stringify(obj)
|
||||
"[__getAnnouncement]success!" + JSON.stringify(obj)
|
||||
);
|
||||
successcb && successcb(obj);
|
||||
} else {
|
||||
console.log(
|
||||
'[__getAnnouncement]failed!' +
|
||||
"[__getAnnouncement]failed!" +
|
||||
obj.errcode +
|
||||
':' +
|
||||
":" +
|
||||
obj.errmsg
|
||||
);
|
||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||
@ -372,7 +372,7 @@ module.exports = {
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log(
|
||||
'[__getAnnouncement]failed!' + errcode + ':' + errmsg
|
||||
"[__getAnnouncement]failed!" + errcode + ":" + errmsg
|
||||
);
|
||||
failcb && failcb(errcode, 0, errmsg);
|
||||
}
|
||||
@ -382,13 +382,13 @@ module.exports = {
|
||||
__getServerList(channelid, gameid, successcb, failcb) {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'SrvList')
|
||||
.addKV('a', 'getSrvList')
|
||||
.addKV('gameid', gameid)
|
||||
.addKV('channel', channelid);
|
||||
.addKV("c", "SrvList")
|
||||
.addKV("a", "getSrvList")
|
||||
.addKV("gameid", gameid)
|
||||
.addKV("channel", channelid);
|
||||
|
||||
if (this.env) {
|
||||
this.urlbd.addKV('env', this.env);
|
||||
this.urlbd.addKV("env", this.env);
|
||||
}
|
||||
|
||||
httpclient.httpGet(
|
||||
@ -397,14 +397,14 @@ module.exports = {
|
||||
var obj = httpclient.JSON_parse(restext);
|
||||
if (obj.errcode == 0) {
|
||||
console.log(
|
||||
'[__getServerList]success!' + JSON.stringify(obj)
|
||||
"[__getServerList]success!" + JSON.stringify(obj)
|
||||
);
|
||||
successcb && successcb(obj.server_list);
|
||||
} else {
|
||||
console.log(
|
||||
'[__getServerList]failed!' +
|
||||
"[__getServerList]failed!" +
|
||||
obj.errcode +
|
||||
':' +
|
||||
":" +
|
||||
obj.errmsg
|
||||
);
|
||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||
@ -412,7 +412,7 @@ module.exports = {
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log(
|
||||
'[__getServerList]failed!' + errcode + ':' + errmsg
|
||||
"[__getServerList]failed!" + errcode + ":" + errmsg
|
||||
);
|
||||
failcb && failcb(errcode, 0, errmsg);
|
||||
}
|
||||
@ -422,28 +422,28 @@ module.exports = {
|
||||
__loginYoume(accountid, sessionid, nickname, successcb, failcb) {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'YouMe')
|
||||
.addKV('a', 'login')
|
||||
.addKV('account_id', accountid)
|
||||
.addKV('session_id', sessionid)
|
||||
.addKV('nickname', nickname);
|
||||
.addKV("c", "YouMe")
|
||||
.addKV("a", "login")
|
||||
.addKV("account_id", accountid)
|
||||
.addKV("session_id", sessionid)
|
||||
.addKV("nickname", nickname);
|
||||
|
||||
httpclient.httpGet(
|
||||
this.urlbd.baseurl,
|
||||
function (restext) {
|
||||
var obj = httpclient.JSON_parse(restext);
|
||||
if (obj.errcode == 0) {
|
||||
console.log('[__loginYoume]success!' + JSON.stringify(obj));
|
||||
console.log("[__loginYoume]success!" + JSON.stringify(obj));
|
||||
successcb && successcb(obj.token);
|
||||
} else {
|
||||
console.log(
|
||||
'[__loginYoume]failed!' + obj.errcode + ':' + obj.errmsg
|
||||
"[__loginYoume]failed!" + obj.errcode + ":" + obj.errmsg
|
||||
);
|
||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||
}
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log('[__loginYoume]failed!' + errcode + ':' + errmsg);
|
||||
console.log("[__loginYoume]failed!" + errcode + ":" + errmsg);
|
||||
failcb && failcb(errcode, 0, errmsg);
|
||||
}
|
||||
);
|
||||
@ -530,7 +530,7 @@ module.exports = {
|
||||
}
|
||||
break;
|
||||
}
|
||||
console.log('[_loadLocalInfo]finish');
|
||||
console.log("[_loadLocalInfo]finish");
|
||||
this._localinfoloaded = true;
|
||||
},
|
||||
|
||||
@ -560,56 +560,56 @@ module.exports = {
|
||||
this.svuserinfo.birthday = info.birthday;
|
||||
this.svuserinfo.phone = info.phone;
|
||||
this.svuserinfo.location = info.location;
|
||||
console.log('[_loadServerInfo]finish');
|
||||
console.log("[_loadServerInfo]finish");
|
||||
this._svinfoloaded = true;
|
||||
},
|
||||
|
||||
_combineInfo(svinfo, lcinfo) {
|
||||
let bupdated = false;
|
||||
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;
|
||||
bupdated = true;
|
||||
}
|
||||
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;
|
||||
bupdated = true;
|
||||
}
|
||||
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;
|
||||
bupdated = true;
|
||||
}
|
||||
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;
|
||||
bupdated = true;
|
||||
}
|
||||
if (lcinfo.avatar_url && svinfo.avatar_url != lcinfo.avatar_url) {
|
||||
console.log(
|
||||
'[avatar_url]' + svinfo.avatar_url + '|' + lcinfo.avatar_url
|
||||
"[avatar_url]" + svinfo.avatar_url + "|" + lcinfo.avatar_url
|
||||
);
|
||||
svinfo.avatar_url = lcinfo.avatar_url;
|
||||
bupdated = true;
|
||||
}
|
||||
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;
|
||||
bupdated = true;
|
||||
}
|
||||
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;
|
||||
bupdated = true;
|
||||
}
|
||||
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;
|
||||
bupdated = true;
|
||||
}
|
||||
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;
|
||||
bupdated = true;
|
||||
}
|
||||
@ -621,15 +621,15 @@ module.exports = {
|
||||
this.owner = owner;
|
||||
this.channelid = channelid;
|
||||
this.gameid = gameid;
|
||||
this.sessionid = this.sessionid ? this.sessionid : '';
|
||||
this.accountid = this.accountid ? this.accountid : '';
|
||||
this.openid = this.openid ? this.openid : '';
|
||||
this.sessionid = this.sessionid ? this.sessionid : "";
|
||||
this.accountid = this.accountid ? this.accountid : "";
|
||||
this.openid = this.openid ? this.openid : "";
|
||||
this.env = env;
|
||||
this.isoffical = isoffical;
|
||||
this.logined = this.logined ? this.logined : false;
|
||||
this.urlbd = new urlbuilder(BaseNet.getNormalApiUrl('login'));
|
||||
this.urlbd = new urlbuilder(BaseNet.getNormalApiUrl("login"));
|
||||
console.log(
|
||||
'[jclogin]init:' + gameid + '|' + channelid + '|' + isoffical
|
||||
"[jclogin]init:" + gameid + "|" + channelid + "|" + isoffical
|
||||
);
|
||||
},
|
||||
|
||||
@ -678,12 +678,12 @@ module.exports = {
|
||||
//
|
||||
let self = this;
|
||||
let openId = BK.getSystemInfoSync().openId;
|
||||
console.log('loginQQ openid:' + openId);
|
||||
console.log("loginQQ openid:" + openId);
|
||||
// BK.Script.loadlib("GameRes://qqPlayCore.js") //预加载bricks js层接口
|
||||
BK.QQ.fetchOpenKey(function (errCode, cmd, data) {
|
||||
if (errCode == 0) {
|
||||
let openKey = data.openKey;
|
||||
console.log('loginQQ openKey:' + openKey);
|
||||
console.log("loginQQ openKey:" + openKey);
|
||||
self.login(openKey, successcb, failcb, openId);
|
||||
}
|
||||
});
|
||||
@ -691,12 +691,12 @@ module.exports = {
|
||||
break;
|
||||
case 6003:
|
||||
{
|
||||
console.log('[qg.login]BEGIN:' + exparam);
|
||||
if (typeof qg != 'undefined') {
|
||||
console.log("[qg.login]BEGIN:" + exparam);
|
||||
if (typeof qg != "undefined") {
|
||||
qg.login({
|
||||
pkgName: exparam,
|
||||
success: (res) => {
|
||||
console.log('[qg.login]success');
|
||||
console.log("[qg.login]success");
|
||||
console.log(JSON.stringify(res));
|
||||
this.login(
|
||||
res.token,
|
||||
@ -707,7 +707,7 @@ module.exports = {
|
||||
this.updateuserinfo(res);
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log('[qg.login]fail');
|
||||
console.log("[qg.login]fail");
|
||||
console.log(JSON.stringify(res));
|
||||
failcb && failcb();
|
||||
},
|
||||
@ -722,7 +722,7 @@ module.exports = {
|
||||
qg.getProfile({
|
||||
token: vivotoken,
|
||||
success: function (data) {
|
||||
console.log('[vivo.login]success');
|
||||
console.log("[vivo.login]success");
|
||||
self.login(
|
||||
vivotoken,
|
||||
successcb,
|
||||
@ -732,20 +732,20 @@ module.exports = {
|
||||
self.updateuserinfo(data);
|
||||
},
|
||||
fail: function (data, code) {
|
||||
console.log('[vivo.login]fail');
|
||||
console.log("[vivo.login]fail");
|
||||
failcb && failcb();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
qg.authorize({
|
||||
type: 'token',
|
||||
type: "token",
|
||||
success: function (data) {
|
||||
console.log('vivoAuthorize success');
|
||||
console.log("vivoAuthorize success");
|
||||
vivoGetUserInfo(data.accessToken);
|
||||
},
|
||||
fail: function (data, code) {
|
||||
console.log('vivoAuthorize fail');
|
||||
console.log("vivoAuthorize fail");
|
||||
failcb && failcb();
|
||||
},
|
||||
});
|
||||
@ -767,16 +767,16 @@ module.exports = {
|
||||
this._loginstarttime = new Date().getTime();
|
||||
wx.login({
|
||||
success: function (res) {
|
||||
console.log('[wx]login success!' + res.code);
|
||||
console.log("[wx]login success!" + res.code);
|
||||
self.login(res.code, successcb, failcb);
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('[wx]login fail!');
|
||||
console.log("[wx]login fail!");
|
||||
failcb && failcb(0, res.errcode, res.errmsg);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
failcb && failcb(-1, 0, 'not weixin platform!');
|
||||
failcb && failcb(-1, 0, "not weixin platform!");
|
||||
}
|
||||
},
|
||||
|
||||
@ -861,10 +861,10 @@ module.exports = {
|
||||
},
|
||||
|
||||
AccountID(openid) {
|
||||
if (this.accountid && this.accountid != '') {
|
||||
if (this.accountid && this.accountid != "") {
|
||||
return this.accountid;
|
||||
}
|
||||
return this.channelid + '_' + this.gameid + '_' + openid;
|
||||
return this.channelid + "_" + this.gameid + "_" + openid;
|
||||
},
|
||||
|
||||
setAccountID(accountid, sessionid) {
|
||||
@ -890,44 +890,44 @@ module.exports = {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'Login')
|
||||
.addKV('a', 'getNonce')
|
||||
.addKV('gameid', this.gameid)
|
||||
.addKV('account', window.account);
|
||||
.addKV("c", "Login")
|
||||
.addKV("a", "getNonce")
|
||||
.addKV("gameid", this.gameid)
|
||||
.addKV("account", window.account);
|
||||
httpclient.httpGet(
|
||||
this.urlbd.baseurl,
|
||||
function (res) {
|
||||
window.nonce = httpclient.JSON_parse(res).nonce;
|
||||
if (cc.sys.os == cc.sys.OS_IOS) {
|
||||
jsb.reflection.callStaticMethod(
|
||||
'AppController',
|
||||
'signApp:',
|
||||
"AppController",
|
||||
"signApp:",
|
||||
window.nonce
|
||||
);
|
||||
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||
var signData = {
|
||||
types: {
|
||||
EIP712Domain: [
|
||||
{ name: 'name', type: 'string' },
|
||||
{ name: 'version', type: 'string' },
|
||||
{ name: "name", type: "string" },
|
||||
{ name: "version", type: "string" },
|
||||
],
|
||||
set: [
|
||||
{ name: 'tips', type: 'string' },
|
||||
{ name: 'nonce', type: 'string' },
|
||||
{ name: "tips", type: "string" },
|
||||
{ name: "nonce", type: "string" },
|
||||
],
|
||||
},
|
||||
primaryType: 'set',
|
||||
domain: { name: 'Auth', version: '1' },
|
||||
primaryType: "set",
|
||||
domain: { name: "Auth", version: "1" },
|
||||
message: {
|
||||
tips: 'sign request',
|
||||
tips: "sign request",
|
||||
nonce: window.nonce,
|
||||
},
|
||||
};
|
||||
|
||||
jsb.reflection.callStaticMethod(
|
||||
'org/cocos2dx/javascript/AppActivity',
|
||||
'signApp',
|
||||
'(Ljava/lang/String;)V',
|
||||
"org/cocos2dx/javascript/AppActivity",
|
||||
"signApp",
|
||||
"(Ljava/lang/String;)V",
|
||||
JSON.stringify(signData)
|
||||
);
|
||||
}
|
||||
@ -944,20 +944,20 @@ module.exports = {
|
||||
autoLogin(accountid, sessionid, successcb) {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'Login')
|
||||
.addKV('a', 'sessionAuth')
|
||||
.addKV('account_id', accountid)
|
||||
.addKV('session_id', sessionid);
|
||||
.addKV("c", "Login")
|
||||
.addKV("a", "sessionAuth")
|
||||
.addKV("account_id", accountid)
|
||||
.addKV("session_id", sessionid);
|
||||
|
||||
console.log('auto....');
|
||||
console.log("auto....");
|
||||
httpclient.httpGet(
|
||||
this.urlbd.baseurl,
|
||||
function (res) {
|
||||
console.log('login success');
|
||||
console.log("login success");
|
||||
successcb && successcb(res);
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log('login err' + errcode + errmsg);
|
||||
console.log("login err" + errcode + errmsg);
|
||||
}
|
||||
);
|
||||
},
|
||||
@ -965,16 +965,16 @@ module.exports = {
|
||||
getSwitch(cb) {
|
||||
const tmpUrlBd = new urlbuilder(BaseNet.getExaminingUrl());
|
||||
tmpUrlBd
|
||||
.addKV('c', 'ServerSwitch')
|
||||
.addKV('a', 'getSwitch')
|
||||
.addKV('gameid', 2006);
|
||||
.addKV("c", "ServerSwitch")
|
||||
.addKV("a", "getSwitch")
|
||||
.addKV("gameid", 2006);
|
||||
|
||||
httpclient.httpGet(
|
||||
tmpUrlBd.baseurl,
|
||||
function (res) {
|
||||
var obj = httpclient.JSON_parse(res);
|
||||
if (obj.examining == '1') {
|
||||
Config.isTest = false;
|
||||
if (obj.examining == "1") {
|
||||
Config.isTest = true;
|
||||
} else {
|
||||
Config.isTest = false;
|
||||
}
|
||||
@ -987,29 +987,29 @@ module.exports = {
|
||||
getVoipSign(group_id, successcb, failcb) {
|
||||
this.urlbd.clear();
|
||||
this.urlbd
|
||||
.addKV('c', 'Login')
|
||||
.addKV('a', 'getVoipSign')
|
||||
.addKV('gameid', this.gameid)
|
||||
.addKV('account_id', this.accountid)
|
||||
.addKV('session_id', this.sessionid)
|
||||
.addKV('group_id', group_id);
|
||||
.addKV("c", "Login")
|
||||
.addKV("a", "getVoipSign")
|
||||
.addKV("gameid", this.gameid)
|
||||
.addKV("account_id", this.accountid)
|
||||
.addKV("session_id", this.sessionid)
|
||||
.addKV("group_id", group_id);
|
||||
|
||||
httpclient.httpGet(
|
||||
this.urlbd.baseurl,
|
||||
function (restext) {
|
||||
var obj = httpclient.JSON_parse(restext);
|
||||
if (obj.errcode == 0) {
|
||||
console.log('[getVoipSign]success!' + JSON.stringify(obj));
|
||||
console.log("[getVoipSign]success!" + JSON.stringify(obj));
|
||||
successcb && successcb(obj);
|
||||
} else {
|
||||
console.log(
|
||||
'[getVoipSign]failed!' + obj.errcode + ':' + obj.errmsg
|
||||
"[getVoipSign]failed!" + obj.errcode + ":" + obj.errmsg
|
||||
);
|
||||
failcb && failcb(0, obj.errcode, obj.errmsg);
|
||||
}
|
||||
},
|
||||
function (errcode, errmsg) {
|
||||
console.log('[getVoipSign]failed!' + errcode + ':' + errmsg);
|
||||
console.log("[getVoipSign]failed!" + errcode + ":" + errmsg);
|
||||
failcb && failcb(errcode, 0, errmsg);
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user