人物基本信息redis存储
parent
3434799eda
commit
2cb6b7998b
|
@ -7,6 +7,7 @@ import com.ljsd.jieling.db.redis.RedisKey;
|
|||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.gm.*;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildCache;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
|
@ -257,4 +258,19 @@ public class CrossServiceLogic {
|
|||
return name;
|
||||
}
|
||||
|
||||
|
||||
private static void update(CSPlayer csUser) {
|
||||
//RedisUtil.getInstence().setObject(getKey(csUser.getId()),csUser,-1);
|
||||
}
|
||||
/* private static String getKey(int uid){
|
||||
return RedisUtil.getInstence().getKey(RedisKey.CROSS_SERVER_USER,String.valueOf(uid),false);
|
||||
}*/
|
||||
/* public static CSPlayer query(int uid) {
|
||||
CSPlayer csUser = RedisUtil.getInstence().getObject(getKey(uid), CSUser.class);
|
||||
if (csUser == null){
|
||||
csUser = getUserByMongo(uid);
|
||||
}
|
||||
return csUser;
|
||||
}*/
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,191 @@
|
|||
package com.ljsd.jieling.logic.dao.cross;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Date 2021/8/31 15:30:04
|
||||
* @Description: 角色信息
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class CSPlayer {
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private int userId;
|
||||
/**
|
||||
* 等级
|
||||
*/
|
||||
private int level;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private int sex;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private int head;
|
||||
/**
|
||||
* 头像框
|
||||
*/
|
||||
private int headFrame;
|
||||
/**
|
||||
* 皮肤
|
||||
*/
|
||||
private int skin;
|
||||
/**
|
||||
* 称号
|
||||
*/
|
||||
private int userTitle;
|
||||
/**
|
||||
* 坐骑
|
||||
*/
|
||||
private int userMount;
|
||||
/**
|
||||
* 修行等级
|
||||
*/
|
||||
private int practiceLevel;
|
||||
/**
|
||||
* 公会id
|
||||
*/
|
||||
private int guildId;
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
private int serverId;
|
||||
|
||||
/**
|
||||
* 最大战力
|
||||
*/
|
||||
private int maxFore;
|
||||
|
||||
public CSPlayer(User user) {
|
||||
PlayerManager manager = user.getPlayerInfoManager();
|
||||
this.userId = user.getId();
|
||||
this.level = manager.getLevel();
|
||||
this.name = manager.getNickName();
|
||||
this.sex = manager.getSex();
|
||||
this.head = manager.getHead();
|
||||
this.headFrame = manager.getHeadFrame();
|
||||
this.skin = manager.getUserSkin();
|
||||
this.userTitle = manager.getUserTitle();
|
||||
this.userMount = manager.getUserMount();
|
||||
this.practiceLevel = user.getHeroManager().getPracticeLevel();
|
||||
this.guildId = manager.getGuildId();
|
||||
this.serverId = GameApplication.serverId;
|
||||
this.maxFore = user.getPlayerInfoManager().getMaxForce();
|
||||
}
|
||||
|
||||
public CSPlayer() {
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public int getHead() {
|
||||
return head;
|
||||
}
|
||||
|
||||
public void setHead(int head) {
|
||||
this.head = head;
|
||||
}
|
||||
|
||||
public int getHeadFrame() {
|
||||
return headFrame;
|
||||
}
|
||||
|
||||
public void setHeadFrame(int headFrame) {
|
||||
this.headFrame = headFrame;
|
||||
}
|
||||
|
||||
public int getSkin() {
|
||||
return skin;
|
||||
}
|
||||
|
||||
public void setSkin(int skin) {
|
||||
this.skin = skin;
|
||||
}
|
||||
|
||||
public int getUserTitle() {
|
||||
return userTitle;
|
||||
}
|
||||
|
||||
public void setUserTitle(int userTitle) {
|
||||
this.userTitle = userTitle;
|
||||
}
|
||||
|
||||
public int getUserMount() {
|
||||
return userMount;
|
||||
}
|
||||
|
||||
public void setUserMount(int userMount) {
|
||||
this.userMount = userMount;
|
||||
}
|
||||
|
||||
public int getPracticeLevel() {
|
||||
return practiceLevel;
|
||||
}
|
||||
|
||||
public void setPracticeLevel(int practiceLevel) {
|
||||
this.practiceLevel = practiceLevel;
|
||||
}
|
||||
|
||||
public int getGuildId() {
|
||||
return guildId;
|
||||
}
|
||||
|
||||
public void setGuildId(int guildId) {
|
||||
this.guildId = guildId;
|
||||
}
|
||||
|
||||
public int getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setServerId(int serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
public int getMaxFore() {
|
||||
return maxFore;
|
||||
}
|
||||
|
||||
public void setMaxFore(int maxFore) {
|
||||
this.maxFore = maxFore;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue