back_recharge
lvxinran 2019-07-03 11:41:03 +08:00
commit 5cf515aa1a
2 changed files with 39 additions and 15 deletions

View File

@ -109,14 +109,14 @@ public class HandlerLogicThread extends Thread{
}
if(msgId != MessageTypeProto.MessageType.GET_CHAT_MESSAGE_REQUEST_VALUE){
LOGGER.info("doWork->uid={},mType={};start", userId, MessageTypeProto.MessageType.valueOf(msgId));
// LOGGER.info("doWork->uid={},mType={};start", userId, MessageTypeProto.MessageType.valueOf(msgId));
}
MissionEventDistributor.requestStart();
baseHandler.execute(session, packetNetData);
MissionEventDistributor.requestEnd(session,true);
if(msgId != MessageTypeProto.MessageType.GET_CHAT_MESSAGE_REQUEST_VALUE){
LOGGER.info("doWork->uid={},mType={};end", userId, MessageTypeProto.MessageType.valueOf(msgId));
// LOGGER.info("doWork->uid={},mType={};end", userId, MessageTypeProto.MessageType.valueOf(msgId));
}
MongoUtil.getInstence().lastUpdate();

View File

@ -124,10 +124,34 @@ public class ProtocolsManager implements ProtocolsAbstract {
}
final ISession session = (ISession) gameSession;
PacketNetData packetNetData = new PacketNetData((byte[]) obj);
// int msgId = packetNetData.getMsgId();
int msgId = packetNetData.getMsgId();
LOGGER.info("uid={},msgId={},index={}",packetNetData.getUserId(),msgId,packetNetData.getIndex());
// MessageTypeProto.MessageType messageType = MessageTypeProto.MessageType.valueOf(msgId);
// FileWriter fw = null;
// if (!gameMessageForLogin.containsKey(messageType)){
// gameMessageForLogin.put(messageType,messageType + "=" + gson.toJson(obj));
// try {
// fw = new FileWriter("tmp/1.txt",true);
// fw.write(messageType + "=" + gson.toJson(obj));
// fw.write("\r\n");
// fw.flush();
// } catch (IOException e) {
// e.printStackTrace();
// try {
// fw.close();
// } catch (IOException e1) {
// e1.printStackTrace();
// }
// }
// }
// if (packetNetData.getMsgId() ==MessageTypeProto.MessageType.GET_FRIEND_INFO_REQUEST_VALUE ){
// try {
// if (fw != null){
// fw.close();
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
if (packetNetData.getMsgId()==1000){
dealHeartBeat(session);
@ -272,18 +296,18 @@ public class ProtocolsManager implements ProtocolsAbstract {
ISession session = (ISession) gameSession;
synchronized (session) {
//输出日志
// PrintStream ps= null;
// try {
// ps = new PrintStream("tmp/game.txt");
// Map<MessageTypeProto.MessageType, String> gameMessageForLogin = ProtocolsManager.gameMessageForLogin;
// for (Map.Entry<MessageTypeProto.MessageType, String> entry :gameMessageForLogin.entrySet()){
// String value = entry.getValue();
// ps.println(value);
// }
// ps.close();
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// }
PrintStream ps= null;
try {
ps = new PrintStream("tmp/game.txt");
Map<MessageTypeProto.MessageType, String> gameMessageForLogin = ProtocolsManager.gameMessageForLogin;
for (Map.Entry<MessageTypeProto.MessageType, String> entry :gameMessageForLogin.entrySet()){
String value = entry.getValue();
ps.println(value);
}
ps.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
User user = UserManager.getUserInMem(session.getUid());
int roomId = user.getRoomInfo().getRoomId();
if(roomId!=-1){