Merge branch 'project0.93'
commit
ae3e1e9a71
|
@ -17,6 +17,7 @@ import com.ljsd.jieling.logic.hero.HeroLogic;
|
|||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.thread.task.DataReportTask;
|
||||
import com.ljsd.jieling.thrift.idl.InvalidOperException;
|
||||
import com.ljsd.jieling.thrift.idl.RPCRequestGMIFace;
|
||||
import com.ljsd.jieling.thrift.idl.Result;
|
||||
|
@ -24,11 +25,13 @@ import com.ljsd.jieling.util.*;
|
|||
import org.apache.thrift.TException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -44,6 +47,16 @@ public class GmService implements RPCRequestGMIFace.Iface {
|
|||
GmInterface obj;
|
||||
try {
|
||||
|
||||
if(cmd.contains("restartthread")){
|
||||
Field configurableApplicationContextField = GameApplication.class.getDeclaredField("configurableApplicationContext");
|
||||
configurableApplicationContextField.setAccessible(true);
|
||||
ConfigurableApplicationContext configurableApplicationContext =(ConfigurableApplicationContext) configurableApplicationContextField.get(GameApplication.class);
|
||||
DataReportTask bean = configurableApplicationContext.getBean(DataReportTask.class);
|
||||
bean.start();
|
||||
result.setResultCode(1);
|
||||
return result;
|
||||
}
|
||||
|
||||
if(cmd.contains("hotfix")){
|
||||
List<User> usersInDB = MongoUtil.getLjsdMongoTemplate().findAll("user", User.class);
|
||||
List<Integer> sendIds = new ArrayList<>(usersInDB.size());
|
||||
|
@ -70,6 +83,7 @@ public class GmService implements RPCRequestGMIFace.Iface {
|
|||
|
||||
} catch (Exception ex) {
|
||||
result.setResultMsg("Cmd Illegal");
|
||||
ex.printStackTrace();
|
||||
return result;
|
||||
}
|
||||
try {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.ljsd.jieling.config.reportData;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.FieldAttributes;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.common.mogodb.util.BlockingUniqueQueue;
|
||||
import com.ljsd.jieling.config.json.SDK37Constans;
|
||||
|
@ -40,6 +42,7 @@ public class DataMessageUtils {
|
|||
}
|
||||
|
||||
public static void manageData() {
|
||||
try {
|
||||
List<Object> sendDataList = new ArrayList<>(10);
|
||||
logQueue.drainTo(sendDataList, 10);
|
||||
|
||||
|
@ -47,6 +50,21 @@ public class DataMessageUtils {
|
|||
logQueue_37.drainTo(sendData37List, 10);
|
||||
|
||||
if (!sendDataList.isEmpty()) {
|
||||
class ExclusionStrategy implements com.google.gson.ExclusionStrategy{
|
||||
|
||||
@Override
|
||||
public boolean shouldSkipField(FieldAttributes fieldAttributes) {
|
||||
return "device_id_s".equals(fieldAttributes.getName()) && "ParamEnvironmentBean".equals(fieldAttributes.getDeclaringClass().getSimpleName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSkipClass(Class<?> aClass) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Gson gson = new GsonBuilder()
|
||||
.setExclusionStrategies(new ExclusionStrategy()) // <---
|
||||
.create();
|
||||
KTSendBody sendBody = new KTSendBody(sendDataList);
|
||||
HttpPool.sendPost(sendUrl, gson.toJson(sendBody));
|
||||
}
|
||||
|
@ -81,6 +99,9 @@ public class DataMessageUtils {
|
|||
}
|
||||
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
public static JSONObject immediateSendPost(Object info){
|
||||
|
|
Loading…
Reference in New Issue