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
78
79
80
81
82
83
| // --------------------------------------------------------------------
| // @author: xxx@syg.com(必填, 创建模块的人员)
| // @description:
| // 这里填写详细说明,主要填写该模块的功能简要
| // <br/>Create: 2019-08-09 15:54:22
| // --------------------------------------------------------------------
| var EliteSummonEvent = require("elitesummon_event")
| var ElitesummonController = cc.Class({
| extends: BaseController,
| ctor: function () {
| },
|
| // 初始化配置数据
| initConfig: function () {
| var ElitesummonModel = require("elitesummon_model");
|
| this.model = new ElitesummonModel();
| this.model.initConfig();
| },
|
| // 返回当前的model
| getModel: function () {
| return this.model;
| },
|
| // 注册监听事件
| registerEvents: function () {
|
| },
|
| // 注册协议接受事件
| registerProtocals: function () {
| // this.RegisterProtocal(1110, this.on1110);
| this.RegisterProtocal(23220, this.handle23220)
| this.RegisterProtocal(23221, this.handle23221)
| this.RegisterProtocal(23222, this.handle23222)
|
| // --预言召唤协议
| // this.RegisterProtocal(16690, this.handle16690)
| // this.RegisterProtocal(16691, this.handle16691)
| // this.RegisterProtocal(16692, this.handle16692)
| // this.RegisterProtocal(16693, this.handle16693)
| // this.RegisterProtocal(16694, this.handle16694)
| },
| send23220(){
| this.SendProtocal(23220)
| },
| send23222(){
| this.SendProtocal(23222)
| },
| send23221(times,recruit_type){
| let proto = {}
| proto.times = times
| proto.recruit_type = recruit_type
| this.SendProtocal(23221,proto)
| },
| handle23220(data){
| gcore.GlobalEvent.fire(EliteSummonEvent.EliteSummon_Message,data)
| },
| handle23221(data){
| message(data.msg)
| },
| handle23222(data){
| message(data.msg)
| },
| handle16690(data){
|
| },
| handle16691(data){
|
| },
| handle16692(data){
|
| },
| handle16693(data){
|
| },
| handle16694(data){
|
| },
| });
|
| module.exports = ElitesummonController;
|
|