/****************************************************************** * * STEP-UP 水晶召喚 * ******************************************************************/ const BridgeController = require( "bridge.controller" ); const CrystalModel = cc.Class( { extends: BridgeController, // 初始化配置数据 initConfig: function() { }, // 注册监听事件 registerEvents: function() { }, // 注册协议接受事件 registerProtocals: function() { this.RegisterProtocal( 23213, this.handle23213.bind( this ) ); this.RegisterProtocal( 23214, this.handle23214.bind( this ) ); this.RegisterProtocal( 23215, this.handle23215.bind( this ) ); }, // 从服务器初始化数据 reqBaseFromServer: function( _cb ) { // 配置加载 let cfgs = [ "recruit_high_data", ]; this.loadConfigs( cfgs, ( _ret, _data ) => { nx.dt.fnInvoke( _cb, true ); } ); }, // 水晶召喚 reqSummon: function( _groupId, _cb ) { this.SendProtocal( 23213, { group_id: _groupId, }, _cb ); }, // 水晶召喚返回 handle23213: function( _data ) { if( !this.isGoodData( _data ) ) { return; } }, // 当前置换状态 reqSwapRecord: function( _cb ) { this.SendProtocal( 23214, {}, _cb ); }, // 当前置换状态返回 handle23214: function( _data ) { if( !this.isGoodData( _data ) ) { return; } }, // 申请置换 reqSwap: function( _partnerId, _cb ) { this.SendProtocal( 23215, { partner_id: _partnerId, action: 1, // 0:取消保存;1:置换;2:确认置换 }, _cb ); }, // 取消置换 reqSwapCancel: function( _partnerId, _cb ) { this.SendProtocal( 23215, { partner_id: _partnerId, action: 0, // 0:取消保存;1:置换;2:确认置换 }, _cb ); }, // 确认置换 reqSwapSave: function( _partnerId, _cb ) { this.SendProtocal( 23215, { partner_id: _partnerId, action: 2, // 0:取消保存;1:置换;2:确认置换 }, _cb ); }, // 申请置换返回 handle23215: function( _data ) { if( !this.isGoodData( _data ) ) { return; } }, }); module.exports = CrystalModel;