Binato/server/packets/ChangeAction.ts

14 lines
433 B
TypeScript
Raw Permalink Normal View History

import PresenceData from "../interfaces/packetTypes/PresenceData";
2023-09-10 12:59:22 +01:00
import User from "../objects/User";
import StatusUpdate from "./StatusUpdate";
2022-11-19 01:06:03 +00:00
2023-10-04 12:28:47 +01:00
export default function ChangeAction(user:User, data:PresenceData) {
2022-11-19 01:06:03 +00:00
user.updatePresence(data);
if (user.spectatorStream != null) {
2023-08-20 13:03:01 +01:00
const statusUpdate = StatusUpdate(user.shared, user.id);
if (statusUpdate instanceof Buffer) {
user.spectatorStream.Send(statusUpdate);
}
2022-11-19 01:06:03 +00:00
}
}