测试:修改任务好友军团活动

This commit is contained in:
luying
2022-04-06 12:39:54 +08:00
parent 4397b03bdf
commit 126c51b4dd
9 changed files with 18 additions and 35 deletions
@@ -130,7 +130,6 @@ export class FriendHandler {
// 申请
public async applyFriend(msg: { roleIds: string[] }, session: BackendSession) {
let roleId: string = session.get('roleId');
let roleIds = msg.roleIds;
@@ -221,6 +221,7 @@ export class ShopHandler {
async debugCompleteRandTask(msg: { type: number }, session: BackendSession) {
const roleId: string = session.get('roleId');
const sid: string = session.get('sid');
const serverId: number = session.get('serverId');
const { type } = msg
let tasks: (DicMainTask | DicDailyTask | DicAchievement)[] = [];
@@ -228,7 +229,7 @@ export class ShopHandler {
tasks.push(task);
}
let task = getRandSingleEelm(tasks);
// await checkTask(roleId, sid, task.taskType, task.condition, false, { isDebug: true });
await checkTask(serverId, roleId, sid, task.taskType, { debugInfo: {condition: task.condition} });
return resResult(STATUS.SUCCESS, {
task
});
+6 -2
View File
@@ -251,7 +251,7 @@ function createChatRec(sender: boolean, curTime: Date, targetRoleId) {
* @param {Date} curTime
*/
async function updateRecentChats(sender: boolean, roleId: string, targetRoleId: string, curTime: Date) {
const chatInfo = await ChatInfoModel.findInfo(roleId);
const chatInfo = await roleChatInfos(roleId);
let recentPrivateChats: PrivateChatRec[] = chatInfo?.recentPrivateChats||[]
const recIdx = recentPrivateChats.findIndex(chat => { return chat.targetRoleId === targetRoleId });
if (recIdx === -1) {
@@ -269,7 +269,11 @@ async function updateRecentChats(sender: boolean, roleId: string, targetRoleId:
/**
* @description 获取聊天信息
*/
export async function roleChatInfos(roleId: string, roleName: string) {
export async function roleChatInfos(roleId: string, roleName?: string) {
if(!roleName) {
let role = await RoleModel.findByRoleId(roleId, 'roleName');
roleName = role.roleName;
}
let result = await ChatInfoModel.findInfo(roleId);
if (!result) {
result = await ChatInfoModel.createInfo({ roleId, roleName });
+6
View File
@@ -23,6 +23,7 @@ import { resResult } from "../../pubUtils/util";
import { getActivities, getActivitiesByType, getActivityByServerId } from "../activity/activityService";
import { getRoleCreateTime, getRoleOnlineInfo, getServerCreateTime } from "../redisService";
import { getEquipById, getJewelByEquip, isRandSeUnLock } from "../equipService";
import { debug } from "console";
export class CheckTask {
serverId: number; // 区id
@@ -339,6 +340,11 @@ export class CheckSingleTask {
public async checkIsMatch(dicTaskParam: number[], getRecord: () => Promise<string[]>) {
let param = this.param;
let result: UpdateTaskParam = null;
if(this.param.debugInfo) {
return { set: this.param.debugInfo.condition }
}
switch(this.taskType) {
case TASK_TYPE.LOGIN_SUM: // 1. 累计登录 x 天
{