Plugin interface updates

Discussion in 'Plugins' started by Lazza, Jun 25, 2016.

  1. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,407
    Likes Received:
    3,096
    The latest plugin interface example on the rFactor 2 site appears to be a little out of date. Thanks to the recent release of the KnockoutQualifying and StockCar plugins, some changes have been revealed (some of these were mentioned in build notes along the way):

    struct TelemWheelV01

    Added: unsigned char mStaticUndeflectedRadius; // tire radius in centimeters


    struct VehicleScoringInfoV01

    Added: float mPitLapDist; // location of pit in terms of lap distance
    Added: float mBestLapSector1; // sector 1 time from best lap (not necessarily the best sector 1 time)
    Added: float mBestLapSector2; // sector 2 time from best lap (not necessarily the best sector 2 time)


    struct ScoringInfoV01

    Added: unsigned char mGameMode; // 1 = server, 2 = client, 3 = server and client
    Added: bool mIsPasswordProtected; // is the server password protected
    Added: unsigned short mServerPort; // the port of the server (if on a server)
    Added: unsigned long mServerPublicIP; // the public IP address of the server (if on a server)
    Added: long mMaxPlayers; // maximum number of vehicles that can be in the session
    Added: char mServerName[32]; // name of the server
    Added: float mStartET; // start time (seconds since midnight) of the event
    Added: double mAvgPathWetness; // average wetness on main path 0.0-1.0


    struct TrackRulesParticipantV01

    Replaced this:
    bool mAllowedToPit; // whether the rules allow this particular vehicle to enter pits right now
    bool mUnused[ 3 ]; //

    With:
    unsigned char mPitsOpen; // whether the rules allow this particular vehicle to enter pits right now (input is 2=false or 3=true; if you want to edit it, set to 0=false or 1=true)
    bool mUpToSpeed; // while in the frozen order, this flag indicates whether the vehicle can be followed (this should be false for somebody who has temporarily spun and hasn't gotten back up to speed yet)
    bool mUnused[ 2 ]; //


    struct TrackRulesV01

    Replaced this:
    bool mYellowFlagLapsWasOverridden; // whether mYellowFlagLaps (below) is an admin request

    With:
    unsigned char mYellowFlagLapsWasOverridden; // whether mYellowFlagLaps (below) is an admin request (0=no 1=yes 2=clear yellow)


    This is just for reference. Best to grab the example plugins to make sure changes to mExpansion[] etc are fully reflected in your code when including the above.
     
    The Iron Wolf likes this.
  2. nickcrete

    nickcrete Registered

    Joined:
    Sep 8, 2013
    Messages:
    59
    Likes Received:
    10
    Thanx for sharing Lazza !
     
  3. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    36
    Likes Received:
    10
    hi lazza, first of all, thanks for the good job. I have developed a hotlaps system with league management and my plugin registered the offpath and onpath wetness to see how wet the road is when you save the laptime. Now onpath is always 0.0. I have included next line in my plugin to get the average wetness:

    double mAvgPathWetness; // average wetness on main path 0.0-1.0

    but no change although rain is 100%

    my question is if is needed to change anything else...thank you in advance

    PS: this is my hotlaps system (HLSSim -> http://www.hlssim.com first time you must select a community)
     
  4. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    2,899
    Likes Received:
    308
    I guess, the main problem is, that the wetness (offpath/onpath) is meant to min/max. As long as you have a dry zone on the track, e.g. under a bridge, the min wet would be allways 0.
     

Share This Page