Page MenuHomeFeedback Tracker

[Bug] CfgRemoteExec functions section defined in a mission invalidates mod based CfgRemoteExec function definitions
Closed, ResolvedPublic

Description

While https://community.bistudio.com/wiki/Arma_3:_CfgRemoteExec states

As usual, the more local config takes precedence: Mission Description.ext (missionConfigFile) > Campaign Description.ext (campaignConfigFile) > Game / Mod Config (configFile). If several definitions for CfgRemoteExec exist, the mode attribute will be overridden by the last parsed config and whitelisted functions and commands will be merged.

This makes sense for mode/jip parameter or when a function/command is defined in both mod and mission, yet otherwise function/command definitions from a mod should not be invalidated

Server.rpt

Scripting function 'bis_fnc_execvm' is not allowed to be remotely executed
User NAME (DDD) tried to remoteExec a disabled function

Scripting function 'xxx_fnc_modFuncution_test' is not allowed to be remotely executed

Client.rpt

Scripting command 'say3d' is not allowed to be remotely executed
Scripting function 'xxx_fnc_modFuncution_test' is not allowed to be remotely executed

Details

Severity
None
Resolution
Fixed
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Multiplayer
Steps To Reproduce

Demo mission: https://github.com/ConnorAU/A3GunGame/releases

Repro:

  1. Load DS with a mod that whitelists a function via CfgRemoteExec
  2. Load a mission with functions whitelisted in CfgRemoteExec
  3. Execute the whitelisted function from the mode on the client and notice how it gets blocked

config.cpp

class CfgRemoteExec {
	class Functions {
		// RemoteExec modes:
		// 0- turned off
		// 1- turned on, taking whitelist into account
		// 2- turned on, ignoring whitelist (default, because of backward compatibility)
		// your functions here
		class xxx_fnc_modFuncution_test {
			allowedTargets = 0;	// can target anyone (default)
			jip = 0;		// sending jip messages is disabled for this function
						// (overrides settings in the Functions class)
		};
	};
};
Additional Information

Related: T155036 T85235

Useful T83522

Event Timeline

Not a bug but design decision, mission config has priority as it is looked up first, if found all other config look ups are skipped

kju-PvPscene added a comment.EditedJan 30 2023, 1:41 PM

But that doesnt make sense as a design - mods are uploaded by the server admin and as such to be considered "secure".

There is no pointing being forced to redefine all functions/commands whitelisted in mods again in every mission that uses CfgRemoteExec whitelisting.

This is super mod use unfriendly "design".

What is your suggestion, considering backward compatibility?

if the current state is to remain the default, I can only see this:

description.ext

class CfgRemoteExec
{
	class Functions
	{
		inheritFromMods = 1;//0 is default and false - 1/true will expand this description.ext definition with classes from CfgRemoteExec/Functions defined by config.cpp of mods, but only if the given class is not defined in the description.ext /inside this class Functions already
	};
	class Commands
	{
		inheritFromMods = 1;
	};
};

in regards to allowedTargets and jip within Functions/Commands class definitions - one could allow a combination of the definitions from description.ext and mod configs, but seems unnecessary complexity to me.
imo if a Functions/Commands class definitions is set in the description.ext, it should just ignore it from mods completely.

kju-PvPscene added a comment.EditedJan 30 2023, 3:29 PM

so

description.ext

class CfgRemoteExec
{
	class Functions
	{
		inheritFromMods = 1;
		class Test {};
	};
	class Commands
	{
		inheritFromMods = 1;
		class say3d {};
	};
};

config.cpp

class CfgRemoteExec
{
	class Functions
	{
		class Test {...};//gets ignored
	};
	class Commands
	{
		class say3d {...};//gets ignored
	};
};
BIS_fnc_KK set Ref Ticket to AIII-55536.Jan 30 2023, 6:50 PM

Revision: 150283 added "as" to "import"

import CfgRemoteExec as CfgRemoteExecMod;
 
class CfgRemoteExec : CfgRemoteExecMod
{
    class Server : Server
    {
        class Functions : Functions
        {
            jip = 0;
            class BIS_fnc_effectKilledSecondaries
            { 
                allowedTargets = 0;
                jip = 0; 
            };
        };
    };
};
BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Jan 30 2023, 6:54 PM
BIS_fnc_KK changed the task status from New to Feedback.

@BIS_fnc_KK

  1. this is not yet in 2.12, correct?
  1. confused about the class server : server part - where is this coming from? or do you need to add this new sublayer to your mod CfgRemoteExec as well? (aka no backwards compatibility)

please advise 🙏

class CfgRemoteExec
{
	class Functions
	{
		mode = 2;
		jip = 1;

		class BIS_fnc_someFunction
		{
			allowedTargets = 0;
			jip = 0;
		};
	};

	class Commands
	{
		mode = 1;

		class setDir
		{
			allowedTargets = 2;
			jip = 0;
		};
	};
};

You want to overwrite cfgremoteexec or extend it? If you wan tto extend then you have to inherit everything. Dunno which version, look through dev log

Thanks!

Is that class server an undocumented feature?

Anyway, this is irrelevant to this ticket, there is default config in the game and it has class Server. If you want to inherit from it this is what you do.

BIS_fnc_KK closed this task as Resolved.Apr 17 2023, 9:16 AM
BIS_fnc_KK changed Resolution from Open to Fixed.

Alright will test with this setup as this is how people defined CfgRemoteExec in config.cpps:

import CfgRemoteExec as CfgRemoteExecMod;

class CfgRemoteExec: CfgRemoteExecMod
{
	class Functions: Functions
	{
		jip = 0;
		class BIS_fnc_effectKilledSecondaries
		{
			allowedTargets = 0;
			jip = 0;
		};
	};
};

as https://community.bistudio.com/wiki/Arma_3:_CfgRemoteExec#Default_Config states

The default CfgRemoteExec in the game's main config uses an outdated format and is left for backward compatibility only (it was used directly by BIS_fnc_MP). The Client and Server classes are obsolete now. The new Remote Execution Framework ignores it (by default, all functions and commands are allowed).

My bad missed that when i searched the BIKI page before.