nwesterhausen / valheim-discordconnector

A plugin to connect a Valheim server to a discord webhook.
https://discord-connector.valheim.games.nwest.one/
MIT License
27 stars 13 forks source link

send in-Game chat #36

Open nwesterhausen opened 3 years ago

nwesterhausen commented 3 years ago

ttestbetterthanftest on NexusMods:

do you think it would be possible to report on discord the conversation of the inGame chat?

nwesterhausen commented 3 years ago

I feel convinced that say and whisper leave one client and go to other clients in range when they are sent. These never seem to be visible to a dedicated server, and when running on the client-hosted server, I can only see the say and whisper messages from the host.


I have tried hooking into both the OnNewChat and the RPC methods in the Chat class. When running on the client, what the player says and whispers does go through the OnNewChat method. But on a dedicated server there is nothing. I'm pretty sure the says and whispers are simply routed by the server between clients that are close to one another.

It may be possible to do some complicated patching and connect the OnNewChat to send a message to the server for all types of messages that this app could listen for but, for me, this isn't a priority to dig into -- so if someone wanted to dig more into this and find out how to make it work, please do 😄

CruxCraft commented 3 years ago

The best work around I have found for this is to use a mod like BetterChat which makes normal chat turn into shouts & then players have to type /say to do normal chats as before (it removes the map pings, but requires all players to have it installed client side so this isn't a server-side fix). It is working great for our needs though, as it makes communication easier across the server as well... wish there was a toggle instead of needing to type /say or /shout for every message

As normal convos sort of seem like they are intended to be local anyway and not broadcast, this might be the better route than trying to figure out chat & whispers. idk.