Multiple instances command line best practise

Discussion in 'Hosting Help' started by aerobaticrug, Mar 2, 2014.

  1. aerobaticrug

    aerobaticrug Registered

    Joined:
    Dec 27, 2012
    Messages:
    203
    Likes Received:
    5
    I want to run 2 instances on our dedi box.

    What are the command line options and what is the best practise for this?

    Currently I have two profiles setup, player and server. The ports in the server multiplayer.ini are advanced by 1 number. However running it through the launcher gives the ensure multiplayer ports are avaliable. I read somewhere that starting it through the cmd line will take care of that.

    When I managed to get the second going through cmd line, I couldn't get 'getmod' to work.

    So basically if someone could list out the commands and give me a basic example that would be fantastic.

    Would it then be possible to put into a startup script if the dedi box ever restarted?
     
  2. DocJones

    DocJones Registered

    Joined:
    Jan 26, 2011
    Messages:
    403
    Likes Received:
    5
    Does that help with your question about the command line: link?

    About 'getmod' not working: Build 494 requires your vmod to not have spaces in its name.
    Could also be an issue with HTTP Server Document Root= and/or Package Dir= not setup correctly in your multi profiles setup, read up on it here
     
  3. aerobaticrug

    aerobaticrug Registered

    Joined:
    Dec 27, 2012
    Messages:
    203
    Likes Received:
    5
    Thanks, I'll give that a go and see how it works out :)
     
  4. aerobaticrug

    aerobaticrug Registered

    Joined:
    Dec 27, 2012
    Messages:
    203
    Likes Received:
    5
    Looked through that and tried the below:

    "D:\rfactor2\Core\rFactor2 Dedicated.exe" +profile="player"
    Start in D:\rfactor2

    Second server:

    "D:\rfactor2\Core\rFactor2 Dedicated.exe" +profile="server"
    Start in D:\rfactor2

    That throws ensure ports set in multiplayer are avaliable. I don't think either of the shortcut commands are working properly as I have to select the profile and mod from the drop down.

    Also +oneclick does not work
     
    Last edited by a moderator: Mar 3, 2014
  5. DocJones

    DocJones Registered

    Joined:
    Jan 26, 2011
    Messages:
    403
    Likes Received:
    5
    Yeah, +oneclick is broken with the current build. However, +profile "profile name" should preselect the right profile for you. It does on the servers I look after. Make sure you have a space between +profile and "profile name".
     
    Last edited by a moderator: Apr 10, 2014
  6. aerobaticrug

    aerobaticrug Registered

    Joined:
    Dec 27, 2012
    Messages:
    203
    Likes Received:
    5
    Cool - so managed to get both servers up and running - however they are vice versa from what it says in match maker, so Sever 1 running mod 1 and server 2 running mod 2 end up with the server displaying as server 1 running mod 2 and the server displaying as server 2 running mod 1!?

    Tried the +profile bit again and it still does not preselect the right profile from the shortcut :(
     
  7. gamer-hosting

    gamer-hosting Registered

    Joined:
    Mar 21, 2012
    Messages:
    28
    Likes Received:
    0
    Hi,

    See this is how we do it. Simply add this in the target:
    "C:\path to your server\148\Core\rFactor2 Dedicated.exe" +path=.. +profile "player" +maxplayers 25 +oneclick

    http://isiforums.net/f/showthread.p...d-server-crash?p=251821&viewfull=1#post251821

    And this are some ideas to automate your root server
    ex1.
    Suppose you have one (or two) server running F1 mod, but you are going to run Clio Cup every weekend. You can automate the start up. Create a scheduled task in the mornig to first kill servers, and second start them again.
    CMD -> Taskkill /IM "rFactor dedicated server.exe" /F
    CMD -> to shortcut with oneclik, but using profile "player2" where player 2 contain PLR with the clio mod.
    On monday, the same with "player1" who contain the F1 mod.
    ex2.
    The same situation but you want to change the day of the race the running conditions (damages, tires, grip, weather ... )
    Or the same situation but want to change every day conditions.
    ex3.
    If your server use so much ram, you can kill it and start it again every night. Or if your server need to restart every day for some reason , you can do it. Also every system restart (windows update).


    Are you using the same installation ? .... Its better to use different install for each server. No problem or conflict if they are different installations.
    Just copy&paste your install to a second one. And use one profile in each one, so you can use the same command line in each one if the profile have the same name.
     
  8. lebuz

    lebuz Registered

    Joined:
    Mar 2, 2014
    Messages:
    13
    Likes Received:
    0
    Hi, I have problem with ports, when start the second instance and configure at save said ports are used, only have this ports to configure un multiplayer.ini

    Server 1

    Simulation Port="54297" // range is 1025 - 65535
    HTTP Server Port="53297" // range is 1025 - 65535

    "C:\Program Files (x86)\rFactor2\Core\rFactor2 Dedicated.exe" +profile="Serverpriv"
    "C:\Program Files (x86)\rFactor2"

    Server 2

    Simulation Port="64297" // range is 1025 - 65535
    HTTP Server Port="63297" // range is 1025 - 65535

    "C:\Program Files (x86)\rFactor2\Core\rFactor2 Dedicated.exe" +profile="Server1"
    "C:\Program Files (x86)\rFactor2"
     
  9. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Correct syntax:
    Code:
    +profile "<ServerName>"
    
    Incorrect syntax:
    Code:
    +profile="<ServerName>"
    
    That should clear up the confusion in this thread.

    The only other catch is the working directory. It needs to be set to the folder where the data.path file is located. So <rFactor2Core>\ not <rFactor2Core>\Core. You can set this in the "Start In" field in your shortcut or by adding "+path=.." to the command line.

    So here is what I have for example:

    Target:
    Code:
    "C:\Program Files (x86)\rFactor2\494\Core\rFactor2 Dedicated.exe" +profile "Server1"
    Start In:
    Code:
    "C:\Program Files (x86)\rFactor2\494"
    Keep in mind it will still prompt for the profile name, but the one you selected on the command line should already be selected in the drop down. +oneclick is broken in 494 but fixed in 515. So for now you can't fully automate the launching of the server.
     
  10. lebuz

    lebuz Registered

    Joined:
    Mar 2, 2014
    Messages:
    13
    Likes Received:
    0

    Thats correct

    +profile "<ServerName>"

    I have 3 servers online Thanks
     

Share This Page