Fix spectator not working

This commit is contained in:
Holly Stubbs 2023-09-10 18:31:38 +01:00
parent 09dc1ffb76
commit f66c867d17
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E

View file

@ -20,11 +20,13 @@ export default class SpectatorManager {
let spectateStream:DataStream;
if (userToSpectate.spectatorStream === undefined) {
user.spectatorStream = spectateStream = userToSpectate.spectatorStream = this.shared.streams.CreateStream(`spectator:${userToSpectate.username}`);
} else {
user.spectatorStream = spectateStream = userToSpectate.spectatorStream;
}
user.spectatingUser = userToSpectate;
spectateStream.AddUser(user);
let osuPacketWriter = osu.Bancho.Writer();