generated from root/miduo_server
天眼密匙走配置
parent
751d044a06
commit
498eb58884
|
|
@ -14,6 +14,7 @@ import com.jmfy.redisProperties.RedisUserKey;
|
||||||
import com.jmfy.utils.*;
|
import com.jmfy.utils.*;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -39,6 +40,8 @@ public class GameTitleController {
|
||||||
private ServerInfoDao serverInfoDao;
|
private ServerInfoDao serverInfoDao;
|
||||||
@Resource
|
@Resource
|
||||||
private UserBannedDao userBannedDao;
|
private UserBannedDao userBannedDao;
|
||||||
|
@Value("${skyeye.privatekey}")
|
||||||
|
private String privateKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 前往封禁页面
|
* 前往封禁页面
|
||||||
|
|
@ -181,7 +184,7 @@ public class GameTitleController {
|
||||||
String skyEye(HttpServletRequest request,HttpSession session){
|
String skyEye(HttpServletRequest request,HttpSession session){
|
||||||
Map<String,String> map = new HashMap<>();
|
Map<String,String> map = new HashMap<>();
|
||||||
map.put("code","1");
|
map.put("code","1");
|
||||||
if(!verify(request,map)){
|
if(!verify(request,map,privateKey)){
|
||||||
map.put("message","verify");
|
map.put("message","verify");
|
||||||
return JSON.toJSONString(map);
|
return JSON.toJSONString(map);
|
||||||
}
|
}
|
||||||
|
|
@ -201,7 +204,7 @@ public class GameTitleController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean verify(HttpServletRequest request,Map<String,String> map)
|
private boolean verify(HttpServletRequest request,Map<String,String> map,String secretKey)
|
||||||
{
|
{
|
||||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||||
String playerId = parameterMap.get("playerId");
|
String playerId = parameterMap.get("playerId");
|
||||||
|
|
@ -212,7 +215,6 @@ public class GameTitleController {
|
||||||
String time = parameterMap.get("time");
|
String time = parameterMap.get("time");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String secretKey = "3dcbb03682d80fea5ee3ead074aebba7";
|
|
||||||
byte[] bytes = (secretKey + playerId + userId + zoneId + serverId + time).getBytes("UTF-8"); // 输出其utf-8的bytes
|
byte[] bytes = (secretKey + playerId + userId + zoneId + serverId + time).getBytes("UTF-8"); // 输出其utf-8的bytes
|
||||||
|
|
||||||
java.security.MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
|
java.security.MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
|
||||||
|
|
@ -222,6 +224,7 @@ public class GameTitleController {
|
||||||
BigInteger bigInt = new BigInteger(1, md5sum);
|
BigInteger bigInt = new BigInteger(1, md5sum);
|
||||||
String newsign = String.format("%032X", bigInt).toLowerCase();
|
String newsign = String.format("%032X", bigInt).toLowerCase();
|
||||||
map.put("message","sign:"+sign+" newSign:"+newsign);
|
map.put("message","sign:"+sign+" newSign:"+newsign);
|
||||||
|
LOGGER.info("message,sign=>{},new sign=>{}",sign,newsign);
|
||||||
return newsign.equalsIgnoreCase(sign); // MD5前面会补零
|
return newsign.equalsIgnoreCase(sign); // MD5前面会补零
|
||||||
|
|
||||||
} catch (NoSuchAlgorithmException | UnsupportedEncodingException e)
|
} catch (NoSuchAlgorithmException | UnsupportedEncodingException e)
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@ public class GMHandler extends BaseHandler {
|
||||||
LOGGER.error("Exception send err dsid=>{},uid=>{},cmd=>{}", coreUserInfo.getServerid(), userId, cmd);
|
LOGGER.error("Exception send err dsid=>{},uid=>{},cmd=>{}", coreUserInfo.getServerid(), userId, cmd);
|
||||||
}else {
|
}else {
|
||||||
// 封禁入库
|
// 封禁入库
|
||||||
|
LOGGER.info("封禁入库,serverid=>{},uid=>{}", zoneId, userId);
|
||||||
updateUserBanner(coreUserInfo,session,jsonBan);
|
updateUserBanner(coreUserInfo,session,jsonBan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,4 +35,6 @@ services.syspro.newtimelimit = 20-9
|
||||||
#开服临界值
|
#开服临界值
|
||||||
services.syspro.openlimit = 3000
|
services.syspro.openlimit = 3000
|
||||||
#新服标签注册人数
|
#新服标签注册人数
|
||||||
services.syspro.newday = 2000
|
services.syspro.newday = 2000
|
||||||
|
#天眼密匙
|
||||||
|
skyeye.privatekey = 45959f3e06be43a92c8908fa99d6f2b3
|
||||||
Loading…
Reference in New Issue