|
@@ -155,7 +155,22 @@
|
|
|
|
|
|
webrtcServerModel*preBestModel = ksharedAppDelegate.bestWebrtcServerModel;
|
|
webrtcServerModel*preBestModel = ksharedAppDelegate.bestWebrtcServerModel;
|
|
|
|
|
|
|
|
+ //判断原来最佳机房是否还在线
|
|
|
|
+ BOOL isBestOnLinnType = NO;
|
|
NSArray<webrtcServerModel>* webrtcServerList = ksharedAppDelegate.DeviceWebRtcMsgMod.data.webrtcServerList;
|
|
NSArray<webrtcServerModel>* webrtcServerList = ksharedAppDelegate.DeviceWebRtcMsgMod.data.webrtcServerList;
|
|
|
|
+
|
|
|
|
+ for (webrtcServerModel*model in webrtcServerList) {
|
|
|
|
+ if ([model.turnIp isEqualToString:preBestModel.turnIp]) {
|
|
|
|
+ isBestOnLinnType = YES;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!isBestOnLinnType) {
|
|
|
|
+ ksharedAppDelegate.bestWebrtcServerModel = webrtcServerList.firstObject;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
if (!webrtcServerList || webrtcServerList.count > pingRoomIndex) {
|
|
if (!webrtcServerList || webrtcServerList.count > pingRoomIndex) {
|
|
webrtcServerModel *model = webrtcServerList[pingRoomIndex];
|
|
webrtcServerModel *model = webrtcServerList[pingRoomIndex];
|
|
model.delayedms = averageDelayedms;
|
|
model.delayedms = averageDelayedms;
|