Introduction

This plugin sends a whispered welcome message to drivers entering the dedicated server. It does so by finding the associated dedicated server window, entering the chat message and sending it. It can be used to provide links to a website, to give a brief explanation of the rules, or just to welcome anyone entering the server.
Additionally it allows setting weight penalties automatically for drivers entering the server, either based on the driver name or the vehicle class.

Installation

– put the WelcomePlugin.dll file in the rFactor2 Bin64\Plugins folder (in case of 64-bit) or Bin32\Plugins folder (in case of 32-bit)
– put the WelcomePlugin.json file in the rFactor2 profile folder (or simply create one)

Usage
Put the welcome and weight information in the WelcomePlugin.json file. The file has to following format:

Code:

{
    "DriverMassOptions": {
        "DriverX": 15,
        "DriverY": 25,
        "[ABC] DriverZ": 25,
    },
    "VehicleMassOptions": {
        "Class1": 10,
        "Class2": 15,
        "Class3": 25
    },
    "WelcomeText": [
        "Line1",
        "Line2",
        "Etc",
        "It is not recommended to put more than 5 lines for performance reasons",
        "The maximum length for each line is 95 chars, the rest will be truncated"
    ],
    "SendWelcomeTextEverySession": true
}

– Place any vehicle class names in the “VehicleMassOptions” list with the associated weight penalty. Leave an empty list or remove the “VehicleMassOptions” section entirely if you do not want to assign weights based on the vehicle class.
Note: the vehicle class is the name that is displayed in-game, i.e. the “Category” in the .veh file.
– Place any drivers in the “DriverMassOptions” list with the associated weight penalty. Leave an empty list or remove the “DriverMassOptions” section entirely if you do not want to assign weights. The driver weight overrides the vehicle class weight in case both are set and apply to the driver.
– Place the welcome text in the “WelcomeText” list. The maximum length per line is 95 chars (taking the maximum driver name length of 32 into account). If you put longer text it will be truncated by the game.
– Set SendWelcomeTextEverySession to true to have the welcome chat sent every session change. Set it to false to have it sent only when joining the server.
– Geeky note: if there are any particular extended ascii characters such as “éàáç@€” in the driver names (e.g. see http://www.ascii-code.com/, any character in the range of 128-255), be sure to encode the file as ANSI and not UTF8 or other. This is because rFactor only supports ANSI encoding and not UTF8, which is often the default file format.

Known issues

– When typing a message in the dedicated server chat at the same time a driver enters, your chat is restored but the chat edit loses focus while it’s sending the welcome messages. You have to click in the chat again to continue typing.
– Not really known issue, but per design: the WelcomePlugin.json file is reloaded every session switch for any changes.
– The plugin is untested with rFactor in other languages than the default English.
– The plugin obviously only works for dedicated servers.

v2.3 Plugin files (32-bit): http://www.tyka.net/racepad/downloads/WelcomePlugin_2.3.1_x86.zip
v2.3 Plugin files (64-bit): http://www.tyka.net/racepad/downloads/WelcomePlugin_2.3.1_x64.zip
v2.3 Source code: http://www.tyka.net/racepad/downloads/WelcomePlugin_2.3.1_source.zip