chore: some fixes to enter guild dojo on U15 #2088
@ -62,7 +62,7 @@ export const confirmGuildInvitationGetController: RequestHandler = async (req, r
|
||||
await guild.save();
|
||||
|
||||
res.json({
|
||||
...(await getGuildClient(guild, account._id.toString())),
|
||||
...(await getGuildClient(guild, account)),
|
||||
InventoryChanges: inventoryChanges
|
||||
});
|
||||
} else {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { RequestHandler } from "express";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { getAccountForRequest } from "@/src/services/loginService";
|
||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||
import { Guild, GuildMember } from "@/src/models/guildModel";
|
||||
import { createUniqueClanName, getGuildClient, giveClanKey } from "@/src/services/guildService";
|
||||
@ -7,11 +7,11 @@ import { getInventory } from "@/src/services/inventoryService";
|
||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||
|
||||
export const createGuildController: RequestHandler = async (req, res) => {
|
||||
const accountId = await getAccountIdForRequest(req);
|
||||
const account = await getAccountForRequest(req);
|
||||
const payload = getJSONfromString<ICreateGuildRequest>(String(req.body));
|
||||
|
||||
// Remove pending applications for this account
|
||||
await GuildMember.deleteMany({ accountId, status: 1 });
|
||||
await GuildMember.deleteMany({ accountId: account._id, status: 1 });
|
||||
|
||||
// Create guild on database
|
||||
const guild = new Guild({
|
||||
@ -21,20 +21,20 @@ export const createGuildController: RequestHandler = async (req, res) => {
|
||||
|
||||
// Create guild member on database
|
||||
await GuildMember.insertOne({
|
||||
accountId: accountId,
|
||||
accountId: account._id,
|
||||
guildId: guild._id,
|
||||
status: 0,
|
||||
rank: 0
|
||||
});
|
||||
|
||||
const inventory = await getInventory(accountId, "GuildId LevelKeys Recipes");
|
||||
const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes");
|
||||
inventory.GuildId = guild._id;
|
||||
const inventoryChanges: IInventoryChanges = {};
|
||||
giveClanKey(inventory, inventoryChanges);
|
||||
await inventory.save();
|
||||
|
||||
res.json({
|
||||
...(await getGuildClient(guild, accountId)),
|
||||
...(await getGuildClient(guild, account)),
|
||||
InventoryChanges: inventoryChanges
|
||||
});
|
||||
};
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { RequestHandler } from "express";
|
||||
import { Guild } from "@/src/models/guildModel";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { getAccountForRequest } from "@/src/services/loginService";
|
||||
import { logger } from "@/src/utils/logger";
|
||||
import { getInventory } from "@/src/services/inventoryService";
|
||||
import { createUniqueClanName, getGuildClient } from "@/src/services/guildService";
|
||||
|
||||
export const getGuildController: RequestHandler = async (req, res) => {
|
||||
const accountId = await getAccountIdForRequest(req);
|
||||
const inventory = await getInventory(accountId, "GuildId");
|
||||
const account = await getAccountForRequest(req);
|
||||
const inventory = await getInventory(account._id.toString(), "GuildId");
|
||||
if (inventory.GuildId) {
|
||||
const guild = await Guild.findById(inventory.GuildId);
|
||||
if (guild) {
|
||||
@ -24,7 +24,7 @@ export const getGuildController: RequestHandler = async (req, res) => {
|
||||
guild.CeremonyResetDate = undefined;
|
||||
await guild.save();
|
||||
}
|
||||
res.json(await getGuildClient(guild, accountId));
|
||||
res.json(await getGuildClient(guild, account));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import { RequestHandler } from "express";
|
||||
import { Types } from "mongoose";
|
||||
import { Guild } from "@/src/models/guildModel";
|
||||
import { getDojoClient } from "@/src/services/guildService";
|
||||
import { Account } from "@/src/models/loginModel";
|
||||
|
||||
export const getGuildDojoController: RequestHandler = async (req, res) => {
|
||||
const guildId = req.query.guildId as string;
|
||||
@ -25,7 +26,8 @@ export const getGuildDojoController: RequestHandler = async (req, res) => {
|
||||
}
|
||||
|
||||
const payload: IGetGuildDojoRequest = req.body ? (JSON.parse(String(req.body)) as IGetGuildDojoRequest) : {};
|
||||
res.json(await getDojoClient(guild, 0, payload.ComponentId));
|
||||
const account = await Account.findById(req.query.accountId as string);
|
||||
res.json(await getDojoClient(guild, 0, payload.ComponentId, account?.BuildLabel));
|
||||
};
|
||||
|
||||
interface IGetGuildDojoRequest {
|
||||
|
@ -1,17 +1,24 @@
|
||||
import { RequestHandler } from "express";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { getAccountForRequest } from "@/src/services/loginService";
|
||||
import { createNewSession } from "@/src/managers/sessionManager";
|
||||
import { logger } from "@/src/utils/logger";
|
||||
import { ISession } from "@/src/types/session";
|
||||
import { JSONParse } from "json-with-bigint";
|
||||
import { toOid2, version_compare } from "@/src/helpers/inventoryHelpers";
|
||||
|
||||
const hostSessionController: RequestHandler = async (req, res) => {
|
||||
const accountId = await getAccountIdForRequest(req);
|
||||
const hostSessionRequest = JSON.parse(req.body as string) as ISession;
|
||||
const account = await getAccountForRequest(req);
|
||||
const hostSessionRequest = JSONParse(String(req.body)) as ISession;
|
||||
logger.debug("HostSession Request", { hostSessionRequest });
|
||||
const session = createNewSession(hostSessionRequest, accountId);
|
||||
const session = createNewSession(hostSessionRequest, account._id);
|
||||
logger.debug(`New Session Created`, { session });
|
||||
|
||||
res.json({ sessionId: { $oid: session.sessionId }, rewardSeed: 99999999 });
|
||||
if (account.BuildLabel && version_compare(account.BuildLabel, "2015.03.21.08.17") < 0) {
|
||||
// U15 or below
|
||||
res.send(session.sessionId.toString());
|
||||
} else {
|
||||
res.json({ sessionId: toOid2(session.sessionId, account.BuildLabel), rewardSeed: 99999999 });
|
||||
}
|
||||
};
|
||||
|
||||
export { hostSessionController };
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
import { Types } from "mongoose";
|
||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
||||
import { config } from "@/src/services/configService";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { getAccountForRequest } from "@/src/services/loginService";
|
||||
import { getInventory } from "@/src/services/inventoryService";
|
||||
|
||||
interface IStartDojoRecipeRequest {
|
||||
@ -20,10 +20,10 @@ interface IStartDojoRecipeRequest {
|
||||
}
|
||||
|
||||
export const startDojoRecipeController: RequestHandler = async (req, res) => {
|
||||
const accountId = await getAccountIdForRequest(req);
|
||||
const inventory = await getInventory(accountId, "GuildId LevelKeys");
|
||||
const account = await getAccountForRequest(req);
|
||||
const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys");
|
||||
const guild = await getGuildForRequestEx(req, inventory);
|
||||
if (!hasAccessToDojo(inventory) || !(await hasGuildPermission(guild, accountId, GuildPermission.Architect))) {
|
||||
if (!hasAccessToDojo(inventory) || !(await hasGuildPermission(guild, account._id, GuildPermission.Architect))) {
|
||||
res.json({ DojoRequestStatus: -1 });
|
||||
return;
|
||||
}
|
||||
@ -64,5 +64,5 @@ export const startDojoRecipeController: RequestHandler = async (req, res) => {
|
||||
setDojoRoomLogFunded(guild, component);
|
||||
}
|
||||
await guild.save();
|
||||
res.json(await getDojoClient(guild, 0));
|
||||
res.json(await getDojoClient(guild, 0, undefined, account.BuildLabel));
|
||||
};
|
||||
|
@ -1,10 +1,12 @@
|
||||
import { ISession, IFindSessionRequest } from "@/src/types/session";
|
||||
import { logger } from "@/src/utils/logger";
|
||||
import { JSONParse } from "json-with-bigint";
|
||||
import { Types } from "mongoose";
|
||||
|
||||
const sessions: ISession[] = [];
|
||||
|
||||
function createNewSession(sessionData: ISession, Creator: string): ISession {
|
||||
const sessionId = getNewSessionID();
|
||||
function createNewSession(sessionData: ISession, Creator: Types.ObjectId): ISession {
|
||||
const sessionId = new Types.ObjectId();
|
||||
const newSession: ISession = {
|
||||
sessionId,
|
||||
creatorId: Creator,
|
||||
@ -25,7 +27,7 @@ function createNewSession(sessionData: ISession, Creator: string): ISession {
|
||||
customSettings: sessionData.customSettings || "",
|
||||
rewardSeed: sessionData.rewardSeed || -1,
|
||||
guildId: sessionData.guildId || "",
|
||||
buildId: sessionData.buildId || 4920386201513015989,
|
||||
buildId: sessionData.buildId || 4920386201513015989n,
|
||||
platform: sessionData.platform || 0,
|
||||
xplatform: sessionData.xplatform || true,
|
||||
freePublic: sessionData.freePublic || 3,
|
||||
@ -40,13 +42,15 @@ function getAllSessions(): ISession[] {
|
||||
return sessions;
|
||||
}
|
||||
|
||||
function getSessionByID(sessionId: string): ISession | undefined {
|
||||
return sessions.find(session => session.sessionId === sessionId);
|
||||
function getSessionByID(sessionId: string | Types.ObjectId): ISession | undefined {
|
||||
return sessions.find(session => session.sessionId.equals(sessionId));
|
||||
}
|
||||
|
||||
function getSession(sessionIdOrRequest: string | IFindSessionRequest): { createdBy: string; id: string }[] {
|
||||
if (typeof sessionIdOrRequest === "string") {
|
||||
const session = sessions.find(session => session.sessionId === sessionIdOrRequest);
|
||||
function getSession(
|
||||
sessionIdOrRequest: string | Types.ObjectId | IFindSessionRequest
|
||||
): { createdBy: Types.ObjectId; id: Types.ObjectId }[] {
|
||||
if (typeof sessionIdOrRequest === "string" || sessionIdOrRequest instanceof Types.ObjectId) {
|
||||
const session = sessions.find(session => session.sessionId.equals(sessionIdOrRequest));
|
||||
if (session) {
|
||||
logger.debug("Found Sessions:", { session });
|
||||
return [
|
||||
@ -79,35 +83,15 @@ function getSession(sessionIdOrRequest: string | IFindSessionRequest): { created
|
||||
}));
|
||||
}
|
||||
|
||||
function getSessionByCreatorID(creatorId: string): ISession | undefined {
|
||||
return sessions.find(session => session.creatorId === creatorId);
|
||||
function getSessionByCreatorID(creatorId: string | Types.ObjectId): ISession | undefined {
|
||||
return sessions.find(session => session.creatorId.equals(creatorId));
|
||||
}
|
||||
|
||||
function getNewSessionID(): string {
|
||||
const characters = "0123456789abcdef";
|
||||
const maxAttempts = 100;
|
||||
let sessionId = "";
|
||||
|
||||
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
||||
sessionId = "64";
|
||||
for (let i = 0; i < 22; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * characters.length);
|
||||
sessionId += characters[randomIndex];
|
||||
}
|
||||
|
||||
if (!sessions.some(session => session.sessionId === sessionId)) {
|
||||
return sessionId;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error("Failed to generate a unique session ID");
|
||||
}
|
||||
|
||||
function updateSession(sessionId: string, sessionData: string): boolean {
|
||||
const session = sessions.find(session => session.sessionId === sessionId);
|
||||
function updateSession(sessionId: string | Types.ObjectId, sessionData: string): boolean {
|
||||
const session = sessions.find(session => session.sessionId.equals(sessionId));
|
||||
if (!session) return false;
|
||||
try {
|
||||
Object.assign(session, JSON.parse(sessionData));
|
||||
Object.assign(session, JSONParse(sessionData));
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error("Invalid JSON string for session update.");
|
||||
@ -115,8 +99,8 @@ function updateSession(sessionId: string, sessionData: string): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
function deleteSession(sessionId: string): boolean {
|
||||
const index = sessions.findIndex(session => session.sessionId === sessionId);
|
||||
function deleteSession(sessionId: string | Types.ObjectId): boolean {
|
||||
const index = sessions.findIndex(session => session.sessionId.equals(sessionId));
|
||||
if (index !== -1) {
|
||||
sessions.splice(index, 1);
|
||||
return true;
|
||||
@ -129,7 +113,6 @@ export {
|
||||
getAllSessions,
|
||||
getSessionByID,
|
||||
getSessionByCreatorID,
|
||||
getNewSessionID,
|
||||
updateSession,
|
||||
deleteSession,
|
||||
getSession
|
||||
|
@ -13,7 +13,8 @@ import {
|
||||
IDojoLeaderboardEntry,
|
||||
IGuildAdDatabase,
|
||||
IAllianceDatabase,
|
||||
IAllianceMemberDatabase
|
||||
IAllianceMemberDatabase,
|
||||
GuildPermission
|
||||
} from "@/src/types/guildTypes";
|
||||
import { Document, Model, model, Schema, Types } from "mongoose";
|
||||
import { fusionTreasuresSchema, typeCountSchema } from "./inventoryModels/inventoryModel";
|
||||
@ -108,31 +109,31 @@ const defaultRanks: IGuildRank[] = [
|
||||
},
|
||||
{
|
||||
Name: "/Lotus/Language/Game/Rank_General",
|
||||
Permissions: 4318
|
||||
Permissions: GuildPermission.Host | 4318
|
||||
},
|
||||
{
|
||||
Name: "/Lotus/Language/Game/Rank_Officer",
|
||||
Permissions: 4314
|
||||
Permissions: GuildPermission.Host | 4314
|
||||
},
|
||||
{
|
||||
Name: "/Lotus/Language/Game/Rank_Leader",
|
||||
Permissions: 4106
|
||||
Permissions: GuildPermission.Host | 4106
|
||||
},
|
||||
{
|
||||
Name: "/Lotus/Language/Game/Rank_Sage",
|
||||
Permissions: 4304
|
||||
Permissions: GuildPermission.Host | 4304
|
||||
},
|
||||
{
|
||||
Name: "/Lotus/Language/Game/Rank_Soldier",
|
||||
Permissions: 4098
|
||||
Permissions: GuildPermission.Host | 4098
|
||||
},
|
||||
{
|
||||
Name: "/Lotus/Language/Game/Rank_Initiate",
|
||||
Permissions: 4096
|
||||
Permissions: GuildPermission.Host | GuildPermission.Fabricator
|
||||
},
|
||||
{
|
||||
Name: "/Lotus/Language/Game/Rank_Utility",
|
||||
Permissions: 4096
|
||||
Permissions: GuildPermission.Host | GuildPermission.Fabricator
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -4,16 +4,16 @@ import { config } from "./configService";
|
||||
import { Account } from "../models/loginModel";
|
||||
import { Types } from "mongoose";
|
||||
import { Friendship } from "../models/friendModel";
|
||||
import { toMongoDate } from "../helpers/inventoryHelpers";
|
||||
import { fromOid, toMongoDate } from "../helpers/inventoryHelpers";
|
||||
|
||||
export const addAccountDataToFriendInfo = async (info: IFriendInfo): Promise<void> => {
|
||||
const account = (await Account.findById(info._id.$oid, "DisplayName LastLogin"))!;
|
||||
const account = (await Account.findById(fromOid(info._id), "DisplayName LastLogin"))!;
|
||||
info.DisplayName = account.DisplayName;
|
||||
info.LastLogin = toMongoDate(account.LastLogin);
|
||||
};
|
||||
|
||||
export const addInventoryDataToFriendInfo = async (info: IFriendInfo): Promise<void> => {
|
||||
const inventory = await getInventory(info._id.$oid, "PlayerLevel ActiveAvatarImageType");
|
||||
const inventory = await getInventory(fromOid(info._id), "PlayerLevel ActiveAvatarImageType");
|
||||
info.PlayerLevel = config.spoofMasteryRank == -1 ? inventory.PlayerLevel : config.spoofMasteryRank;
|
||||
info.ActiveAvatarImageType = inventory.ActiveAvatarImageType;
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Request } from "express";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { getAccountIdForRequest, TAccountDocument } from "@/src/services/loginService";
|
||||
import { addLevelKeys, addRecipes, combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
|
||||
import { Alliance, AllianceMember, Guild, GuildAd, GuildMember, TGuildDatabaseDocument } from "@/src/models/guildModel";
|
||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||
@ -19,7 +19,7 @@ import {
|
||||
IGuildVault,
|
||||
ITechProjectDatabase
|
||||
} from "@/src/types/guildTypes";
|
||||
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
||||
import { toMongoDate, toOid, toOid2 } from "@/src/helpers/inventoryHelpers";
|
||||
import { Types } from "mongoose";
|
||||
import { ExportDojoRecipes, ExportResources, IDojoBuild, IDojoResearch } from "warframe-public-export-plus";
|
||||
import { logger } from "../utils/logger";
|
||||
@ -54,7 +54,10 @@ export const getGuildForRequestEx = async (
|
||||
return guild;
|
||||
};
|
||||
|
||||
export const getGuildClient = async (guild: TGuildDatabaseDocument, accountId: string): Promise<IGuildClient> => {
|
||||
export const getGuildClient = async (
|
||||
guild: TGuildDatabaseDocument,
|
||||
account: TAccountDocument
|
||||
): Promise<IGuildClient> => {
|
||||
const guildMembers = await GuildMember.find({ guildId: guild._id });
|
||||
|
||||
const members: IGuildMemberClient[] = [];
|
||||
@ -62,13 +65,13 @@ export const getGuildClient = async (guild: TGuildDatabaseDocument, accountId: s
|
||||
const dataFillInPromises: Promise<void>[] = [];
|
||||
for (const guildMember of guildMembers) {
|
||||
const member: IGuildMemberClient = {
|
||||
_id: toOid(guildMember.accountId),
|
||||
_id: toOid2(guildMember.accountId, account.BuildLabel),
|
||||
Rank: guildMember.rank,
|
||||
Status: guildMember.status,
|
||||
Note: guildMember.RequestMsg,
|
||||
RequestExpiry: guildMember.RequestExpiry ? toMongoDate(guildMember.RequestExpiry) : undefined
|
||||
};
|
||||
if (guildMember.accountId.equals(accountId)) {
|
||||
if (guildMember.accountId.equals(account._id)) {
|
||||
missingEntry = false;
|
||||
} else {
|
||||
dataFillInPromises.push(addAccountDataToFriendInfo(member));
|
||||
@ -79,13 +82,13 @@ export const getGuildClient = async (guild: TGuildDatabaseDocument, accountId: s
|
||||
if (missingEntry) {
|
||||
// Handle clans created prior to creation of the GuildMember model.
|
||||
await GuildMember.insertOne({
|
||||
accountId: accountId,
|
||||
accountId: account._id,
|
||||
guildId: guild._id,
|
||||
status: 0,
|
||||
rank: 0
|
||||
});
|
||||
members.push({
|
||||
_id: { $oid: accountId },
|
||||
_id: toOid2(account._id, account.BuildLabel),
|
||||
Status: 0,
|
||||
Rank: 0
|
||||
});
|
||||
@ -94,7 +97,7 @@ export const getGuildClient = async (guild: TGuildDatabaseDocument, accountId: s
|
||||
await Promise.all(dataFillInPromises);
|
||||
|
||||
return {
|
||||
_id: toOid(guild._id),
|
||||
_id: toOid2(guild._id, account.BuildLabel),
|
||||
Name: guild.Name,
|
||||
MOTD: guild.MOTD,
|
||||
LongMOTD: guild.LongMOTD,
|
||||
@ -106,11 +109,11 @@ export const getGuildClient = async (guild: TGuildDatabaseDocument, accountId: s
|
||||
ActiveDojoColorResearch: guild.ActiveDojoColorResearch,
|
||||
Class: guild.Class,
|
||||
XP: guild.XP,
|
||||
IsContributor: !!guild.CeremonyContributors?.find(x => x.equals(accountId)),
|
||||
IsContributor: !!guild.CeremonyContributors?.find(x => x.equals(account._id)),
|
||||
NumContributors: guild.CeremonyContributors?.length ?? 0,
|
||||
CeremonyResetDate: guild.CeremonyResetDate ? toMongoDate(guild.CeremonyResetDate) : undefined,
|
||||
AutoContributeFromVault: guild.AutoContributeFromVault,
|
||||
AllianceId: guild.AllianceId ? toOid(guild.AllianceId) : undefined
|
||||
AllianceId: guild.AllianceId ? toOid2(guild.AllianceId, account.BuildLabel) : undefined
|
||||
};
|
||||
};
|
||||
|
||||
@ -130,10 +133,11 @@ export const getGuildVault = (guild: TGuildDatabaseDocument): IGuildVault => {
|
||||
export const getDojoClient = async (
|
||||
guild: TGuildDatabaseDocument,
|
||||
status: number,
|
||||
componentId?: Types.ObjectId | string
|
||||
componentId?: Types.ObjectId | string,
|
||||
buildLabel?: string
|
||||
): Promise<IDojoClient> => {
|
||||
const dojo: IDojoClient = {
|
||||
_id: { $oid: guild._id.toString() },
|
||||
_id: toOid2(guild._id, buildLabel),
|
||||
Name: guild.Name,
|
||||
Tier: guild.Tier,
|
||||
GuildEmblem: guild.Emblem,
|
||||
@ -155,8 +159,8 @@ export const getDojoClient = async (
|
||||
for (const dojoComponent of guild.DojoComponents) {
|
||||
if (!componentId || dojoComponent._id.equals(componentId)) {
|
||||
const clientComponent: IDojoComponentClient = {
|
||||
id: toOid(dojoComponent._id),
|
||||
SortId: toOid(dojoComponent.SortId ?? dojoComponent._id), // always providing a SortId so decos don't need repositioning to reparent
|
||||
id: toOid2(dojoComponent._id, buildLabel),
|
||||
SortId: toOid2(dojoComponent.SortId ?? dojoComponent._id, buildLabel), // always providing a SortId so decos don't need repositioning to reparent
|
||||
pf: dojoComponent.pf,
|
||||
ppf: dojoComponent.ppf,
|
||||
Name: dojoComponent.Name,
|
||||
@ -165,7 +169,7 @@ export const getDojoClient = async (
|
||||
Settings: dojoComponent.Settings
|
||||
};
|
||||
if (dojoComponent.pi) {
|
||||
clientComponent.pi = toOid(dojoComponent.pi);
|
||||
clientComponent.pi = toOid2(dojoComponent.pi, buildLabel);
|
||||
clientComponent.op = dojoComponent.op!;
|
||||
clientComponent.pp = dojoComponent.pp!;
|
||||
}
|
||||
@ -221,7 +225,7 @@ export const getDojoClient = async (
|
||||
clientComponent.Decos = [];
|
||||
for (const deco of dojoComponent.Decos) {
|
||||
const clientDeco: IDojoDecoClient = {
|
||||
id: toOid(deco._id),
|
||||
id: toOid2(deco._id, buildLabel),
|
||||
Type: deco.Type,
|
||||
Pos: deco.Pos,
|
||||
Rot: deco.Rot,
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Types } from "mongoose";
|
||||
import { IMongoDate, IOid } from "./commonTypes";
|
||||
import { IMongoDate, IOidWithLegacySupport } from "./commonTypes";
|
||||
|
||||
export interface IFriendInfo {
|
||||
_id: IOid;
|
||||
_id: IOidWithLegacySupport;
|
||||
DisplayName?: string;
|
||||
PlatformNames?: string[];
|
||||
PlatformAccountId?: string;
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Types } from "mongoose";
|
||||
import { IOid, IMongoDate } from "@/src/types/commonTypes";
|
||||
import { IOid, IMongoDate, IOidWithLegacySupport } from "@/src/types/commonTypes";
|
||||
import { IFusionTreasure, IMiscItem, ITypeCount } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
import { IPictureFrameInfo } from "./shipTypes";
|
||||
import { IFriendInfo } from "./friendTypes";
|
||||
|
||||
export interface IGuildClient {
|
||||
_id: IOid;
|
||||
_id: IOidWithLegacySupport;
|
||||
Name: string;
|
||||
MOTD: string;
|
||||
LongMOTD?: ILongMOTD;
|
||||
@ -22,7 +22,7 @@ export interface IGuildClient {
|
||||
CeremonyResetDate?: IMongoDate;
|
||||
CrossPlatformEnabled?: boolean;
|
||||
AutoContributeFromVault?: boolean;
|
||||
AllianceId?: IOid;
|
||||
AllianceId?: IOidWithLegacySupport;
|
||||
}
|
||||
|
||||
export interface IGuildDatabase {
|
||||
@ -71,7 +71,6 @@ export interface ILongMOTD {
|
||||
authorGuildName?: string;
|
||||
}
|
||||
|
||||
// 32 seems to be reserved
|
||||
export enum GuildPermission {
|
||||
Ruler = 1, // Clan: Change hierarchy. Alliance (Creator only): Kick clans.
|
||||
Advertiser = 8192,
|
||||
@ -79,6 +78,7 @@ export enum GuildPermission {
|
||||
Regulator = 4, // Kick members
|
||||
Promoter = 8, // Clan: Promote and demote members. Alliance (Creator only): Change clan permissions.
|
||||
Architect = 16, // Create and destroy rooms
|
||||
Host = 32, // No longer used in modern versions
|
||||
Decorator = 1024, // Create and destroy decos
|
||||
Treasurer = 64, // Clan: Contribute from vault and edit tax rate. Alliance: Divvy vault.
|
||||
Tech = 128, // Queue research
|
||||
@ -127,13 +127,13 @@ export interface IGuildVault {
|
||||
}
|
||||
|
||||
export interface IDojoClient {
|
||||
_id: IOid; // ID of the guild
|
||||
_id: IOidWithLegacySupport; // ID of the guild
|
||||
Name: string;
|
||||
Tier: number;
|
||||
TradeTax?: number;
|
||||
FixedContributions: boolean;
|
||||
DojoRevision: number;
|
||||
AllianceId?: IOid;
|
||||
AllianceId?: IOidWithLegacySupport;
|
||||
Vault?: IGuildVault;
|
||||
Class?: number; // Level
|
||||
RevisionTime: number;
|
||||
@ -148,11 +148,11 @@ export interface IDojoClient {
|
||||
}
|
||||
|
||||
export interface IDojoComponentClient {
|
||||
id: IOid;
|
||||
SortId?: IOid;
|
||||
id: IOidWithLegacySupport;
|
||||
SortId?: IOidWithLegacySupport;
|
||||
pf: string; // Prefab (.level)
|
||||
ppf: string;
|
||||
pi?: IOid; // Parent ID. N/A to root.
|
||||
pi?: IOidWithLegacySupport; // Parent ID. N/A to root.
|
||||
op?: string; // Name of the door within this room that leads to its parent. N/A to root.
|
||||
pp?: string; // Name of the door within the parent that leads to this room. N/A to root.
|
||||
Name?: string;
|
||||
@ -166,7 +166,7 @@ export interface IDojoComponentClient {
|
||||
DestructionTimeRemaining?: number; // old versions
|
||||
Decos?: IDojoDecoClient[];
|
||||
DecoCapacity?: number;
|
||||
PaintBot?: IOid;
|
||||
PaintBot?: IOidWithLegacySupport;
|
||||
PendingColors?: number[];
|
||||
Colors?: number[];
|
||||
PendingLights?: number[];
|
||||
@ -191,7 +191,7 @@ export interface IDojoComponentDatabase
|
||||
}
|
||||
|
||||
export interface IDojoDecoClient {
|
||||
id: IOid;
|
||||
id: IOidWithLegacySupport;
|
||||
Type: string;
|
||||
Pos: number[];
|
||||
Rot: number[];
|
||||
@ -285,7 +285,7 @@ export interface IGuildAdDatabase {
|
||||
}
|
||||
|
||||
export interface IAllianceClient {
|
||||
_id: IOid;
|
||||
_id: IOidWithLegacySupport;
|
||||
Name: string;
|
||||
MOTD?: ILongMOTD;
|
||||
LongMOTD?: ILongMOTD;
|
||||
@ -306,7 +306,7 @@ export interface IAllianceDatabase {
|
||||
}
|
||||
|
||||
export interface IAllianceMemberClient {
|
||||
_id: IOid;
|
||||
_id: IOidWithLegacySupport;
|
||||
Name: string;
|
||||
Tier: number;
|
||||
Pending: boolean;
|
||||
@ -314,7 +314,7 @@ export interface IAllianceMemberClient {
|
||||
Permissions: number;
|
||||
MemberCount: number;
|
||||
ClanLeader?: string;
|
||||
ClanLeaderId?: IOid;
|
||||
ClanLeaderId?: IOidWithLegacySupport;
|
||||
OriginalPlatform?: number;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { Types } from "mongoose";
|
||||
|
||||
export interface ISession {
|
||||
sessionId: string;
|
||||
creatorId: string;
|
||||
sessionId: Types.ObjectId;
|
||||
creatorId: Types.ObjectId;
|
||||
maxPlayers?: number;
|
||||
minPlayers?: number;
|
||||
privateSlots?: number;
|
||||
@ -18,7 +20,7 @@ export interface ISession {
|
||||
customSettings?: string;
|
||||
rewardSeed?: number;
|
||||
guildId?: string;
|
||||
buildId?: number;
|
||||
buildId?: number | bigint;
|
||||
platform?: number;
|
||||
xplatform?: boolean;
|
||||
freePublic?: number;
|
||||
|
Loading…
x
Reference in New Issue
Block a user