generated from root/miduo_server
代码简化
parent
f8b395df43
commit
43cb649ab7
|
|
@ -147,24 +147,12 @@ public class AutoServerManager {
|
|||
String cont;
|
||||
try {
|
||||
int i = 0;
|
||||
// rpc信息获取
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, serverId, String.class, -1);
|
||||
if (null == rpcString || rpcString.split(":").length < 2) {
|
||||
LOGGER.error("服务器验证状态异常, 获取rpc参数报错:serverId:{}", serverId);
|
||||
return false;
|
||||
}
|
||||
String content = GMHandler.getCmdContent("serverstatus", serverId);
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[1];
|
||||
if (StringUtil.isEmpty(content) || StringUtil.isEmpty(thriftIp) || StringUtil.isEmpty(thriftPort)) {
|
||||
LOGGER.error("服务器验证状态异常, rpc参数存在空值:content:{},thriftIp:{},thriftPort:{}",content,thriftIp,thriftPort);
|
||||
return false;
|
||||
}
|
||||
do {
|
||||
// 间隔30秒再获取开服数据
|
||||
Thread.sleep(DateUtil.ONE_SECOND * 30);
|
||||
// 发送rpc到游戏服
|
||||
Result result1 = RPCClient.gmSend(content,thriftIp,thriftPort);
|
||||
Result result1 = RPCClient.sendCmd(Integer.parseInt(serverId),content);
|
||||
if (result1 == null) {
|
||||
// result1为空表示rpc发送失败,最多重复三次
|
||||
LOGGER.error("服务器验证状态异常,报null,第{}次重试",i+1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue