Actually, the message format is LLSD notation not python (d'oh)
This commit is contained in:
@@ -38,9 +38,8 @@ import { ObjectResolvedEvent } from '../events/ObjectResolvedEvent';
|
||||
import { Avatar } from './public/Avatar';
|
||||
import Timer = NodeJS.Timer;
|
||||
import { GenericStreamingMessageMessage } from './messages/GenericStreamingMessage';
|
||||
import { PythonParser } from './python/PythonParser';
|
||||
import { PythonDict } from './python/PythonDict';
|
||||
import { PythonList } from './python/PythonList';
|
||||
import { LLSDNotationParser } from './llsd/LLSDNotationParser';
|
||||
import { LLSDMap } from './llsd/LLSDMap';
|
||||
|
||||
export class ObjectStoreLite implements IObjectStore
|
||||
{
|
||||
@@ -85,12 +84,12 @@ export class ObjectStoreLite implements IObjectStore
|
||||
const genMsg = packet.message as GenericStreamingMessageMessage;
|
||||
if (genMsg.MethodData.Method === 0x4175)
|
||||
{
|
||||
// Whoever decided to use python notation for this is a psychopath
|
||||
const result = PythonParser.parse(genMsg.DataBlock.Data.toString('utf-8'));
|
||||
if (result instanceof PythonDict)
|
||||
// LLSD Notation format
|
||||
const result = LLSDNotationParser.parse(genMsg.DataBlock.Data.toString('utf-8'));
|
||||
if (result instanceof LLSDMap)
|
||||
{
|
||||
const arr = result.get('te');
|
||||
if (arr instanceof PythonList)
|
||||
if (Array.isArray(arr))
|
||||
{
|
||||
if (arr.length === 0)
|
||||
{
|
||||
@@ -98,7 +97,7 @@ export class ObjectStoreLite implements IObjectStore
|
||||
}
|
||||
|
||||
// TODO: figure out what to do with this..
|
||||
// console.log(JSON.stringify(result, null, 4));
|
||||
console.log(JSON.stringify(result, null, 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user