Jump to content

Recommended Posts

Hi,

i got a server only mod (No F&F by CarlZalph) that players shouldn't know about (else defeats it's purpose), so looked at:

and with this info in mind compared with the mod settings:

client_only_mod = false
all_clients_require_mod = false
server_only_mod = true

but the server still shows up as modded. Is there something I'm missing or it's impossible to have server only mods without making your server show as modded?

Edit: It's a Linux dedicated server if matters.

Edited by cezarica
Link to comment
https://forums.kleientertainment.com/forums/topic/93670-hide-server-only-mods/
Share on other sites

Maybe I am a bit too late to the show but yes, there is actually a way to do what you want. But get ready for one more mod :P

When a server starts for the first time the engine's TheNet:StartServer collects various data from it and creates a server listing that will be sent to Klei's lobby servers on connect. Fortunately for us, mod info details are stored in lua's environment for easier access and manipulation.

When collecting these details, first the engine calls AreServerModsEnabled (mods.lua:47) (currently, this function is only used by the engine and only for this specific task). If that returns true then GetEnabledModsModInfoDetails (mods.lua:130) follows providing all the info about the server mods. However if the return value is false then this part is being skipped.

With a small little mod you could override this global function to return always false. This is a bit of a "hack" and not a good practice overall though, but I don't think there is a better way of doing this with such an ease to be honest.
A simple implemetation of this would look probably like the following:

-- modmain.lua

GLOBAL.AreServerModsEnabled = function()
    return false
end

That's it. Now your server will pop up as a vanilla one even though there are two mods on it :)

Please note that this approach should not be used when mods with all_clients_require_mod set to true are enabled on the server. 


I hope that helps.

  • Like 1

 

On 7/13/2023 at 4:05 AM, Wolfalpha360 said:

I have the same issue and how might I utilize this and turn it into a mod?

You will have to create a folder in your mods directory representing the mod's folder. Then inside it you want to setup a modinfo.lua and a modmain.lua with the above code I have posted.

After that, you can enable it in your modoverrides.lua file using the newly created folders name.

You will find a lot of posts on this forums writing about this process in much more detail if needed.

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...