You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🆙 Added Youtube Brtoadcast
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -494,4 +494,5 @@ export class IncomingHeader
|
||||
// YouTube Room Broadcast
|
||||
public static YOUTUBE_ROOM_BROADCAST = 8001;
|
||||
public static YOUTUBE_ROOM_WATCHERS = 8002;
|
||||
public static YOUTUBE_ROOM_SETTINGS = 8003;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '@nitrots/api';
|
||||
import { MessageEvent } from '@nitrots/events';
|
||||
import { YouTubeRoomSettingsParser } from '../../../parser';
|
||||
|
||||
export class YouTubeRoomSettingsEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, YouTubeRoomSettingsParser);
|
||||
}
|
||||
|
||||
public getParser(): YouTubeRoomSettingsParser
|
||||
{
|
||||
return this.parser as YouTubeRoomSettingsParser;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './YouTubeRoomBroadcastEvent';
|
||||
export * from './YouTubeRoomSettingsEvent';
|
||||
export * from './YouTubeRoomWatchersEvent';
|
||||
|
||||
@@ -507,4 +507,5 @@ export class OutgoingHeader
|
||||
// YouTube Room Broadcast
|
||||
public static YOUTUBE_ROOM_PLAY = 8001;
|
||||
public static YOUTUBE_ROOM_WATCHING = 8002;
|
||||
public static YOUTUBE_ROOM_SETTINGS = 8003;
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import { IMessageComposer } from '@nitrots/api';
|
||||
|
||||
export class YouTubeRoomSettingsComposer implements IMessageComposer<any[]>
|
||||
{
|
||||
private _data: any[];
|
||||
|
||||
constructor(enabled: boolean)
|
||||
{
|
||||
this._data = [enabled ? 1 : 0];
|
||||
}
|
||||
|
||||
public getMessageArray() { return this._data; }
|
||||
public dispose(): void {}
|
||||
}
|
||||
+2
@@ -6,6 +6,8 @@ export class YouTubeRoomWatchingComposer implements IMessageComposer<any[]>
|
||||
|
||||
constructor(watching: boolean)
|
||||
{
|
||||
// Send as int (0/1) instead of bare boolean to avoid
|
||||
// serialization ambiguity in the Nitro wire protocol.
|
||||
this._data = [watching ? 1 : 0];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './YouTubeRoomPlayComposer';
|
||||
export * from './YouTubeRoomSettingsComposer';
|
||||
export * from './YouTubeRoomWatchingComposer';
|
||||
|
||||
@@ -21,6 +21,9 @@ export class BadgeReceivedParser implements IMessageParser
|
||||
|
||||
this._badgeId = wrapper.readInt();
|
||||
this._badgeCode = wrapper.readString();
|
||||
// Extra field appended by the Arcturus-Nitro fork: sender username for
|
||||
// badges awarded by a staff member via the `:badge` command. Read
|
||||
// defensively so older servers that don't send it still parse cleanly.
|
||||
this._senderName = wrapper.bytesAvailable ? wrapper.readString() : '';
|
||||
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class YouTubeRoomSettingsParser implements IMessageParser
|
||||
{
|
||||
private _youtubeEnabled: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._youtubeEnabled = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
this._youtubeEnabled = wrapper.readInt() === 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public get youtubeEnabled(): boolean { return this._youtubeEnabled; }
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './YouTubeRoomBroadcastParser';
|
||||
export * from './YouTubeRoomSettingsParser';
|
||||
export * from './YouTubeRoomWatchersParser';
|
||||
|
||||
Reference in New Issue
Block a user