改名推送
parent
48d7ee726c
commit
9c676a4c6f
|
@ -102,7 +102,7 @@ public class PlayerLogic {
|
||||||
/**
|
/**
|
||||||
* 起名字
|
* 起名字
|
||||||
* @param name
|
* @param name
|
||||||
* @param type
|
* @param type 1:玩家起名 2: 阵容起名 3 玩家改名
|
||||||
*/
|
*/
|
||||||
public void resetUserName(ISession iSession, String name, int type,int teamPosId) throws Exception {
|
public void resetUserName(ISession iSession, String name, int type,int teamPosId) throws Exception {
|
||||||
int uid = iSession.getUid();
|
int uid = iSession.getUid();
|
||||||
|
@ -114,7 +114,7 @@ public class PlayerLogic {
|
||||||
if (checkName(iSession, name, msgId)){
|
if (checkName(iSession, name, msgId)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (type == 1) {
|
if (type == 1||type == 3) {
|
||||||
// 检查名字是否被占用
|
// 检查名字是否被占用
|
||||||
if (PlayerLogic.getInstance().isExistName(name)) {
|
if (PlayerLogic.getInstance().isExistName(name)) {
|
||||||
MessageUtil.sendErrorResponse(iSession, 0, msgId, SErrorCodeEerverConfig.getI18NMessage("name_repeat_txt"));
|
MessageUtil.sendErrorResponse(iSession, 0, msgId, SErrorCodeEerverConfig.getI18NMessage("name_repeat_txt"));
|
||||||
|
@ -135,18 +135,21 @@ public class PlayerLogic {
|
||||||
teamPosManager.getTeamNames().put(teamPosId,name);
|
teamPosManager.getTeamNames().put(teamPosId,name);
|
||||||
}
|
}
|
||||||
|
|
||||||
//检查下
|
if(type==3){
|
||||||
int[][] cost = new int[1][];
|
//检查下
|
||||||
int[] temp = new int[2];
|
int[][] cost = new int[1][];
|
||||||
temp[0] = Global.CHANGENAME;
|
int[] temp = new int[2];
|
||||||
temp[1] = 1;
|
temp[0] = Global.CHANGENAME;
|
||||||
cost[0] = temp;
|
temp[1] = 1;
|
||||||
|
cost[0] = temp;
|
||||||
|
|
||||||
boolean enoughCost = ItemUtil.itemCost(user,cost,BIReason.CHANGE_NAME,0);
|
boolean enoughCost = ItemUtil.itemCost(user,cost,BIReason.CHANGE_NAME,0);
|
||||||
if(!enoughCost){
|
if(!enoughCost){
|
||||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"道具不足");
|
MessageUtil.sendErrorResponse(iSession,0,msgId,"道具不足");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageUtil.sendMessage(iSession,1,msgId,null,true);
|
MessageUtil.sendMessage(iSession,1,msgId,null,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue