|
@@ -58,13 +58,16 @@ class UserProc {
|
|
|
my_Assert((ctx()->privateData()->lastRenameTs + glc()->Rename_Cooldown) < now(), "改名功能冷却中");
|
|
|
my_Assert(ctx()->base()->Consume_Cash($cost), "元宝不足!");
|
|
|
my_Assert(self::checkRoleNameNotExist($newName), "昵称已存在, 请重新命名.");
|
|
|
- $historyNames[] = ctx()->base()->name;
|
|
|
- ctx()->privateData()->HistoryNames = $historyNames;
|
|
|
- ctx()->privateState->lastRenameTs = now();
|
|
|
- ctx()->base()->name = $newName;
|
|
|
- self::updateUserInfo(); # 回存数据
|
|
|
- FightProc::UpdateRankUserName(req()->uid, $newName); # 刷新排行榜上的昵称
|
|
|
- return Resp::ok();
|
|
|
+ if (1 == self::regRole(req()->zoneid, req()->uid, $newName, "", "", "")) {
|
|
|
+ $historyNames[] = ctx()->base()->name;
|
|
|
+ ctx()->privateData()->HistoryNames = $historyNames;
|
|
|
+ ctx()->privateState->lastRenameTs = now();
|
|
|
+ ctx()->base()->name = $newName;
|
|
|
+ self::updateUserInfo(); # 回存数据
|
|
|
+ FightProc::UpdateRankUserName(req()->uid, $newName); # 刷新排行榜上的昵称
|
|
|
+ return Resp::ok();
|
|
|
+ }
|
|
|
+ return Resp::err(ErrCode::err_db);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -392,7 +395,8 @@ class UserProc {
|
|
|
static $sqlFormat = "SELECT count(*) as cnt FROM `tab_rolename` WHERE roleName='%s';";
|
|
|
$sql = sprintf($sqlFormat, $roleName);
|
|
|
$n = daoInst()->query($sql)->fetch();
|
|
|
- return $n->rows <= 0;
|
|
|
+ var_dump($n);
|
|
|
+ return $n->cnt <= 0;
|
|
|
}
|
|
|
|
|
|
/**
|