decord/source/modules/guild_rooms/GuildRoomUtils.tsx

71 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9905
// Function ID: 9906
2026-07-29 08:29:29 +00:00
// Name: serverGuildRoomObjectToClient
2026-08-24 06:08:38 +00:00
// Dependencies: [9906, 9907, 9904, 2]
2026-08-11 06:20:06 +00:00
// Exports: findSeat, serverGuildRoomToClient
2026-08-24 06:08:38 +00:00
// Module 9905 (serverGuildRoomObjectToClient)
import set2 from "set" /* 2 */;
import GuildRoomObjectTypes from "GuildRoomObjectTypes" /* 9904 */;
import items from "items" /* 9906 */;
2026-07-20 16:05:17 +00:00
function serverGuildRoomObjectToClient(object_type) {
2026-08-24 06:08:38 +00:00
if (object_type.object_type === GuildRoomObjectTypes.GuildRoomObjectTypes.PLANT) {
2026-07-29 08:29:29 +00:00
let obj = { objectType: null };
2026-08-24 06:08:38 +00:00
obj[0] = tmp(9904).GuildRoomObjectTypes.PLANT;
2026-07-29 08:29:29 +00:00
obj = { objectId: null, createdBy: null, updatedAt: null, updatedBy: null };
({ object_id: obj2[0], created_by: obj2[1] } = object_type);
let date;
if (null != object_type.updated_at) {
const _Date2 = Date;
date = new Date(object_type.updated_at);
}
obj[2] = date;
obj[3] = object_type.updated_by;
const merged = Object.assign(obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { objectType: null };
2026-08-24 06:08:38 +00:00
obj[0] = tmp(9904).GuildRoomObjectTypes.NOTE;
obj1 = { objectId: null, createdBy: null, updatedAt: null, updatedBy: null };
2026-07-29 08:29:29 +00:00
({ object_id: obj4[0], created_by: obj4[1] } = object_type);
let date1;
if (null != object_type.updated_at) {
const _Date = Date;
date1 = new Date(object_type.updated_at);
}
obj1[2] = date1;
obj1[3] = object_type.updated_by;
const merged1 = Object.assign(obj1);
({ content: obj3.content, position: obj3.position } = object_type);
2026-07-20 16:05:17 +00:00
}
return obj;
}
2026-08-24 06:08:38 +00:00
let closure_2 = items.GUILD_ROOM_BACKGROUND_CONFIG;
let result = set2.fileFinishedImporting("modules/guild_rooms/GuildRoomUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-08-11 06:20:06 +00:00
export const findSeat = function findSeat(items1) {
const _require = items1;
2026-08-24 06:08:38 +00:00
const seats = table[_require(undefined, 9907).GuildRoomBackgrounds.DEFAULT].seats;
2026-08-11 06:20:06 +00:00
return seats.find((position) => position.position.x === items1.x && position.position.y === tmp.y);
};
2026-07-20 16:05:17 +00:00
export const serverGuildRoomToClient = function serverGuildRoomToClient(body) {
2026-08-24 06:08:38 +00:00
const obj = {
roomId: body.room_id,
users: users.reduce((set, userId) => {
const result = set.set(userId.user_id, { userId: userId.user_id, position: userId.position, statusId: userId.status_id, statusText: userId.status_text });
return set;
}, new Map()),
background: body.background,
objects: null
};
users = body.users;
2026-07-20 16:05:17 +00:00
const entries = Object.entries(body.objects);
const map = new Map();
2026-07-29 08:29:29 +00:00
obj[3] = entries.reduce((set) => {
2026-07-20 16:05:17 +00:00
[tmp, arr] = arg1;
2026-08-11 06:20:06 +00:00
const result = set.set(+tmp, arr.map(closure_3));
2026-07-20 16:05:17 +00:00
return set;
}, new Map());
return obj;
};