正在显示
13 个修改的文件
包含
140 行增加
和
113 行删除
此 diff 太大无法显示。
| @@ -26,7 +26,7 @@ import ArrayBufferUtil from 'libs/ArrayBufferUtil'; | @@ -26,7 +26,7 @@ import ArrayBufferUtil from 'libs/ArrayBufferUtil'; | ||
| 26 | import UTF8 from 'utf-8'; | 26 | import UTF8 from 'utf-8'; |
| 27 | 27 | ||
| 28 | let loger = Loger.getLoger('MessageEntrance'); | 28 | let loger = Loger.getLoger('MessageEntrance'); |
| 29 | -let _sdkInfo = {"version": "v.1.8.1.20170327-5", "author": "www.3mang.com"}; | 29 | +let _sdkInfo = {"version": "v.1.8.3.20170329-4", "author": "www.3mang.com"}; |
| 30 | 30 | ||
| 31 | //APE | 31 | //APE |
| 32 | let _sass; | 32 | let _sass; |
| @@ -165,6 +165,7 @@ export default class MessageEntrance extends Emiter { | @@ -165,6 +165,7 @@ export default class MessageEntrance extends Emiter { | ||
| 165 | this.sendDocumentSwitchDoc = this._sendDocumentSwitchDoc.bind(this); //切换文档 | 165 | this.sendDocumentSwitchDoc = this._sendDocumentSwitchDoc.bind(this); //切换文档 |
| 166 | this.sendDocumentSwitchPage = this._sendDocumentSwitchPage.bind(this);//翻页 | 166 | this.sendDocumentSwitchPage = this._sendDocumentSwitchPage.bind(this);//翻页 |
| 167 | this.sendDocumentDelete = this._sassDeleteDocument.bind(this); | 167 | this.sendDocumentDelete = this._sassDeleteDocument.bind(this); |
| 168 | + this.sendDocBroadcastMsg=this._sendDocBroadcastMsg.bind(this); | ||
| 168 | //删除文档,先通过Sass删除,sass删除成功之后再同步mcu | 169 | //删除文档,先通过Sass删除,sass删除成功之后再同步mcu |
| 169 | //this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档 | 170 | //this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档 |
| 170 | this.sendDocumentCommand = this._sendDocumentCommand.bind(this); | 171 | this.sendDocumentCommand = this._sendDocumentCommand.bind(this); |
| @@ -173,8 +174,12 @@ export default class MessageEntrance extends Emiter { | @@ -173,8 +174,12 @@ export default class MessageEntrance extends Emiter { | ||
| 173 | //获取文档图片的完整路径 | 174 | //获取文档图片的完整路径 |
| 174 | this.getDocPDFFullPath = this._getDocPDFFullPath.bind(this);//获取文档的完整路径 | 175 | this.getDocPDFFullPath = this._getDocPDFFullPath.bind(this);//获取文档的完整路径 |
| 175 | 176 | ||
| 177 | + this.setDebuger = this._setDebuger.bind(this);//debug | ||
| 176 | } | 178 | } |
| 177 | 179 | ||
| 180 | + _setDebuger(_data){ | ||
| 181 | + GlobalConfig.isDebuger=_data.isDebuger||true; | ||
| 182 | + } | ||
| 178 | //mcu异常监听 | 183 | //mcu异常监听 |
| 179 | _mcuErrorHandler(_data, _option) { | 184 | _mcuErrorHandler(_data, _option) { |
| 180 | let option = _option || ""; | 185 | let option = _option || ""; |
| @@ -649,6 +654,15 @@ export default class MessageEntrance extends Emiter { | @@ -649,6 +654,15 @@ export default class MessageEntrance extends Emiter { | ||
| 649 | } | 654 | } |
| 650 | } | 655 | } |
| 651 | 656 | ||
| 657 | + _sendDocBroadcastMsg(_param){ | ||
| 658 | + if (!_mcu.connected) { | ||
| 659 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 660 | + return; | ||
| 661 | + } | ||
| 662 | + if (_doc_ape) { | ||
| 663 | + _doc_ape.sendDocBroadcastMsg(_param); | ||
| 664 | + } | ||
| 665 | + } | ||
| 652 | //Sass删除文档成功之后,同步删除MCU数据 | 666 | //Sass删除文档成功之后,同步删除MCU数据 |
| 653 | _sassDeleteDocumentSuccess(_param) { | 667 | _sassDeleteDocumentSuccess(_param) { |
| 654 | loger.log('sassDeleteDocumentSuccess', _param); | 668 | loger.log('sassDeleteDocumentSuccess', _param); |
| @@ -987,7 +1001,7 @@ export default class MessageEntrance extends Emiter { | @@ -987,7 +1001,7 @@ export default class MessageEntrance extends Emiter { | ||
| 987 | 1001 | ||
| 988 | //// 文档变更,白板也需要做处理 | 1002 | //// 文档变更,白板也需要做处理 |
| 989 | docUpdateHandler(_data) { | 1003 | docUpdateHandler(_data) { |
| 990 | - if (!_mcu.connected) { | 1004 | + if (!_mcu.connected&&!GlobalConfig.isRecordPlayBack) { |
| 991 | loger.warn(GlobalConfig.getCurrentStatus()); | 1005 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 992 | return; | 1006 | return; |
| 993 | } | 1007 | } |
| @@ -1007,39 +1021,30 @@ export default class MessageEntrance extends Emiter { | @@ -1007,39 +1021,30 @@ export default class MessageEntrance extends Emiter { | ||
| 1007 | 1021 | ||
| 1008 | //文档加入频道成功,同步到MCU服务器上的数据 | 1022 | //文档加入频道成功,同步到MCU服务器上的数据 |
| 1009 | docJoinChannelSuccess() { | 1023 | docJoinChannelSuccess() { |
| 1010 | - loger.log("docJoinChannelSuccess isHost=", GlobalConfig.isHost); | ||
| 1011 | - loger.log(GlobalConfig.docListPrepare); | ||
| 1012 | - loger.log("docJoinChannelSuccess docListPrepare="); | 1024 | + loger.log("docJoinChannelSuccess->isHost=", GlobalConfig.isHost,"length=",GlobalConfig.docListPrepare.length); |
| 1025 | + //loger.log("docJoinChannelSuccess docListPrepare="); | ||
| 1013 | //如果是主持人,那么需要判断一下文档模块同步的数据和从sass获取的文档数据是否相同,如果mcu服务器不存在的,需要上传 | 1026 | //如果是主持人,那么需要判断一下文档模块同步的数据和从sass获取的文档数据是否相同,如果mcu服务器不存在的,需要上传 |
| 1014 | - if (GlobalConfig.isHost) { | ||
| 1015 | - for (let value of GlobalConfig.docListPrepare) { | 1027 | + if (GlobalConfig.isHost&&GlobalConfig.docListPrepare.length>0) { |
| 1028 | + for (let i=0;i<GlobalConfig.docListPrepare.length;i++) { | ||
| 1029 | + let value=GlobalConfig.docListPrepare[i]; | ||
| 1030 | + if (value) { | ||
| 1031 | + //loger.log("判断是否需要把提前上传的文档上传到mcu", value); | ||
| 1032 | + let paramInfo = { | ||
| 1033 | + "pageNum": value.pdfSize, | ||
| 1034 | + "fileName": value.name, | ||
| 1035 | + "fileType": value.type, | ||
| 1036 | + "relativeUrl": value.relativeLocation, | ||
| 1037 | + "url": value.absoluteLocation, | ||
| 1038 | + "creatUserId": value.createUserID, | ||
| 1039 | + "docId": value.id, | ||
| 1040 | + "md5": value.MD5, | ||
| 1041 | + "visible": false | ||
| 1042 | + }; | ||
| 1043 | + this._sendDocumentUpload(paramInfo); | ||
| 1044 | + } | ||
| 1045 | + } | ||
| 1046 | + /* for (let value of GlobalConfig.docListPrepare) { | ||
| 1016 | if (value) { | 1047 | if (value) { |
| 1017 | - /* //提前上传的文档文档信息的结构 | ||
| 1018 | - { | ||
| 1019 | - "MD5": "f3feb3fac8cd3a953bded00e07a0c66b", | ||
| 1020 | - "absoluteLocation": "http://101.200.150.192/DocSharing/data/526661904/20170203-115400026/f3feb3fac8cd3a953bded00e07a0c66b.swf", | ||
| 1021 | - "createUserID": "972", | ||
| 1022 | - "createUserIP": "114.241.81.175", | ||
| 1023 | - "createUserName": "base", | ||
| 1024 | - "dynamicPPT": 0, | ||
| 1025 | - "dynamicTransferStatic": "", | ||
| 1026 | - "id": "8ab3b0ed5a00f2fa015a0219a3df016c", | ||
| 1027 | - "meetingNumber": "", | ||
| 1028 | - "name": "McuClient_v.1.0.1_API.pdf", | ||
| 1029 | - "orderStr": "", | ||
| 1030 | - "pdfSize": 5, | ||
| 1031 | - "processEndTime": "2017-02-03 11:54:31", | ||
| 1032 | - "processRate": 0, | ||
| 1033 | - "processStartTime": "2017-02-03 11:54:27", | ||
| 1034 | - "relativeLocation": "/DocSharing/data/526661904/20170203-115400026/f3feb3fac8cd3a953bded00e07a0c66b.swf", | ||
| 1035 | - "siteID": "h5test", | ||
| 1036 | - "size": 360920, | ||
| 1037 | - "status": 3, | ||
| 1038 | - "type": "pdf", | ||
| 1039 | - "uploadEndTime": "2017-02-03 11:54:27", | ||
| 1040 | - "uploadStartTime": "2017-02-03 11:54:27" | ||
| 1041 | - }*/ | ||
| 1042 | - | ||
| 1043 | loger.log("判断是否需要把提前上传的文档上传到mcu", value); | 1048 | loger.log("判断是否需要把提前上传的文档上传到mcu", value); |
| 1044 | let paramInfo = { | 1049 | let paramInfo = { |
| 1045 | "pageNum": value.pdfSize, | 1050 | "pageNum": value.pdfSize, |
| @@ -1055,7 +1060,7 @@ export default class MessageEntrance extends Emiter { | @@ -1055,7 +1060,7 @@ export default class MessageEntrance extends Emiter { | ||
| 1055 | 1060 | ||
| 1056 | this._sendDocumentUpload(paramInfo); | 1061 | this._sendDocumentUpload(paramInfo); |
| 1057 | } | 1062 | } |
| 1058 | - } | 1063 | + }*/ |
| 1059 | } | 1064 | } |
| 1060 | } | 1065 | } |
| 1061 | 1066 |
| @@ -50,6 +50,8 @@ MessageTypes.AUDIO_BROADCAST= "audio_broadcast";//'audio.broadcast'; | @@ -50,6 +50,8 @@ MessageTypes.AUDIO_BROADCAST= "audio_broadcast";//'audio.broadcast'; | ||
| 50 | //文档模块事件定义 | 50 | //文档模块事件定义 |
| 51 | MessageTypes.DOC_DELETE="document_delete";//'document.delete';//删除文档 | 51 | MessageTypes.DOC_DELETE="document_delete";//'document.delete';//删除文档 |
| 52 | MessageTypes.DOC_UPDATE ="document_update";// 'document.update';//更新文档(添加、变更) | 52 | MessageTypes.DOC_UPDATE ="document_update";// 'document.update';//更新文档(添加、变更) |
| 53 | +MessageTypes.DOC_BROADCAST= "doc_broadcast";// | ||
| 54 | + | ||
| 53 | //MessageTypes.DOC_SHOW = 'document.show'; | 55 | //MessageTypes.DOC_SHOW = 'document.show'; |
| 54 | //MessageTypes.DOC_UPLOAD='document.upload';//上传文档 | 56 | //MessageTypes.DOC_UPLOAD='document.upload';//上传文档 |
| 55 | //MessageTypes.DOC_COMMAND='document.command';//操作文档 | 57 | //MessageTypes.DOC_COMMAND='document.command';//操作文档 |
| @@ -131,7 +131,7 @@ class RecordPlayBackParse extends Emiter { | @@ -131,7 +131,7 @@ class RecordPlayBackParse extends Emiter { | ||
| 131 | pduMsg.type = PduType.RCPDU_SEND_DATA_REQUEST; | 131 | pduMsg.type = PduType.RCPDU_SEND_DATA_REQUEST; |
| 132 | pduType = PduType.RCPDU_SEND_DATA_REQUEST; | 132 | pduType = PduType.RCPDU_SEND_DATA_REQUEST; |
| 133 | } | 133 | } |
| 134 | - loger.log('pduType', pduType); | 134 | + //loger.log('pduType', pduType); |
| 135 | switch (pduType) { | 135 | switch (pduType) { |
| 136 | case PduType.RCPDU_CONNECT_PROVIDER_RESPONSE: | 136 | case PduType.RCPDU_CONNECT_PROVIDER_RESPONSE: |
| 137 | //加入课堂请求返回数据处理 | 137 | //加入课堂请求返回数据处理 |
| @@ -157,7 +157,7 @@ class RecordPlayBackParse extends Emiter { | @@ -157,7 +157,7 @@ class RecordPlayBackParse extends Emiter { | ||
| 157 | let ape = this._apes[pduMsg.sessionId]; | 157 | let ape = this._apes[pduMsg.sessionId]; |
| 158 | let sessionLabel = ApeConsts(pduMsg.sessionId); | 158 | let sessionLabel = ApeConsts(pduMsg.sessionId); |
| 159 | //只做解析存储,不对外发送 | 159 | //只做解析存储,不对外发送 |
| 160 | - loger.log('解析数据-timestamp->', timestamp, 'sessionId->', pduMsg.sessionId, 'sessionLabel->', sessionLabel); | 160 | + //loger.log('解析数据-timestamp->', timestamp, 'sessionId->', pduMsg.sessionId, 'sessionLabel->', sessionLabel); |
| 161 | switch (pduMsg.sessionId) { | 161 | switch (pduMsg.sessionId) { |
| 162 | case ApeConsts.CONFERENCE_SESSION_ID: | 162 | case ApeConsts.CONFERENCE_SESSION_ID: |
| 163 | this.saveParseData(data, timestamp, this._conferApeMssages); | 163 | this.saveParseData(data, timestamp, this._conferApeMssages); |
| @@ -226,12 +226,12 @@ class RecordPlayBackParse extends Emiter { | @@ -226,12 +226,12 @@ class RecordPlayBackParse extends Emiter { | ||
| 226 | this._emit(MessageTypes.CLASS_UPDATE_TIMER, {"classTimestamp": this._recordPlaybackTimestamp}); | 226 | this._emit(MessageTypes.CLASS_UPDATE_TIMER, {"classTimestamp": this._recordPlaybackTimestamp}); |
| 227 | 227 | ||
| 228 | //各个APE模块根据时间查找消息数据 | 228 | //各个APE模块根据时间查找消息数据 |
| 229 | - this._searchMessageFromTime(this._recordPlaybackTimestamp, this._conferApeMssages); | ||
| 230 | - this._searchMessageFromTime(this._recordPlaybackTimestamp, this._chatApeMssages); | ||
| 231 | - this._searchMessageFromTime(this._recordPlaybackTimestamp, this._docApeMssages); | ||
| 232 | - this._searchMessageFromTime(this._recordPlaybackTimestamp, this._whiteApeMssages); | ||
| 233 | - this._searchMessageFromTime(this._recordPlaybackTimestamp, this._videoApeMssages); | ||
| 234 | - this._searchMessageFromTime(this._recordPlaybackTimestamp, this._audioApeMssages); | 229 | + this._searchMessageFromTime(this._recordPlaybackTimestamp, this._conferApeMssages,"conferApe"); |
| 230 | + this._searchMessageFromTime(this._recordPlaybackTimestamp, this._chatApeMssages,"chatApe"); | ||
| 231 | + this._searchMessageFromTime(this._recordPlaybackTimestamp, this._docApeMssages,"docApe"); | ||
| 232 | + this._searchMessageFromTime(this._recordPlaybackTimestamp, this._whiteApeMssages,"whiteApe"); | ||
| 233 | + this._searchMessageFromTime(this._recordPlaybackTimestamp, this._videoApeMssages,"videoAp"); | ||
| 234 | + this._searchMessageFromTime(this._recordPlaybackTimestamp, this._audioApeMssages,"audioApe"); | ||
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | //加载录制文件 | 237 | //加载录制文件 |
| @@ -322,12 +322,13 @@ class RecordPlayBackParse extends Emiter { | @@ -322,12 +322,13 @@ class RecordPlayBackParse extends Emiter { | ||
| 322 | } | 322 | } |
| 323 | 323 | ||
| 324 | //根据时间查找数据 | 324 | //根据时间查找数据 |
| 325 | - _searchMessageFromTime(_timestamp, _apeMessages) { | 325 | + _searchMessageFromTime(_timestamp, _apeMessages,_ape) { |
| 326 | let msgDataArr = _apeMessages[_timestamp]; | 326 | let msgDataArr = _apeMessages[_timestamp]; |
| 327 | if (!msgDataArr) { | 327 | if (!msgDataArr) { |
| 328 | //没有数据,需要查找当前时间点属于哪一个时间戳关键帧 | 328 | //没有数据,需要查找当前时间点属于哪一个时间戳关键帧 |
| 329 | } else { | 329 | } else { |
| 330 | //把时间点对应的数据发送,同一秒内有存在多个数据的情况 | 330 | //把时间点对应的数据发送,同一秒内有存在多个数据的情况 |
| 331 | + loger.log(_ape,"回放数据->",msgDataArr.length) | ||
| 331 | for (let i = 0; i < msgDataArr.length; i++) { | 332 | for (let i = 0; i < msgDataArr.length; i++) { |
| 332 | this._everSocketMsgReceivedHandler(msgDataArr[i].byteData, 0); | 333 | this._everSocketMsgReceivedHandler(msgDataArr[i].byteData, 0); |
| 333 | } | 334 | } |
| @@ -440,12 +441,14 @@ class RecordPlayBackParse extends Emiter { | @@ -440,12 +441,14 @@ class RecordPlayBackParse extends Emiter { | ||
| 440 | let counter=0; | 441 | let counter=0; |
| 441 | let messageItem; | 442 | let messageItem; |
| 442 | let keyFrameSeek = 0; | 443 | let keyFrameSeek = 0; |
| 444 | + //let mssageArr=[]; | ||
| 443 | for (let i = this._recordPlaybackTimestamp; i > 0; i--) { | 445 | for (let i = this._recordPlaybackTimestamp; i > 0; i--) { |
| 444 | messageItem = _apeMessages[i]; | 446 | messageItem = _apeMessages[i]; |
| 445 | if (messageItem) { | 447 | if (messageItem) { |
| 446 | //把时间点对应的数据发送,同一秒内有存在多个数据的情况 | 448 | //把时间点对应的数据发送,同一秒内有存在多个数据的情况 |
| 447 | for (let i = 0; i < messageItem.length; i++) { | 449 | for (let i = 0; i < messageItem.length; i++) { |
| 448 | this._everSocketMsgReceivedHandler(messageItem[i].byteData, 0); | 450 | this._everSocketMsgReceivedHandler(messageItem[i].byteData, 0); |
| 451 | + //mssageArr.push(messageItem[i].byteData); | ||
| 449 | counter++; | 452 | counter++; |
| 450 | if(counter>30){ | 453 | if(counter>30){ |
| 451 | loger.warn("SEEK->最多处理历史消息30条"); | 454 | loger.warn("SEEK->最多处理历史消息30条"); |
| @@ -454,7 +457,13 @@ class RecordPlayBackParse extends Emiter { | @@ -454,7 +457,13 @@ class RecordPlayBackParse extends Emiter { | ||
| 454 | } | 457 | } |
| 455 | } | 458 | } |
| 456 | } | 459 | } |
| 457 | - | 460 | + ////mssageArr记录的数据是按时间最大排序的,发消息的时候需要从时间小的开始,倒着发数据 |
| 461 | + //let len=mssageArr.length; | ||
| 462 | + //if(len>0){ | ||
| 463 | + // for (let k=len-1;k>0;k--){ | ||
| 464 | + // this._everSocketMsgReceivedHandler(mssageArr[k], 0); | ||
| 465 | + // } | ||
| 466 | + //} | ||
| 458 | } | 467 | } |
| 459 | 468 | ||
| 460 | } | 469 | } |
| @@ -419,7 +419,7 @@ class Sass extends Emiter { | @@ -419,7 +419,7 @@ class Sass extends Emiter { | ||
| 419 | let url = `http://${GlobalConfig.portal}/3m/recordingMeeting/insertRecordingMeeting.do?siteID=${siteID}&meetingID=${meetingID}&userID=${userID}&userName=${userName}&meetingName=${meetingName}&startTime=${startTime}&endTime=${endTime}&playUrl=${playUrl}&streamName=${streamName}&downloadUrl=${downloadUrl}&configFile=${confRecordFileName}×tamp=${timestamp}&recordTimestamp=${recordTimestamp}&authId=${authId}`; | 419 | let url = `http://${GlobalConfig.portal}/3m/recordingMeeting/insertRecordingMeeting.do?siteID=${siteID}&meetingID=${meetingID}&userID=${userID}&userName=${userName}&meetingName=${meetingName}&startTime=${startTime}&endTime=${endTime}&playUrl=${playUrl}&streamName=${streamName}&downloadUrl=${downloadUrl}&configFile=${confRecordFileName}×tamp=${timestamp}&recordTimestamp=${recordTimestamp}&authId=${authId}`; |
| 420 | loger.log('saveClassRecordContrlInfo', url); | 420 | loger.log('saveClassRecordContrlInfo', url); |
| 421 | 421 | ||
| 422 | - fetch(url, { | 422 | + fetch( encodeURI(url), { |
| 423 | timeout: 5000 | 423 | timeout: 5000 |
| 424 | }) | 424 | }) |
| 425 | .then(ret => { | 425 | .then(ret => { |
| @@ -441,7 +441,6 @@ class Sass extends Emiter { | @@ -441,7 +441,6 @@ class Sass extends Emiter { | ||
| 441 | .catch(err => { | 441 | .catch(err => { |
| 442 | loger.error(`保存开始录制信息异常.状态码:${err}`); | 442 | loger.error(`保存开始录制信息异常.状态码:${err}`); |
| 443 | }); | 443 | }); |
| 444 | - | ||
| 445 | } | 444 | } |
| 446 | } | 445 | } |
| 447 | 446 |
| @@ -21,7 +21,7 @@ let tempMcuIp=""; | @@ -21,7 +21,7 @@ let tempMcuIp=""; | ||
| 21 | let tempMcuPort=""; | 21 | let tempMcuPort=""; |
| 22 | let tempMsIp=""; | 22 | let tempMsIp=""; |
| 23 | let tempMsPort=""; | 23 | let tempMsPort=""; |
| 24 | -let msDefaultPort=":1935"; | 24 | +let msDefaultPort="1935"; |
| 25 | let mcuDefaultPort="7777"; | 25 | let mcuDefaultPort="7777"; |
| 26 | let speedTestPort = ':5555';//测速端口统一 | 26 | let speedTestPort = ':5555';//测速端口统一 |
| 27 | 27 | ||
| @@ -51,14 +51,14 @@ class ServerCheck extends Emiter { | @@ -51,14 +51,14 @@ class ServerCheck extends Emiter { | ||
| 51 | let md5Str = MD5("addr=" + ip + "&token=b657c3507b324353e09c1958ee956a98efceb3e3");//("addr=" + ip + "&token=b657c3507b324353e09c1958ee956a98efceb3e3"),转成MD5 | 51 | let md5Str = MD5("addr=" + ip + "&token=b657c3507b324353e09c1958ee956a98efceb3e3");//("addr=" + ip + "&token=b657c3507b324353e09c1958ee956a98efceb3e3"),转成MD5 |
| 52 | let timestamp = new Date().getTime(); | 52 | let timestamp = new Date().getTime(); |
| 53 | let location = `http://ipapi.ipip.net/find?addr=${ip}&sid=14&uid=5237&sig=${md5Str}&_=${timestamp}`; | 53 | let location = `http://ipapi.ipip.net/find?addr=${ip}&sid=14&uid=5237&sig=${md5Str}&_=${timestamp}`; |
| 54 | - loger.log('获取IP信息 ', userIp, location); | 54 | + // loger.log('获取IP信息 ', userIp, location); |
| 55 | 55 | ||
| 56 | fetchJsonp(location, { | 56 | fetchJsonp(location, { |
| 57 | timeout: timeOutDelay, | 57 | timeout: timeOutDelay, |
| 58 | }).then(function (response) { | 58 | }).then(function (response) { |
| 59 | return response.json() | 59 | return response.json() |
| 60 | }).then(function (json) { | 60 | }).then(function (json) { |
| 61 | - loger.log('获取IP信息返回', json) | 61 | + // loger.log('获取IP信息返回', json) |
| 62 | if (json) { | 62 | if (json) { |
| 63 | userIpInfo.ret = json.ret; | 63 | userIpInfo.ret = json.ret; |
| 64 | userIpInfo.country = json.data[0];//国家 | 64 | userIpInfo.country = json.data[0];//国家 |
| @@ -68,31 +68,31 @@ class ServerCheck extends Emiter { | @@ -68,31 +68,31 @@ class ServerCheck extends Emiter { | ||
| 68 | } | 68 | } |
| 69 | this.serverGetUserIpInfoCallback(userIpInfo); | 69 | this.serverGetUserIpInfoCallback(userIpInfo); |
| 70 | }.bind(this)).catch(function (ex) { | 70 | }.bind(this)).catch(function (ex) { |
| 71 | - loger.log('获取IP信息失败', ex.message) | 71 | + // loger.log('获取IP信息失败', ex.message) |
| 72 | this.serverGetUserIpInfoCallback(userIpInfo); | 72 | this.serverGetUserIpInfoCallback(userIpInfo); |
| 73 | }.bind(this)); | 73 | }.bind(this)); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | //获取ip信息返回 | 76 | //获取ip信息返回 |
| 77 | serverGetUserIpInfoCallback(userIpInfo) { | 77 | serverGetUserIpInfoCallback(userIpInfo) { |
| 78 | - loger.log("获取IP详情,开始处理", userIpInfo); | 78 | + // loger.log("获取IP详情,开始处理", userIpInfo); |
| 79 | if (userIpInfo.ret == "ok") { | 79 | if (userIpInfo.ret == "ok") { |
| 80 | GlobalConfig.country = userIpInfo.country;//国家 | 80 | GlobalConfig.country = userIpInfo.country;//国家 |
| 81 | GlobalConfig.city = userIpInfo.city;//城市 | 81 | GlobalConfig.city = userIpInfo.city;//城市 |
| 82 | GlobalConfig.province = userIpInfo.province;//服务商 | 82 | GlobalConfig.province = userIpInfo.province;//服务商 |
| 83 | GlobalConfig.isp = userIpInfo.isp;//服务商 | 83 | GlobalConfig.isp = userIpInfo.isp;//服务商 |
| 84 | - loger.log("获取ip详情成功,country:" + GlobalConfig.country + ",city:" + GlobalConfig.city + ",isp:" + GlobalConfig.isp); | 84 | + // loger.log("获取ip详情成功,country:" + GlobalConfig.country + ",city:" + GlobalConfig.city + ",isp:" + GlobalConfig.isp); |
| 85 | this._chooseBestIpFromServer(); | 85 | this._chooseBestIpFromServer(); |
| 86 | } | 86 | } |
| 87 | else { | 87 | else { |
| 88 | - loger.log("获取ip详情失败"); | 88 | + // loger.log("获取ip详情失败"); |
| 89 | this._chooseBestIpFromSassParam(); | 89 | this._chooseBestIpFromSassParam(); |
| 90 | } | 90 | } |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | //从IPIP服务列表中选择最快的IP | 93 | //从IPIP服务列表中选择最快的IP |
| 94 | _chooseBestIpFromServer() { | 94 | _chooseBestIpFromServer() { |
| 95 | - loger.log("从Server服务列表中选择最快的IP"); | 95 | + // loger.log("从Server服务列表中选择最快的IP"); |
| 96 | isRequestMcuCallback=false; | 96 | isRequestMcuCallback=false; |
| 97 | isRequestMsCallback=false; | 97 | isRequestMsCallback=false; |
| 98 | isTestFromServer=true; | 98 | isTestFromServer=true; |
| @@ -130,7 +130,7 @@ class ServerCheck extends Emiter { | @@ -130,7 +130,7 @@ class ServerCheck extends Emiter { | ||
| 130 | } | 130 | } |
| 131 | //从Sass返回的msList mcuList中选点 | 131 | //从Sass返回的msList mcuList中选点 |
| 132 | _chooseBestIpFromSassParam() { | 132 | _chooseBestIpFromSassParam() { |
| 133 | - loger.log("从Sass服务列表中选择最快的IP"); | 133 | + // loger.log("从Sass服务列表中选择最快的IP"); |
| 134 | isRequestMcuCallback = false; | 134 | isRequestMcuCallback = false; |
| 135 | isRequestMsCallback = false; | 135 | isRequestMsCallback = false; |
| 136 | isTestFromSass=false; | 136 | isTestFromSass=false; |
| @@ -157,7 +157,7 @@ class ServerCheck extends Emiter { | @@ -157,7 +157,7 @@ class ServerCheck extends Emiter { | ||
| 157 | 157 | ||
| 158 | //获取最快的MCU服务器地址,参数是一个ip数组 | 158 | //获取最快的MCU服务器地址,参数是一个ip数组 |
| 159 | getBestMcuServer(_param) { | 159 | getBestMcuServer(_param) { |
| 160 | - loger.log('开始MCU选点 ', _param); | 160 | + // loger.log('开始MCU选点 ', _param); |
| 161 | if(_param==null||_param.length<1){ | 161 | if(_param==null||_param.length<1){ |
| 162 | this._getBestMcuServerCallbackHandler("") | 162 | this._getBestMcuServerCallbackHandler("") |
| 163 | return; | 163 | return; |
| @@ -167,7 +167,7 @@ class ServerCheck extends Emiter { | @@ -167,7 +167,7 @@ class ServerCheck extends Emiter { | ||
| 167 | loger.warn('getBestMcuServer -> nothing!'); | 167 | loger.warn('getBestMcuServer -> nothing!'); |
| 168 | this._getBestMcuServerCallbackHandler("") | 168 | this._getBestMcuServerCallbackHandler("") |
| 169 | } else { | 169 | } else { |
| 170 | - //loger.log('getBestMcuServer done -> ', fatest_ip_response); | 170 | + loger.log('getBestMcuServer done -> ', fatest_ip_response); |
| 171 | this._getBestMcuServerCallbackHandler(fatest_ip_response) | 171 | this._getBestMcuServerCallbackHandler(fatest_ip_response) |
| 172 | } | 172 | } |
| 173 | }.bind(this), timeOutDelay); | 173 | }.bind(this), timeOutDelay); |
| @@ -175,7 +175,7 @@ class ServerCheck extends Emiter { | @@ -175,7 +175,7 @@ class ServerCheck extends Emiter { | ||
| 175 | 175 | ||
| 176 | //获取最快的MS服务器地址,参数是一个ip数组 | 176 | //获取最快的MS服务器地址,参数是一个ip数组 |
| 177 | getBestMsServer(_param) { | 177 | getBestMsServer(_param) { |
| 178 | - loger.log('开始MS选点 ', _param); | 178 | + // loger.log('开始MS选点 ', _param); |
| 179 | if(_param==null||_param.length<1){ | 179 | if(_param==null||_param.length<1){ |
| 180 | this._getBestMsServerCallbackHandler("") | 180 | this._getBestMsServerCallbackHandler("") |
| 181 | return; | 181 | return; |
| @@ -185,16 +185,16 @@ class ServerCheck extends Emiter { | @@ -185,16 +185,16 @@ class ServerCheck extends Emiter { | ||
| 185 | loger.warn('getBestMsServer -> nothing!'); | 185 | loger.warn('getBestMsServer -> nothing!'); |
| 186 | this._getBestMsServerCallbackHandler(""); | 186 | this._getBestMsServerCallbackHandler(""); |
| 187 | } else { | 187 | } else { |
| 188 | - //loger.log('getBestMsServer done -> ', fatest_ip_response); | 188 | + loger.log('getBestMsServer done -> ', fatest_ip_response); |
| 189 | this._getBestMsServerCallbackHandler(fatest_ip_response); | 189 | this._getBestMsServerCallbackHandler(fatest_ip_response); |
| 190 | } | 190 | } |
| 191 | }.bind(this), timeOutDelay); | 191 | }.bind(this), timeOutDelay); |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | _getBestMcuServerCallbackHandler(_data) { | 194 | _getBestMcuServerCallbackHandler(_data) { |
| 195 | - loger.log("MCU选点返回1", _data); | 195 | + // loger.log("MCU选点返回1", _data); |
| 196 | if (isRequestMcuCallback) { | 196 | if (isRequestMcuCallback) { |
| 197 | - loger.log("MCU选点,已经有返回"); | 197 | + // loger.log("MCU选点,已经有返回"); |
| 198 | return; | 198 | return; |
| 199 | } | 199 | } |
| 200 | isRequestMcuCallback = true; | 200 | isRequestMcuCallback = true; |
| @@ -211,14 +211,14 @@ class ServerCheck extends Emiter { | @@ -211,14 +211,14 @@ class ServerCheck extends Emiter { | ||
| 211 | } | 211 | } |
| 212 | } | 212 | } |
| 213 | } | 213 | } |
| 214 | - loger.log("MCU选点返回2",tempMcuIp,tempMcuPort); | 214 | + // loger.log("MCU选点返回2",tempMcuIp,tempMcuPort); |
| 215 | this._startConnectMcu(); | 215 | this._startConnectMcu(); |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | _getBestMsServerCallbackHandler(_data) { | 218 | _getBestMsServerCallbackHandler(_data) { |
| 219 | - loger.log("MS选点返回1", _data); | 219 | + // loger.log("MS选点返回1", _data); |
| 220 | if (isRequestMsCallback) { | 220 | if (isRequestMsCallback) { |
| 221 | - loger.log("_getBestMsServerCallbackHandler,已经有返回"); | 221 | + // loger.log("_getBestMsServerCallbackHandler,已经有返回"); |
| 222 | return; | 222 | return; |
| 223 | } | 223 | } |
| 224 | isRequestMsCallback = true; | 224 | isRequestMsCallback = true; |
| @@ -229,13 +229,13 @@ class ServerCheck extends Emiter { | @@ -229,13 +229,13 @@ class ServerCheck extends Emiter { | ||
| 229 | } | 229 | } |
| 230 | tempMsPort=msDefaultPort; | 230 | tempMsPort=msDefaultPort; |
| 231 | for(let i=0;i<checkMsIpGroup.length;i++){ | 231 | for(let i=0;i<checkMsIpGroup.length;i++){ |
| 232 | - if(tempMsPort==checkMsIpGroup[i].ip){ | 232 | + if(tempMsIp==checkMsIpGroup[i].ip){ |
| 233 | tempMsPort=checkMsIpGroup[i].port||msDefaultPort; | 233 | tempMsPort=checkMsIpGroup[i].port||msDefaultPort; |
| 234 | break; | 234 | break; |
| 235 | } | 235 | } |
| 236 | } | 236 | } |
| 237 | } | 237 | } |
| 238 | - loger.log("MS选点返回2", tempMsIp,tempMsPort); | 238 | + // loger.log("MS选点返回2", tempMsIp,tempMsPort); |
| 239 | this._startConnectMcu(); | 239 | this._startConnectMcu(); |
| 240 | } | 240 | } |
| 241 | 241 | ||
| @@ -251,7 +251,7 @@ class ServerCheck extends Emiter { | @@ -251,7 +251,7 @@ class ServerCheck extends Emiter { | ||
| 251 | GlobalConfig.MCUServerPort=tempMcuPort; | 251 | GlobalConfig.MCUServerPort=tempMcuPort; |
| 252 | GlobalConfig.MSServerIP=tempMsIp; | 252 | GlobalConfig.MSServerIP=tempMsIp; |
| 253 | GlobalConfig.MSServerPort=tempMsPort; | 253 | GlobalConfig.MSServerPort=tempMsPort; |
| 254 | - loger.log("Server选点完成", "mcu-->",GlobalConfig.MCUServerIP,GlobalConfig.MCUServerPort,"ms---->",GlobalConfig.MSServerIP,GlobalConfig.MSServerPort); | 254 | + // loger.log("Server选点完成", "mcu-->",GlobalConfig.MCUServerIP,GlobalConfig.MCUServerPort,"ms---->",GlobalConfig.MSServerIP,GlobalConfig.MSServerPort); |
| 255 | this._emit(ServerCheck.SEVER_CHECK_BEST_IP_SUCCESS); | 255 | this._emit(ServerCheck.SEVER_CHECK_BEST_IP_SUCCESS); |
| 256 | } | 256 | } |
| 257 | } else { | 257 | } else { |
| @@ -278,12 +278,12 @@ class ServerCheck extends Emiter { | @@ -278,12 +278,12 @@ class ServerCheck extends Emiter { | ||
| 278 | //按country没有查找到就返回default | 278 | //按country没有查找到就返回default |
| 279 | if(!countryData){ | 279 | if(!countryData){ |
| 280 | countryData=jsona.MCU.default; | 280 | countryData=jsona.MCU.default; |
| 281 | - loger.log("_returnServerMCU->countryData->default",countryData); | 281 | + // loger.log("_returnServerMCU->countryData->default",countryData); |
| 282 | return countryData; | 282 | return countryData; |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | if(country!="中国"){ | 285 | if(country!="中国"){ |
| 286 | - loger.log("_returnServerMCU->countryData",countryData); | 286 | + // loger.log("_returnServerMCU->countryData",countryData); |
| 287 | return countryData; | 287 | return countryData; |
| 288 | } | 288 | } |
| 289 | 289 | ||
| @@ -292,7 +292,7 @@ class ServerCheck extends Emiter { | @@ -292,7 +292,7 @@ class ServerCheck extends Emiter { | ||
| 292 | let ispData=countryData.isp[isp]; | 292 | let ispData=countryData.isp[isp]; |
| 293 | //isp查找到就返回 | 293 | //isp查找到就返回 |
| 294 | if(ispData){ | 294 | if(ispData){ |
| 295 | - loger.log("_returnServerMCU->ispData",ispData); | 295 | + // loger.log("_returnServerMCU->ispData",ispData); |
| 296 | return ispData; | 296 | return ispData; |
| 297 | } | 297 | } |
| 298 | 298 | ||
| @@ -300,7 +300,7 @@ class ServerCheck extends Emiter { | @@ -300,7 +300,7 @@ class ServerCheck extends Emiter { | ||
| 300 | let provinceData=countryData.province[province]; | 300 | let provinceData=countryData.province[province]; |
| 301 | //用province查找到就返回 | 301 | //用province查找到就返回 |
| 302 | if(provinceData){ | 302 | if(provinceData){ |
| 303 | - loger.log("_returnServerMCU->provinceData",provinceData); | 303 | + // loger.log("_returnServerMCU->provinceData",provinceData); |
| 304 | return provinceData; | 304 | return provinceData; |
| 305 | } | 305 | } |
| 306 | 306 | ||
| @@ -308,10 +308,10 @@ class ServerCheck extends Emiter { | @@ -308,10 +308,10 @@ class ServerCheck extends Emiter { | ||
| 308 | //isp province都没有,使用default | 308 | //isp province都没有,使用default |
| 309 | let defaultData=countryData.default | 309 | let defaultData=countryData.default |
| 310 | if(defaultData){ | 310 | if(defaultData){ |
| 311 | - loger.log("_returnServerMCU->defaultData",defaultData); | 311 | + // loger.log("_returnServerMCU->defaultData",defaultData); |
| 312 | return defaultData; | 312 | return defaultData; |
| 313 | }else { | 313 | }else { |
| 314 | - loger.log("_returnServerMCU->defaultData",""); | 314 | + // loger.log("_returnServerMCU->defaultData",""); |
| 315 | return []; | 315 | return []; |
| 316 | } | 316 | } |
| 317 | return []; | 317 | return []; |
| @@ -324,12 +324,12 @@ class ServerCheck extends Emiter { | @@ -324,12 +324,12 @@ class ServerCheck extends Emiter { | ||
| 324 | //按country没有查找到就返回default | 324 | //按country没有查找到就返回default |
| 325 | if(!countryData){ | 325 | if(!countryData){ |
| 326 | countryData=jsona.MS.default; | 326 | countryData=jsona.MS.default; |
| 327 | - loger.log("_returnServerMS->countryData->default",countryData); | 327 | + // loger.log("_returnServerMS->countryData->default",countryData); |
| 328 | return countryData; | 328 | return countryData; |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | if(country!="中国"){ | 331 | if(country!="中国"){ |
| 332 | - loger.log("_returnServerMS->countryData",countryData); | 332 | + // loger.log("_returnServerMS->countryData",countryData); |
| 333 | return countryData; | 333 | return countryData; |
| 334 | } | 334 | } |
| 335 | 335 | ||
| @@ -338,7 +338,7 @@ class ServerCheck extends Emiter { | @@ -338,7 +338,7 @@ class ServerCheck extends Emiter { | ||
| 338 | let ispData=countryData.isp[isp]; | 338 | let ispData=countryData.isp[isp]; |
| 339 | //isp查找到就返回 | 339 | //isp查找到就返回 |
| 340 | if(ispData){ | 340 | if(ispData){ |
| 341 | - loger.log("_returnServerMS->ispData",ispData); | 341 | + // loger.log("_returnServerMS->ispData",ispData); |
| 342 | return ispData; | 342 | return ispData; |
| 343 | } | 343 | } |
| 344 | 344 | ||
| @@ -346,7 +346,7 @@ class ServerCheck extends Emiter { | @@ -346,7 +346,7 @@ class ServerCheck extends Emiter { | ||
| 346 | let provinceData=countryData.province[province]; | 346 | let provinceData=countryData.province[province]; |
| 347 | //用province查找到就返回 | 347 | //用province查找到就返回 |
| 348 | if(provinceData){ | 348 | if(provinceData){ |
| 349 | - loger.log("_returnServerMS->provinceData",provinceData); | 349 | + // loger.log("_returnServerMS->provinceData",provinceData); |
| 350 | return provinceData; | 350 | return provinceData; |
| 351 | } | 351 | } |
| 352 | 352 | ||
| @@ -354,10 +354,10 @@ class ServerCheck extends Emiter { | @@ -354,10 +354,10 @@ class ServerCheck extends Emiter { | ||
| 354 | //isp province都没有,使用default | 354 | //isp province都没有,使用default |
| 355 | let defaultData=countryData.default | 355 | let defaultData=countryData.default |
| 356 | if(defaultData){ | 356 | if(defaultData){ |
| 357 | - loger.log("_returnServerMS->defaultData",defaultData); | 357 | + // loger.log("_returnServerMS->defaultData",defaultData); |
| 358 | return defaultData; | 358 | return defaultData; |
| 359 | }else { | 359 | }else { |
| 360 | - loger.log("_returnServerMS->defaultData",""); | 360 | + // loger.log("_returnServerMS->defaultData",""); |
| 361 | return []; | 361 | return []; |
| 362 | } | 362 | } |
| 363 | 363 |
| @@ -371,7 +371,6 @@ export default class Ape extends Emiter { | @@ -371,7 +371,6 @@ export default class Ape extends Emiter { | ||
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | sendChatUniform(appPdu, top) { | 373 | sendChatUniform(appPdu, top) { |
| 374 | - loger.log('Ape发送数据UNIFORM PDU'); | ||
| 375 | //console.log(appPdu); | 374 | //console.log(appPdu); |
| 376 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); | 375 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); |
| 377 | if (GlobalConfig.getCurrentStatus().code == 0 || GlobalConfig.getCurrentStatus().code == 1) { | 376 | if (GlobalConfig.getCurrentStatus().code == 0 || GlobalConfig.getCurrentStatus().code == 1) { |
| @@ -391,6 +390,7 @@ export default class Ape extends Emiter { | @@ -391,6 +390,7 @@ export default class Ape extends Emiter { | ||
| 391 | PduConsts.SEG_ONCE | 390 | PduConsts.SEG_ONCE |
| 392 | ); | 391 | ); |
| 393 | uniformPdu.data = appPdu.toArrayBuffer(); | 392 | uniformPdu.data = appPdu.toArrayBuffer(); |
| 393 | + loger.log('Ape发送数据UNIFORM PDU',uniformPdu); | ||
| 394 | // Mcu发送 | 394 | // Mcu发送 |
| 395 | this.mcu.send(uniformPdu); | 395 | this.mcu.send(uniformPdu); |
| 396 | } | 396 | } |
| @@ -42,6 +42,7 @@ class DocApe extends Ape { | @@ -42,6 +42,7 @@ class DocApe extends Ape { | ||
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | /////////////发送数据操作////////////////////////////////////////////////////// | 44 | /////////////发送数据操作////////////////////////////////////////////////////// |
| 45 | + | ||
| 45 | //上传文档 | 46 | //上传文档 |
| 46 | documentUpload(paramInfo){ | 47 | documentUpload(paramInfo){ |
| 47 | if(paramInfo==null||EngineUtils.isEmptyObject(paramInfo)){ | 48 | if(paramInfo==null||EngineUtils.isEmptyObject(paramInfo)){ |
| @@ -96,7 +97,7 @@ class DocApe extends Ape { | @@ -96,7 +97,7 @@ class DocApe extends Ape { | ||
| 96 | this.sendUniform(adapterPdu,true); | 97 | this.sendUniform(adapterPdu,true); |
| 97 | } | 98 | } |
| 98 | updaterDoc(_docDataModel,_itemIdx){ | 99 | updaterDoc(_docDataModel,_itemIdx){ |
| 99 | - loger.log("文档===updaterDoc ",_itemIdx); | 100 | + //loger.log("文档===updaterDoc ",_itemIdx); |
| 100 | //验证坐标点集合数组是否合法 | 101 | //验证坐标点集合数组是否合法 |
| 101 | if(_docDataModel==null||_itemIdx==null){ | 102 | if(_docDataModel==null||_itemIdx==null){ |
| 102 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 103 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| @@ -266,7 +267,7 @@ class DocApe extends Ape { | @@ -266,7 +267,7 @@ class DocApe extends Ape { | ||
| 266 | //console.log(docDataModelPdu); | 267 | //console.log(docDataModelPdu); |
| 267 | //console.log(docDataModel); | 268 | //console.log(docDataModel); |
| 268 | if(docDataModel==null){ | 269 | if(docDataModel==null){ |
| 269 | - loger.log('documentCommand失败,文档不存在',paramInfo); | 270 | + loger.log('documentSwitchPage->,文档不存在',paramInfo); |
| 270 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 271 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 271 | return; | 272 | return; |
| 272 | } | 273 | } |
| @@ -279,13 +280,30 @@ class DocApe extends Ape { | @@ -279,13 +280,30 @@ class DocApe extends Ape { | ||
| 279 | this.updaterDoc(docDataModel,docDataModel.itemIdx); | 280 | this.updaterDoc(docDataModel,docDataModel.itemIdx); |
| 280 | } | 281 | } |
| 281 | 282 | ||
| 282 | - //缩放/滚动 | 283 | + //文档切换显示模式 |
| 284 | + documentSwitchShowModel(paramInfo){ | ||
| 285 | + loger.log('documentSwitchShowModel',paramInfo); | ||
| 286 | + //获取已经存在的数据 | ||
| 287 | + let docDataModel= this.docList[paramInfo.itemIdx]; | ||
| 288 | + | ||
| 289 | + if(docDataModel==null){ | ||
| 290 | + loger.log('documentSwitchShowModel->文档不存在',paramInfo); | ||
| 291 | + this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | ||
| 292 | + return; | ||
| 293 | + } | ||
| 294 | + //更新数据的字段 | ||
| 295 | + docDataModel.action=ApeConsts.DOC_ACTION_SWITCH_PAGE; | ||
| 296 | + docDataModel.curPageNo=parseInt(paramInfo.curPageNo)||1; | ||
| 297 | + if(docDataModel.curPageNo<1){ | ||
| 298 | + docDataModel.curPageNo=1;//默认值最小是1 | ||
| 299 | + } | ||
| 300 | + this.updaterDoc(docDataModel,docDataModel.itemIdx); | ||
| 301 | + } | ||
| 302 | + | ||
| 303 | + //缩放/滚动/显示模式 | ||
| 283 | documentCommand(paramInfo){ | 304 | documentCommand(paramInfo){ |
| 284 | - //console.log(this.docList); | ||
| 285 | //获取已经存在的数据 | 305 | //获取已经存在的数据 |
| 286 | let docDataModel= this.docList[paramInfo.itemIdx]; | 306 | let docDataModel= this.docList[paramInfo.itemIdx]; |
| 287 | - //console.log(docDataModelPdu); | ||
| 288 | - //console.log(docDataModel); | ||
| 289 | if(docDataModel==null){ | 307 | if(docDataModel==null){ |
| 290 | loger.log('documentCommand失败,文档不存在',paramInfo); | 308 | loger.log('documentCommand失败,文档不存在',paramInfo); |
| 291 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 309 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| @@ -293,7 +311,7 @@ class DocApe extends Ape { | @@ -293,7 +311,7 @@ class DocApe extends Ape { | ||
| 293 | } | 311 | } |
| 294 | //更新数据的字段 | 312 | //更新数据的字段 |
| 295 | docDataModel.action=ApeConsts.DOC_ACTION_COMMAND; | 313 | docDataModel.action=ApeConsts.DOC_ACTION_COMMAND; |
| 296 | - //docDataModel.scale=parseInt(paramInfo.scale)||100;//默认是100(百分比) | 314 | + docDataModel.showType=parseInt(paramInfo.showType)||0;//0;//完整显示;1;//按宽度显示;2;//按高度显示 |
| 297 | this.updaterDoc(docDataModel,docDataModel.itemIdx); | 315 | this.updaterDoc(docDataModel,docDataModel.itemIdx); |
| 298 | } | 316 | } |
| 299 | 317 | ||
| @@ -403,28 +421,6 @@ class DocApe extends Ape { | @@ -403,28 +421,6 @@ class DocApe extends Ape { | ||
| 403 | loger.log('tableUpdateHandler 数据无效--> itemIdx',itemIdx); | 421 | loger.log('tableUpdateHandler 数据无效--> itemIdx',itemIdx); |
| 404 | } | 422 | } |
| 405 | 423 | ||
| 406 | - | ||
| 407 | - /*try { | ||
| 408 | - const recordInfo = pdu['RCDocSendDataRequestPdu'].decode(itemData); | ||
| 409 | - recordInfo.type = ApeConsts.DOCUMENT_LOAD; | ||
| 410 | - | ||
| 411 | - recordInfo.ext = recordInfo.name.substr(recordInfo.name.indexOf('.') + 1); | ||
| 412 | - recordInfo.wbid = (recordInfo.id << 10) + recordInfo.curPageNo; | ||
| 413 | - recordInfo.isPicture = ~['bmp', 'png', 'gif', 'jpg', 'jpeg'].indexOf(recordInfo.ext); | ||
| 414 | - | ||
| 415 | - if (recordInfo.isPicture) { | ||
| 416 | - recordInfo.namePath = recordInfo.uri.substring(0, recordInfo.uri.lastIndexOf('.')); | ||
| 417 | - recordInfo.loadURL = recordInfo.namePath + '.' + recordInfo.ext; | ||
| 418 | - } else { | ||
| 419 | - recordInfo.namePath = recordInfo.uri.substring(0, recordInfo.uri.lastIndexOf('/')); | ||
| 420 | - recordInfo.loadURL = `${recordInfo.namePath}/${recordInfo.curPageNo}.jpg`; | ||
| 421 | - } | ||
| 422 | - this.docList[recordId] = recordInfo; | ||
| 423 | - this._emit(MessageTypes.DOC_UPDATE, recordInfo); | ||
| 424 | - loger.log('Doc update ->' + itemIdx); | ||
| 425 | - } catch (e) { | ||
| 426 | - loger.warn('Doc Table Update Decode包异常'); | ||
| 427 | - }*/ | ||
| 428 | } | 424 | } |
| 429 | onJoinChannelHandlerSuccess(){ | 425 | onJoinChannelHandlerSuccess(){ |
| 430 | loger.log(this._session_name + ' onJoinChannelHandlerSuccess==========================='); | 426 | loger.log(this._session_name + ' onJoinChannelHandlerSuccess==========================='); |
| @@ -488,6 +484,7 @@ class DocApe extends Ape { | @@ -488,6 +484,7 @@ class DocApe extends Ape { | ||
| 488 | optional string file_name=16;//文档的名字 | 484 | optional string file_name=16;//文档的名字 |
| 489 | optional string dynamic_TS=17;//"dynamicTransferStatic": "0" | 485 | optional string dynamic_TS=17;//"dynamicTransferStatic": "0" |
| 490 | optional string md5=18;//md5 | 486 | optional string md5=18;//md5 |
| 487 | + optional uint32 show_type=19;//显示模式 | ||
| 491 | }*/ | 488 | }*/ |
| 492 | 489 | ||
| 493 | //判断type类型,根据type设置不同的参数 | 490 | //判断type类型,根据type设置不同的参数 |
| @@ -510,6 +507,7 @@ class DocApe extends Ape { | @@ -510,6 +507,7 @@ class DocApe extends Ape { | ||
| 510 | docModelPdu.md5=_param.md5||"";//MD5 | 507 | docModelPdu.md5=_param.md5||"";//MD5 |
| 511 | docModelPdu.fileName=_param.fileName||"doc_"+_itemIdx;//文档的名字 | 508 | docModelPdu.fileName=_param.fileName||"doc_"+_itemIdx;//文档的名字 |
| 512 | docModelPdu.dynamicTS=_param.dynamicTS||"0";//文档上传后返回值中的字段dynamicTransferStatic | 509 | docModelPdu.dynamicTS=_param.dynamicTS||"0";//文档上传后返回值中的字段dynamicTransferStatic |
| 510 | + docModelPdu.showType=_param.showType||0;//文档显示模式 | ||
| 513 | loger.log(docModelPdu); | 511 | loger.log(docModelPdu); |
| 514 | return docModelPdu; | 512 | return docModelPdu; |
| 515 | } | 513 | } |
| @@ -523,7 +521,7 @@ class DocApe extends Ape { | @@ -523,7 +521,7 @@ class DocApe extends Ape { | ||
| 523 | 521 | ||
| 524 | try{ | 522 | try{ |
| 525 | let docModelPdu= pdu['RCDocSendDataModelPdu'].decode(itemData); | 523 | let docModelPdu= pdu['RCDocSendDataModelPdu'].decode(itemData); |
| 526 | - loger.log(docModelPdu); | 524 | + //loger.log(docModelPdu); |
| 527 | return docModelPdu; | 525 | return docModelPdu; |
| 528 | }catch (err){ | 526 | }catch (err){ |
| 529 | loger.log("文档收到数据 unPackPdu Pdu解析错误,itemIdx="+itemIdx+" err:"+err.message); | 527 | loger.log("文档收到数据 unPackPdu Pdu解析错误,itemIdx="+itemIdx+" err:"+err.message); |
| @@ -44,6 +44,7 @@ class MediaModule { | @@ -44,6 +44,7 @@ class MediaModule { | ||
| 44 | + port + "/live/" | 44 | + port + "/live/" |
| 45 | + _param.streamId; | 45 | + _param.streamId; |
| 46 | } | 46 | } |
| 47 | + path=path.replace("::",":");//如果ip和port之间有多的:需要去掉 | ||
| 47 | return {"code": ApeConsts.RETURN_SUCCESS, "data": "","playUrl": path}; | 48 | return {"code": ApeConsts.RETURN_SUCCESS, "data": "","playUrl": path}; |
| 48 | } | 49 | } |
| 49 | 50 | ||
| @@ -61,6 +62,8 @@ class MediaModule { | @@ -61,6 +62,8 @@ class MediaModule { | ||
| 61 | + port + "/live/" | 62 | + port + "/live/" |
| 62 | + _param.streamId | 63 | + _param.streamId |
| 63 | + "/total.m3u8"; | 64 | + "/total.m3u8"; |
| 65 | + | ||
| 66 | + path=path.replace("::",":");//如果ip和port之间有多的:需要去掉 | ||
| 64 | return {"code": ApeConsts.RETURN_SUCCESS, "data": "","playUrl": path}; | 67 | return {"code": ApeConsts.RETURN_SUCCESS, "data": "","playUrl": path}; |
| 65 | } | 68 | } |
| 66 | 69 | ||
| @@ -93,6 +96,7 @@ class MediaModule { | @@ -93,6 +96,7 @@ class MediaModule { | ||
| 93 | let publishUrl = "rtmp://" + GlobalConfig.MSServerIP | 96 | let publishUrl = "rtmp://" + GlobalConfig.MSServerIP |
| 94 | + port + "/"+pubType+"/" +streamId; | 97 | + port + "/"+pubType+"/" +streamId; |
| 95 | 98 | ||
| 99 | + publishUrl=publishUrl.replace("::",":");//如果ip和port之间有多的:需要去掉 | ||
| 96 | this.needPublishMediaChannel[publishUrl]={ | 100 | this.needPublishMediaChannel[publishUrl]={ |
| 97 | "channelId":freeChannel, | 101 | "channelId":freeChannel, |
| 98 | "publishUrl":publishUrl, | 102 | "publishUrl":publishUrl, |
| @@ -292,7 +292,6 @@ class VideoApe extends Ape { | @@ -292,7 +292,6 @@ class VideoApe extends Ape { | ||
| 292 | } | 292 | } |
| 293 | videoReceivePdu.data = this._rCArrayBufferUtil.uint8ArrayToStr(videoReceivePdu.data, 2);//开头两个字会乱码 | 293 | videoReceivePdu.data = this._rCArrayBufferUtil.uint8ArrayToStr(videoReceivePdu.data, 2);//开头两个字会乱码 |
| 294 | loger.log('视频控制消息处理 .',videoReceivePdu); | 294 | loger.log('视频控制消息处理 .',videoReceivePdu); |
| 295 | - loger.log(videoReceivePdu); | ||
| 296 | 295 | ||
| 297 | //判断接收者的id,如果不是0,并且也不是自己的nodeId,那么消息不做处理 | 296 | //判断接收者的id,如果不是0,并且也不是自己的nodeId,那么消息不做处理 |
| 298 | if (videoReceivePdu.toNodeId != 0 && videoReceivePdu.toNodeId != GlobalConfig.nodeId) { | 297 | if (videoReceivePdu.toNodeId != 0 && videoReceivePdu.toNodeId != GlobalConfig.nodeId) { |
| @@ -277,7 +277,7 @@ class WhiteBoardApe extends Ape { | @@ -277,7 +277,7 @@ class WhiteBoardApe extends Ape { | ||
| 277 | //文档更新,白板也要更新 | 277 | //文档更新,白板也要更新 |
| 278 | docUpdateHandler(_data) { | 278 | docUpdateHandler(_data) { |
| 279 | loger.log("白板收到文档更新的消息docUpdateHandler"); | 279 | loger.log("白板收到文档更新的消息docUpdateHandler"); |
| 280 | - loger.log(_data); | 280 | + //loger.log(_data); |
| 281 | 281 | ||
| 282 | //如果切换了文档或翻页,清除之前的添加步骤记录 | 282 | //如果切换了文档或翻页,清除之前的添加步骤记录 |
| 283 | if (_data.action == ApeConsts.DOC_ACTION_SWITCH_DOC || _data.action == ApeConsts.DOC_ACTION_SWITCH_PAGE) { | 283 | if (_data.action == ApeConsts.DOC_ACTION_SWITCH_DOC || _data.action == ApeConsts.DOC_ACTION_SWITCH_PAGE) { |
| @@ -324,7 +324,7 @@ class WhiteBoardApe extends Ape { | @@ -324,7 +324,7 @@ class WhiteBoardApe extends Ape { | ||
| 324 | annotaionItems.push(item); | 324 | annotaionItems.push(item); |
| 325 | loger.log("显示和文档对应的白板数据docUpdateHandler itemIdx:", item.itemIdx, "doc itemIdx:", GlobalConfig.activeDocId, "curPageNo:", GlobalConfig.activeDocCurPage); | 325 | loger.log("显示和文档对应的白板数据docUpdateHandler itemIdx:", item.itemIdx, "doc itemIdx:", GlobalConfig.activeDocId, "curPageNo:", GlobalConfig.activeDocCurPage); |
| 326 | } else { | 326 | } else { |
| 327 | - //loger.log("不显示白板数据docUpdateHandler",item); | 327 | + loger.log("不显示白板数据docUpdateHandler",item); |
| 328 | } | 328 | } |
| 329 | } | 329 | } |
| 330 | var updateObj = { | 330 | var updateObj = { |
| @@ -107,3 +107,4 @@ RCPduPackage.RCPDU_SEND_AUDIO_DATA_REQUEST = 502; | @@ -107,3 +107,4 @@ RCPduPackage.RCPDU_SEND_AUDIO_DATA_REQUEST = 502; | ||
| 107 | RCPduPackage.RCPDU_SEND_GIFT_DATA_REQUEST = 503; | 107 | RCPduPackage.RCPDU_SEND_GIFT_DATA_REQUEST = 503; |
| 108 | RCPduPackage.RCPDU_SEND_CHAT_DATA_REQUEST = 504; | 108 | RCPduPackage.RCPDU_SEND_CHAT_DATA_REQUEST = 504; |
| 109 | RCPduPackage.RCPDU_THIRD_BROADCAST_DATA_REQUEST = 505;//第三方广播消息 | 109 | RCPduPackage.RCPDU_THIRD_BROADCAST_DATA_REQUEST = 505;//第三方广播消息 |
| 110 | +RCPduPackage.RCPDU_SEND_DOC_BROADCAST_DATA_REQUEST = 506; |
| @@ -146,6 +146,7 @@ enum RCPduType_E { | @@ -146,6 +146,7 @@ enum RCPduType_E { | ||
| 146 | RCPDU_SEND_GIFT_DATA_REQUEST = 503; | 146 | RCPDU_SEND_GIFT_DATA_REQUEST = 503; |
| 147 | RCPDU_SEND_CHAT_DATA_REQUEST = 504; | 147 | RCPDU_SEND_CHAT_DATA_REQUEST = 504; |
| 148 | RCPDU_THIRD_BROADCAST_DATA_REQUEST = 505; | 148 | RCPDU_THIRD_BROADCAST_DATA_REQUEST = 505; |
| 149 | + RCPDU_SEND_DOC_BROADCAST_DATA_REQUEST = 506; | ||
| 149 | } | 150 | } |
| 150 | 151 | ||
| 151 | enum RCPduNodeType_E { | 152 | enum RCPduNodeType_E { |
| @@ -731,8 +732,17 @@ message RCDocSendDataModelPdu { | @@ -731,8 +732,17 @@ message RCDocSendDataModelPdu { | ||
| 731 | optional string file_name=16;//文档的名字 | 732 | optional string file_name=16;//文档的名字 |
| 732 | optional string dynamic_TS=17;//"dynamicTransferStatic": "0" | 733 | optional string dynamic_TS=17;//"dynamicTransferStatic": "0" |
| 733 | optional string md5=18;//md5 | 734 | optional string md5=18;//md5 |
| 735 | + optional uint32 show_type=19;//文档显示模式 | ||
| 734 | 736 | ||
| 735 | } | 737 | } |
| 738 | + | ||
| 739 | +message RCDocBroadcastDataRequestPdu { | ||
| 740 | + optional uint32 from_node_id = 1;//发起人 | ||
| 741 | + optional uint32 to_node_id = 2;//接收人,如果是0就是所有人都接收 | ||
| 742 | + optional uint32 actionType = 3;//消息指令类型; | ||
| 743 | + optional bytes data = 4;//其他数据,这个根据actionType来确定数据的结构 | ||
| 744 | +} | ||
| 745 | + | ||
| 736 | message RCGiftSendDataRequestPdu { | 746 | message RCGiftSendDataRequestPdu { |
| 737 | optional uint32 initiator = 1; | 747 | optional uint32 initiator = 1; |
| 738 | required uint32 peer = 2; | 748 | required uint32 peer = 2; |
-
请 注册 或 登录 后发表评论