From cc642b48a05959a5d90111ee80e0bb6dfa34a122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9C=89=E7=A3=8A?= Date: Sat, 16 Jan 2016 14:52:36 +0800 Subject: [PATCH] format --- .../zhaidaosi/game/server/model/player/Player.java | 11 ++++++++--- src/main/resources/applicationContext.xml | 1 - src/main/resources/jgframework.properties | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/zhaidaosi/game/server/model/player/Player.java b/src/main/java/com/zhaidaosi/game/server/model/player/Player.java index 0bdc957..a7dbf96 100644 --- a/src/main/java/com/zhaidaosi/game/server/model/player/Player.java +++ b/src/main/java/com/zhaidaosi/game/server/model/player/Player.java @@ -4,6 +4,9 @@ import java.util.Map; import java.util.Map.Entry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.zhaidaosi.game.jgframework.common.BaseJson; import com.zhaidaosi.game.jgframework.model.BasePosition; import com.zhaidaosi.game.jgframework.model.action.ActionManager; @@ -18,6 +21,8 @@ import com.zhaidaosi.game.server.sdm.model.UserInfo; public class Player extends BasePlayer { + private static final Logger log = LoggerFactory.getLogger(Player.class); + private static Map levelExperience = new HashMap(); private UserInfo userInfo; @@ -39,17 +44,17 @@ public void init(UserInfo userInfo) { this.hp = this.totalHp; this.experience = userInfo.getExperience(); - System.out.println(userInfo.getActions()); + log.info(userInfo.getActions()); actionJson = BaseJson.JsonToObject(userInfo.getActions(), Map.class); for (Map.Entry entry : actionJson.entrySet()) { try { - System.out.println("--" + entry.getKey() + "--" + entry.getValue()); + log.info(entry.getKey() + "-->" + entry.getValue()); AttackAction attackAction = (AttackAction) ActionManager.getAction(entry.getKey()); attackAction.setLevel(entry.getValue()); this.addAction(attackAction); } catch (Exception e) { - e.printStackTrace(); + log.error("", e); } } diff --git a/src/main/resources/applicationContext.xml b/src/main/resources/applicationContext.xml index faef883..8e59bff 100644 --- a/src/main/resources/applicationContext.xml +++ b/src/main/resources/applicationContext.xml @@ -148,5 +148,4 @@ - \ No newline at end of file diff --git a/src/main/resources/jgframework.properties b/src/main/resources/jgframework.properties index eebd9ce..acc6189 100644 --- a/src/main/resources/jgframework.properties +++ b/src/main/resources/jgframework.properties @@ -30,7 +30,7 @@ service.syncPeriod=60 service.threadCount=0 service.heartbeatTime=6000 #socket or websocket -service.mode=socket +service.mode=websocket service.maxLoginUser=0 #auth