diff --git a/src/ts/plugins/embedscript.ts b/src/ts/plugins/embedscript.ts index 32aa323d..66854b24 100644 --- a/src/ts/plugins/embedscript.ts +++ b/src/ts/plugins/embedscript.ts @@ -190,9 +190,15 @@ addWorkerFunction('setState', async (statename, data) => { if(typeof data !== 'string' && typeof data !== 'number' && typeof data !== 'boolean'){ return false } + if(typeof data === 'string' && data.length > 100000){ + return false + } if(!chat.scriptstate){ chat.scriptstate = {} } + if(Object.keys(chat.scriptstate).length > 50){ + return false + } chat.scriptstate[statename] = data char.chats[char.chatPage] = chat db.characters[selectedChar] = char