Entity
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
import type { DiplomacyState, NationID } from "@/defs.js";
|
||||||
|
|
||||||
|
export interface Diplomacy {
|
||||||
|
_id: string;
|
||||||
|
|
||||||
|
lowerNationID: NationID;
|
||||||
|
higherNationID: NationID;
|
||||||
|
|
||||||
|
state: DiplomacyState;
|
||||||
|
|
||||||
|
lowerNationDeadCrew?: number;
|
||||||
|
higherNationDeadCrew?: number;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import type { NationID } from "@/defs.js";
|
||||||
|
|
||||||
|
export interface IDiplomaticLetter {
|
||||||
|
_id: string;
|
||||||
|
|
||||||
|
srcNationID: NationID;
|
||||||
|
destNationID: NationID;
|
||||||
|
|
||||||
|
prevID?: string;
|
||||||
|
|
||||||
|
state: 'proposed' | 'accepted' | 'rejected' | 'canceled' | 'replaced';
|
||||||
|
|
||||||
|
srcSigner: {
|
||||||
|
generalID: string;
|
||||||
|
generalName: string;
|
||||||
|
icon: string;
|
||||||
|
};
|
||||||
|
destSigner: {
|
||||||
|
generalID: string;
|
||||||
|
generalName: string;
|
||||||
|
icon: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
textBrief: string;
|
||||||
|
textDetail: string;
|
||||||
|
|
||||||
|
createdAt: Date;
|
||||||
|
updatedAt: Date;
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { GeneralID } from "@/defs.js";
|
import type { GeneralID } from "@/defs.js";
|
||||||
|
|
||||||
//게임 외부적인 General Rank ㅈ어보
|
//게임 외부적인 General Rank 정보
|
||||||
export interface IGeneralExternalRankEntity {
|
export interface IGeneralExternalRankEntity {
|
||||||
generalID: GeneralID;
|
generalID: GeneralID;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import type { GeneralID } from "@/defs.js";
|
||||||
|
|
||||||
|
export interface IGeneralTurn {
|
||||||
|
generalID: GeneralID;
|
||||||
|
turn: {
|
||||||
|
action: string;
|
||||||
|
arg?: Record<string, unknown>;
|
||||||
|
brief: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import type { StaffLevel } from "@/defs.js";
|
||||||
|
|
||||||
|
export interface INationTurn {
|
||||||
|
_id: string;
|
||||||
|
|
||||||
|
nationID: string;
|
||||||
|
officerLevel: StaffLevel,
|
||||||
|
|
||||||
|
turn: {
|
||||||
|
action: string;
|
||||||
|
arg?: Record<string, unknown>;
|
||||||
|
brief: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ export interface IGeneralEntity {
|
|||||||
ownerID?: UserID;
|
ownerID?: UserID;
|
||||||
npcType: NpcType;
|
npcType: NpcType;
|
||||||
affinity?: number;
|
affinity?: number;
|
||||||
picture?: string;
|
icon?: string;
|
||||||
name: GeneralName;
|
name: GeneralName;
|
||||||
ownerName?: UserName;
|
ownerName?: UserName;
|
||||||
nationID: NationID;
|
nationID: NationID;
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import type { GeneralID, GeneralName, NationName, ScenarioID, ServerID, UserID, UserName } from "@/defs.js"
|
||||||
|
import type { IGeneralRankEntity } from "../GeneralRankEntity.js";
|
||||||
|
import type { IGeneralExternalRankEntity } from "../External/GeneralExternalRankEntity.js";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export interface IHallOfFame {
|
||||||
|
_id: string
|
||||||
|
|
||||||
|
serverID: ServerID;
|
||||||
|
serverIdx: number;
|
||||||
|
season: number;
|
||||||
|
|
||||||
|
scenarioID: ScenarioID;
|
||||||
|
scenarioName: string;
|
||||||
|
|
||||||
|
generalID: GeneralID;
|
||||||
|
generalName: GeneralName;
|
||||||
|
ownerID: UserID;
|
||||||
|
ownerName: UserName;
|
||||||
|
icon: string;
|
||||||
|
|
||||||
|
nationName: NationName;
|
||||||
|
nationColor: string;
|
||||||
|
|
||||||
|
startTime: Date;
|
||||||
|
endTime: Date;
|
||||||
|
|
||||||
|
ingame: IGeneralRankEntity;
|
||||||
|
external: IGeneralExternalRankEntity;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import type { CityID, CityLevel, CityState, NationID, NpcType, OfficerLevel, RegionID, ServerID } from "@/defs.js";
|
||||||
|
|
||||||
|
export interface IHistory {
|
||||||
|
_id: string;
|
||||||
|
|
||||||
|
serverID: ServerID;
|
||||||
|
year: number;
|
||||||
|
month: number;
|
||||||
|
mapBase: string;
|
||||||
|
nations: Map<NationID, {
|
||||||
|
name: string;
|
||||||
|
color: string;
|
||||||
|
cities: Set<CityID>;
|
||||||
|
generals: {
|
||||||
|
name: string;
|
||||||
|
npcType: NpcType;
|
||||||
|
}[];
|
||||||
|
}>;
|
||||||
|
cities: Map<CityID, {
|
||||||
|
nationID: NationID;
|
||||||
|
name: string;
|
||||||
|
hasSupply: boolean;
|
||||||
|
|
||||||
|
level: CityLevel;
|
||||||
|
state: CityState;
|
||||||
|
regionID: RegionID;
|
||||||
|
|
||||||
|
remainWarMonth: number;
|
||||||
|
}>
|
||||||
|
globalHistory: string[];
|
||||||
|
globalAction: string[];
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import type { CityLevel, GeneralID, ServerID, UserID } from "@/defs.js";
|
||||||
|
import type { IGeneralEntity } from "../GeneralEntity.js";
|
||||||
|
import type { IGeneralRankEntity } from "../GeneralRankEntity.js";
|
||||||
|
|
||||||
|
export interface OldGeneral {
|
||||||
|
_id: string;
|
||||||
|
|
||||||
|
serverID: ServerID;
|
||||||
|
generalID: GeneralID;
|
||||||
|
ownerID?: UserID;
|
||||||
|
|
||||||
|
lastYearMonth: number;
|
||||||
|
|
||||||
|
general: IGeneralEntity;
|
||||||
|
rank: IGeneralRankEntity;
|
||||||
|
|
||||||
|
troopName?: string;
|
||||||
|
cityBasic: {
|
||||||
|
name: string;
|
||||||
|
level: CityLevel;
|
||||||
|
}
|
||||||
|
nationBasic: {
|
||||||
|
name: string;
|
||||||
|
color: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
createdAt: Date;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import type { GeneralID, GeneralName, ItemID, ItemKeyType, NationID, NpcType, OfficerLevel, PersonalityType, ServerID, SpecialityDomesticType, SpecialityWarType, UserID } from "@/defs.js";
|
||||||
|
import type { INationEntity } from "../NationEntity.js";
|
||||||
|
|
||||||
|
export interface IOldNation {
|
||||||
|
_id: string;
|
||||||
|
|
||||||
|
serverID: ServerID;
|
||||||
|
nationID: NationID;
|
||||||
|
|
||||||
|
nation: INationEntity;
|
||||||
|
|
||||||
|
lastYearMonth: number;
|
||||||
|
|
||||||
|
members: Record<number, {
|
||||||
|
generalID: GeneralID;
|
||||||
|
generalName: GeneralName;
|
||||||
|
ownerID?: UserID;
|
||||||
|
ownerName?: string;
|
||||||
|
|
||||||
|
npcType?: NpcType;
|
||||||
|
icon?: string;
|
||||||
|
|
||||||
|
officerLevel: OfficerLevel;
|
||||||
|
officerCityID?: number;
|
||||||
|
}>
|
||||||
|
|
||||||
|
history: {
|
||||||
|
year: number;
|
||||||
|
month: number;
|
||||||
|
text: string[];
|
||||||
|
};
|
||||||
|
|
||||||
|
createdAt: Date;
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ export type RegionID = number & { zz_t?: "RegionID" };
|
|||||||
|
|
||||||
//서버 ID
|
//서버 ID
|
||||||
export type ServerID = number & { zz_t?: "ServerID" };
|
export type ServerID = number & { zz_t?: "ServerID" };
|
||||||
|
export type ScenarioID = number & { zz_t?: "ScenarioID" };
|
||||||
|
|
||||||
//TODO: 무언가의 keyof 로 바꿔야함
|
//TODO: 무언가의 keyof 로 바꿔야함
|
||||||
export type NationType = string & { zz_t?: "NationType" };
|
export type NationType = string & { zz_t?: "NationType" };
|
||||||
@@ -43,18 +44,7 @@ export const enum NpcType {
|
|||||||
npc_invader = 9,
|
npc_invader = 9,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const enum OfficerLevel {
|
export const enum StaffLevel {
|
||||||
//재야
|
|
||||||
none = 0,
|
|
||||||
|
|
||||||
//일반
|
|
||||||
normal = 1,
|
|
||||||
|
|
||||||
//도시관직
|
|
||||||
cityLeadership = 2,
|
|
||||||
cityIntel = 3,
|
|
||||||
cityStrength = 4,
|
|
||||||
|
|
||||||
//지력관직
|
//지력관직
|
||||||
staffIntel3 = 5,
|
staffIntel3 = 5,
|
||||||
staffIntel2 = 7,
|
staffIntel2 = 7,
|
||||||
@@ -70,7 +60,45 @@ export const enum OfficerLevel {
|
|||||||
|
|
||||||
//군주
|
//군주
|
||||||
lord = 12,
|
lord = 12,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const enum CityOfficerLevel {
|
||||||
|
cityLeadership = 2,
|
||||||
|
cityIntel = 3,
|
||||||
|
cityStrength = 4,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//XXX: const enum의 merge가 없어?
|
||||||
|
|
||||||
|
export const enum OfficerLevel {
|
||||||
|
//재야
|
||||||
|
none = 0,
|
||||||
|
|
||||||
|
//일반
|
||||||
|
normal = 1,
|
||||||
|
|
||||||
|
//도시관직
|
||||||
|
cityLeadership = CityOfficerLevel.cityLeadership,
|
||||||
|
cityIntel = CityOfficerLevel.cityIntel,
|
||||||
|
cityStrength = CityOfficerLevel.cityStrength,
|
||||||
|
|
||||||
|
//지력관직
|
||||||
|
staffIntel3 = StaffLevel.staffIntel3,
|
||||||
|
staffIntel2 = StaffLevel.staffIntel2,
|
||||||
|
staffIntel1 = StaffLevel.staffIntel1,
|
||||||
|
|
||||||
|
//무력관직
|
||||||
|
staffStrength3 = StaffLevel.staffStrength3,
|
||||||
|
staffStrength2 = StaffLevel.staffStrength2,
|
||||||
|
staffStrength1 = StaffLevel.staffStrength1,
|
||||||
|
|
||||||
|
//참모
|
||||||
|
staffChief = StaffLevel.staffChief,
|
||||||
|
|
||||||
|
//군주
|
||||||
|
lord = StaffLevel.lord,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const enum DiplomaticPermission {
|
export const enum DiplomaticPermission {
|
||||||
@@ -103,12 +131,6 @@ export const enum FrontStatus {
|
|||||||
NearEmpty = 3,
|
NearEmpty = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const enum CityOfficerLevel {
|
|
||||||
cityLeadership = 2,
|
|
||||||
cityIntel = 3,
|
|
||||||
cityStrength = 4,
|
|
||||||
}
|
|
||||||
|
|
||||||
//XXX: 기존처럼 값 하나만 유지할 것인가?
|
//XXX: 기존처럼 값 하나만 유지할 것인가?
|
||||||
export const enum CityState {
|
export const enum CityState {
|
||||||
//일반
|
//일반
|
||||||
@@ -135,6 +157,21 @@ export const enum CityState {
|
|||||||
thief = 9,
|
thief = 9,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//NOTE: PHP버전과 수치가 다름
|
||||||
|
export const enum DiplomacyState{
|
||||||
|
//중립
|
||||||
|
neutral = 0,
|
||||||
|
|
||||||
|
//선포중
|
||||||
|
declare = 1,
|
||||||
|
|
||||||
|
//전쟁중
|
||||||
|
war = 2,
|
||||||
|
|
||||||
|
//불가침
|
||||||
|
inviolable = 7,
|
||||||
|
}
|
||||||
|
|
||||||
/* 전용 stat이어서 확장하고자 하는경우 아래와 같이 확장 가능
|
/* 전용 stat이어서 확장하고자 하는경우 아래와 같이 확장 가능
|
||||||
```ts
|
```ts
|
||||||
declare module "@/defs.js" {
|
declare module "@/defs.js" {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export interface IUser {
|
|||||||
allowGatewayAction?: ServerActionType[];
|
allowGatewayAction?: ServerActionType[];
|
||||||
penalty?: Map<string, Date>;
|
penalty?: Map<string, Date>;
|
||||||
|
|
||||||
picture?: string;
|
icon?: string;
|
||||||
useImgSvr?: boolean;
|
useImgSvr?: boolean;
|
||||||
|
|
||||||
regDate: Date;
|
regDate: Date;
|
||||||
@@ -75,7 +75,7 @@ export const User = new Schema<IUser>({
|
|||||||
},
|
},
|
||||||
penalty: { type: Map, required: false, of: Date },
|
penalty: { type: Map, required: false, of: Date },
|
||||||
|
|
||||||
picture: { type: String, required: false },
|
icon: { type: String, required: false },
|
||||||
useImgSvr: { type: Boolean, required: false },
|
useImgSvr: { type: Boolean, required: false },
|
||||||
|
|
||||||
regDate: { type: Date, required: true },
|
regDate: { type: Date, required: true },
|
||||||
|
|||||||
Reference in New Issue
Block a user