update
This commit is contained in:
parent
a941f317bc
commit
2cebeacf6c
@ -1,4 +1,4 @@
|
||||
import { isTest, mainConfig } from "./Config";
|
||||
import { isTest, mainConfig } from './Config';
|
||||
|
||||
export var allBaseNet = {
|
||||
usa: '-z1-test.cebg.games',
|
||||
@ -7,22 +7,18 @@ export var allBaseNet = {
|
||||
turkey: '-z4-test.cebg.games',
|
||||
};
|
||||
|
||||
|
||||
isDevEnv()
|
||||
isExamining()
|
||||
isDevEnv();
|
||||
isExamining();
|
||||
|
||||
function isDevEnv() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function isExamining() {
|
||||
|
||||
if(!isDevEnv() && isTest && mainConfig.packageid!=0 ){
|
||||
|
||||
return true
|
||||
}else{
|
||||
|
||||
return false
|
||||
if (!isDevEnv() && isTest && mainConfig.packageid != 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,7 +85,7 @@ function getCommonParam() {
|
||||
'&_version=' +
|
||||
encodeURIComponent(mainConfig.version) +
|
||||
'&_hotfixversion=' +
|
||||
encodeURIComponent(mainConfig.hotfixVersion)+
|
||||
encodeURIComponent(mainConfig.hotfixVersion) +
|
||||
'&_packageid=' +
|
||||
encodeURIComponent(mainConfig.packageid)
|
||||
);
|
||||
@ -114,11 +110,7 @@ export function getExaminingUrl() {
|
||||
}
|
||||
|
||||
export function getRelationUrl() {
|
||||
return (
|
||||
functionNet['relation'] +
|
||||
getUrlSuffix() +
|
||||
'/friend/websocket'
|
||||
);
|
||||
return functionNet['relation'] + getUrlSuffix() + '/friend/websocket';
|
||||
}
|
||||
|
||||
export function getNodeUrl() {
|
||||
|
@ -1,11 +1,11 @@
|
||||
var battlenet = require("battlenetmanage");
|
||||
var SDKManage = require("SDKManage");
|
||||
var gameConfig = require("gameConfig");
|
||||
var Utils = require("Utils");
|
||||
const NetManage = require("../../manages/NetManage");
|
||||
const { showLoading } = require("../../gif/Loading");
|
||||
const { OperationType } = require("../../Operation/Operation");
|
||||
const jcgamelog = require("../../jcfw/service/jcgamelog");
|
||||
var battlenet = require('battlenetmanage');
|
||||
var SDKManage = require('SDKManage');
|
||||
var gameConfig = require('gameConfig');
|
||||
var Utils = require('Utils');
|
||||
const NetManage = require('../../manages/NetManage');
|
||||
const { showLoading } = require('../../gif/Loading');
|
||||
const { OperationType } = require('../../Operation/Operation');
|
||||
const jcgamelog = require('../../jcfw/service/jcgamelog');
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
|
||||
@ -78,18 +78,22 @@ cc.Class({
|
||||
// LIFE-CYCLE CALLBACKS:
|
||||
|
||||
onLoad() {
|
||||
this.weaponStr = "[]";
|
||||
this.weaponStr = '[]';
|
||||
this.weapon_uniid = new Array();
|
||||
|
||||
cc.Notifier.on("battleclickchose", this, this.battleclickchose.bind(this));
|
||||
cc.Notifier.on(
|
||||
"SMUpdateMatchInfo",
|
||||
'battleclickchose',
|
||||
this,
|
||||
this.battleclickchose.bind(this)
|
||||
);
|
||||
cc.Notifier.on(
|
||||
'SMUpdateMatchInfo',
|
||||
this,
|
||||
this.SMUpdateMatchInfo.bind(this)
|
||||
);
|
||||
cc.Notifier.on("infochangeskin", this, this.infochangeskin.bind(this));
|
||||
cc.Notifier.on('infochangeskin', this, this.infochangeskin.bind(this));
|
||||
// choose weapon
|
||||
cc.Notifier.on("haschooseWeapon", this, (index, name) => {
|
||||
cc.Notifier.on('haschooseWeapon', this, (index, name) => {
|
||||
if (index) {
|
||||
console.log(`index-------${window.currentWeaponName}`);
|
||||
if (index == 0) {
|
||||
@ -98,7 +102,9 @@ cc.Class({
|
||||
cc.SpriteFrame,
|
||||
(err, res) => {
|
||||
if (this.nd_weaponNode1)
|
||||
this.nd_weaponNode1.getComponent(cc.Sprite).spriteFrame = res;
|
||||
this.nd_weaponNode1.getComponent(
|
||||
cc.Sprite
|
||||
).spriteFrame = res;
|
||||
}
|
||||
);
|
||||
} else if (index == 1) {
|
||||
@ -107,7 +113,9 @@ cc.Class({
|
||||
cc.SpriteFrame,
|
||||
(err, res) => {
|
||||
if (this.nd_weaponNode2)
|
||||
this.nd_weaponNode2.getComponent(cc.Sprite).spriteFrame = res;
|
||||
this.nd_weaponNode2.getComponent(
|
||||
cc.Sprite
|
||||
).spriteFrame = res;
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -127,9 +135,9 @@ cc.Class({
|
||||
});
|
||||
},
|
||||
onDestroy() {
|
||||
cc.Notifier.off("battleclickchose", this);
|
||||
cc.Notifier.off("SMUpdateMatchInfo", this);
|
||||
cc.Notifier.off("infochangeskin", this);
|
||||
cc.Notifier.off('battleclickchose', this);
|
||||
cc.Notifier.off('SMUpdateMatchInfo', this);
|
||||
cc.Notifier.off('infochangeskin', this);
|
||||
},
|
||||
SMUpdateMatchInfo(_data) {
|
||||
var data = _data.info;
|
||||
@ -137,7 +145,8 @@ cc.Class({
|
||||
for (var i = 0; i < data.members.length; i++) {
|
||||
var onedata = data.members[i];
|
||||
if (onedata.hero_skin > 0) {
|
||||
onedata.hero_id = gameConfig.all_ItemConfig[onedata.hero_skin].playerid;
|
||||
onedata.hero_id =
|
||||
gameConfig.all_ItemConfig[onedata.hero_skin].playerid;
|
||||
onedata.hero_skin = onedata.hero_skin;
|
||||
}
|
||||
}
|
||||
@ -158,17 +167,23 @@ cc.Class({
|
||||
return;
|
||||
}
|
||||
|
||||
var heroDetail = this.getHeroDetailByID(v.hero_id)
|
||||
var process = (heroDetail.ceg_uplimit - heroDetail.today_get_gold) / heroDetail.ceg_uplimit;
|
||||
var heroDetail = this.getHeroDetailByID(v.hero_id);
|
||||
var process =
|
||||
(heroDetail.ceg_uplimit - heroDetail.today_get_gold) /
|
||||
heroDetail.ceg_uplimit;
|
||||
|
||||
this.node.getComponentInChildren("pbbattleui").nd_processbar.progress = process;
|
||||
this.node.getComponentInChildren("pbbattleui").nd_remainceg.string = heroDetail.ceg_uplimit - heroDetail.today_get_gold;
|
||||
this.node.getComponentInChildren('pbbattleui').nd_processbar.progress =
|
||||
process;
|
||||
this.node.getComponentInChildren('pbbattleui').nd_remainceg.string =
|
||||
heroDetail.ceg_uplimit - heroDetail.today_get_gold;
|
||||
|
||||
for (var i = 0; i < this.herodatalist.length; i++) {
|
||||
if (this.herodatalist[i].account_id == v.account_id) {
|
||||
this.herodatalist[i].hero_id = v.hero_id;
|
||||
this.herodatalist[i].hero_skin = v.hero_skin;
|
||||
this.herodatalist[i].hero_uuid = this.getHeroUUidByid(v.hero_id);
|
||||
this.herodatalist[i].hero_uuid = this.getHeroUUidByid(
|
||||
v.hero_id
|
||||
);
|
||||
if (SDKManage.account_id == v.account_id) {
|
||||
cc.playerData.changeHero(v.hero_id);
|
||||
this.hero_id = v.hero_id;
|
||||
@ -179,15 +194,16 @@ cc.Class({
|
||||
hero_id: v.hero_id,
|
||||
weapons: JSON.parse(this.weaponStr),
|
||||
skins: [],
|
||||
baseskin: gameConfig.all_ItemConfig[v.hero_skin].skinid,
|
||||
baseskin:
|
||||
gameConfig.all_ItemConfig[v.hero_skin].skinid,
|
||||
hero_skin: v.hero_skin,
|
||||
skill_list: cc.playerData.getbattleskilllist(),
|
||||
hero_uniid:this.herodatalist[i].hero_uuid,
|
||||
hero_uniid: this.herodatalist[i].hero_uuid,
|
||||
};
|
||||
|
||||
this.matchdata = data;
|
||||
|
||||
cc.battleIns.sendbattlemsg("CMMatchChoose", data);
|
||||
cc.battleIns.sendbattlemsg('CMMatchChoose', data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,7 +246,7 @@ cc.Class({
|
||||
for (var i = 0; i < pcount; i++) {
|
||||
var nd = cc.instantiate(this.pb_herolihui);
|
||||
addnode.addChild(nd);
|
||||
var scp = nd.getComponent("pbbattleui");
|
||||
var scp = nd.getComponent('pbbattleui');
|
||||
scp.target = this;
|
||||
this.herolist.push(scp);
|
||||
}
|
||||
@ -241,7 +257,7 @@ cc.Class({
|
||||
|
||||
changetype(data1, data2) {
|
||||
this.changelist(Number(data2));
|
||||
cc.Notifier.emit("btnchose", { k: data2 });
|
||||
cc.Notifier.emit('btnchose', { k: data2 });
|
||||
},
|
||||
|
||||
changelist(type) {
|
||||
@ -251,23 +267,19 @@ cc.Class({
|
||||
var herolist = [];
|
||||
this.allHeroUUID = [];
|
||||
this.allHeroID = [];
|
||||
this.heroDetails=[]
|
||||
this.heroDetails = [];
|
||||
|
||||
NetManage.getHeroList((data) => {
|
||||
herolist = data.hero_list;
|
||||
for (var i = 0; i < herolist.length; i++) {
|
||||
var element = herolist[i];
|
||||
if(element.lock_type!=3){
|
||||
if (element.lock_type != 3) {
|
||||
this.allHeroUUID.push(element.hero_uniid);
|
||||
this.allHeroID.push(element.hero_id)
|
||||
this.heroDetails.push(herolist[i])
|
||||
this.allHeroID.push(parseInt(element.hero_id));
|
||||
this.heroDetails.push(herolist[i]);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(this.allHeroID)
|
||||
|
||||
|
||||
|
||||
for (var i = 0; i < this.allHeroID.length; i++) {
|
||||
var hid = this.allHeroID[i];
|
||||
var heroType = gameConfig.playerConfig[hid].herotype;
|
||||
@ -281,16 +293,13 @@ cc.Class({
|
||||
var newlist = Utils.arrtoarr(cherolist, 2);
|
||||
// this.allHeroID = cherolist;
|
||||
this.tableView_chose
|
||||
.getComponent("tableView")
|
||||
.getComponent('tableView')
|
||||
.initTableView(newlist.length, {
|
||||
array: newlist,
|
||||
target: this,
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// for (var i = 0; i < openherolist.length; i++) {
|
||||
// var hid = openherolist[i];
|
||||
// var heroType = gameConfig.playerConfig[hid].herotype;
|
||||
@ -316,7 +325,7 @@ cc.Class({
|
||||
return this.allHeroUUID[index];
|
||||
},
|
||||
|
||||
getHeroDetailByID(id){
|
||||
getHeroDetailByID(id) {
|
||||
var index = this.allHeroID.indexOf(id);
|
||||
return this.heroDetails[index];
|
||||
},
|
||||
@ -328,12 +337,9 @@ cc.Class({
|
||||
},
|
||||
onclickgo() {
|
||||
//single
|
||||
jcgamelog.addOperation(
|
||||
OperationType.BUTTON,
|
||||
'startgame',
|
||||
);
|
||||
jcgamelog.addOperation(OperationType.BUTTON, 'startgame');
|
||||
if (!this.canzb) {
|
||||
cc.uiHelper.showTips("Please choose a hero first");
|
||||
cc.uiHelper.showTips('Please choose a hero first');
|
||||
return;
|
||||
}
|
||||
// showLoading();
|
||||
@ -362,25 +368,22 @@ cc.Class({
|
||||
},
|
||||
onclicktype() {},
|
||||
onclickcancelready() {
|
||||
cc.battleIns.sendbattlemsg("CMMatchCancelStartGame");
|
||||
cc.battleIns.sendbattlemsg('CMMatchCancelStartGame');
|
||||
},
|
||||
onclickready() {
|
||||
jcgamelog.addOperation(
|
||||
OperationType.BUTTON,
|
||||
'startgame',
|
||||
);
|
||||
jcgamelog.addOperation(OperationType.BUTTON, 'startgame');
|
||||
// team
|
||||
if (!this.canzb) {
|
||||
cc.uiHelper.showTips("Please choose a hero first");
|
||||
cc.uiHelper.showTips('Please choose a hero first');
|
||||
return;
|
||||
}
|
||||
//
|
||||
if (this.matchdata) {
|
||||
this.matchdata.weapons = JSON.parse(this.weaponStr);
|
||||
cc.battleIns.sendbattlemsg("CMMatchChoose", this.matchdata);
|
||||
cc.battleIns.sendbattlemsg('CMMatchChoose', this.matchdata);
|
||||
}
|
||||
//
|
||||
cc.battleIns.sendbattlemsg("CMMatchStartGame");
|
||||
cc.battleIns.sendbattlemsg('CMMatchStartGame');
|
||||
},
|
||||
doready(state) {
|
||||
if (this.team_mode) {
|
||||
@ -390,7 +393,7 @@ cc.Class({
|
||||
}
|
||||
},
|
||||
infochangeskin(v) {
|
||||
cc.Notifier.emit("battleclickchose", {
|
||||
cc.Notifier.emit('battleclickchose', {
|
||||
account_id: SDKManage.account_id,
|
||||
hero_id: this.hero_id,
|
||||
hero_skin: v,
|
||||
@ -404,6 +407,6 @@ cc.Class({
|
||||
var node = cc.instantiate(this.pb_chooseWeapon);
|
||||
node.scale = 0.8;
|
||||
this.node.addChild(node);
|
||||
node.getComponent("chooseGun").startFrom(data);
|
||||
node.getComponent('chooseGun').startFrom(data);
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user