decord/source/modules/guild_rooms/GuildRoomUtils.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

85 lines
3 KiB
TypeScript

// Module ID: 4721
// Function ID: 4722
// Name: serverGuildRoomObjectToClient
// Dependencies: [4718, 4722, 4723, 4720, 4719, 2]
// Exports: findSeat, serverGuildRoomToClient
// Module 4721 (serverGuildRoomObjectToClient)
import GuildRoomObjectTypes from "GuildRoomObjectTypes" /* 4719 */;
import closure_2 from "resolveCreatingNotes" /* 4718 */;
import { GUILD_ROOM_BACKGROUND_CONFIG as closure_3 } from "items" /* 4722 */;
require = arg1;
function serverGuildRoomObjectToClient(object_type) {
if (object_type.object_type === GuildRoomObjectTypes.GuildRoomObjectTypes.PLANT) {
let obj = { objectType: null };
obj[0] = tmp(4719).GuildRoomObjectTypes.PLANT;
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);
} else {
obj = { objectType: null };
obj[0] = tmp(4719).GuildRoomObjectTypes.NOTE;
obj1 = { objectId: null, createdBy: null, updatedAt: null, updatedBy: null };
({ 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);
}
return obj;
}
let result = require("set").fileFinishedImporting("modules/guild_rooms/GuildRoomUtils.tsx");
export const findSeat = function findSeat(items2, channelId, channelId2) {
const _require = channelId;
room = room.getRoom(channelId2);
let background;
if (room != null) {
background = room.background;
}
if (background == null) {
background = _require(4723).GuildRoomBackgrounds.DEFAULT;
}
const seats = table[background].seats;
if (null != items2) {
if (items2 !== _require(4720).GuildRoomSeats.UNSET) {
let found = seats[items2];
}
return found;
}
const values = Object.values(seats);
found = values.find((position) => position.position.x === x.x && position.position.y === tmp.y);
};
export const serverGuildRoomToClient = function serverGuildRoomToClient(body) {
const obj = {
roomId: body.room_id,
users: users.reduce((set, userId) => {
const result = set.set(userId.user_id, { userId: userId.user_id, seat: userId.seat, position: userId.position, statusId: userId.status_id, statusText: userId.status_text });
return set;
}, new Map()),
background: body.background,
objects: null
};
users = body.users;
const entries = Object.entries(body.objects);
const map = new Map();
obj[3] = entries.reduce((set) => {
[tmp, arr] = arg1;
const result = set.set(+tmp, arr.map(closure_4));
return set;
}, new Map());
return obj;
};