Binato/server/packets/ChangeAction.ts

13 lines
357 B
TypeScript
Raw Normal View History

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-09-10 12:59:22 +01:00
export default function ChangeAction(user:User, data:any) {
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
}
}