Page 1 of 1

Accessing chat history locally for custom display hardware

Posted: Mon Nov 20, 2023 6:02 pm
by pewdiepieofficial
Hey all, long time player first time poster. I've been wanting to get back into SS13 after a couple years hiatus and also exercise my programming muscles a bit with a dumb side project. I've been running into a brick wall and I'm hoping I can get some insight from the community.

I've been attempting to find a way to access the messages from the chat window in real time to feed to a python script that will drive an external display of some sort, maybe an LED matrix or a receipt printer or something, but so far I've had no luck. I'm not new to programming by any means but most of my experience is along the lines of embedded systems and using python for data science-y things. I don't really have any specific goal I'm trying to accomplish with this, just have some fun messing around with hardware odds and ends I have laying around during some free time.

I figure the messages must be cached locally somewhere, since I can exit a game a reload it and the messages reappear, but I cannot for the life of me figure out how the system works. So far I've tried searching through the files under Documents/BYOND/cache and capturing network traffic to/from the game using Wireshark but nothing I've seen so far looks anything like a chat messages. Another avenue I tried is looking into the code behind the "Save chat log" button, which seems to indicate that there is a JavaScript class called ChatRenderer that stores the messages, but I'm not sure if this is accessible to the user at all or how I would go about doing that. I guess worst case scenario I can take screen captures of the chat portion of the window and run OCR on it, but that seems rather clunky.

I will say that looking through the tgstation codebase has given me a new appreciation of the work that went into this game. The number of moving parts almost overwhelming.

Please move this post if it doesn't belong here. I'm new to the forum and this seemed like a good starting point.

Re: Accessing chat history locally for custom display hardware

Posted: Tue Nov 21, 2023 3:36 am
by oranges
they're stored in internet explorers local storage