天眼封禁properties空判断

back_recharge
mengchengzhen 2021-06-08 14:18:08 +08:00
parent 33cbd037da
commit bda5f6a970
1 changed files with 10 additions and 1 deletions

View File

@ -84,7 +84,10 @@ public class MessageUtil {
}
public static byte[] wrappedBufferSE(GeneratedMessage generatedMessage,SkyEyeProperties properties) {
int b1 = Integer.parseInt(properties.getAppId(),16);
int b1 = 0;
if(properties.getAppId() != null){
b1 = Integer.parseInt(properties.getAppId(),16);
}
byte[] idByte = short2byte((short) b1);
byte[] backMessage = generatedMessage.toByteArray();
byte[] verifyByte = new byte[2+4+backMessage.length];
@ -464,6 +467,9 @@ public class MessageUtil {
}
SkyEyeAutoConfigration netServerConfig = ConfigurableApplicationContextManager.getBean(SkyEyeAutoConfigration.class);
SkyEyeProperties properties = netServerConfig.getSkyEyeProperties();
if(properties == null){
return;
}
ChatProto.ChatV3.Builder v3 = buildChatV3(msg,me,he,channel,properties);
byte[] byteBuf = wrappedBufferSE(v3.build(),properties);
// session.writeAndFlush(byteBuf);
@ -488,6 +494,9 @@ public class MessageUtil {
v3.setIp(ip);
skyEyeExtraMap.clear();
String url = properties.getGmAddress();
if(url == null){
return v3;
}
skyEyeExtraMap.put("url",url);
v3.setExtra(JSON.toJSONString(skyEyeExtraMap));
return v3;