749 lines
18 KiB
JavaScript
749 lines
18 KiB
JavaScript
// Learn cc.Class:
|
|
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
|
|
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
|
|
// Learn Attribute:
|
|
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
|
|
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
|
|
// Learn life-cycle callbacks:
|
|
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
|
|
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
|
|
var httpclient = require('httpclient');
|
|
var urlbuilder = require('urlbuilder');
|
|
const BaseNet = require('../BaseNet');
|
|
|
|
module.exports = {
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {},
|
|
init(account_id, session_id, name, avatar_url) {
|
|
this.account_id = account_id;
|
|
|
|
this.session_id = session_id;
|
|
this.name = name;
|
|
this.avatar_url = avatar_url;
|
|
this.urlbd = new urlbuilder(BaseNet.getNormalApiUrl('gameapi'));
|
|
},
|
|
|
|
getResponce(cb, urlbd, cb2) {
|
|
var self = this;
|
|
|
|
httpclient.httpGet(
|
|
urlbd.baseurl,
|
|
function (restext) {
|
|
var obj;
|
|
try {
|
|
obj = httpclient.JSON_parse(restext);
|
|
} catch (e) {
|
|
cc.uiHelper.showTips('Request failed');
|
|
}
|
|
var obj = httpclient.JSON_parse(restext);
|
|
if (obj.property_chg) {
|
|
cc.playerData.property(obj.property_chg);
|
|
}
|
|
if (obj.award) {
|
|
cc.Notifier.emit('getreward', obj.award);
|
|
}
|
|
|
|
if (obj.errmsg) {
|
|
cc.uiHelper.showTips(obj.errmsg);
|
|
}
|
|
if (obj.errcode == 0) {
|
|
if (cb) {
|
|
cb(obj);
|
|
}
|
|
if (cb2) {
|
|
cb2(obj);
|
|
}
|
|
}
|
|
|
|
if (obj.errcode == 1001) {
|
|
cc.Notifier.emit('multipointlogin');
|
|
}
|
|
},
|
|
function (errcode, errmsg) {
|
|
setTimeout(() => {
|
|
self.getResponce(cb, urlbd, cb2);
|
|
}, 1000);
|
|
}
|
|
);
|
|
},
|
|
|
|
clientBattleReport(
|
|
rank_score,
|
|
gold,
|
|
kills,
|
|
damage_amount,
|
|
time_alive,
|
|
rank,
|
|
team_status
|
|
) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Role')
|
|
.addKV('a', 'clientBattleReport')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('rank_score', rank_score)
|
|
.addKV('coin_num', gold)
|
|
.addKV('kills', kills)
|
|
.addKV('harm', damage_amount)
|
|
.addKV('alive_time', time_alive)
|
|
.addKV('rank', rank)
|
|
.addKV('team_status', team_status);
|
|
this.getResponce(
|
|
cc.playerData.clientBattleReport.bind(cc.playerData),
|
|
this.urlbd
|
|
);
|
|
},
|
|
|
|
getTime(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Hang')
|
|
.addKV('a', 'getTime')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(
|
|
cc.playerData.getTime.bind(cc.playerData),
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
|
|
createTeam(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Team')
|
|
.addKV('a', 'createTeam')
|
|
.addKV('node_id', cc.playerData.node_id)
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
getTeamInfo(team_uuid, cb) {
|
|
var teamid = '';
|
|
if (typeof team_uuid == 'string') {
|
|
teamid = team_uuid;
|
|
} else {
|
|
teamid = team_uuid.team_uuid;
|
|
}
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Team')
|
|
.addKV('a', 'teamInfo')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('team_uuid', teamid);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
joinTeam(team_uuid, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Team')
|
|
.addKV('a', 'joinTeam')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('team_uuid', team_uuid);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
leaveTeam(team_uuid, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Team')
|
|
.addKV('a', 'leaveTeam')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('team_uuid', team_uuid);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
teamStartGame(team_uuid) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Team')
|
|
.addKV('a', 'startGame')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('team_uuid', team_uuid);
|
|
this.getResponce(null, this.urlbd);
|
|
},
|
|
|
|
saveNewbie(newbieid) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Role')
|
|
.addKV('a', 'saveNewbie')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('id', newbieid);
|
|
this.getResponce(
|
|
cc.playerData.saveNewbie.bind(cc.playerData),
|
|
this.urlbd
|
|
);
|
|
},
|
|
|
|
getNodeID(cb) {
|
|
var urlbd = new urlbuilder(BaseNet.getNodeUrl());
|
|
urlbd.clear();
|
|
urlbd.addKV('c', 'Ops').addKV('a', 'getNodeId');
|
|
this.getResponce(
|
|
cc.playerData.getNodeID.bind(cc.playerData),
|
|
urlbd,
|
|
cb
|
|
);
|
|
},
|
|
|
|
dirtyWordCheck(text) {
|
|
var urlbd;
|
|
urlbd = new urlbuilder(BaseNet.getNormalApiUrl('service'));
|
|
urlbd.clear();
|
|
urlbd
|
|
.addKV('c', 'TextService')
|
|
.addKV('a', 'dirtyWordCheck')
|
|
.addKV('text', text);
|
|
this.getResponce(
|
|
cc.playerData.dirtyWordCheck.bind(cc.playerData),
|
|
urlbd
|
|
);
|
|
},
|
|
|
|
/////new
|
|
|
|
logingame(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'User')
|
|
.addKV('a', 'login')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
getDiscountList() {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Shop')
|
|
.addKV('a', 'buyGoods')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(
|
|
cc.playerData.getDiscountList.bind(cc.playerData),
|
|
this.urlbd
|
|
);
|
|
},
|
|
getHeroList(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Hero')
|
|
.addKV('a', 'heroList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(
|
|
cc.playerData.getHeroList.bind(cc.playerData),
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
getSkinList(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Hero')
|
|
.addKV('a', 'skinList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(
|
|
cc.playerData.getSkinList.bind(cc.playerData),
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
getItemList(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Bag')
|
|
.addKV('a', 'itemList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(
|
|
cc.playerData.getItemList.bind(cc.playerData),
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
|
|
getShopGoodsInfo(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Shop')
|
|
.addKV('a', 'info')
|
|
.addKV('shop_id', 1)
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(
|
|
(res) => {
|
|
cc.Notifier.emit('shopItem', res);
|
|
},
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
|
|
buyGood(shop_id, goods_id, goods_num, cost_item_id, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Shop')
|
|
.addKV('a', 'buyGoods')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('shop_id', shop_id)
|
|
.addKV('goods_id', goods_id)
|
|
.addKV('goods_num', goods_num)
|
|
.addKV('cost_item_id', cost_item_id);
|
|
this.getResponce(
|
|
() => {
|
|
cc.uiHelper.showTips('successful purchase');
|
|
},
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
|
|
gettalentList(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Gun')
|
|
.addKV('a', 'talentList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(
|
|
cc.playerData.gettalentList.bind(cc.playerData),
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
|
|
upgradeTalentLv(talent_id) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Gun')
|
|
.addKV('a', 'upgradeTalentLv')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('talent_id', talent_id);
|
|
this.getResponce(() => {
|
|
cc.uiHelper.showTips('update successed');
|
|
this.gettalentList(() => {
|
|
cc.Notifier.emit('talent_lvup', talent_id);
|
|
});
|
|
}, this.urlbd);
|
|
},
|
|
|
|
useitem(item_id, item_num, param1, param2, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Bag')
|
|
.addKV('a', 'useItem')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('item_id', item_id)
|
|
.addKV('item_num', item_num);
|
|
if (param1) {
|
|
this.urlbd.addKV('param1', param1);
|
|
}
|
|
if (param2) {
|
|
this.urlbd.addKV('param2', param2);
|
|
}
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
getSeasonInfo(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Season')
|
|
.addKV('a', 'info')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(
|
|
cc.playerData.getSeasonInfo.bind(cc.playerData),
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
getSeasonReward(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Season')
|
|
.addKV('a', 'getMissionReward')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
checkName(v, cb) {
|
|
var url = BaseNet.getNormalApiUrl('service');
|
|
var urlbd = new urlbuilder(url);
|
|
urlbd
|
|
.addKV('c', 'TextService')
|
|
.addKV('a', 'isValidName')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('name', v);
|
|
|
|
this.getResponce(cb, urlbd);
|
|
},
|
|
|
|
getRankList(type, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Ranking')
|
|
.addKV('a', 'rankingList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('type', type);
|
|
|
|
this.getResponce(
|
|
cc.playerData.getRankList.bind(cc.playerData),
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
|
|
getactivityRankingList(type, cb) {
|
|
console.log('GET RANK DATA');
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Ranking')
|
|
.addKV('a', 'activityRankingList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('type', type);
|
|
this.getResponce(
|
|
(res) => {
|
|
// cc.Notifier.emit('missionList', res);
|
|
},
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
|
|
getUeserInfo(target_id, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'User')
|
|
.addKV('a', 'detailInfo')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('target_id', target_id);
|
|
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
getUserMainInfo(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'User')
|
|
.addKV('a', 'Info')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('target_id', this.account_id);
|
|
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
missionList(type, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Mission')
|
|
.addKV('a', 'missionList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('type', type);
|
|
|
|
this.getResponce(
|
|
(res) => {
|
|
cc.Notifier.emit('missionList', res);
|
|
},
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
commitMission(mission_id, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Mission')
|
|
.addKV('a', 'commitMission')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('mission_id', mission_id);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
gunList(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Gun')
|
|
.addKV('a', 'gunList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
|
|
this.getResponce(
|
|
(res) => {
|
|
cc.Notifier.emit('gunList', res);
|
|
},
|
|
this.urlbd,
|
|
cb
|
|
);
|
|
},
|
|
|
|
getSeasonAllReward() {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'SeasonCard')
|
|
.addKV('a', 'getAllReward')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(() => {
|
|
this.seasonCard((res) => {
|
|
cc.Notifier.emit('onSeasonCardInfo', res);
|
|
});
|
|
}, this.urlbd);
|
|
},
|
|
seasonCard(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'SeasonCard')
|
|
.addKV('a', 'info')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
seasonCardReward(type, level, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'SeasonCard')
|
|
.addKV('a', 'getReward')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('type', type)
|
|
.addKV('level', level);
|
|
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
buyseadonlevel(add_level) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'SeasonCard')
|
|
.addKV('a', 'buyLevel')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('add_level', add_level);
|
|
this.getResponce(() => {
|
|
this.seasonCard((res) => {
|
|
cc.Notifier.emit('onSeasonCardInfo', res);
|
|
});
|
|
}, this.urlbd);
|
|
},
|
|
|
|
updateuseinfo(v) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'User')
|
|
.addKV('a', 'update')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
|
|
if (v.head_id) {
|
|
this.urlbd.addKV('head_id', v.head_id);
|
|
}
|
|
if (v.head_frame) {
|
|
this.urlbd.addKV('head_frame', v.head_frame);
|
|
}
|
|
if (v.hero_id) {
|
|
this.urlbd.addKV('hero_id', v.hero_id);
|
|
}
|
|
if (v.first_fight) {
|
|
this.urlbd.addKV('first_fight', v.first_fight);
|
|
}
|
|
|
|
this.getResponce(null, this.urlbd);
|
|
},
|
|
|
|
buybook(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'SeasonCard')
|
|
.addKV('a', 'buyGiftPackage')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('package_id', 2)
|
|
.addKV('cost_item_id', 10002);
|
|
this.getResponce(() => {
|
|
this.seasonCard((res) => {
|
|
cc.Notifier.emit('onSeasonCardInfo', res);
|
|
cb();
|
|
});
|
|
}, this.urlbd);
|
|
},
|
|
sendWantedMission(mission, object, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Mission')
|
|
.addKV('a', 'sendOfferRewardMission')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('mission_id', mission)
|
|
.addKV('objects', object);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
boostOfferRewardMission(mission, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Mission')
|
|
.addKV('a', 'boostOfferRewardMission')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('mission_id', mission);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
cancelOfferRewardMission(mission, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Mission')
|
|
.addKV('a', 'cancelOfferRewardMission')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('mission_id', mission);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
offerRewardMissionPreview(mission, objects, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Mission')
|
|
.addKV('a', 'offerRewardMissionPreview')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('mission_id', mission)
|
|
.addKV('objects', objects);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
searchUserByAccountid(account, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'User')
|
|
.addKV('a', 'info')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('target_id', account);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
searchUserByName(name, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'User')
|
|
.addKV('a', 'query')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('name', name);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
getRankOpenList(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Ranking')
|
|
.addKV('a', 'getOpenList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
getOptionSwitch(cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'ServerSwitch')
|
|
.addKV('a', 'getSwitch')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
heroUpgradeLevel(hero_uuid, slot, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Hero')
|
|
.addKV('a', 'upgradeLevel')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('hero_uniid', hero_uuid)
|
|
.addKV('slot_id', slot)
|
|
.addKV('cost_item_id', 10001);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
heroUpgradeQuality(hero_uuid, sec_hero_uuid, slot, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Hero')
|
|
.addKV('a', 'upgradeQuality')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('hero_uniid', hero_uuid)
|
|
.addKV('cost_hero_uniid', sec_hero_uuid)
|
|
.addKV('slot_id', slot)
|
|
.addKV('cost_item_id', 10001);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
getUpgradeLevelList(cb) {
|
|
this.urlbd
|
|
.addKV('c', 'Hero')
|
|
.addKV('a', 'getUpgradeLevelList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
getUpgradeQualityList(cb) {
|
|
this.urlbd
|
|
.addKV('c', 'Hero')
|
|
.addKV('a', 'getUpgradeQualityList')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
reciveUpReward(type, hero_uuid, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Hero')
|
|
.addKV('a', 'receive')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('type', type) // 1 level 2 quality
|
|
.addKV('hero_uniid', hero_uuid);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
|
|
upgradeQualityPreview(hero_uuid, cost_hero_uuid, cb) {
|
|
this.urlbd.clear();
|
|
this.urlbd
|
|
.addKV('c', 'Hero')
|
|
.addKV('a', 'upgradeQualityPreview')
|
|
.addKV('account_id', this.account_id)
|
|
.addKV('session_id', this.session_id)
|
|
.addKV('hero_uniid', hero_uuid)
|
|
.addKV('cost_hero_uniid', cost_hero_uuid);
|
|
this.getResponce(cb, this.urlbd);
|
|
},
|
|
};
|