Server and Client on the same Machine

Discussion in 'Hosting Help' started by Franck, Apr 25, 2021.

  1. Franck

    Franck Registered

    Joined:
    Mar 26, 2017
    Messages:
    62
    Likes Received:
    329
    Hello,
    Which method to use to have the server and the client on the same machine?

    1-I made a shortcut to dedicated by adding "+ path =" .. "", and it works, but I must run RF2 BEFORE the server, otherwise RF2 does not launch.

    2-I did the guide method, so with the SteamCMD
    (Server and Client on the same Machine at the end of the guide). Everything works (even with paid content). I succeeded in everything, but the problem is the same: I must run RF2 BEFORE the server, otherwise RF2 does not launch.

    If I run RF2 first, then the server, it works. But if RF2 crashes, I can't restart it because the server is running.
     
  2. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,976
    Likes Received:
    687
    Before you start Steam and rFactor 2, start the SteamCMD Dedicated-Server.
    In that Way you can restart rFactor 2 without a Problem, while the Dedi is still running.
    Should work with the integrated Dedi too, i guess.
     
  3. Franck

    Franck Registered

    Joined:
    Mar 26, 2017
    Messages:
    62
    Likes Received:
    329
    it works very well with your method! Thank you!
     
  4. GitGang

    GitGang Registered

    Joined:
    May 25, 2021
    Messages:
    5
    Likes Received:
    0
    Hi there I have just completed the online tutorial just like Franck but I can no longer run RF2 before or after launching the DEDI. Steam shows that RF2 is running so I can't open it normally but when I try to run RF2 using the launcher file rather than steam I get the error message below.

    My knowledge of servers is limited at best and following the tutorial with the help of Davy Jones' youtube video still took me a good few hours. Please bear this in mind when you reply. I can navigate my way around the files in the game folders and things but that's about my limit.

    Any help to get me playing again would be awesome, I'm considering uninstalling the game and deleting all files to start again, but I would much rather understand the problem and fix it.

    Thanks

    RF2 Error.JPG
     
  5. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    9,449
    Likes Received:
    4,471
    Did you exit steam before starting the server? From reading above it seems that's all that could be missing. If you can start the steamcmd server without steam automatically running, it won't think rF2 is running and stop you playing it.

    The error is normal when trying to run the game directly from the file. You need to run it through steam. The key here is to start the server, separately and without steam, first.
     
  6. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,976
    Likes Received:
    687
    Not really, read the Thread from the Beginning on. ;)
     
  7. GitGang

    GitGang Registered

    Joined:
    May 25, 2021
    Messages:
    5
    Likes Received:
    0
    Hi all, I have tried all these options but still cannot get it to run. I got hoe from work without changing a thing after it somehow runningok last night and cannot run RF2 with or without running the server.
     
  8. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,976
    Likes Received:
    687
    If rFactor 2 isn't running anymore, make a Steam File Integrity Check and if that doesn't help, before you try to start rFactor 2, rename the Folder
    ..\steamapps\common\rFactor 2\UserData
    into
    ..\steamapps\common\rFactor 2\UserData_backup
    for Example and then start the Game.
    In that Way you get fresh User Files.
    If that also doesn't solve the Problem, post more Information, like Error Mesages and what exactly happens, please.
    And do you use the rFactor 2 Steam cmd dedicated Server?
     
  9. GitGang

    GitGang Registered

    Joined:
    May 25, 2021
    Messages:
    5
    Likes Received:
    0
    Hiya,

    Some more information on my issue, when I initially start the game from steam, I get this options dialogue.

    upload_2021-5-26_21-58-30.png

    Not sure if this is normal, my friend says he doesn't get it and it's been such a long time since I played the game I cannot remember if I used to get it before I created my server - which is a steamCMD server by the way. N.B. I have only played it the once since the UI update.

    I didn't receive any error messages, the game would just flick up the RF2 logo screen shown below and then stop running a few moments later. This happened regardless of whether I was running the server or in what order I started RF2/steam/the server.

    upload_2021-5-26_22-5-8.png


    The advice to rename the user data folder so RF2 creates a new version worked so I can now launch RF2 again on it's own or if I start the sever before logging into steam. So thank you very much.

    However, my server is still not appearing in the lists after I set it running.

    I have followed advise on discord to change the ports in the server’s multiplayer.json file: http port to 27013, simulation port to 53297 and then forward 27013TCP, 53297TCP&UDP, and 27014 and 27015UDP on my router, but still not resolved.

    Also, as an aside, I cannot "alt tab" out of RF2 when running so I would have to close the game to make any changes to the server, unless I can choose which screen RF2 runs on. I use a laptop hooked up to a TV for gaming.

    Thank you for the help here, I really do appreciate it, and enjoy learning how to set this stuff up.

    It wouldn't be half as frustrating if it wasn't for the fact that I was able to "relatively" easily get a server running last year when I first purchased the game. However since then I have moved house and the router has changed. Not sure if it's of any consequence but I have a talk talk router, and was using a virgin one before.
     
  10. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,976
    Likes Received:
    687
    Yes, that is the normal "pre" Menu, if you start rFactor from Steam


    So that Problem is solved as it seems.


    You can find some Threads about "invisible" Servers in the Server List, here in the Forum.
    And for Example a missing NAT Loopback Functionality of the Router can be one of the Reasons, if i remeber it right.
    And one Solution, to get it visible when Game and Server are on the same Machine, was to open/use another Port, where i unfortunately don't remember the Port Number anymore.
    But do you really need to see it on the Server List?
    Can't you just join by using a direct Shortcut?
    Or what you also could do, is to use a Website that lists the Servers and join from there.
    I have made such a Site long ago and refreshed it a few Weeks ago, so you can try it out, if your Server is listed there.
    The Adress is: https://simracepackages.lima-city.de/rF2server/

    And that Alt-Tab is not working for some is a bit weird.
    For me it always worked, independent of the Mode Setting (Fullscreen, Borderless, Windowed)
    So i can not reproduce it, to try to find a Solution for that.
     
  11. GitGang

    GitGang Registered

    Joined:
    May 25, 2021
    Messages:
    5
    Likes Received:
    0
    Ok so I feel I am making progress but it is 1 step forward 2 steps back!

    Without changing anything I can see my server in the servers list through using the link you gave me, thank you for that.

    However, I seem to have to rename the user data folder again to actually run RF2. Is there something that can be done so I do not have to do this every time I wish to run my server?

    You say about creating a link to join my server - how do I do this please?

    Also, I cannot download or run updates for the server anymore.
    For updating I am using the following command:
    steamcmd +login anonymous +force_install_dir ../rFactor2-Dedicated +app_update 400300 +quit
    PAUSE

    For downloading I am using the following command:
    steamcmd.exe +login anonymous +workshop_download_item 365960 xxxxxxxxxx +quit (xx's = item id from steam).
    PAUSE

    I have successfully used both commands yesterday but I get this error now:
    'steamcmd.exe' is not recognized as an internal or external command, operable program or batch file.
     
  12. Woodee

    Woodee Registered

    Joined:
    Oct 4, 2010
    Messages:
    3,523
    Likes Received:
    621
    Your update command is WRONG

    Use the GAME ID.

    [​IMG]

    Done it just now.
     
  13. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,976
    Likes Received:
    687
    I leave out the Dedicated Update Problem, because @Woodee did answer to that already.
    To join your dedicated Server with a direct Link, you have to use a Shortcut to the rFactor2.exe in the Folder
    ..\steamapps\common\rFactor 2\Bin64
    Righclick on the rFactor2.exe and select "create Shortcut".
    When the Shortcut was created, rightclick on the Shortcut and select "Properties".
    In the Tab "Shortcut", you see what the below Screenshot shows (sorry, i'm a German, so it's in german Language).
    You have to edit 2 Things.
    In the Field "Target" (marked with green), go to the End of the Entry and hit "Space" on your Keyboard
    then Enter this:
    +multiplayer +connect="127.0.0.1:64297"
    NOTE: if you use another Port than the default 64297, you have to use that.
    And in the Field "execute in" (marked with red) delete \Bin64
    If you did these 2 Things, click OK to save it.
    Move the Shortcut to wherever you want to have it.
    To use it, as first, start your dedicated Server.
    When the Server is running, start Steam.
    And then doubleclick on the Shortcut.
    If everything works as it should, you directly join the Server now.

    Shortcutsetup.jpg
     
  14. GitGang

    GitGang Registered

    Joined:
    May 25, 2021
    Messages:
    5
    Likes Received:
    0
    Ok cool thanks for that, bit confused as I copied and pasted the update command from the tutorial but hey I'm no expert.

    Do you know why the download command isn't working?

    thanks again
     
  15. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    1,976
    Likes Received:
    687
    @GitGang Did you also read THIS?

    EDIT To download Content for the Steam cmd dedicated Server, create a new Text File in the Folder where the steamcmd.exe is and put the following Line into it:

    steamcmd.exe +login anonymous +workshop_download_item 365960 1411394979 +quit

    then save it and rename it to download_content.bat for Example (the File-Extension .bat is mandatory)
    The Workshop Content ID 1411394979 will download the DLC Porsche_991RSR_GTE_2017 for Example and you can find the downloaded Files in the Folder
    [Your Steam cmd Installation Folder]\steamapps\workshop\content\365960\1411394979

    To start the Download, just doubleclick on that File.
    And if you want to download another Item, edit it and replace the Content ID with the Content ID of the new Item.
     
    Last edited: May 29, 2021

Share This Page