上报战斗修改
parent
0ae007f55f
commit
18b4fdfb9c
|
@ -37,10 +37,7 @@ import util.MathUtils;
|
||||||
import util.StringUtil;
|
import util.StringUtil;
|
||||||
import util.TimeUtils;
|
import util.TimeUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.*;
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
@ -62,17 +59,32 @@ public class GMRequestHandler extends BaseHandler{
|
||||||
String command = gmCommand.getCommand();
|
String command = gmCommand.getCommand();
|
||||||
int uid = iSession.getUid();
|
int uid = iSession.getUid();
|
||||||
LOGGER.error("gm commond is {}",command);
|
LOGGER.error("gm commond is {}",command);
|
||||||
if(command.startsWith("//check_fight")){
|
// if(command.startsWith("//check_fight")){
|
||||||
FIGHT_LOGGER.error(command);
|
// FIGHT_LOGGER.error(command);
|
||||||
CommonProto.GmResponse.Builder gmBuilder = CommonProto.GmResponse.newBuilder();
|
// CommonProto.GmResponse.Builder gmBuilder = CommonProto.GmResponse.newBuilder();
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true);
|
// MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
if(command.startsWith("//check_fight")){
|
||||||
|
|
||||||
if(command.startsWith("//")){
|
|
||||||
PrintWriter printWriter = new PrintWriter(new FileOutputStream( new File(SysUtil.getPath("conf/check_fight" + uid + ".txt"))));
|
PrintWriter printWriter = new PrintWriter(new FileOutputStream( new File(SysUtil.getPath("conf/check_fight" + uid + ".txt"))));
|
||||||
|
//保存前端战斗数据
|
||||||
printWriter.print(command);
|
printWriter.print(command);
|
||||||
|
printWriter.print("\n");
|
||||||
|
//保存后端战斗数据
|
||||||
|
FileReader fileReader = new FileReader(SysUtil.getPath("luafight/BattleRecord/log-" + uid + ".txt"));
|
||||||
|
BufferedReader reader= new BufferedReader(fileReader);
|
||||||
|
String line = reader.readLine();
|
||||||
|
while(line!=null){
|
||||||
|
printWriter.print(line);
|
||||||
|
printWriter.print("\n");
|
||||||
|
|
||||||
|
line = reader.readLine();
|
||||||
|
}
|
||||||
printWriter.flush();
|
printWriter.flush();
|
||||||
|
fileReader.close();
|
||||||
|
reader.close();
|
||||||
printWriter.close();
|
printWriter.close();
|
||||||
CommonProto.GmResponse.Builder gmBuilder = CommonProto.GmResponse.newBuilder();
|
CommonProto.GmResponse.Builder gmBuilder = CommonProto.GmResponse.newBuilder();
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true);
|
||||||
|
|
Loading…
Reference in New Issue