rF2_serverNotify

Discussion in 'Other' started by Seven Smiles, Aug 20, 2017.

  1. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    A simple program to scan a set of your favourite rFactor 2 servers and pop up a notification if someone joins a server that had no drivers.

    The program is configured by the file rF2_serverNotify.json which should be edited with the server(s) of interest.
    It has two types of dictionary entry:
    a) ServerX : 'name of server to be scanned'
    There can be any number of Server entries.
    Text beyond Server is ignored, it's just needed to make each entry different.​
    b) Interval : 30
    seconds between checking the servers​

    When someone joins one of the servers this will pop up
    rF2_serverNotify.JPG


    A data file servers.file.json is created automatically the first time the program is run.
    It contains all the servers and their addresses.

    Download rF2_serverNotify.exe and rF2_serverNotify.json from https://github.com/TonyWhitley/rF2_serverNotify/releases then edit rF2_serverNotify.json with the server(s) you are interested in. Here is a sample:

    Code:
    {
      "Server1" : "F1_1979_Official_Server_1" ,
      "Server2" : "RSVRsig-racing.boards.net",
      "Interval" : 30
    }
    (Updated link to latest version 0.5 that has AI driver filter, also adds a new program rF2_serversWithHumans.exe that goes through all servers finding the ones with drivers whose names are not in the list of known AI drivers (drivers.txt))
     
    Last edited: Apr 27, 2018
  2. Pauli Partanen

    Pauli Partanen Registered

    Joined:
    May 15, 2012
    Messages:
    1,091
    Likes Received:
    1,748
    Great work!
     
    Seven Smiles likes this.
  3. knackko

    knackko Registered

    Joined:
    Oct 6, 2010
    Messages:
    142
    Likes Received:
    65
    Nice !
    Can it be easily adapted to make web notifications through a javascript for example?
     
    Pauli Partanen likes this.
  4. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    I have never done any web programming (or Javascript) so I don't know. I used Python, there isn't much to the program, just a handful of Steam library calls.
     
  5. 64r

    64r Registered

    Joined:
    Jan 16, 2012
    Messages:
    191
    Likes Received:
    35
    Thanks for this, I didn't even know a Steam API existed! I just quickly threw some code together, it looks like the steam API does not correctly make a distinction between real players and bots, at the moment it looks like there are no real players on any servers, that can't be right?

    upload_2017-8-21_18-34-45.png
     
  6. 64r

    64r Registered

    Joined:
    Jan 16, 2012
    Messages:
    191
    Likes Received:
    35
    I just joined a server and both the player count and bot count went up by 1. The server I joined (OTCR Rad Challenge) has 10 players and they are all bots. It's disappointing if the bots count does not work correctly because I would really like a server browser that showed counts of bots and real world players.
     
  7. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
  8. 64r

    64r Registered

    Joined:
    Jan 16, 2012
    Messages:
    191
    Likes Received:
    35
    I can't imagine that it is a Steam issue as I assume that many people use the API and would have reported it to Steam. I suspect that S397 are not correctly marking each player on the server as a real/bot player so the steam API cannot correctly report the data. I will ask on the Discord support forum as it may be a known issue.
     
    knackko likes this.
  9. knackko

    knackko Registered

    Joined:
    Oct 6, 2010
    Messages:
    142
    Likes Received:
    65
    There is no AI on ODS Grand Prix Series F175 server :)
     
  10. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    New version that filters out the known AI driver names in drivers.txt See first post.

    Code:
    "RSVRsig-racing.boards.net" Idle
    "F1_1979_Official_Server_1" Idle
    "DC5 Austria Endurance Race" Active but only AI drivers
    "OTCR Clio Cup Rnd 1" Active but only AI drivers
     
    Last edited: Apr 27, 2018
    Pauli Partanen likes this.
  11. Goanna

    Goanna Registered

    Joined:
    Jan 19, 2012
    Messages:
    1,405
    Likes Received:
    953
    Guys, I might be talking out my arse here but, does the steam api log steam guid's of players? If it does can you then have a column that is a count of guid's (humans) and then another column that is the total minus the humans figure as the number of bots?

    Just a thought I had, know nothing about coding and api's and stuff, like I said I might be talking shit here. :D

    Cheers

    G
     
  12. Pauli Partanen

    Pauli Partanen Registered

    Joined:
    May 15, 2012
    Messages:
    1,091
    Likes Received:
    1,748
    Does this filter the randomly generated AI names?
     
  13. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    I like your thinking Goanna but I can't see anything like that in the data that's returned to my program:

    Code:
    AI: {'duration': 90080.21875, 'index': 0, 'name': 'Sebastiaan Bleekemolen #57', 'score': 0}
    Me:  {'duration': 90080.21875, 'index': 0, 'name': 'Seven Smiles', 'score': 0}
    There may well be other APIs I'm not using.
     
    Last edited: Aug 22, 2017
  14. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152
    I don't know anything about those, I just extracted all the names from the .veh files in the .mas files on my PC (just over 1,000 of them). The names for any vehicles I don't have won't be in the file. It's far from perfect.
     
  15. Seven Smiles

    Seven Smiles Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,099
    Likes Received:
    1,152

Share This Page