Welcome Message plugin

I
Hello,

Here is the requested plugin by Fergy.

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.

Screenshots
(to be reloaded)

Installation
- put the WelcomePlugin.dll file in the rFactor2 Bin64\Plugins folder
- put the WelcomePlugin.json file in the rFactor2 profile folder (or simply create one)

Note: I didn't make a 32-bit plugin out of laziness, as I doubt there's actually still anyone on a 32-bit system. Let me know if you need 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,
    },
    "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 drivers in the "DriverMassOptions" list with the associated weight penalty. Pleave an empty list or remove the "DriverMassOptions" section entirely if you do not want to assign weights.
- 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 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.

Enjoy!
Tygernoot.

v2.1 Plugin files: http://www.tyka.net/racepad/downloads/WelcomePlugin_2.1.zip
v2.1 Source code: http://www.tyka.net/racepad/downloads/WelcomePlugin_2.1_source.zip


Latest update: 26 Jan17 - updated download links


I want a 32 bits version, is it possible?
I'll try to use in another simulator...
 
Last edited:
OK, I think I got it :). I didn't test it thoroughly yet and I may need to adjust the timing so that very quick rejoins don't slip under the radar... but it seems to work:

rejoin.png


Here is a test version (64 bit): http://tyka.net/downloads/WelcomePlugin_2.2_test.zip

Can you have a quick look if this is working properly in a "real" dedicated environment with some drivers present? I was only to test with myself in the dedicated server with some AIs. I spent an hour figuring out how to launch a dedicated and then join on the same machine via command line without Steam going bonkers :). The server listing doesn't show my own server and I don't have a VM set up yet with the Steam version... By the way, does that actually work via Steam if I launch the game in both Steams with the same Steam account?

Anyway, please note that this version is purely for testing. Please don't run it on any league server yet in case I messed something up ;). Once it's confirmed to be working I'll build a proper version with a 32-bits version as well.

Best regards,
Ed.
 
Can you have a quick look if this is working properly in a "real" dedicated environment with some drivers present?

We had a little test session last evening and i can report that it's working flawless. You did a very very very good job there. Finally we can use your awsome tool and don't have to work with seperate .hdv files for weight penalty :):):)
 
Hello,

I've been running your plugin on the F3 Fanatics' server for quite some time, thank you.

Recently I have to re-install rFactor2 onto the dedicated server.

I can't get it to run.

I have the .dll file in the 64bit plugins folder and the the .json file in the "player" folder.

Is that the correct place for the .json file??? It used to go in the rFactor2's root directory.

I've tried it in both locations and it doesn't seem to matter. I can't get it to work.

Here is the log:
Succeeded to open handle to the dedicated window (chat button)
Succeeded to open handle to the dedicated window (chat edit)
Error parsing JSON file: C:\Racing\rfactor2-dedicated\UserData\player\WelcomePlugin.json
Driver joined the server: Bryan Birtwell [SR4L]
Error parsing JSON file: C:\Racing\rfactor2-dedicated\UserData\player\WelcomePlugin.json
Driver joined the server: Bryan Birtwell [SR4L]
Error parsing JSON file: C:\Racing\rfactor2-dedicated\UserData\player\WelcomePlugin.json
Driver joined the server: Bryan Birtwell [SR4L]
Error parsing JSON file: C:\Racing\rfactor2-dedicated\UserData\player\WelcomePlugin.json
Driver joined the server: Bryan Birtwell [SR4L]
Error parsing JSON file: C:\Racing\rfactor2-dedicated\UserData\player\WelcomePlugin.json
Driver joined the server: Bryan Birtwell [SR4L]
Driver joined the server: Bryan Birtwell [SR4L]

And, here is the actual .json file:

{
"DriverMassOptions": {
"DriverX": 15,
"DriverY": 25,
"DriverZ": 25,
},
"WelcomeText": [
"Welcome!Donate today! PayPal birtwell@msn.com",
"Team Speak IP 172.245.211.109 Password EVE"



}

Thanks for any help that can come my way.

Bryan
 
Hi Bryan,

There's a small mistake in the json file :)

Code:
{
"DriverMassOptions": {
"DriverX": 15,
"DriverY": 25,
"DriverZ": 25,    <<<<< remove the comma
},
"WelcomeText": [
"Welcome!Donate today! PayPal birtwell@msn.com",
"Team Speak IP 172.245.211.109 Password EVE"
]         <<<<< add this ]
}

That should fix it, but let me know if it still doesn't work.
 
Thank you for your speedy reply!

I still can't get it to work for me.

This is what I got for a .JSON file:

{
"DriverMassOptions": {
"DriverX": 15,
"DriverY": 25,
"DriverZ": 25
},
"WelcomeText": [
"Welcome!Donate today! PayPal birtwell@msn.com",
"Team Speak IP 172.245.211.109 Password EVE"
]
}

I copy/pasted what you posted above; removing the comma after the last "driver" in the add mass thingie.

I removed the notes, telling what to "add" and "remove"

I'm also still not clear on what/where the "profile" folder is in rFactor2.

Thanks,

Bryan
 
Just got round to adding this to our practice and race server at SiG Racing

Not sure if anyone else is interested but I have set it so that individuals can set their own ballast without being admin by adding a number to their last name in game. You just need to edit the json file with multiple copies of each racers name with numbers 1 - whatever I have 100 after it and the corresponding ballast.

When we assign ballast in a series the preceding week people can then practice with the correct ballast without the need for admin to be online.

If anyone could now bring Grid Edit tool and this plugin together so changes to the grid can be made based on the previous race automatically as the server clicks over to the next race ie reverse grid in race 2 based on finishing order for race 1 that would make my day!
 
Hi, i tried to run welcome plugin on the new 1.1109 dedicated server, but i dont work... i made everything from the manual but when someone join the server there is no welcome message, in the logfile i can only see that the plugin sends the messages to the ki driver, but when a driver joins the server nothing happens.

Any ideas ?
 

Attachments

Hi Clemenca,

Sorry if I'm stating the obvious... The welcome message is sent via a whisper message, meaning only the actual driver receives it. It is not broadcast to all drivers every time.

Can you see these chat messages being sent by the dedicated server window? Or when you join the server yourself, do the chat messages appear?

If not, I'll have a look if something changed. I haven't run rF2 in a while, perhaps the new dedicated server is different and the trick I used no longer works.
 
I have an interesting issue. I could not see a message when joining server. I got my mate to join and he sees it, all the time. I never see message. So it IS working, I am just not getting it!
Any ideas?
 
Hi, can anyone help me? My server loads only the welcome messages. Setmass does not carry. I already checked the JSON file and found no error. I inserted the dll file into the PLUGINS folder in Bin64, and inserted the JSON file into the dedicated server profile. but it only reads the welcome messages, the Setmass that is the main one does not work ..

JSON File:
{
"DriverMassOptions": {
"Rafael Sousa": 50
},
"WelcomeText": [
"Linha 1",
"Linha 2"
],
"SendWelcomeTextEverySession": true
}
 
Hi Rafael,
That looks OK indeed.
I'm surprised that the welcome text works, but the setmass option doesn't... I'd rather expect none or everything to work :)

I wonder if there might be some rFactor setting that interferes with the setmass. Does it work when you manually enter it in the server chat?

Can you check the log file?
It should say something like (from the top of my head):
Driver joined the server: Rafael Sousa
/w Rafael Sousa Linha 1
/w Rafael Sousa Linha 2
/setmass 50 Rafael Sousa

Is the /setmass line present there?

Best regards,
Ed.
 
Hello,

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.

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,
    },
    "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 drivers in the "DriverMassOptions" list with the associated weight penalty. Pleave an empty list or remove the "DriverMassOptions" section entirely if you do not want to assign weights.
- 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.

Enjoy!
Tygernoot.

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

Latest update: 7 June 2017 - rejoining the race (re)applies the weight penalty
Hi... I can't get this to work again.

NRT Re-installed Windows Server and rFactor2

rFactor2 does not have a "profile" folder. Or did you mean rFactor2's root directory?

I always had the txt file as a .txt file. Is it now supposed to be a .json file?
{
"DriverMassOptions": {
"DriverX": 15,
"DriverY": 25,
"DriverZ": 25,
},
"WelcomeText": [
"Welcome to the F3 Fanatics!",
"Please Donate via PayPal to birtwell@msn.com",
"Race every Sat. Practice starts at 6PM Eastern Time (US)",
"TS IP=172.245.177.71"
],
"SendWelcomeTextEverySession": true
}

Shouldn't the above text work?

Thanks,

Bryan
 
Back
Top