李勇

1.修改MCU的选点测速逻辑,如果测速失败,会从已有的列表中安顺序连接,不再随机选择

... ... @@ -58,7 +58,7 @@ export default class MessageEntrance extends Emiter {
constructor() {
super();
//sdk 信息
GlobalConfig.sdkVersion = "v1.74.0.20170814";
GlobalConfig.sdkVersion = "v1.75.0.20170815";
loger.warn("sdkVersion:" + GlobalConfig.sdkVersion);
//设置
... ... @@ -1117,11 +1117,30 @@ export default class MessageEntrance extends Emiter {
GlobalConfig.MCUServerIP = _data.ip || "";
GlobalConfig.MCUServerPort = _data.port || "";
} else {
//随机选择一个
if (GlobalConfig.mcuListFinal && GlobalConfig.mcuListFinal.length > 0) {
let index = parseInt(Math.random() * GlobalConfig.mcuListFinal.length);
GlobalConfig.MCUServerIP = GlobalConfig.mcuListFinal[index].ip || "";
GlobalConfig.MCUServerPort = GlobalConfig.mcuListFinal[index].port || "";
//如果当前没有设置过mcu的ip和端口随机选择一个
if(!GlobalConfig.MCUServerIP||GlobalConfig.mcuListFinal.length==1){
let index = parseInt(Math.random() * GlobalConfig.mcuListFinal.length);
GlobalConfig.MCUServerIP = GlobalConfig.mcuListFinal[index].ip || "";
GlobalConfig.MCUServerPort = GlobalConfig.mcuListFinal[index].port || "";
}else {
//当前mcu已经有值,需要选择一个新的
for(let i=0;i<GlobalConfig.mcuListFinal.length;i++){
if(GlobalConfig.MCUServerIP == GlobalConfig.mcuListFinal[i].ip){
//获取下一个MCU
let nextMcu= GlobalConfig.mcuListFinal[i+1];
if(!nextMcu){
//如果下一个mcu不存在就使用第一个
nextMcu=GlobalConfig.mcuListFinal[0];
}
if(nextMcu){
GlobalConfig.MCUServerIP = nextMcu.ip || "";
GlobalConfig.MCUServerPort = nextMcu.port || "";
}
break;
}
}
}
}
}
if (oldIp && oldIp != GlobalConfig.MCUServerIP) {
... ...
... ... @@ -814,7 +814,7 @@ class ConferApe extends Ape {
thirdMessage.toNodeID = thirdBroadcastReceivePdu.peer;
//loger.log("监听第三方消息通道消息->1", thirdMessage);
thirdMessage.message = this._rCArrayBufferUtil.uint8ArrayToStr(thirdBroadcastReceivePdu.message, 2);
loger.log("监听第三方消息通道消息->", thirdMessage);
loger.log("收到第三方消息通道消息->", thirdMessage);
this._emit(MessageTypes.RECEIVE_THIRD_MESSGAE, thirdMessage);
if (this.thirdMessage) {
this.thirdMessage.sendMessageToParent(thirdMessage.message);
... ...