Jump to content
gc8

Check client mods

Recommended Posts

Hi

I was thinking about making mission to support multiple mods such as unsung for example and I would like to give the multiplayer admin option to select the used mod from mission parameters in the lobby. My question is how do you show information to client who is about to join the server which mods is the mission currently running?

 

I think it would be easy to just kick the client if he's missing mods once joined the game but I would like instead prevent the client from joining the game if he doesn't have required mods.

 

What are the best approaches to do this?

 

thx!

Share this post


Link to post
Share on other sites
11 minutes ago, davidoss said:

Does the arma launcher not doing this already?

No. As far as I tested, your server shows only the number of players as described in the server.cfg, and the Vanilla DLC/extensions.
 Neither the difficulty nor the mods are displayed in the servers page if you don't know how to do this, and that's the question.

  • Thanks 1

Share this post


Link to post
Share on other sites

It would be nice to have command that changes the server name so you can put list of used mods in the string. Or some other way to show the mod list

Share this post


Link to post
Share on other sites

If you use -serverMod startup parameter, then players can't see mods that server uses, if -mod one -- they can.

Share this post


Link to post
Share on other sites
3 minutes ago, Schatten said:

If you use -serverMod startup parameter, then players can't see mods that server uses, if -mod one -- they can.

 

ok thanks but like I said I'm looking for solution where the mods are selected in the lobby by parameters

Share this post


Link to post
Share on other sites

@gc8, not sure that it is possible. AFAIK, if mods are listed in mission.sqf, then players who don't have requred mods, will not able to connect to server; if mods are not listed in mission.sqf, then game of players who don't have requred mods, will simply crash.

Share this post


Link to post
Share on other sites
6 minutes ago, Schatten said:

if mods are listed in mission.sqf, then players who don't have requred mods, will not able to connect to server; if mods are not listed in mission.sqf, then game of players who don't have requred mods, will simply crash.

 

Right. Didn't know about the crash though. Maybe there is a way to kick the player before that, those who don't have required mods. Best place to do this would probably in the lobby when mission is about to start

Share this post


Link to post
Share on other sites
2 minutes ago, gc8 said:

Maybe there is a way to kick the player before that, those who don't have required mods.

Just list required mods in mission.sqf file.

Share this post


Link to post
Share on other sites

If you have server keys set up, the launcher will show the required mods and offer players to download them from the workshop. That's not the case for the in-game server browser AFAIK. Anyways with the keys players who do not have the ods won't be able to join in.

Share this post


Link to post
Share on other sites

Also ace 3 used to include an option to check mods but I think it's been discontinued. Might also be worth checking cba for such functions 

Share this post


Link to post
Share on other sites
5 minutes ago, Schatten said:

Just list required mods in mission.sqf file.

 

Then there will be long list required mods of which only like one is used.

Share this post


Link to post
Share on other sites
1 minute ago, Mr H. said:

Also ace 3 used to include an option to check mods but I think it's been discontinued. Might also be worth checking cba for such functions 

 

Checking loaded mods it self isn't the problem. It's where to do this check and how to proceed.

Share this post


Link to post
Share on other sites

Does anyone know what scripts are called when player enters MP lobby?

 

Share this post


Link to post
Share on other sites

If you are having a mods parameter then just them let decide? Set default to vanilla. You can check if a user is running mod if you know the mod(s) you want - See configClasses command.

https://community.bistudio.com/wiki/configClasses

These return which mods you have loaded:

https://community.bistudio.com/wiki/configSourceModList

https://community.bistudio.com/wiki/configSourceAddonList

Share this post


Link to post
Share on other sites

Thanks HazJ, interesting commands. This is how I have checked if mod is loaded so far:

 

isModloaded =
{
 params ["_mod"];
 isClass (configfile >> "CfgPatches" >> _mod)
};


if(isServer) then
{
if(!("uns_main" call isModloaded)) then
{
 diag_log "SERVER, NO UNSUNG!";
}
else
{
 diag_log "SERVER, MODS OK";
};
};

 

Share this post


Link to post
Share on other sites
1 minute ago, pierremgi said:

Do you have some proof of that, or it's just a feeling?

 

Yes tested it

Share this post


Link to post
Share on other sites

@gc8

What you're trying to do is essentially issue mission code before the mission is loaded. 

 

The server might be able to do it with JIP clients by leveraging onPlayerConnected and remoteExec but on mission startup is a different story. Maybe remoteExec a hook into the lobby ui to display the message and stop the load. Not sure if the handler for remoteExec calls is running that early though. 

 

This could possibly be implemented in a clientside mod but that sort of defeats the purpose... 

Share this post


Link to post
Share on other sites
45 minutes ago, mrcurry said:

What you're trying to do is essentially issue mission code before the mission is loaded. 

 

Yes this is the problem. I don't think any of the mission code is executed in lobby. Only mission description.ext header and maybe some other stuff is read. So not sure if it's even possible to call mission scripts in lobby

Share this post


Link to post
Share on other sites

 

4 minutes ago, gc8 said:

 

Yes this is the problem. I don't think any of the mission code is executed in lobby. Only mission description.ext header and maybe some other stuff is read. So not sure if it's even possible to call mission scripts in lobby

 

I haven't investigated this but have you looked at how onPlayerConnected would react if added through the server's startup command -init, might be worth checking out.

Share this post


Link to post
Share on other sites
1 minute ago, mrcurry said:

I haven't investigated this but have you looked at how onPlayerConnected would react if added through the server's startup command -init, might be worth checking out.

 

I put it in preinit actually to make sure it's set early as possible. Not sure about the -init parameter, never used that

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×