NOTE: This setup is not required for using the mod.
This article describes how to setup AstroChat to send all chat log events to a remote web server for custom handling. It assumes you have access to a website where you can process GET requests sent to a specific URL. It also assumes you know how to do something useful with the data that is received at that URL.
In order to get AstroChat to send chat log events somewhere, you need to tell it how and where to send them. This can be done by adding some information to Astroneer's engine.ini configuration file. In a standard multiplayer session, only the host player needs to configure these settings. Remote client players will ignore these settings because only the server side of AstroChat attempts to send data to a webhook.
The typical location of engine.ini for the Steam version of Astroneer is
%localappdata%\Astro\Saved\Config\WindowsNoEditor
If you are running a dedicated server, you can find the server's engine.ini within the server's directory at
Astro\Saved\Config\WindowsServer
Make sure the game or dedicated server is shut down before editing the file. Open the file in any plaintext editor and add the following section:
[/Game/ChatMod/ChatManager.ChatManager_C]
WebhookUrl="http://my.server.address/myscript.php"
WebhookParams=mycustomparam1=optional&mycustomparam2=optional
Those property values are examples only. You will need to update them to use the URL of your chat handling script and any custom params you want to pass to the script. You can leave the params blank if you don't need them. They are primarily there to support more specialized use cases.
Once you have the properties set, save the file. Then run the game/server. Load into a save or server and send some chat messages. You should receive data at your webhook url. The data will be in the form of GET parameters. In addition to any custom params you may have set in the config, you will also receive the following params.
evt
The "evt" param indicates the type of event that is being logged. It will be one of the following:
- join - a player has joined the game
- leave - a player has left the game
- chat - a player has sent a chat message
- cmd - a player has entered a console command (by starting a message with '/')
name
The "name'" param contains the name of the player that is the source of the event.
msg
The "msg" param contains the text associated with the event.
- join/leave - The msg param is empty
- chat - The msg param contains the chat message
- cmd - The msg param contains the full text of the command, not including the starting '/' character.