Skip to content

Commit 76028cf

Browse files
committed
日志优化
1 parent df1fce6 commit 76028cf

File tree

2 files changed

+153
-6
lines changed

2 files changed

+153
-6
lines changed

src/main/java/com/huiwan/gdata/modules/gdata/combat/service/impl/CombatLogServiceImpl.java

+53-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class CombatLogServiceImpl implements CombatLogService {
4545
private IDictService dictService;
4646
@Autowired
4747
private IGameDictService gameDictService;
48-
48+
4949
/**
5050
* 通过时间获取分区表
5151
*
@@ -66,14 +66,13 @@ public static String getTable(String dt) {
6666
e.printStackTrace();
6767
}
6868
}
69-
String t = " zl_log_info" + table_suffix+" ";
69+
String t = " zl_log_info" + table_suffix + " ";
7070
return t;
7171
}
7272

7373
public static void main(String[] args) {
7474
System.out.println(getTable("2018-08-10 12:50:30"));
7575
}
76-
7776

7877
@Override
7978
public PaginatorResult getPaginatorList(Paginator paginator, QueryCommBean bean) {
@@ -156,7 +155,7 @@ public PaginatorResult getPaginatorList(Paginator paginator, QueryCommBean bean)
156155
// 转换文件名
157156
if (dicts.containsKey(log.getFile())) {
158157
log.setFileName(dicts.get(log.getFile()));
159-
}else{
158+
} else {
160159
log.setFileName(log.getFile());
161160
}
162161
// 转换服务器
@@ -216,7 +215,7 @@ public PaginatorResult getPaginatorList(Paginator paginator, QueryCommBean bean)
216215
String skill_name = zl_effect_type.get(key);
217216
jsonCont.put("effect_Prob", skill_name);
218217
} else {
219-
jsonCont.put("effect_Prob", key);
218+
jsonCont.put("effect_Prob", "末能翻译:" + key);
220219
}
221220
log.setCont(jsonCont.toJSONString());
222221
}
@@ -360,7 +359,7 @@ public PaginatorResult getPaginatorList(Paginator paginator, QueryCommBean bean)
360359
exotics_array.add(exotics_json);
361360
continue;
362361
}
363-
if("EXOTIC_RAND_ATTR".equals(exotics_Dict.getName())){//他才有属性
362+
if ("EXOTIC_RAND_ATTR".equals(exotics_Dict.getName())) {// 他才有属性
364363
String attrs_key = "A_" + exotics_Dict.getArg1();
365364
if (zl_attrs_types.containsKey(attrs_key)) {
366365
exotics_json.put("attr", zl_attrs_types.get(attrs_key).getName());
@@ -378,7 +377,55 @@ public PaginatorResult getPaginatorList(Paginator paginator, QueryCommBean bean)
378377
jsonCont.put("add_pass_passive_skill_type", add_pass_passive_skill_type.toJSONString());
379378
log.setCont(jsonCont.toJSONString());
380379
}
380+
// 独特属性转换
381+
if ("exotics_ids".equals(log.getFile())) {
382+
JSONObject jsonCont = (JSONObject) JSONObject.parse(log.getCont());
383+
if (!jsonCont.containsKey("exotics_ids")) {
384+
continue;
385+
}
386+
String exotics_ids = jsonCont.get("exotics_ids").toString();
387+
if (StringUtils.isBlank(exotics_ids)) {
388+
continue;
389+
}
390+
String[] ids = exotics_ids.replace("[", "").replace("]", "").split(",");
391+
JSONArray exotics_array = new JSONArray();
392+
393+
for (String id : ids) {
394+
JSONObject jsonCont_new = new JSONObject();
395+
if (!zl_exotics_type.containsKey(id)) {
396+
jsonCont_new.put("msg", "配置表末能找到对应的id_" + id);
397+
exotics_array.add(jsonCont_new);
398+
continue;
399+
}
400+
Dict exotics_Dict = zl_exotics_type.get(id);
401+
// 独特属性
402+
jsonCont_new.put("id", exotics_Dict.getValue());
403+
jsonCont_new.put("type", exotics_Dict.getName());
404+
jsonCont_new.put("arg2", exotics_Dict.getArg2());
405+
jsonCont_new.put("arg3", exotics_Dict.getArg3());
406+
// 接着翻译
407+
if (StringUtils.isBlank(exotics_Dict.getArg1())) {
408+
jsonCont_new.put("attr", "空");
409+
exotics_array.add(jsonCont_new);
410+
continue;
411+
}
412+
if ("EXOTIC_RAND_ATTR".equals(exotics_Dict.getName())) {// 他才有属性
413+
String attrs_key = "A_" + exotics_Dict.getArg1();
414+
if (zl_attrs_types.containsKey(attrs_key)) {
415+
jsonCont_new.put("attr", zl_attrs_types.get(attrs_key).getName());
416+
} else {
417+
jsonCont_new.put("属性:配置表末能翻译-", attrs_key);
418+
}
419+
}
381420

421+
exotics_array.add(jsonCont_new);
422+
}
423+
424+
JSONObject add_pass_passive_skill_type = new JSONObject();
425+
add_pass_passive_skill_type.put("pass_list", exotics_array);
426+
jsonCont.put("add_pass_passive_skill_type", add_pass_passive_skill_type.toJSONString());
427+
log.setCont(jsonCont.toJSONString());
428+
}
382429
}
383430

384431
// for (CombatLog log : data) {

src/main/webapp/views/modules/gdata/combat/combatLog.html

+100
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,34 @@ <h4 class="modal-title" id="openAttrsDivModalLabel">对象基础属性</h4>
940940
_table_html+=obj_JSON.en_steal;
941941
_table_html+="</td>";
942942
}
943+
if("hit_type" in obj_JSON){
944+
_table_html+="<td>伤害类型:";
945+
var hit_v=obj_JSON.hit_type;
946+
if(hit_v=="1"){
947+
hit_v="招架";
948+
}
949+
if(hit_v=="2"){
950+
hit_v="暴击";
951+
}
952+
if(hit_v=="4"){
953+
hit_v="闪避";
954+
}
955+
if(hit_v=="8"){
956+
hit_v="生命偷取";
957+
}
958+
if(hit_v=="16"){
959+
hit_v="能量偷取";
960+
}
961+
if(hit_v=="32"){
962+
hit_v="伤害反弹";
963+
}
964+
if(hit_v=="64"){
965+
hit_v="伤害吸收";
966+
}
967+
_table_html+=hit_v;
968+
_table_html+="</td>";
969+
}
970+
943971
_table_html+="</tr>";
944972
_table_html+="</table>";
945973
return _table_html;
@@ -1018,6 +1046,77 @@ <h4 class="modal-title" id="openAttrsDivModalLabel">对象基础属性</h4>
10181046
_pass_table_html+="</td>";
10191047
}
10201048

1049+
// if(_pass_obj_JSON_v.hasOwnProperty("attr")){
1050+
// _pass_table_html+="<td>属性:";
1051+
// _pass_table_html+=_pass_obj_JSON_v.attr;
1052+
// _pass_table_html+="</td>";
1053+
// }else{
1054+
// _pass_table_html+="<td>属性:无";
1055+
// _pass_table_html+="</td>";
1056+
// }
1057+
// if(_pass_obj_JSON_v.hasOwnProperty("type")){
1058+
// _pass_table_html+="<td>效果type:";
1059+
// _pass_table_html+=_pass_obj_JSON_v.type;
1060+
// _pass_table_html+="</td>";
1061+
// }
1062+
1063+
// if(_pass_obj_JSON_v.hasOwnProperty("arg3")){
1064+
// _pass_table_html+="<td>特效名称:";
1065+
// _pass_table_html+=_pass_obj_JSON_v.arg3;
1066+
// _pass_table_html+="</td>";
1067+
// }
1068+
_pass_table_html+="</tr>";
1069+
}
1070+
_pass_table_html+="</table>";
1071+
_table_html+=_pass_table_html;
1072+
}
1073+
_table_html+="</td>";
1074+
_table_html+="</tr>";
1075+
_table_html+="</table>";
1076+
return _table_html;
1077+
}
1078+
//-----------------独特属性-----------------------
1079+
if(obj_JSON.file=='exotics'){//技能
1080+
if(obj_JSON.hasOwnProperty("name")){
1081+
_table_html+="<td>name:";
1082+
_table_html+=obj_JSON.name;
1083+
_table_html+="</td>";
1084+
}
1085+
if("exotics_ids" in obj_JSON){
1086+
_table_html+="<td>exotics_ids:";
1087+
_table_html+=obj_JSON.exotics_ids;
1088+
_table_html+="</td>";
1089+
}
1090+
1091+
1092+
1093+
_table_html+="</tr><tr>";
1094+
if("add_pass_passive_skill_type" in obj_JSON){
1095+
_table_html+="<td colspan='2'>";
1096+
var pass_obj_=JSON.parse(obj_JSON.add_pass_passive_skill_type);
1097+
var _pass_obj_JSON=pass_obj_.pass_list;
1098+
if((typeof _pass_obj_JSON)=='undefined'){
1099+
_table_html+="undefined-xx</td>";
1100+
_table_html+="</tr>";
1101+
_table_html+="</table>";
1102+
return _table_html;
1103+
}
1104+
var _pass_table_html="<table>";
1105+
for(var j=0;j<_pass_obj_JSON.length;j++){
1106+
var _pass_obj_JSON_v= _pass_obj_JSON[j];
1107+
_pass_table_html+="<tr>";
1108+
if(_pass_obj_JSON_v.hasOwnProperty("id")){
1109+
_pass_table_html+="<td>id:";
1110+
_pass_table_html+=_pass_obj_JSON_v.id;
1111+
_pass_table_html+="</td>";
1112+
}
1113+
1114+
// if(_pass_obj_JSON_v.hasOwnProperty("arg2")){
1115+
// _pass_table_html+="<td>参数:";
1116+
// _pass_table_html+=_pass_obj_JSON_v.arg2;
1117+
// _pass_table_html+="</td>";
1118+
// }
1119+
10211120
if(_pass_obj_JSON_v.hasOwnProperty("attr")){
10221121
_pass_table_html+="<td>属性:";
10231122
_pass_table_html+=_pass_obj_JSON_v.attr;
@@ -1047,6 +1146,7 @@ <h4 class="modal-title" id="openAttrsDivModalLabel">对象基础属性</h4>
10471146
_table_html+="</table>";
10481147
return _table_html;
10491148
}
1149+
10501150
//------------------角色特殊-----------------------
10511151
if(obj_JSON.file=='player_join'||obj_JSON.file=='player_leave'||obj_JSON.file=='mon_dead'||obj_JSON.file=='player_dead'){
10521152

0 commit comments

Comments
 (0)