difenduandada
2024-12-31 34abe6963b344c882358274957f4b992456fee40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//      这里填写详细说明,主要填写该模块的功能简要
// <br/>Create: 2019-04-30 16:21:08
// --------------------------------------------------------------------
var HeroController = require("hero_controller")
var LookController = cc.Class({
    extends: BaseController,
    ctor: function () {
    },
 
    // 初始化配置数据
    initConfig: function () {
        var LookModel = require("look_model");
 
        this.model = new LookModel();
        this.model.initConfig();
    },
 
    // 返回当前的model
    getModel: function () {
        return this.model;
    },
 
    // 注册监听事件
    registerEvents: function () {
        
    },
 
    // 注册协议接受事件
    registerProtocals: function () {
        // this.RegisterProtocal(1110, this.on1110);
        this.RegisterProtocal(11061, this.handle11061)     //--查看对方英雄信息
        this.RegisterProtocal(11062, this.handle11062)     //--查看对方分享英雄信息
    },
    sender11061(r_rid,r_srvid,partner_id){
        let protocal ={}
        protocal.r_rid = r_rid
        protocal.r_srvid = r_srvid
        protocal.partner_id = partner_id
        this.SendProtocal(11061,protocal)
    },
    handle11061( data ){
        message(data.msg)
        if(data.bid != 0){
            let config = Config.partner_data.data_partner_base[data.bid]
            let camp_type = 1
            if(config){
                camp_type = config.camp_type
            }
            data.camp_type = camp_type
            HeroController.getInstance().openHeroTipsPanel(true, data)
        }
    },
    // --查看对方分享英雄信息
    sender11062(id, srv_id){
        let protocal ={}
        protocal.id = id
        protocal.srv_id = srv_id
        this.SendProtocal(11062,protocal)
    },
    handle11062( data ){
        message(data.msg)
        if(data.bid != 0){
            let config = Config.partner_data.data_partner_base[data.bid]
            let camp_type = 1
            if(config){
                camp_type = config.camp_type
            }
            data.camp_type = camp_type
            HeroController.getInstance().openHeroTipsPanel(true, data)
        }
    },
});
 
module.exports = LookController;