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
Merge branch 'Dev' into feat/wired-fixes-apr08
This commit is contained in:
@@ -315,6 +315,9 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
||||
|
||||
const url = canvas.toDataURL('image/png');
|
||||
|
||||
canvas.width = 0;
|
||||
canvas.height = 0;
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -23,6 +23,12 @@ export class ImageData
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
if(this._container)
|
||||
{
|
||||
this._container.destroy({ children: true });
|
||||
this._container = null;
|
||||
}
|
||||
|
||||
this._texture = null;
|
||||
this._regPoint = null;
|
||||
this._colorTransform = null;
|
||||
|
||||
@@ -117,7 +117,12 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager
|
||||
|
||||
TextureUtils.writeToTexture(container, renderTexture);
|
||||
|
||||
return await TextureUtils.generateImage(renderTexture);
|
||||
const image = await TextureUtils.generateImage(renderTexture);
|
||||
|
||||
renderTexture.destroy(true);
|
||||
container.destroy({ children: true });
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
public get effects(): Map<string, IRoomCameraWidgetEffect>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -495,4 +495,9 @@ export class IncomingHeader
|
||||
public static USER_PREFIXES = 7001;
|
||||
public static PREFIX_RECEIVED = 7002;
|
||||
public static ACTIVE_PREFIX_UPDATED = 7003;
|
||||
|
||||
// YouTube Room Broadcast
|
||||
public static YOUTUBE_ROOM_BROADCAST = 8001;
|
||||
public static YOUTUBE_ROOM_WATCHERS = 8002;
|
||||
public static YOUTUBE_ROOM_SETTINGS = 8003;
|
||||
}
|
||||
|
||||
@@ -13,3 +13,4 @@ export * from './pet';
|
||||
export * from './session';
|
||||
export * from './unit';
|
||||
export * from './unit/chat';
|
||||
export * from './youtube';
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '@nitrots/api';
|
||||
import { MessageEvent } from '@nitrots/events';
|
||||
import { YouTubeRoomBroadcastParser } from '../../../parser';
|
||||
|
||||
export class YouTubeRoomBroadcastEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, YouTubeRoomBroadcastParser);
|
||||
}
|
||||
|
||||
public getParser(): YouTubeRoomBroadcastParser
|
||||
{
|
||||
return this.parser as YouTubeRoomBroadcastParser;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '@nitrots/api';
|
||||
import { MessageEvent } from '@nitrots/events';
|
||||
import { YouTubeRoomWatchersParser } from '../../../parser';
|
||||
|
||||
export class YouTubeRoomWatchersEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, YouTubeRoomWatchersParser);
|
||||
}
|
||||
|
||||
public getParser(): YouTubeRoomWatchersParser
|
||||
{
|
||||
return this.parser as YouTubeRoomWatchersParser;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './YouTubeRoomBroadcastEvent';
|
||||
export * from './YouTubeRoomSettingsEvent';
|
||||
export * from './YouTubeRoomWatchersEvent';
|
||||
@@ -510,4 +510,9 @@ export class OutgoingHeader
|
||||
public static SET_ACTIVE_PREFIX = 7012;
|
||||
public static DELETE_PREFIX = 7013;
|
||||
public static PURCHASE_PREFIX = 7014;
|
||||
|
||||
// YouTube Room Broadcast
|
||||
public static YOUTUBE_ROOM_PLAY = 8001;
|
||||
public static YOUTUBE_ROOM_WATCHING = 8002;
|
||||
public static YOUTUBE_ROOM_SETTINGS = 8003;
|
||||
}
|
||||
|
||||
@@ -17,3 +17,4 @@ export * from './RedeemItemClothingComposer';
|
||||
export * from './session';
|
||||
export * from './unit';
|
||||
export * from './unit/chat';
|
||||
export * from './youtube';
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { IMessageComposer } from '@nitrots/api';
|
||||
|
||||
export class YouTubeRoomPlayComposer implements IMessageComposer<any[]>
|
||||
{
|
||||
private _data: any[];
|
||||
|
||||
constructor(videoId: string, playlist: string[])
|
||||
{
|
||||
this._data = [videoId, playlist.length, ...playlist];
|
||||
}
|
||||
|
||||
public getMessageArray() { return this._data; }
|
||||
public dispose(): void {}
|
||||
}
|
||||
+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 {}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { IMessageComposer } from '@nitrots/api';
|
||||
|
||||
export class YouTubeRoomWatchingComposer implements IMessageComposer<any[]>
|
||||
{
|
||||
private _data: 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];
|
||||
}
|
||||
|
||||
public getMessageArray() { return this._data; }
|
||||
public dispose(): void {}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './YouTubeRoomPlayComposer';
|
||||
export * from './YouTubeRoomSettingsComposer';
|
||||
export * from './YouTubeRoomWatchingComposer';
|
||||
@@ -1,14 +1,16 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class BadgeReceivedParser implements IMessageParser
|
||||
{
|
||||
private _badgeId: number;
|
||||
private _badgeCode: string;
|
||||
private _senderName: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._badgeId = 0;
|
||||
this._badgeCode = null;
|
||||
this._senderName = '';
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -19,6 +21,10 @@ 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;
|
||||
}
|
||||
@@ -32,4 +38,9 @@ export class BadgeReceivedParser implements IMessageParser
|
||||
{
|
||||
return this._badgeCode;
|
||||
}
|
||||
|
||||
public get senderName(): string
|
||||
{
|
||||
return this._senderName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,3 +13,4 @@ export * from './pet';
|
||||
export * from './session';
|
||||
export * from './unit';
|
||||
export * from './unit/chat';
|
||||
export * from './youtube';
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class YouTubeRoomBroadcastParser implements IMessageParser
|
||||
{
|
||||
private _videoId: string;
|
||||
private _senderName: string;
|
||||
private _playlist: string[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._videoId = '';
|
||||
this._senderName = '';
|
||||
this._playlist = [];
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._videoId = wrapper.readString();
|
||||
this._senderName = wrapper.readString();
|
||||
const count = wrapper.readInt();
|
||||
this._playlist = [];
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
this._playlist.push(wrapper.readString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public get videoId(): string { return this._videoId; }
|
||||
public get senderName(): string { return this._senderName; }
|
||||
public get playlist(): string[] { return this._playlist; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||
|
||||
export class YouTubeRoomWatchersParser implements IMessageParser
|
||||
{
|
||||
private _watcherIds: number[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._watcherIds = [];
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
const count = wrapper.readInt();
|
||||
this._watcherIds = [];
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
this._watcherIds.push(wrapper.readInt());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public get watcherIds(): number[] { return this._watcherIds; }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './YouTubeRoomBroadcastParser';
|
||||
export * from './YouTubeRoomSettingsParser';
|
||||
export * from './YouTubeRoomWatchersParser';
|
||||
@@ -239,6 +239,8 @@ export class RoomPreviewer
|
||||
|
||||
if(this.isRoomEngineReady)
|
||||
{
|
||||
if((this._currentPreviewObjectCategory === RoomObjectCategory.FLOOR) && (this._currentPreviewObjectType === classId) && (this._currentPreviewObjectData === (extra || ''))) return RoomPreviewer.PREVIEW_OBJECT_ID;
|
||||
|
||||
this.reset(false);
|
||||
|
||||
this._currentPreviewObjectType = classId;
|
||||
|
||||
@@ -164,6 +164,18 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement
|
||||
|
||||
if(this._avatarImage) this._avatarImage.dispose();
|
||||
|
||||
if(this._cachedAvatars)
|
||||
{
|
||||
for(const avatar of this._cachedAvatars.getValues()) avatar && avatar.dispose();
|
||||
this._cachedAvatars.reset();
|
||||
}
|
||||
|
||||
if(this._cachedAvatarEffects)
|
||||
{
|
||||
for(const avatar of this._cachedAvatarEffects.getValues()) avatar && avatar.dispose();
|
||||
this._cachedAvatarEffects.reset();
|
||||
}
|
||||
|
||||
if(this._reflectionOppositeTexture)
|
||||
{
|
||||
this._reflectionOppositeTexture.destroy(true);
|
||||
|
||||
@@ -27,6 +27,17 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
|
||||
this._photoUrl = null;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
if (this._thumbnailTexture instanceof RenderTexture) {
|
||||
this._thumbnailTexture.destroy(true);
|
||||
}
|
||||
|
||||
this._thumbnailTexture = null;
|
||||
this._thumbnailImageNormal = null;
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
public get hasThumbnailImage(): boolean {
|
||||
return !(this._thumbnailImageNormal == null);
|
||||
}
|
||||
|
||||
@@ -158,6 +158,16 @@ export class RoomPlane implements IRoomPlane
|
||||
this._animationLayers = [];
|
||||
}
|
||||
|
||||
this._windowReflectionLastVisible.clear();
|
||||
this._windowReflectionFadeOut.clear();
|
||||
this._windowReflectionFirstSeenAt.clear();
|
||||
|
||||
if(this._maskFilter)
|
||||
{
|
||||
this._maskFilter.destroy();
|
||||
this._maskFilter = null;
|
||||
}
|
||||
|
||||
this._disposed = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user