Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
张有磊 committed Jan 16, 2016
1 parent 9818ea4 commit cc642b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
11 changes: 8 additions & 3 deletions src/main/java/com/zhaidaosi/game/server/model/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Integer, Integer> levelExperience = new HashMap<Integer, Integer>();

private UserInfo userInfo;
Expand All @@ -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<Integer, Integer> 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);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/applicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,4 @@

<!-- service beans -->
<import resource="classpath*:services.xml"/>

</beans>
2 changes: 1 addition & 1 deletion src/main/resources/jgframework.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cc642b4

Please sign in to comment.