Actually, the message format is LLSD notation not python (d'oh)

This commit is contained in:
Casper Warden
2023-11-10 14:25:34 +00:00
parent 72d4eff2d8
commit 3c69b8f05e
26 changed files with 792 additions and 682 deletions

View File

@@ -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));
}
}
}