1.课堂初始化接口增加是否延迟接收消息的字段
2.sass接口中增加延迟消息的时间长度的字段,单位是秒 3.APE默认所有模块都支持延迟消息 3.mcu增加延迟消息判断
正在显示
9 个修改的文件
包含
53 行增加
和
36 行删除
此 diff 太大无法显示。
| @@ -300,6 +300,9 @@ export default class MessageEntrance extends Emiter { | @@ -300,6 +300,9 @@ export default class MessageEntrance extends Emiter { | ||
| 300 | GlobalConfig.userId = _param.userId || "0"; | 300 | GlobalConfig.userId = _param.userId || "0"; |
| 301 | GlobalConfig.userName = _param.userName || ""; | 301 | GlobalConfig.userName = _param.userName || ""; |
| 302 | 302 | ||
| 303 | + //客户端决定是否延迟接收消息 | ||
| 304 | + GlobalConfig.messageDelay = _param.messageDelay || false; | ||
| 305 | + | ||
| 303 | //最长允许录制的时间 | 306 | //最长允许录制的时间 |
| 304 | if(_param.allowRecordMaxTime){ | 307 | if(_param.allowRecordMaxTime){ |
| 305 | GlobalConfig.allowRecordMaxTime=parseInt(_param.allowRecordMaxTime); | 308 | GlobalConfig.allowRecordMaxTime=parseInt(_param.allowRecordMaxTime); |
| @@ -412,7 +415,7 @@ export default class MessageEntrance extends Emiter { | @@ -412,7 +415,7 @@ export default class MessageEntrance extends Emiter { | ||
| 412 | // console.log(_data); | 415 | // console.log(_data); |
| 413 | //包含整个课堂最全的信息,储存数据 | 416 | //包含整个课堂最全的信息,储存数据 |
| 414 | if (_data) { | 417 | if (_data) { |
| 415 | - GlobalConfig.mcuDelay = _data.mcuDelay || 60;//mcu消息延迟,用于文档模块 | 418 | + GlobalConfig.mcuDelay = _data.h5Delay || 0;//mcu消息延迟的时间间隔,单位(秒),结合客户端传的messageDelay的值使用 |
| 416 | GlobalConfig.className = _data.meetingName || ""; | 419 | GlobalConfig.className = _data.meetingName || ""; |
| 417 | GlobalConfig.classBeginTime = _data.beginTime || ""; | 420 | GlobalConfig.classBeginTime = _data.beginTime || ""; |
| 418 | GlobalConfig.classEndTime = _data.endTime || ""; | 421 | GlobalConfig.classEndTime = _data.endTime || ""; |
| @@ -242,8 +242,10 @@ GlobalConfig.statusCode_4={"code":4,message:"未知状态"}; | @@ -242,8 +242,10 @@ GlobalConfig.statusCode_4={"code":4,message:"未知状态"}; | ||
| 242 | 242 | ||
| 243 | GlobalConfig.md5=""; | 243 | GlobalConfig.md5=""; |
| 244 | GlobalConfig.msType=1;//目前固定用这个 | 244 | GlobalConfig.msType=1;//目前固定用这个 |
| 245 | -GlobalConfig.mcuDelay=60;//默认的延迟时间 flash中使用的是3000毫秒 | ||
| 246 | -GlobalConfig.docDelay=1600;//文档模块加入成功之后延迟发送送成功的消息给主模块 | 245 | +GlobalConfig.messageDelay=false;//是否启用消息延迟 |
| 246 | +GlobalConfig.mcuDelay=0;//默认的延迟时间(单位-秒) | ||
| 247 | + | ||
| 248 | +GlobalConfig.docDelay=1600;//文档模块加入成功之后延迟发送送成功的消息给主模块(sdk内部使用) | ||
| 247 | GlobalConfig.portal="112.126.80.182:80";//Sass IP | 249 | GlobalConfig.portal="112.126.80.182:80";//Sass IP |
| 248 | 250 | ||
| 249 | //GlobalConfig.ip="112.126.80.182"; | 251 | //GlobalConfig.ip="112.126.80.182"; |
| @@ -201,7 +201,7 @@ class Sass extends Emiter { | @@ -201,7 +201,7 @@ class Sass extends Emiter { | ||
| 201 | 201 | ||
| 202 | // 获取课堂基本详情------------------------------------------------------------------------------------ | 202 | // 获取课堂基本详情------------------------------------------------------------------------------------ |
| 203 | getClassDetail() { | 203 | getClassDetail() { |
| 204 | - let url = `http://${confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${confInfo.classId}`; | 204 | + let url = `http://${GlobalConfig.portal}/3m/meeting/getClassH5.do?classNumber=${GlobalConfig.classId}`; |
| 205 | loger.log('获取Class详情.', url); | 205 | loger.log('获取Class详情.', url); |
| 206 | fetch(url, { | 206 | fetch(url, { |
| 207 | timeout: 5000 | 207 | timeout: 5000 |
| @@ -300,7 +300,7 @@ class Sass extends Emiter { | @@ -300,7 +300,7 @@ class Sass extends Emiter { | ||
| 300 | } | 300 | } |
| 301 | var timestamp = new Date().getTime(); | 301 | var timestamp = new Date().getTime(); |
| 302 | var authId = MD5(_param.docId + "" + _param.classId + "" + timestamp);// docId+classId+timestamp的字符串,转成MD5 | 302 | var authId = MD5(_param.docId + "" + _param.classId + "" + timestamp);// docId+classId+timestamp的字符串,转成MD5 |
| 303 | - let url = `http://${confInfo.portal}/3m/api/document/deleteRelation.do?docId=${_param.docId}&classId=${confInfo.classId}×tamp=${timestamp}&authId=${authId}`; | 303 | + let url = `http://${GlobalConfig.portal}/3m/api/document/deleteRelation.do?docId=${_param.docId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; |
| 304 | loger.log('sassDeleteDocument', url); | 304 | loger.log('sassDeleteDocument', url); |
| 305 | 305 | ||
| 306 | fetch(url, { | 306 | fetch(url, { |
| @@ -350,16 +350,16 @@ class Sass extends Emiter { | @@ -350,16 +350,16 @@ class Sass extends Emiter { | ||
| 350 | } | 350 | } |
| 351 | //{"classStatusInfo":classStatusInfo} | 351 | //{"classStatusInfo":classStatusInfo} |
| 352 | var timestamp = new Date().getTime(); | 352 | var timestamp = new Date().getTime(); |
| 353 | - var authId = MD5(confInfo.classId + "" + timestamp);// (classId+timestamp)的字符串,转成MD5 | 353 | + var authId = MD5(GlobalConfig.classId + "" + timestamp);// (classId+timestamp)的字符串,转成MD5 |
| 354 | let classStatusInfo = JSON.stringify(_param.classStatusInfo); | 354 | let classStatusInfo = JSON.stringify(_param.classStatusInfo); |
| 355 | - let url = `http://${confInfo.portal}/3m/api/meeting/saveInfo.do`; | 355 | + let url = `http://${GlobalConfig.portal}/3m/api/meeting/saveInfo.do`; |
| 356 | loger.log('saveClassStatusInfo', url); | 356 | loger.log('saveClassStatusInfo', url); |
| 357 | fetch(url, { | 357 | fetch(url, { |
| 358 | method: 'POST', | 358 | method: 'POST', |
| 359 | headers: { | 359 | headers: { |
| 360 | "Content-Type": "application/x-www-form-urlencoded" | 360 | "Content-Type": "application/x-www-form-urlencoded" |
| 361 | }, | 361 | }, |
| 362 | - body: `classId=${confInfo.classId}&info=${classStatusInfo}×tamp=${timestamp}&authId=${authId}`, | 362 | + body: `classId=${GlobalConfig.classId}&info=${classStatusInfo}×tamp=${timestamp}&authId=${authId}`, |
| 363 | timeout: 5000 | 363 | timeout: 5000 |
| 364 | }) | 364 | }) |
| 365 | .then(ret => { | 365 | .then(ret => { |
| @@ -416,7 +416,7 @@ class Sass extends Emiter { | @@ -416,7 +416,7 @@ class Sass extends Emiter { | ||
| 416 | 416 | ||
| 417 | let timestamp = new Date().getTime(); | 417 | let timestamp = new Date().getTime(); |
| 418 | let authId = MD5(key + siteID + meetingID + timestamp); | 418 | let authId = MD5(key + siteID + meetingID + timestamp); |
| 419 | - let url = `http://${confInfo.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(url, { |
| @@ -27,6 +27,8 @@ let speedTestPort = ':5555';//测速端口统一 | @@ -27,6 +27,8 @@ let speedTestPort = ':5555';//测速端口统一 | ||
| 27 | 27 | ||
| 28 | let checkMcuIpGroup =[];//储存MCU需要查询的ip数组 | 28 | let checkMcuIpGroup =[];//储存MCU需要查询的ip数组 |
| 29 | let checkMsIpGroup =[];//储存MCU需要查询的ip数组 | 29 | let checkMsIpGroup =[];//储存MCU需要查询的ip数组 |
| 30 | +const timeOutDelay=1000;//选点超时 | ||
| 31 | + | ||
| 30 | class ServerCheck extends Emiter { | 32 | class ServerCheck extends Emiter { |
| 31 | constructor() { | 33 | constructor() { |
| 32 | super(); | 34 | super(); |
| @@ -52,7 +54,7 @@ class ServerCheck extends Emiter { | @@ -52,7 +54,7 @@ class ServerCheck extends Emiter { | ||
| 52 | loger.log('获取IP信息 ', userIp, location); | 54 | loger.log('获取IP信息 ', userIp, location); |
| 53 | 55 | ||
| 54 | fetchJsonp(location, { | 56 | fetchJsonp(location, { |
| 55 | - timeout: 3000, | 57 | + timeout: timeOutDelay, |
| 56 | }).then(function (response) { | 58 | }).then(function (response) { |
| 57 | return response.json() | 59 | return response.json() |
| 58 | }).then(function (json) { | 60 | }).then(function (json) { |
| @@ -168,7 +170,7 @@ class ServerCheck extends Emiter { | @@ -168,7 +170,7 @@ class ServerCheck extends Emiter { | ||
| 168 | //loger.log('getBestMcuServer done -> ', fatest_ip_response); | 170 | //loger.log('getBestMcuServer done -> ', fatest_ip_response); |
| 169 | this._getBestMcuServerCallbackHandler(fatest_ip_response) | 171 | this._getBestMcuServerCallbackHandler(fatest_ip_response) |
| 170 | } | 172 | } |
| 171 | - }.bind(this), 3000); | 173 | + }.bind(this), timeOutDelay); |
| 172 | } | 174 | } |
| 173 | 175 | ||
| 174 | //获取最快的MS服务器地址,参数是一个ip数组 | 176 | //获取最快的MS服务器地址,参数是一个ip数组 |
| @@ -186,7 +188,7 @@ class ServerCheck extends Emiter { | @@ -186,7 +188,7 @@ class ServerCheck extends Emiter { | ||
| 186 | //loger.log('getBestMsServer done -> ', fatest_ip_response); | 188 | //loger.log('getBestMsServer done -> ', fatest_ip_response); |
| 187 | this._getBestMsServerCallbackHandler(fatest_ip_response); | 189 | this._getBestMsServerCallbackHandler(fatest_ip_response); |
| 188 | } | 190 | } |
| 189 | - }.bind(this), 3000); | 191 | + }.bind(this), timeOutDelay); |
| 190 | } | 192 | } |
| 191 | 193 | ||
| 192 | _getBestMcuServerCallbackHandler(_data) { | 194 | _getBestMcuServerCallbackHandler(_data) { |
| @@ -40,7 +40,7 @@ export default class Ape extends Emiter { | @@ -40,7 +40,7 @@ export default class Ape extends Emiter { | ||
| 40 | this._adapter_pdu = new pdu['RCAdapterPdu']; | 40 | this._adapter_pdu = new pdu['RCAdapterPdu']; |
| 41 | this._classInfo = null; | 41 | this._classInfo = null; |
| 42 | this._rCArrayBufferUtil = ArrayBufferUtil; | 42 | this._rCArrayBufferUtil = ArrayBufferUtil; |
| 43 | - this._apeDelayed = false; | 43 | + this._apeDelayed = true; |
| 44 | this._apeDelayedMsgs = []; | 44 | this._apeDelayedMsgs = []; |
| 45 | this._apeDelayedTimer = 0; | 45 | this._apeDelayedTimer = 0; |
| 46 | 46 | ||
| @@ -75,15 +75,17 @@ export default class Ape extends Emiter { | @@ -75,15 +75,17 @@ export default class Ape extends Emiter { | ||
| 75 | // 消息处理 | 75 | // 消息处理 |
| 76 | _pduMessageHandler(regBuffer,_seekTime) { | 76 | _pduMessageHandler(regBuffer,_seekTime) { |
| 77 | let seekTime=_seekTime||0;//这个只有在录制回放的时候才有 | 77 | let seekTime=_seekTime||0;//这个只有在录制回放的时候才有 |
| 78 | - //loger.log("RCPDU_REG_ADAPTER============seekTime",seekTime); | ||
| 79 | - if (this._apeDelayed) { | ||
| 80 | - // this._apeDelayedMsgs.push(regBuffer); | ||
| 81 | - // this._apeDelayedStart(); | 78 | + /* loger.warn('APE->收到消息处理->',GlobalConfig.mcuDelay,GlobalConfig.messageDelay); |
| 79 | + //延迟处理消息(3个条件--->ape允许延迟&&客户端设置需要延迟&&Sass设置的延迟时间大于0) | ||
| 80 | + if (this._apeDelayed&&GlobalConfig.messageDelay&&GlobalConfig.mcuDelay>0) { | ||
| 81 | + loger.warn('延迟处理消息->',GlobalConfig.mcuDelay); | ||
| 82 | setTimeout(() => { | 82 | setTimeout(() => { |
| 83 | this._pduRegAdapterHandler(regBuffer,seekTime); | 83 | this._pduRegAdapterHandler(regBuffer,seekTime); |
| 84 | - }, GlobalConfig.mcuDelay || 2000); | 84 | + }, GlobalConfig.mcuDelay*1000);//mcuDelay单位是秒,这里需要换算为毫秒 |
| 85 | return; | 85 | return; |
| 86 | } | 86 | } |
| 87 | +*/ | ||
| 88 | + //不延迟,立即处理 | ||
| 87 | this._pduRegAdapterHandler(regBuffer,seekTime); | 89 | this._pduRegAdapterHandler(regBuffer,seekTime); |
| 88 | } | 90 | } |
| 89 | 91 | ||
| @@ -164,7 +166,7 @@ export default class Ape extends Emiter { | @@ -164,7 +166,7 @@ export default class Ape extends Emiter { | ||
| 164 | let tableUpdateItems = tableUpdateData.items; | 166 | let tableUpdateItems = tableUpdateData.items; |
| 165 | let tableUpdateItemsLen = tableUpdateItems.length; | 167 | let tableUpdateItemsLen = tableUpdateItems.length; |
| 166 | //loger.log("RCRegistryTableUpdateItemPdu " + tableUpdateItemsLen); | 168 | //loger.log("RCRegistryTableUpdateItemPdu " + tableUpdateItemsLen); |
| 167 | - loger.log(tableUpdateData); | 169 | + //loger.log(tableUpdateData); |
| 168 | 170 | ||
| 169 | for (let i = 0; i < tableUpdateItemsLen; ++i) { | 171 | for (let i = 0; i < tableUpdateItemsLen; ++i) { |
| 170 | let tableItem = tableUpdateItems[i]; | 172 | let tableItem = tableUpdateItems[i]; |
| @@ -34,8 +34,6 @@ class DocApe extends Ape { | @@ -34,8 +34,6 @@ class DocApe extends Ape { | ||
| 34 | this.docList = {};//记录文档的数组this.docList[itemIdx]=itemIdx的数据 | 34 | this.docList = {};//记录文档的数组this.docList[itemIdx]=itemIdx的数据 |
| 35 | //this.activeDocItemIdx =0;//当前激活的文档itemIdx | 35 | //this.activeDocItemIdx =0;//当前激活的文档itemIdx |
| 36 | //this.activeDocCurPage=1;//当前激活的文档的当前页 | 36 | //this.activeDocCurPage=1;//当前激活的文档的当前页 |
| 37 | - // 延迟 | ||
| 38 | - this._apeDelayed = false; | ||
| 39 | 37 | ||
| 40 | // Ape Models | 38 | // Ape Models |
| 41 | this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer); | 39 | this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer); |
| @@ -43,8 +43,6 @@ class WhiteBoardApe extends Ape { | @@ -43,8 +43,6 @@ class WhiteBoardApe extends Ape { | ||
| 43 | this.annoInfos = {};//储存所有的标注数据 | 43 | this.annoInfos = {};//储存所有的标注数据 |
| 44 | this.insertHistory = [];//添加的白板记录,用于撤回操作 | 44 | this.insertHistory = [];//添加的白板记录,用于撤回操作 |
| 45 | // 白板延迟 | 45 | // 白板延迟 |
| 46 | - // this._apeDelayed = true; | ||
| 47 | - | ||
| 48 | //Ape Models | 46 | //Ape Models |
| 49 | this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer); | 47 | this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer); |
| 50 | this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.WHITEBOARD_OBJ_TABLE_ID, | 48 | this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.WHITEBOARD_OBJ_TABLE_ID, |
| @@ -35,21 +35,22 @@ class MCU extends Emiter { | @@ -35,21 +35,22 @@ class MCU extends Emiter { | ||
| 35 | _everSocketOpenHandler() { | 35 | _everSocketOpenHandler() { |
| 36 | this._sendJoinClassRequest(); | 36 | this._sendJoinClassRequest(); |
| 37 | } | 37 | } |
| 38 | + | ||
| 38 | // EverSocket连接断开 | 39 | // EverSocket连接断开 |
| 39 | _everSocketCloseHandler() { | 40 | _everSocketCloseHandler() { |
| 40 | GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_3); | 41 | GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_3); |
| 41 | - this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_SOCKET_DISCONNECT); | 42 | + this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_SOCKET_DISCONNECT); |
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | 45 | ||
| 45 | //MCU-发送加入课堂请求 | 46 | //MCU-发送加入课堂请求 |
| 46 | - _sendJoinClassRequest(){ | 47 | + _sendJoinClassRequest() { |
| 47 | //const classInfo = this.classInfo; | 48 | //const classInfo = this.classInfo; |
| 48 | loger.log('MCU-发送加入课堂请求.'); | 49 | loger.log('MCU-发送加入课堂请求.'); |
| 49 | loger.log(this.classInfo); | 50 | loger.log(this.classInfo); |
| 50 | var descriptorPdu = new pdu['RCConferenceDescriptorPdu']; | 51 | var descriptorPdu = new pdu['RCConferenceDescriptorPdu']; |
| 51 | descriptorPdu.id = this.classInfo.classId; | 52 | descriptorPdu.id = this.classInfo.classId; |
| 52 | - descriptorPdu.name = this.classInfo.className||""; | 53 | + descriptorPdu.name = this.classInfo.className || ""; |
| 53 | descriptorPdu.mode = 0; | 54 | descriptorPdu.mode = 0; |
| 54 | descriptorPdu.capacity = 1; | 55 | descriptorPdu.capacity = 1; |
| 55 | 56 | ||
| @@ -75,7 +76,7 @@ class MCU extends Emiter { | @@ -75,7 +76,7 @@ class MCU extends Emiter { | ||
| 75 | pduMsg.set("userId", this.classInfo.userId); | 76 | pduMsg.set("userId", this.classInfo.userId); |
| 76 | pduMsg.set("userName", Base64.fromByteArray(ArrayBufferUtil.strToUint8Array(this.classInfo.userName))); | 77 | pduMsg.set("userName", Base64.fromByteArray(ArrayBufferUtil.strToUint8Array(this.classInfo.userName))); |
| 77 | pduMsg.set("userRole", this.classInfo.userRole); | 78 | pduMsg.set("userRole", this.classInfo.userRole); |
| 78 | - pduMsg.set("deviceType",""+GlobalConfig.deviceType); | 79 | + pduMsg.set("deviceType", "" + GlobalConfig.deviceType); |
| 79 | pduMsg.set("data", joinRequestPdu.toArrayBuffer()); | 80 | pduMsg.set("data", joinRequestPdu.toArrayBuffer()); |
| 80 | 81 | ||
| 81 | this._everSocket.send(pduMsg.toArrayBuffer()); | 82 | this._everSocket.send(pduMsg.toArrayBuffer()); |
| @@ -93,7 +94,7 @@ class MCU extends Emiter { | @@ -93,7 +94,7 @@ class MCU extends Emiter { | ||
| 93 | //加入课堂请求返回数据处理 | 94 | //加入课堂请求返回数据处理 |
| 94 | let joinConfPdu = pdu['RCConferenceJoinResponsePdu'].decode(pduData); | 95 | let joinConfPdu = pdu['RCConferenceJoinResponsePdu'].decode(pduData); |
| 95 | let pduResultCode = joinConfPdu.result; | 96 | let pduResultCode = joinConfPdu.result; |
| 96 | - loger.warn( 'RCPDU_CONNECT_PROVIDER_RESPONSE ->pduResultCode:'+pduResultCode); | 97 | + loger.warn('RCPDU_CONNECT_PROVIDER_RESPONSE ->pduResultCode:' + pduResultCode); |
| 97 | switch (pduResultCode) { | 98 | switch (pduResultCode) { |
| 98 | case PduConsts.RET_SUCCESS: | 99 | case PduConsts.RET_SUCCESS: |
| 99 | //加入成功 | 100 | //加入成功 |
| @@ -101,7 +102,7 @@ class MCU extends Emiter { | @@ -101,7 +102,7 @@ class MCU extends Emiter { | ||
| 101 | this._emit(MessageTypes.CLASS_JOIN_MCU_SUCCESS, this.classInfo); | 102 | this._emit(MessageTypes.CLASS_JOIN_MCU_SUCCESS, this.classInfo); |
| 102 | break; | 103 | break; |
| 103 | case PduConsts.RET_FULL_CAPACITY: | 104 | case PduConsts.RET_FULL_CAPACITY: |
| 104 | - this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_CLASS_JOIN_FULL); | 105 | + this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_CLASS_JOIN_FULL); |
| 105 | //this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERR_CLASS_JOIN_FULL); | 106 | //this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERR_CLASS_JOIN_FULL); |
| 106 | //this._emit(MessageTypes.CLASS_JOIN_FULL); | 107 | //this._emit(MessageTypes.CLASS_JOIN_FULL); |
| 107 | break; | 108 | break; |
| @@ -117,7 +118,18 @@ class MCU extends Emiter { | @@ -117,7 +118,18 @@ class MCU extends Emiter { | ||
| 117 | if (ape) { | 118 | if (ape) { |
| 118 | let subTypeLabel = pdu.id2type(pduMsg.subType); | 119 | let subTypeLabel = pdu.id2type(pduMsg.subType); |
| 119 | //loger.log('MCU-SecondLayer封装消息', 'sessionId', sessionLabel, pduMsg.sessionId, 'subtype', subTypeLabel, pduMsg.subType); | 120 | //loger.log('MCU-SecondLayer封装消息', 'sessionId', sessionLabel, pduMsg.sessionId, 'subtype', subTypeLabel, pduMsg.subType); |
| 120 | - //ape广播事件,只要ape中监听就能收到 | 121 | + |
| 122 | + loger.warn('MCU->收到消息处理->', GlobalConfig.mcuDelay, GlobalConfig.messageDelay); | ||
| 123 | + //延迟处理消息(3个条件--->ape允许延迟&&客户端设置需要延迟&&Sass设置的延迟时间大于0) | ||
| 124 | + if (ape._apeDelayed && GlobalConfig.messageDelay && GlobalConfig.mcuDelay > 0) { | ||
| 125 | + loger.warn('延迟处理消息->', GlobalConfig.mcuDelay); | ||
| 126 | + setTimeout(() => { | ||
| 127 | + //this._pduRegAdapterHandler(regBuffer, seekTime); | ||
| 128 | + ape._emit(pduMsg.subType, pduMsg.data); | ||
| 129 | + }, GlobalConfig.mcuDelay * 1000);//mcuDelay单位是秒, | ||
| 130 | + // 这里需要换算为毫秒 | ||
| 131 | + return; | ||
| 132 | + } | ||
| 121 | ape._emit(pduMsg.subType, pduMsg.data); | 133 | ape._emit(pduMsg.subType, pduMsg.data); |
| 122 | } else { | 134 | } else { |
| 123 | loger.warn(sessionLabel + '尚未注册'); | 135 | loger.warn(sessionLabel + '尚未注册'); |
| @@ -153,7 +165,7 @@ class MCU extends Emiter { | @@ -153,7 +165,7 @@ class MCU extends Emiter { | ||
| 153 | this._everSocket.send(msg.toArrayBuffer()); | 165 | this._everSocket.send(msg.toArrayBuffer()); |
| 154 | } else { | 166 | } else { |
| 155 | loger.log('MCU-发送课堂数据失败,MCU底层通道不可用'); | 167 | loger.log('MCU-发送课堂数据失败,MCU底层通道不可用'); |
| 156 | - this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_SOCKET_DISCONNECT); | 168 | + this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_SOCKET_DISCONNECT); |
| 157 | } | 169 | } |
| 158 | } | 170 | } |
| 159 | 171 | ||
| @@ -174,19 +186,19 @@ class MCU extends Emiter { | @@ -174,19 +186,19 @@ class MCU extends Emiter { | ||
| 174 | _classInfo.classId = parseInt(_classInfo.classId); // classId 必须整形 | 186 | _classInfo.classId = parseInt(_classInfo.classId); // classId 必须整形 |
| 175 | this.classInfo = _classInfo; | 187 | this.classInfo = _classInfo; |
| 176 | // 创建刷新nodeId | 188 | // 创建刷新nodeId |
| 177 | - this.classInfo.nodeId =EngineUtils.creatSoleNumberFromTimestamp(); | ||
| 178 | - GlobalConfig.nodeId=this.classInfo.nodeId;//这是标识自己身份的id | 189 | + this.classInfo.nodeId = EngineUtils.creatSoleNumberFromTimestamp(); |
| 190 | + GlobalConfig.nodeId = this.classInfo.nodeId;//这是标识自己身份的id | ||
| 179 | 191 | ||
| 180 | let nodeInfoRecordPdu = new pdu['RCNodeInfoRecordPdu']; | 192 | let nodeInfoRecordPdu = new pdu['RCNodeInfoRecordPdu']; |
| 181 | nodeInfoRecordPdu.name = this.classInfo.userName; | 193 | nodeInfoRecordPdu.name = this.classInfo.userName; |
| 182 | nodeInfoRecordPdu.nodeId = this.classInfo.nodeId; | 194 | nodeInfoRecordPdu.nodeId = this.classInfo.nodeId; |
| 183 | nodeInfoRecordPdu.userId = this.classInfo.userId; | 195 | nodeInfoRecordPdu.userId = this.classInfo.userId; |
| 184 | - nodeInfoRecordPdu.role = ApeConsts.userTypesToId[this.classInfo.userRole]||1; //NR_NORMAL用户的身份,根据用户登录时的身份设置 | 196 | + nodeInfoRecordPdu.role = ApeConsts.userTypesToId[this.classInfo.userRole] || 1; //NR_NORMAL用户的身份,根据用户登录时的身份设置 |
| 185 | nodeInfoRecordPdu.level = 0; | 197 | nodeInfoRecordPdu.level = 0; |
| 186 | 198 | ||
| 187 | let conferenceRecord = {}; //RCConferenceRecord_T | 199 | let conferenceRecord = {}; //RCConferenceRecord_T |
| 188 | conferenceRecord._conference_id = this.classInfo.classId; | 200 | conferenceRecord._conference_id = this.classInfo.classId; |
| 189 | - conferenceRecord._top_node_id =this.classInfo.topNodeID; | 201 | + conferenceRecord._top_node_id = this.classInfo.topNodeID; |
| 190 | 202 | ||
| 191 | this.mcuClassInfo = {}; //RCMeetingInfo_T | 203 | this.mcuClassInfo = {}; //RCMeetingInfo_T |
| 192 | this.mcuClassInfo.self = nodeInfoRecordPdu; | 204 | this.mcuClassInfo.self = nodeInfoRecordPdu; |
| @@ -196,7 +208,7 @@ class MCU extends Emiter { | @@ -196,7 +208,7 @@ class MCU extends Emiter { | ||
| 196 | this.classInfo.mcuClassInfo = this.mcuClassInfo; | 208 | this.classInfo.mcuClassInfo = this.mcuClassInfo; |
| 197 | 209 | ||
| 198 | //开启EverSocket | 210 | //开启EverSocket |
| 199 | - this._everSocket.begin(this.classInfo.MCUServerIP,this.classInfo.MCUServerPort); | 211 | + this._everSocket.begin(this.classInfo.MCUServerIP, this.classInfo.MCUServerPort); |
| 200 | } | 212 | } |
| 201 | } | 213 | } |
| 202 | 214 |
-
请 注册 或 登录 后发表评论