74 lines
2.4 KiB
JavaScript
74 lines
2.4 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '194c8GmGllFW47okY5PMj37', 'look_controller');
|
||
|
|
// Scripts/mod/friend/look_controller.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
// --------------------------------------------------------------------
|
||
|
|
// @author: xxx@syg.com(必填, 创建模块的人员)
|
||
|
|
// @description:
|
||
|
|
// 这里填写详细说明,主要填写该模块的功能简要
|
||
|
|
// <br/>Create: 2019-04-30 16:21:08
|
||
|
|
// --------------------------------------------------------------------
|
||
|
|
var BridgeController = require("bridge.controller");
|
||
|
|
var HeroController = require("hero_controller");
|
||
|
|
var TipsController = require("tips_controller");
|
||
|
|
var LookController = cc.Class({
|
||
|
|
"extends": BridgeController,
|
||
|
|
ctor: function ctor() {},
|
||
|
|
// 初始化配置数据
|
||
|
|
initConfig: function initConfig() {},
|
||
|
|
// 注册监听事件
|
||
|
|
registerEvents: function registerEvents() {},
|
||
|
|
// 注册协议接受事件
|
||
|
|
registerProtocals: function registerProtocals() {
|
||
|
|
// this.RegisterProtocal(1110, this.on1110);
|
||
|
|
this.RegisterProtocal(11061, this.handle11061); //--查看对方英雄信息
|
||
|
|
this.RegisterProtocal(11062, this.handle11062); //--查看对方分享英雄信息
|
||
|
|
},
|
||
|
|
sender11061: function sender11061(r_rid, r_srvid, partner_id) {
|
||
|
|
var protocal = {};
|
||
|
|
protocal.r_rid = r_rid;
|
||
|
|
protocal.r_srvid = r_srvid;
|
||
|
|
protocal.partner_id = partner_id;
|
||
|
|
this.SendProtocal(11061, protocal);
|
||
|
|
},
|
||
|
|
handle11061: function handle11061(data) {
|
||
|
|
if (data.msg != "") {
|
||
|
|
nx.tbox(data.msg);
|
||
|
|
}
|
||
|
|
if (data.bid != 0) {
|
||
|
|
var config = game.configs.partner_data.data_partner_base[data.bid];
|
||
|
|
var camp_type = 1;
|
||
|
|
if (config) {
|
||
|
|
camp_type = config.camp_type;
|
||
|
|
}
|
||
|
|
data.camp_type = camp_type;
|
||
|
|
TipsController.getInstance().showPartnerTips(data);
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// --查看对方分享英雄信息
|
||
|
|
sender11062: function sender11062(id, srv_id) {
|
||
|
|
var protocal = {};
|
||
|
|
protocal.id = id;
|
||
|
|
protocal.srv_id = srv_id;
|
||
|
|
this.SendProtocal(11062, protocal);
|
||
|
|
},
|
||
|
|
handle11062: function handle11062(data) {
|
||
|
|
nx.tbox(data.msg);
|
||
|
|
if (data.bid != 0) {
|
||
|
|
var config = game.configs.partner_data.data_partner_base[data.bid];
|
||
|
|
var camp_type = 1;
|
||
|
|
if (config) {
|
||
|
|
camp_type = config.camp_type;
|
||
|
|
}
|
||
|
|
data.camp_type = camp_type;
|
||
|
|
TipsController.getInstance().showPartnerTips(data);
|
||
|
|
// HeroController.getInstance().openHeroTipsPanel(true, data)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
module.exports = LookController;
|
||
|
|
|
||
|
|
cc._RF.pop();
|