mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-27 01:40:52 +01:00
Fix reference issue with packet parsers
This commit is contained in:
parent
dce98c249f
commit
43cc4d7222
@ -301,9 +301,12 @@ export class SocketConnection extends EventDispatcher implements IConnection
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const parser = events[0].parser;
|
//@ts-ignore
|
||||||
|
const parser = new events[0].parserClass();
|
||||||
|
|
||||||
if(!parser || !parser.flush() || !parser.parse(wrapper)) return null;
|
if(!parser || !parser.flush() || !parser.parse(wrapper)) return null;
|
||||||
|
|
||||||
|
for(const event of events) (event.parser = parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (e)
|
catch (e)
|
||||||
|
@ -67,13 +67,6 @@ export class MessageClassManager
|
|||||||
existing = [];
|
existing = [];
|
||||||
|
|
||||||
this._messageInstancesById.set(header, existing);
|
this._messageInstancesById.set(header, existing);
|
||||||
|
|
||||||
//@ts-ignore
|
|
||||||
event.parser = new event.parserClass();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
event.parser = existing[0].parser;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
existing.push(event);
|
existing.push(event);
|
||||||
|
Loading…
Reference in New Issue
Block a user