[REL] Timed server control (race session every x hours like iRacing)

Discussion in 'Other' started by cubbi, Jun 24, 2014.

  1. cubbi

    cubbi Registered

    Joined:
    Jul 8, 2013
    Messages:
    90
    Likes Received:
    1
    Tool to (re-)start an rFactor2 server at a specified date and time.

    For example this allows you to run your public server similiar to iRacing, where a race session would start every full hour (every 2h, 3h, etc.)

    [​IMG]

    Download v1.3
    Source code (feel free to contribute)

    Tested with:
    Windows 8 64bit
    Windows Server 2008 32bit

    Usage:
    1. Set a start date and start time: This is when the server will be restarted for the first time.
    2. Then set a restart time: The server will be restarted every x hours y minutes after the start time or last restart.
    3. Then select the rF2 server window to control by clicking on it.
    If you want to run your server on autopilot, make sure to disable session voting.
    Also make sure that the restart time is not too close to the end of a race, as there is always some delay between switching sessions. A safe value should be 15-20min.

    Don't forget to mention when a race takes places in your server name, like: "ServerX.com - Race session every full hour"

    All feedback is welcome!
     
    Last edited by a moderator: Jun 25, 2014
    atomed likes this.
  2. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    That's a clever idea. I feel like rF2 would have more online activity if public servers were more structured with something like you have created here. I think that if public servers made proper use of GetMod so joining is simple but also have some sort of set schedule like iRacing that it would be much more popular. You could have a calendar that says what car and track will be active for the week and only change cars and tracks once a week and like you said are saying, start a race session on some sort of regular interval that people can plan around.

    Do people remember the old days where RFC used to have organized public servers where they would stick to one set of cars and tracks for a week at a time? Remember how we could join at just about any time of the day and race with resonable fields? Also, you had to register on their site and your stats were tracked so there was more accountability. Still not the quality of racing you find in a league, but it wasn't as bad as a disorganized public server. rF2 needs just a few more APIs and we could get really creative with this concept. We really need a way to connect to a server via command line. Even if it is a command line option on the actual launcher which then validates your licence before passing the command line on to rFactor2.exe. I would love to see a website like iRacing where you could hold a spot in a session and others would see a list of drivers who have committed to a session and join in if they wanted. Just think how amazing rF2 would be if it combined the openness of rF2 with the organization of iRacing.
     
    DA likes this.
  3. V.A.

    V.A. Registered

    Joined:
    Jun 24, 2014
    Messages:
    23
    Likes Received:
    0
    Soon. Very soon, Noel. Tracks, Cars, Servers... Races for a new era.
     
  4. cubbi

    cubbi Registered

    Joined:
    Jul 8, 2013
    Messages:
    90
    Likes Received:
    1
    Yes exactly! I hope ISI will provide more APIs in the future (like they did for mas extraction recently).
    As you said the community can improve the game experience quite a bit by adding such tools, not only by adding in-game content :)
     
  5. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Don't you think it is already achievable, by creating an application that make the same think than a human do (take reference to the window and simulate click on UI - it is what is used by this tool), and create functionalities/rules (website, rule engine, etc...)

    I'm ok to work on this king of things, if i have clear needs (as i not very familiar of all PC sim racing needs/possibilities)
     
  6. V.A.

    V.A. Registered

    Joined:
    Jun 24, 2014
    Messages:
    23
    Likes Received:
    0
    There is software to control unattended servers. With access control drivers (registry, banned, etc.). Sanctions management, automatic commissioners, grills, telemetry, anti-cheat ... Operating 24 x 7 without overload on the server. Installed in high performance dedicated server and databases with high capacity.

    Over 500 simultaneous races could be managed without problems.
     
  7. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Yeah you could do some UI automation but then it's dependent on what UI people have installed and stuff like that. It would be better to have some reliable command line options and stuff like that.
     
  8. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    This sounds very exciting. Can't wait to hear more details about this.
     
  9. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Sure, it will be better, but i don't know if it will be allowed some day.
     
  10. DocJones

    DocJones Registered

    Joined:
    Jan 26, 2011
    Messages:
    403
    Likes Received:
    5
    This is a very nice tool, thanks cubbi!
     
  11. Emery

    Emery Registered

    Joined:
    Oct 24, 2010
    Messages:
    3,035
    Likes Received:
    1,654
    Definitely a cool tool... can see how it would promote longer race sessions. I really dislike the "practice for 30 minutes and race for 15 minutes" format that most public servers have.
     
  12. The Great Apt

    The Great Apt Registered

    Joined:
    May 3, 2020
    Messages:
    68
    Likes Received:
    38
    Does this still work?
     
  13. trichens

    trichens Registered

    Joined:
    Nov 2, 2020
    Messages:
    213
    Likes Received:
    152
    A bit late to respond, but yes it seems to be working OK.
    Basically you tell it when to start, when to restart and which is the rFactor2 server dialog it has to interact with.

    When the elapsed time is up it "clicks" the "Restart Weekend" so kicking off the server again.

    In theory it should work with multiple instances.
    However if you try that with the downloaded exe file then you get the warning...
    "An older version of this script is already running. Replace it with this instance?
    Note: To avoid this message, see #SingleInstance in the help file"

    However there is no help file with TSC and this message is actually coming from AutoHotKey which is the tool used to create this utility. If you download the source file and AutoHotKey you can run multiple copies - note that the exe file displays v1.3 but the source code is v1.31

    As far as I can tell Cubbi who first posted this hasn't been active in the forum for around two and a half years. I can provide a new compiled version if anyone wants it.
    Cubbi has suggested that others can contibute, does this need any other features?
    It could write to a log file for instance so that if multiple instances are being run it can record when the "Restart Weekend" process was clicked.
     
  14. trichens

    trichens Registered

    Joined:
    Nov 2, 2020
    Messages:
    213
    Likes Received:
    152
    Perhaps also handle multiple rFactor2 servers though one programme with a tabbed interface?
     
  15. trichens

    trichens Registered

    Joined:
    Nov 2, 2020
    Messages:
    213
    Likes Received:
    152
    New version available for download.
    No changes apart recompiled to latest version v1.31 which allows multiple copies to be run.
    Also some minor cosmetic changes


    upload_2020-12-29_18-13-39.png
     
    Last edited: Dec 31, 2020
    Corti likes this.
  16. trichens

    trichens Registered

    Joined:
    Nov 2, 2020
    Messages:
    213
    Likes Received:
    152
    Revised version v1.32
    Changed so that the start date/time can't be in the past

    Download v1.32
     
    DJCruicky and atomed like this.
  17. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    924
    Likes Received:
    6,278
    Hi, I have also made some improvements and fixed a few bugs:

    - Fixed hour & minute calculation, previously hour can add up and go over 24 hour, and minute can go over 60 mins, which caused calculation bug and result in wrong & missing restart countdown.

    - Now can select full range of minutes from 00 to 59. A special 60 min selection also available for restart box, which is needed if you want a 24 hour restart rotation (just select both 23 and 60 in restart box)

    - Disabled previous date selection & allow multiple copies to be run. (ideas from trichens)
     
    Last edited: Jan 19, 2022
    Corti likes this.
  18. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    924
    Likes Received:
    6,278
    New test version:
    20210811.png

    Changelog:
    - No longer activate (focused) RF2 server window when starting & restarting (now server window can be minimized and should no longer interrupt other applications).
    - Added additional options (single-choice). When "Practice Session Only" mode is selected, advancing to any none Practice session will immediately trigger auto restart weekend (to avoid any issue, server must have Practice session enabled). When "Start in Qualify Session" mode is selected, server will skip Practice Session on timed restart (server must have both Practice & Qualify session enabled).
    - Auto send restarting chat text.
    - Adjusted GUI layout.
    - Removed 200ms sleep time.
    - GUI window now opens at center of screen.
     
    Corti likes this.
  19. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    924
    Likes Received:
    6,278
    Revised ver.20210811B

    - Added a separate "Practice Session Only" mode. When enabled, server will restart any "none practice" session into Practice session during none scheduled race time. You can set estimated race length for this to work. This function would help avoid the "not enough" players vote for restarting weekend, while also allows scheduled race to run uninterrupted.

    - Redone & Added Restart mode selection, either "Full Weekend" or "Skip Practice Session".

    - All GUI droplists & buttons are disabled after Starting, re-adjusted GUI layout.
     
    Last edited: Jan 19, 2022
    Corti, cybe, Badboy and 1 other person like this.
  20. cybe

    cybe Registered

    Joined:
    Aug 23, 2019
    Messages:
    25
    Likes Received:
    28
    What a great Tool. Thank you all (cubbi, trichens & svictor)!
     
    svictor likes this.

Share This Page