manage ActiveDojoColorResearch
This commit is contained in:
parent
2572b665a6
commit
0798eb2c56
@ -78,6 +78,9 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
||||
processFundedProject(guild, techProject, recipe);
|
||||
}
|
||||
}
|
||||
if (data.RecipeType.substring(0, 39) == "/Lotus/Types/Items/Research/DojoColors/") {
|
||||
guild.ActiveDojoColorResearch = data.RecipeType;
|
||||
}
|
||||
await guild.save();
|
||||
res.end();
|
||||
} else if (data.Action == "Contribute") {
|
||||
@ -192,12 +195,14 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
||||
} else if (data.Action == "Pause") {
|
||||
const project = guild.TechProjects!.find(x => x.ItemType == data.RecipeType)!;
|
||||
project.State = -2;
|
||||
guild.ActiveDojoColorResearch = "";
|
||||
await guild.save();
|
||||
await removePigmentsFromGuildMembers(guild._id);
|
||||
res.end();
|
||||
} else if (data.Action == "Unpause") {
|
||||
const project = guild.TechProjects!.find(x => x.ItemType == data.RecipeType)!;
|
||||
project.State = 0;
|
||||
guild.ActiveDojoColorResearch = data.RecipeType;
|
||||
await guild.save();
|
||||
res.end();
|
||||
} else {
|
||||
|
@ -151,6 +151,7 @@ const guildSchema = new Schema<IGuildDatabase>(
|
||||
VaultShipDecorations: { type: [typeCountSchema], default: undefined },
|
||||
VaultFusionTreasures: { type: [fusionTreasuresSchema], default: undefined },
|
||||
TechProjects: { type: [techProjectSchema], default: undefined },
|
||||
ActiveDojoColorResearch: { type: String, default: "" },
|
||||
Class: { type: Number, default: 0 },
|
||||
XP: { type: Number, default: 0 },
|
||||
ClaimedXP: { type: [String], default: undefined },
|
||||
|
@ -92,6 +92,7 @@ export const getGuildClient = async (guild: TGuildDatabaseDocument, accountId: s
|
||||
Ranks: guild.Ranks,
|
||||
Tier: 1,
|
||||
Vault: getGuildVault(guild),
|
||||
ActiveDojoColorResearch: guild.ActiveDojoColorResearch,
|
||||
Class: guild.Class,
|
||||
XP: guild.XP,
|
||||
IsContributor: !!guild.CeremonyContributors?.find(x => x.equals(accountId)),
|
||||
|
@ -14,6 +14,7 @@ export interface IGuildClient {
|
||||
}[];
|
||||
Tier: number;
|
||||
Vault: IGuildVault;
|
||||
ActiveDojoColorResearch: string;
|
||||
Class: number;
|
||||
XP: number;
|
||||
IsContributor: boolean;
|
||||
@ -39,6 +40,7 @@ export interface IGuildDatabase {
|
||||
VaultFusionTreasures?: IFusionTreasure[];
|
||||
|
||||
TechProjects?: ITechProjectDatabase[];
|
||||
ActiveDojoColorResearch: string;
|
||||
|
||||
Class: number;
|
||||
XP: number;
|
||||
|
Loading…
x
Reference in New Issue
Block a user