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
SocketConnection parser cast + RoomChatHandler arg-order fix
- SocketConnection.processMessage() did 'new events[0].parserClass()' where parserClass is typed as 'Function' on IMessageEvent (no construct signature). Cast to 'new () => IMessageParser' at the call site so the spawned instance is type-correct downstream. - RoomChatHandler dispatched RoomSessionChatEvent with the args in the wrong order: '[]' (intended as the 'links' array) was landing in the 'chatColours' string slot. Swap to '"", []' so links go to position 8 and chatColours stays a string.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ICodec, IConnection, IMessageComposer, IMessageConfiguration, IMessageDataWrapper, IMessageEvent, WebSocketEventEnum } from '@nitrots/api';
|
||||
import { ICodec, IConnection, IMessageComposer, IMessageConfiguration, IMessageDataWrapper, IMessageEvent, IMessageParser, WebSocketEventEnum } from '@nitrots/api';
|
||||
import { GetConfiguration } from '@nitrots/configuration';
|
||||
import { GetEventDispatcher, NitroEvent, NitroEventType, ReconnectEvent } from '@nitrots/events';
|
||||
import { NitroLogger } from '@nitrots/utils';
|
||||
@@ -509,7 +509,7 @@ export class SocketConnection implements IConnection
|
||||
|
||||
try
|
||||
{
|
||||
const parser = new events[0].parserClass();
|
||||
const parser = new (events[0].parserClass as new () => IMessageParser)();
|
||||
|
||||
if(!parser || !parser.flush() || !parser.parse(wrapper)) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user