改名推送

back_recharge
zhangshanxue 2019-08-29 16:21:50 +08:00
parent 48d7ee726c
commit 9c676a4c6f
1 changed files with 15 additions and 12 deletions

View File

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