Jamie

remoteExecCall Help

6 posts in this topic

Hello, I am trying to use remoteExecCall to run a function defined in the missionFile as a server but its not running correctly, any ideas anyone?

As a client i am running this:

remoteExecCall ["ExileClient_Custom_fnc_test",2];

This is my CfgRemoteExec:

class CfgRemoteExec
{
    class Functions
    {
        mode = 1;
        jip = 0;
        class fnc_AdminReq { allowedTargets=2; };
        class ExileServer_system_network_dispatchIncomingMessage { allowedTargets=2; };
        class ExileClient_Custom_fnc_test { allowedTargets=2; };
    };
    class Commands
    {
        mode=0;
        jip=0;
    };
};

And this is my test function:

//ExileClient_Custom_fnc_test
/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 *
 * Moddified By:    Jamchiv01
 * Last Moddified:  02/01/16
 * Description:     Handles the database update query!
 */
 
format ["setTerritorySize:%1:%2",6,5] call ExileServer_system_database_query_fireAndForget;

Note the function is also defined in my CfgFunctions and works when called but not when remoteExecCall:

class ExileClient_Custom
{
	tag = "ExileClient_Custom";
	class ExileClient_Custom
	{
		file = "ExileClient_Custom";
		class test {};
	};
};

 

Share this post


Link to post
Share on other sites

whats in your test class?

or I think you may need to make your test function file look like:

class test
{
format ["setTerritorySize:%1:%2",6,5] call ExileServer_system_database_query_fireAndForget;
};

 

Share this post


Link to post
Share on other sites
Advertisement

The way it works currently is as follows: 

The function is defined in CfgFunctions.

To call the function you would use (_this call ExileClient_Custom_fnc_Downgrade_Territory) to run it as a client. But i need to run it as a server. After talking to @eraser1 he said i need to add the function to  CfgRemoteExec So i did, tried to call it and it didnt work.

To clear up for you, test class is the file 

//ExileClient_Custom_fnc_test
/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 *
 * Moddified By:    Jamchiv01
 * Last Moddified:  02/01/16
 * Description:     Handles the database update query!
 */
 
format ["setTerritorySize:%1:%2",6,5] call ExileServer_system_database_query_fireAndForget;

so adding test class{FUNCTIONHERE} shouldn't make a difference.

Share this post


Link to post
Share on other sites

I know you know the test class is the file, but how does the compiler know that the test class is that file unless you define it by class{FUNCTIONHERE}

 

I could be totally wrong, I just woke up so yeah....

Share this post


Link to post
Share on other sites

Posted (edited)

The way it can tell is the way CfgFunctions works as shown in the example here: https://community.bistudio.com/wiki/Functions_Library_(Arma_3)

class ExileClient_Custom	//TAG HERE
{
	tag = "ExileClient_Custom";	//TAG ALSO DEFINED HERE
	class ExileClient_Custom //CATEGORY HERE
	{
		file = "ExileClient_Custom"; //Sets file location
		class test {};	//Loads ExileClient_Custom_fn_test.sqf
	};
};

"myTag_fnc_myFunction"  So:

 

ExileClient_Custom_fnc_test Executes: \MissionRoot\ExileClient_Custom\fn_test.sqf

Edited by Jamie

Share this post


Link to post
Share on other sites

UPDATE i got this working, it was me being stupid and trying to update the wrong record in the database :(

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.