名字限制
parent
ca477db687
commit
dcf5a3bcfa
|
|
@ -45,7 +45,8 @@ public interface Global {
|
||||||
//返回状态
|
//返回状态
|
||||||
int USER_NO_EXIT_STATE = 10000; // 玩家不存在
|
int USER_NO_EXIT_STATE = 10000; // 玩家不存在
|
||||||
int NO_FIND_ONESELF_STATE = 10001; // 不能查找自己
|
int NO_FIND_ONESELF_STATE = 10001; // 不能查找自己
|
||||||
|
int RENAME_DIRTY = 10002;
|
||||||
|
int RENAME_SIZE_ERROR = 10003;
|
||||||
|
|
||||||
//跑马灯状态
|
//跑马灯状态
|
||||||
int LUCKY_LUCK = 1; //吉运
|
int LUCKY_LUCK = 1; //吉运
|
||||||
|
|
|
||||||
|
|
@ -107,12 +107,12 @@ public class PlayerLogic {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (length > SGameSetting.getGameSetting().getMaxNameLength() || length < 1) {
|
if (length > SGameSetting.getGameSetting().getMaxNameLength() || length < 1) {
|
||||||
MessageUtil.sendErrorResponse(iSession, 0, msgId, "名字长度不符!");
|
MessageUtil.sendErrorResponse(iSession, Global.RENAME_DIRTY, msgId, "名字长度不符!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
boolean result = ShieldedWordUtils.checkName( name,true);
|
boolean result = ShieldedWordUtils.checkName( name,true);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
MessageUtil.sendErrorResponse(iSession, 0, msgId, "名字不合法");
|
MessageUtil.sendErrorResponse(iSession, Global.RENAME_SIZE_ERROR, msgId, "名字不合法");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue