ChatPatches icon indicating copy to clipboard operation
ChatPatches copied to clipboard

World specific chat history

Open Dark-Phoenix-01 opened this issue 1 year ago • 7 comments

Issue: Basically when I join a server, all of the chat messages are restored including chats from single player or other multiplayer servers. Most of the times we do not need those. And many times it gets difficult to find server specific chat history.

Proposed solution: Create a configurable toggle that'll help up restore chat history either globally or world specific. Also world specific chat history reload should reduce chat load time too.

Note: As far as I have explored, I did not find this feature in the mod. So if it is already present and I missed it, I apologize in advance.

Dark-Phoenix-01 avatar Aug 13 '24 18:08 Dark-Phoenix-01

it sounds to me like you're interested in using the vanilla chat clearing option, which clears the chat when leaving a world/server

mrbuilder1961 avatar Aug 13 '24 19:08 mrbuilder1961

No, what I meant is having world specific chat history. Lets say I join world A, do some chat and leave. Then join world B, do some chat and leave. When I join back to world A, it should restore chats from world A only and not B. And when I join world B, it should restore chats from world B only and not A.

Dark-Phoenix-01 avatar Aug 15 '24 10:08 Dark-Phoenix-01

oh okay interesting. so why is this preferred over the current system + searching?

mrbuilder1961 avatar Aug 15 '24 11:08 mrbuilder1961

I would say we rarely need chat history from one server in another. Mostly we like to see what was last discussion on the specific server only. Yes we can search, but that's not the same as getting the chat history of that server easily viewable. Its just easy to navigate through instead of searching through all chat history especially if I joined multiple servers since I joined the current server last. I'm not saying make it default. But can make it a switch where in global mode it'll store all chats in a single file and restore from that. And in world specific mode it'll store all chats by server name/ip and restore from that.

Dark-Phoenix-01 avatar Aug 15 '24 15:08 Dark-Phoenix-01

revisiting this and i could probably do this via a new system like ./logs/chatlog/chatlog_<levelname>.json. but an easier one could just be to, when enabled, filter all messages to only show if they're under a boundary line corresponding to the current level?

ex. w this chat,

[serv]
hey i'm on a server!
aaaah!
bye
[world]
how nice.
a priv worl just for me
ah creeper!
Player was blown up.
[serv]
i love you hypixel

the opt enabled, and in serv, would look like:

[serv]
hey i'm on a server!
aaaah!
bye
[serv]
i love you hypixel

feels pretty smooth to me, the only thing is it'd require boundary lines to be enabled (easy) and boundaries of the current level to be retained in the logs (hard? not sure). this feels pretty nice though so i might get to work on this soon!

mrbuilder1961 avatar Jul 27 '25 05:07 mrbuilder1961

Yeah. I assume filtering would be easier and faster to implement. And as long as it works, it's totally fine by me however it is implemented. But, in future I suppose modular approach would be better for both handling, clearing, restoring the chats. As for now, any way is fine really.

Dark-Phoenix-01 avatar Jul 28 '25 18:07 Dark-Phoenix-01

Note: I have hot-patched some of the code to make it retain world specific chat history in separate files and load them when joining the world(By redefining PATH to world name). However, since I have no experience in modding, it works as is and I suppose chat clearing and some other stuffs might be broken. But for streamlined scenario it properly saves and loads from world specific files.

Dark-Phoenix-01 avatar Jul 30 '25 16:07 Dark-Phoenix-01