generated from root/miduo_server
master
parent
b430d49ac0
commit
e532d7f5eb
|
|
@ -369,7 +369,7 @@ public class ServerInfoController {
|
|||
exec.destroy();
|
||||
}
|
||||
}
|
||||
LOGGER.error("检测游戏端口耗时:{}",DateUtil.now()-start);
|
||||
LOGGER.info("检测游戏端口耗时:{}",DateUtil.now()-start);
|
||||
}
|
||||
|
||||
private String getPayPort(String gamePort){
|
||||
|
|
@ -382,23 +382,23 @@ public class ServerInfoController {
|
|||
* @param port
|
||||
* @return
|
||||
*/
|
||||
private boolean checkPort(List<String> strings, String port){
|
||||
LOGGER.error("页面输出===============");
|
||||
strings.forEach(System.out::println);
|
||||
private boolean checkPort(List<String> strings, String port, String limitPort){
|
||||
// 1,第一行日志无用,所以删除
|
||||
strings.remove(0);
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
for (String string : strings) {
|
||||
// 2,用【tab】分割
|
||||
String[] split = string.split("\t");
|
||||
// 3,用【:】号分割
|
||||
String[] split1 = split[3].split(":");
|
||||
// 4,取最后一位,是端口号
|
||||
String s = split1[split1.length - 1];
|
||||
list.add(s);
|
||||
// 2,用【 】分割
|
||||
String[] split = string.split(" ");
|
||||
for (String str1 : split) {
|
||||
if (str1.contains(limitPort)){
|
||||
// 3,用【:】分割
|
||||
String[] str2 = str1.split(":");
|
||||
// 4,取最后一位,是端口号
|
||||
String s = str2[str2.length - 1];
|
||||
list.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("结果==================");
|
||||
list.forEach(System.out::println);
|
||||
return list.contains(port);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue