Disable DRS by PlugIn

Discussion in 'Plugins' started by MerlinC, Nov 11, 2014.

  1. MerlinC

    MerlinC Registered

    Joined:
    Nov 3, 2012
    Messages:
    282
    Likes Received:
    3
    Does anyone know whether it's possible to set change DRS Enabled /Disabled using the API?

    There is a flag called mRearFlapStatus in the Telemetry structure - but struct provided within function is declared as const.

    P.S.: Writting the names out of my head so they might not be spelled right.


    Sent with Tapatalk
     
  2. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,345
    Likes Received:
    6,572
    Pretty sure it's not possible.
     
  3. TechAde

    TechAde Registered

    Joined:
    Oct 13, 2010
    Messages:
    606
    Likes Received:
    38
    The Telemetry structure is output only, changing any of the values will have no effect whatsoever.
     
  4. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Inputs can be triggered by a plugin so yes, the rear flap can be triggered via a plugin. Here is some sample code from one of my plugins where I put the game in replay mode. Note, the keys don't actually need to be mapped in the controller.json to be called here.

    Code:
    bool BroadcastPlugin::CheckHWControl(const char * const controlName, double &fRetVal)
    {
    if (replaySet == 0)
    {
    if (_stricmp(controlName, "InstantReplay") == 0)
    {
    replaySet = 1;
    fRetVal = 0.5f;
    return(true);
    }
    }
    return(false);
    }
    
    I don't know exactly what the rear flap is called in this function. You may need to dump all the possible inputs to a file so you can get the name of the rear flap.
     
  5. MerlinC

    MerlinC Registered

    Joined:
    Nov 3, 2012
    Messages:
    282
    Likes Received:
    3

    Tryed to dump all values as you described - but it seems that the procedure is never being called :(

    Did override the virtual function of base class, DEBUG is defined as well and the output-stream is a valid stream object. Furthermore if I set a breakpoint in the debugger it never stops - but does for other functions.

    Do I have to override another function to tell rF2 that it's supposed to call this function?

    Here is the very simple code I tried to use to dump all the functions. Any advise highly appreciated.

    Code:
    bool DTM_DRS::CheckHWControl(const char * const controlName, double &fRetVal){
    	#if defined _DEBUG		//do logfile just in case of debugging is enabled (compiler setting)
    		CheckHWControl_Log << controlName << "\t" << fRetVal << "\n";
    	#endif
    	return false;
    }
     
  6. MerlinC

    MerlinC Registered

    Joined:
    Nov 3, 2012
    Messages:
    282
    Likes Received:
    3
    Does anyone know whether CheckHWControl is called for plugins loaded by a dedicated server? That would explain why the procedure is never beiing called when the plugin is loaded by a dedicated server.

    @Noel: Thanks for your advise but using CheckHWControl to prevent the DRS from opening when the driver presses the button will not work because then every driver would have to install the plugin and it is getting complicated to ensure that nobody gains an advantage by not having the plugIn running.

    Hoping that ISI will extend the API interface: http://isiforums.net/f/showthread.p...-to-set-values?p=322481&viewfull=1#post322481
     
  7. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Sorry for the slow response. Yeah your probably right, this function probably only gets called in realtime.
     
  8. MerlinC

    MerlinC Registered

    Joined:
    Nov 3, 2012
    Messages:
    282
    Likes Received:
    3
    ... and just on the client and not on the dedicated server - which is realtime as well, isn't it?



    Sent with Tapatalk
     
    Last edited by a moderator: Nov 29, 2014

Share This Page