数数:修改创建角色逻辑
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
import { COUNTER, DEFAULT_LV, ADULT_AGE, GUEST_MAX_TIME, BLOCK_TYPE, TA_EVENT } from '@consts';
|
||||
import { COUNTER, DEFAULT_LV, ADULT_AGE, GUEST_MAX_TIME, BLOCK_TYPE } from '@consts';
|
||||
import { RoleModel } from '@db/Role';
|
||||
import { UserModel, UserType } from '@db/User';
|
||||
import { STATUS, GET_SMS_TYPE, ADDICTION_PREVENTION_CODE } from '@consts';
|
||||
@@ -317,12 +317,9 @@ export default class Auth extends Service {
|
||||
const code = ctx.service.utils.genCode(6);
|
||||
const seqId = await Counter.getNewCounter(COUNTER.ROLE) || -1;
|
||||
|
||||
const role = await RoleModel.createRole(uid, serverId, { roleId, code, roleName: "默认玩家名", seqId, lv: DEFAULT_LV, exp: (getExpByLv(DEFAULT_LV - 1) || { sum: 0 }).sum || 0 });
|
||||
const role = await RoleModel.createRole(uid, serverId, { roleId, code, roleName: "默认玩家名", seqId, lv: DEFAULT_LV, exp: (getExpByLv(DEFAULT_LV - 1) || { sum: 0 }).sum || 0 }, distinctId);
|
||||
if (role) {
|
||||
await ServerlistModel.incRoleCnt(serverId);
|
||||
// 任务
|
||||
|
||||
ctx.service.sdk.reportTAEventWithRoleIdAndDistinctId(roleId, distinctId, TA_EVENT.CREATE_ROLE, null, ctx.clientIp);
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS, { roleId: role.roleId });
|
||||
}
|
||||
return ctx.service.utils.resResult(STATUS.ROLE_NOT_FOUND);
|
||||
|
||||
Reference in New Issue
Block a user