Jump to content

Server side only mod that writes stats to file


ZomboidGrognard

Recommended Posts

I would like to develop a server side only mod that collects game data like player kills and writes the data to a file on the server. My plan is then to take that data and import it into discord.

 

I created a basic mod files and added it to the /home/container/.cache/Server/server.ini "mod=" section.

 

When I tried to login with a client it wouldn't allow me as I didn't have the server side mode installed. 

 

How would I create a server only side mod that doesn't require clients to install one?

 

Second question:

 

I would like to write player data to a file on the server.  Does anyone have any base code I could reference that would get me started with this capability?

Link to comment
Share on other sites

I don't think you can have a server only mod, but you can make a mod that works on a server and does nothing client side.

 

My 'Daily Kill Count' (on the Steam workshop) has code for writing to a file, I borrowed some code from the Twitch Stats mod by M3ss.

 

https://steamcommunity.com/sharedfiles/filedetails/?id=2629062026&searchtext=twitch+stats

 

File is created in C:\Users\username\Zomboid\Lua\, I don't know if there is a way of writing to a file somewhere else.

 

Link to comment
Share on other sites

On 11/16/2023 at 8:54 AM, Hugo Qwerty said:

a mod that works on a server and does nothing client side.

by that do you mean it only works for players who have installed the mod on their end? I don't think the mod will work if placed on the server's back end.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...