Files
core/hwe/ts/defs/API/Message.ts
T
Hide_D 6c76d688b5 fix: 메시지 삭제 안되는 버그
- GetRecentMessage에서 keepRecent 관련 오동작 수정
  - 왜 이걸 넣었는지 생각해보기로..
2023-03-21 01:38:58 +09:00

76 lines
1.6 KiB
TypeScript

export type MsgType = "private" | "public" | "national" | "diplomacy";
export const minMsgSeq: Record<MsgType, number> = {
private: 0x7fffffff,
public: 0x7fffffff,
national: 0x7fffffff,
diplomacy: 0x7fffffff,
};
export type MsgTarget = {
id: number;
name: string;
nation_id: number; //XXX: 왜 이 값은 nationID가 아니고 nation_id인가?
nation: string;
color: string;
icon: string;
};
export type MsgActionType = 'scout' | 'noAggression' | 'cancelNA' | 'stopWar';
export type MsgItem = {
id: number;
msgType: MsgType;
src: MsgTarget;
dest?: MsgTarget;
text: string;
option: {
action?: MsgActionType;
invalid?: boolean;
deletable?: boolean;
overwrite?: number[];
hide?: boolean;
silence?: boolean;
delete?: number;
};
time: string;
};
export type MsgPrintItem = MsgItem & {
generalName: string;
nationID: number;
nationType: "local" | "src" | "dest";
myGeneralID: number;
allowButton: boolean;
last5min: string;
now: string;
invalidType: "msg_invalid" | "msg_valid";
deletable: boolean;
src: MsgTarget & { colorType: "bright" | "dark" };
dest: MsgTarget & { colorType: "bright" | "dark" };
defaultIcon: string;
};
export type MsgResponse = {
[v in MsgType]: MsgItem[];
} & {
result: true;
nationID: number;
generalName: string;
sequence: number;
};
export type MailboxItem = {
id: number,
mailbox: number,
color: string,
name: string,
nationID: number,
//nation: string,
general: [number, string, number][]
}
export type MabilboxListResponse = {
result: true,
nation: MailboxItem[]
}