generated from root/miduo_server
开发提醒rpc
parent
c78e2b6e20
commit
e39a71fc50
|
@ -2,6 +2,7 @@ package com.jmfy.utils;
|
|||
|
||||
import com.jmfy.dao.ServerInfoDao;
|
||||
import com.jmfy.handler.DingTalkLogic;
|
||||
import com.jmfy.handler.GMHandler;
|
||||
import com.jmfy.model.AutoServerSetting;
|
||||
import com.jmfy.model.CServerOpenTime;
|
||||
import com.jmfy.model.ServerInfo;
|
||||
|
@ -146,9 +147,22 @@ 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 {
|
||||
// 发送rpc到游戏服
|
||||
Result result1 = RPCClient.sendCmd(Integer.parseInt(serverId), "serverstatus " + serverId);
|
||||
Result result1 = RPCClient.gmSend(" " + serverId,thriftIp,thriftPort);
|
||||
if (result1 == null) {
|
||||
// result1为空表示rpc发送失败,最多重复三次
|
||||
LOGGER.error("服务器验证状态异常,报null,第{}次重试",i+1);
|
||||
|
|
Loading…
Reference in New Issue