sdk: 根据37要求修改问题

This commit is contained in:
luying
2021-12-03 17:28:16 +08:00
parent a6ee89854a
commit 000742ace7
5 changed files with 26 additions and 7 deletions
+6 -3
View File
@@ -12,7 +12,7 @@ import { GuildModel } from "../db/Guild";
import { getRoleOnlineInfo, updateUserInfo } from "./redisService";
import { Application, pinus } from "pinus";
import { getGuildChannelSid } from "./chatService";
import { getRandSingleEelm, readWordTxt, writeWordTxt } from "../pubUtils/util";
import { getRandSingleEelm, readWordTxt, resResult, writeWordTxt } from "../pubUtils/util";
const ThinkingAnalytics = require("thinkingdata-node");
import Trie from '../pubUtils/trie';
import _ = require("underscore");
@@ -99,9 +99,9 @@ export async function checkGuildName(guildCode: string, serverId: number, name:
// 根据37sdk处理违规玩家名
export async function treatRoleName(roleId: string) {
export async function treatRoleName(roleId: string, isDebug?: boolean) {
let role = await RoleModel.findByRoleId(roleId);
if(role && role.sdkMark) { // 有设置标记的情况下
if((role && role.sdkMark) || isDebug) { // 有设置标记的情况下
let newName = "默认玩家名";
// 新名字上传
await checkRoleName(roleId, newName, role);
@@ -112,6 +112,9 @@ export async function treatRoleName(roleId: string) {
const { sid } = await getRoleOnlineInfo(roleId);
if(!!sid) {
await pinus.app.rpc.connector.connectorRemote.setOtherUserRoleNameSession.toServer(sid,[{ roleId, roleName: newName }]); // 改session
pinus.app.get('channelService').pushMessageByUids('onPlayerDataChange', resResult(STATUS.SUCCESS, {
roleName: newName
}), [{uid: roleId, sid}]);
}
// 补偿
let gold = getGoldObject(NAMEPLATE.NAMEPLATE_FEECOST)