奇遇:初始

This commit is contained in:
luying
2021-08-25 18:20:45 +08:00
parent e9441f1063
commit caaf091ff9
2 changed files with 10 additions and 0 deletions

View File

@@ -4,6 +4,8 @@ import { resResult, shouldRefresh, shouldRefreshWeek } from '../pubUtils/util';
import { nowSeconds } from "../pubUtils/timeUtil";
// import { RoleModel } from '../db/Role';
import { refDailyTask, refDailyTaskBox } from './taskService'
import { EVENT_STATUS, FUNCS_ID } from "../consts";
import { startEvent } from "./eventSercive";
/**
* 刷新
@@ -12,9 +14,15 @@ import { refDailyTask, refDailyTaskBox } from './taskService'
export async function refresh(session: FrontendOrBackendSession) {
const roleId = session.get('roleId');
const sid = session.get('sid');
const funcs = session.get('funcs');
const eventStatus = session.get('eventStatus')||EVENT_STATUS.WAITING;
let uids = [{uid: roleId, sid}];
pinus.app.get('channelService').pushMessageByUids('onPushCurrentTime', resResult(STATUS.SUCCESS, {time: Date.now()}), uids);
await refreshDaily(session);
if(funcs && funcs.includes(FUNCS_ID.EVENT) && eventStatus == EVENT_STATUS.WAITING) {
await startEvent(session);
}
}
/**

View File

@@ -15,6 +15,7 @@ export class FriendParams {
serverId: number;
serverName: string;
type: number = FRIEND_RELATION_TYPE.NORMAL;
guildName: string = '';
constructor(role: RoleType) {
this.roleId = role.roleId;
@@ -25,6 +26,7 @@ export class FriendParams {
this.spine = role.spine;
this.ce = role.ce;
this.title = role.title;
this.guildName = role.guildName||'';
}
setServerName(serverId: number, serverName: string) {