奇遇:初始
This commit is contained in:
@@ -4,6 +4,8 @@ import { resResult, shouldRefresh, shouldRefreshWeek } from '../pubUtils/util';
|
|||||||
import { nowSeconds } from "../pubUtils/timeUtil";
|
import { nowSeconds } from "../pubUtils/timeUtil";
|
||||||
// import { RoleModel } from '../db/Role';
|
// import { RoleModel } from '../db/Role';
|
||||||
import { refDailyTask, refDailyTaskBox } from './taskService'
|
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) {
|
export async function refresh(session: FrontendOrBackendSession) {
|
||||||
const roleId = session.get('roleId');
|
const roleId = session.get('roleId');
|
||||||
const sid = session.get('sid');
|
const sid = session.get('sid');
|
||||||
|
const funcs = session.get('funcs');
|
||||||
|
const eventStatus = session.get('eventStatus')||EVENT_STATUS.WAITING;
|
||||||
|
|
||||||
let uids = [{uid: roleId, sid}];
|
let uids = [{uid: roleId, sid}];
|
||||||
pinus.app.get('channelService').pushMessageByUids('onPushCurrentTime', resResult(STATUS.SUCCESS, {time: Date.now()}), uids);
|
pinus.app.get('channelService').pushMessageByUids('onPushCurrentTime', resResult(STATUS.SUCCESS, {time: Date.now()}), uids);
|
||||||
await refreshDaily(session);
|
await refreshDaily(session);
|
||||||
|
if(funcs && funcs.includes(FUNCS_ID.EVENT) && eventStatus == EVENT_STATUS.WAITING) {
|
||||||
|
await startEvent(session);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export class FriendParams {
|
|||||||
serverId: number;
|
serverId: number;
|
||||||
serverName: string;
|
serverName: string;
|
||||||
type: number = FRIEND_RELATION_TYPE.NORMAL;
|
type: number = FRIEND_RELATION_TYPE.NORMAL;
|
||||||
|
guildName: string = '';
|
||||||
|
|
||||||
constructor(role: RoleType) {
|
constructor(role: RoleType) {
|
||||||
this.roleId = role.roleId;
|
this.roleId = role.roleId;
|
||||||
@@ -25,6 +26,7 @@ export class FriendParams {
|
|||||||
this.spine = role.spine;
|
this.spine = role.spine;
|
||||||
this.ce = role.ce;
|
this.ce = role.ce;
|
||||||
this.title = role.title;
|
this.title = role.title;
|
||||||
|
this.guildName = role.guildName||'';
|
||||||
}
|
}
|
||||||
|
|
||||||
setServerName(serverId: number, serverName: string) {
|
setServerName(serverId: number, serverName: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user