Server Setup

A post specifically about hosting a T2 server should be stickied somewhere. How to setup and host your own dedicated server, optimizations and such. Maybe some common map packs. Just an idea ;D

If it already exists, sorry I missed it.
«1

Comments

  • edited January 2009
    An example serverprefs.cs:
    $Host::AdminList = "12345\t65734\t76345643";
    $Host::AdminPassword = "adminpasswordgoeshere";
    $Host::allowAdminPlayerVotes = 0; //1 here will allow admin voting
    $Host::AllowMapScript = 1;
    $Host::AllowMPBTeleporter = 0;
    $Host::BanTime = 1800000;
    $Host::BotCount = 14; //how many bots u want
    $Host::BotsEnabled = 1; //1 if u want bots, 0 if not
    $Host::ConnectLogging = 1;
    $Host::CRCTextures = 1;
    $Host::Dedicated = 1;
    $Host::FloodProtectionEnabled = 1;
    $Host::GameName = "nameyourserverhere";
    $Host::HiVisibility = "0"; //do not set this to enabled 1, it always crashes the server eventualy
    $Host::holoName1 = "Storm";
    $Host::holoName2 = "Inferno";
    $Host::holoName3 = "Starwolf";
    $Host::holoName4 = "DSword";
    $Host::holoName5 = "BloodEagle";
    $Host::holoName6 = "Harbinger";
    $Host::Info = "yourcoolmessagegoeshere.";
    $Host::KickBanTime = 30000;
    $Host::LoadTR2Gametype = 0; //keeps from loading rabbit, clients join faster
    $Host::Map = "Sanctuary";
    $Host::MapPlayerLimitsAbominable_CnH = "-1 -1";
    $Host::MapPlayerLimitsAgentsOfFortune_TeamHunters = "-1 32";
    $Host::MapPlayerLimitsAlcatraz_Siege = "-1 48";
    $Host::MapPlayerLimitsArchipelago_CTF = "16 -1";
    $Host::MapPlayerLimitsAshesToAshes_CnH = "16 -1";
    $Host::MapPlayerLimitsBeggarsRun_CTF = "-1 32";
    $Host::MapPlayerLimitsCaldera_Siege = "-1 48";
    $Host::MapPlayerLimitsCasernCavite_Bounty = "-1 32";
    $Host::MapPlayerLimitsCasernCavite_DM = "-1 32";
    $Host::MapPlayerLimitsCasernCavite_Hunters = "-1 32";
    $Host::MapPlayerLimitsDamnation_CTF = "-1 32";
    $Host::MapPlayerLimitsDeathBirdsFly_CTF = "8 -1";
    $Host::MapPlayerLimitsDesiccator_CTF = "-1 -1";
    $Host::MapPlayerLimitsDustToDust_CTF = "-1 32";
    $Host::MapPlayerLimitsDustToDust_Hunters = "-1 32";
    $Host::MapPlayerLimitsDustToDust_TeamHunters = "-1 32";
    $Host::MapPlayerLimitsEquinox_CnH = "-1 -1";
    $Host::MapPlayerLimitsEquinox_DM = "-1 32";
    $Host::MapPlayerLimitsEscalade_Bounty = "16 32";
    $Host::MapPlayerLimitsEscalade_DM = "16 -1";
    $Host::MapPlayerLimitsEscalade_Hunters = "8 -1";
    $Host::MapPlayerLimitsEscalade_Rabbit = "16 -1";
    $Host::MapPlayerLimitsEscalade_TeamHunters = "8 -1";
    $Host::MapPlayerLimitsFirestorm_CnH = "-1 24";
    $Host::MapPlayerLimitsFirestorm_CTF = "-1 24";
    $Host::MapPlayerLimitsFlashpoint_CnH = "-1 -1";
    $Host::MapPlayerLimitsGauntlet_Siege = "-1 32";
    $Host::MapPlayerLimitsGehenna_Hunters = "-1 -1";
    $Host::MapPlayerLimitsGehenna_TeamHunters = "-1 -1";
    $Host::MapPlayerLimitsIcebound_Siege = "-1 -1";
    $Host::MapPlayerLimitsInsalubria_CnH = "-1 32";
    $Host::MapPlayerLimitsJacobsLadder_CnH = "-1 -1";
    $Host::MapPlayerLimitsKatabatic_CTF = "-1 48";
    $Host::MapPlayerLimitsMasada_Siege = "-1 32";
    $Host::MapPlayerLimitsMinotaur_CTF = "-1 32";
    $Host::MapPlayerLimitsMyrkwood_DM = "-1 32";
    $Host::MapPlayerLimitsMyrkwood_Hunters = "-1 32";
    $Host::MapPlayerLimitsMyrkwood_Rabbit = "-1 32";
    $Host::MapPlayerLimitsOasis_DM = "-1 32";
    $Host::MapPlayerLimitsOverreach_CnH = "8 -1";
    $Host::MapPlayerLimitsQuagmire_CTF = "-1 -1";
    $Host::MapPlayerLimitsRasp_Bounty = "-1 32";
    $Host::MapPlayerLimitsRasp_TeamHunters = "-1 32";
    $Host::MapPlayerLimitsRecalescence_CTF = "16 -1";
    $Host::MapPlayerLimitsRespite_Siege = "-1 32";
    $Host::MapPlayerLimitsReversion_CTF = "-1 -1";
    $Host::MapPlayerLimitsRimehold_Hunters = "8 -1";
    $Host::MapPlayerLimitsRiverdance_CTF = "-1 -1";
    $Host::MapPlayerLimitsSanctuary_CTF = "-1 -1";
    $Host::MapPlayerLimitsSirocco_CnH = "8 -1";
    $Host::MapPlayerLimitsSlapdash_CTF = "-1 -1";
    $Host::MapPlayerLimitsSunDried_Bounty = "8 -1";
    $Host::MapPlayerLimitsSunDried_DM = "8 -1";
    $Host::MapPlayerLimitsTalus_Bounty = "-1 32";
    $Host::MapPlayerLimitsThinIce_CTF = "-1 -1";
    $Host::MapPlayerLimitsTombstone_CTF = "-1 -1";
    $Host::MapPlayerLimitsUltimaThule_Siege = "8 -1";
    $Host::MapPlayerLimitsUnderhill_Bounty = "-1 32";
    $Host::MapPlayerLimitsUnderhill_DM = "-1 -1";
    $Host::MapPlayerLimitsWhiteout_Bounty = "8 -1";
    $Host::MapPlayerLimitsWhiteout_DM = "8 -1";
    $Host::MarkDnDObjectives = 1;
    $Host::MarkHybridObjectives = 0;
    $Host::MaxBotDifficulty = 0.99; //.99 is as tough as they get
    $Host::MaxMessageLen = 120;
    $Host::MaxPlayers = 32;  //total players allowed, bots included
    $Host::MinBotDifficulty = 0.99; //no one wants stupid bots, set to .99
    $Host::MissionType = "CTF";
    $Host::NoSmurfs = 1; //if enabled (1) denies smurfing, no fake names allowed
    $Host::PlayerRespawnTimeout = 60;
    $Host::Port = 28000; //can be set to any port above 1024 and below 65535 not in use
    $Host::PureServer = 0; //this was an effort by sierra to make all pure servers exactly the same, set it to 0
    $Host::RandomMissions = 0; //set to 1 if you want a mission to be selected at random
    $Host::Siege::Halftime = 20000;
    $Host::SuperAdminList = "123321"; //set this number to your guid
    $Host::SuperAdminWhois = 1;
    $Host::TeamDamageOn = 0; //durr
    $Host::TeamName0 = "Unassigned"; //do not mess with team names
    $Host::TeamName1 = "Storm";
    $Host::TeamName2 = "Inferno";
    $Host::TeamName3 = "Starwolf";
    $Host::TeamName4 = "Diamond Sword";
    $Host::TeamName5 = "Blood Eagle";
    $Host::TeamName6 = "Phoenix";
    $Host::TeamSkin0 = "blank";
    $Host::TeamSkin1 = "base";
    $Host::TeamSkin2 = "baseb";
    $Host::TeamSkin3 = "swolf";
    $Host::TeamSkin4 = "dsword";
    $Host::TeamSkin5 = "beagle";
    $Host::TeamSkin6 = "cotp";
    $Host::TimeLimit = "30";
    $Host::TN::beat = 3;
    $Host::TN::echo = 1;
    $Host::TournamentMode = 0;
    $Host::VotePassPercent = 60;
    $Host::VoteSpread = 20;
    $Host::VoteTime = 30;
    $Host::warmupTime = 20;
    

    The following can be placed into autoexec folder (with any name, such as auto.cs) that can be used to adjust packet rates:
    $pref::Net::PacketRateToClient = "20"; //determines how many packets per second sent to each client
    $pref::Net::PacketRateToServer = "32"; //may determine how many packets are allowed from each client
    $pref::Net::PacketSize = "256"; //size of each packet sent to each client, maximum.has no effect on size of packets client send to the server
    
    
    setlogmode(0);
    // leave this set to zero unless you are coding and need a log it will make a huge file...!!!
    
    $logechoenabled=0;
    //set to 1 you can now see game details in console.  Thanks to tubaguy.
    
    SetPerfCounterEnable(0); //server stutter fix
    
  • $Host::TeamName0 = "Unassigned"; //do not mess with team names

    You can mess with the team names, It will just affect some settings in game.
  • Does anybody have a list of admin commands or links to decent admin mods which work?
  • http://www.maxogc.net/misc/tribes/tribes2/Tricon 2 for Tribes 2/
    Tricon for Tribes 2

    I'll find a readme sort of file and dump it in there to explain how to install it correctly.
  • I don't suggest TriCon. It's buggy and has some security holes.
  • Tricon is very stable, and the latest version has no security hole that I know of, the admin hole was patched in the last release.
  • Thank you all. This is the kind of stuff I was talking about.

    Wasn't there some sorta fix for the flickering or lag in the server that the latest "Official" patch didn't address or was created by the latest patch?
  • SetPerfCounterEnable(0); //server stutter fix
  • edited January 2009
    SetPerfCounterEnable(0); //server stutter fix

    Does this go in serverprefs.cs?

    **Edit...
    I see it now in auto.cs in the above post by Blakhart
  • Tricon is very stable, and the latest version has no security hole that I know of, the admin hole was patched in the last release.
  • Oh Dear...Thyth might hurt somebody.

    [move]RUN!!! RUN!!! RUN SOME MORE!!!!![/move]
  • Tricon is very stable, and the latest version has no security hole that I know of, the admin hole was patched in the last release.
    When I downloaded the latest version of TriCon, and, immediately, I noticed these things:
    * I was unable to kick or start a vote to kick. TriCon thought I was trying to hack it.
    * I saw this "encryption" system. That's stupid. Why not just check if the person is an admin instead of allowing public admins to achieve tricon admins status through a little know-how? The admin flagging stuff is handled by the server anyway.
  • Mine works fine, dunno why others have issues with it. You have to read the manuals and take some time getting it all sorted. And if you want to see buggy, try tricon for t1.
  • Let's see the command line options now for Windows based OS's...
    Tribes2.exe -dedicated -mod base++
    

    Is it possible to specify...
    bot count
    port
    ip
    config file name
    more??
  • edited January 2009
    Yes it is.
    • -nopure - this makes it so your server isn't "pure" (no calls to eval) and some other stuff (not entirely sure).
    • -clientprefs path - specifies while clientprefs file to use, default is prefs/ClientPrefs.cs.
    • -serverprefs path - specifies while serverprefs file to use, default is prefs/ServerPrefs.cs.
    • -host - makes a listen server?
    • -password arg - automatically puts in your password to log in (may not be compatible with TribesNext patch).
    • -bot arg - specifies how many bots there should be.

    Some Others
    -navBuild (build a navigation graph), -spnBuild (builds a spawn graph), -prepBuild (prepares the server and compiles all the scripts), -quit (quits the game immediately), -demo (puts the game in demo mode?)

    There are all lot of others, however, I'm not sure what a few do and if you'd find them useful or not (I'm not even sure about a few above).
  • Yes it is.
    • -serverprefs path - specifies while serverprefs file to use, default is prefs/ServerPrefs.cs.

    Thanks for those!

    The serverprefs.cs file, is it relative to the mod's folder or to the GameData folder?
  • One more question on a dedicated server...

    My server resets itself when the last human drops. How do I keep the game going with the bots playing?

    I found this in another mod's config and it's not working with a base server.
    $Host::AutoResetServer = 0;
    $Host::ResetTime = 20;
    
  • You may have to try an admin mod such as tricon to do what you want.
  • edited February 2009
    Ok I found this in server.cs...
       // reset the server if everyone has left the game
       //if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission )
       //   schedule(0, 0, "resetServerDefaults");
    
       // z0dd - ZOD, 5/12/02. Reset the server if everyone has left the game and set this mission as startup mission.
       // This helps with $Host::RandomMissions to keep the random more random.
       if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission )
       {
          $Host::Map = $CurrentMission;
          export("$Host::*", "prefs/ServerPrefs.cs", false);
          $Host::MissionType = $CurrentMissionType;
          export("$Host::*", "prefs/ServerPrefs.cs", false);
          schedule(10, 0, "resetServerDefaults");
       }
    }
    

    Is it possible to modify this to read the config file as to whether or not to reset the server when the last human player drops? Also if enabled to reset, how long should the server wait until it restarts in seconds or minutes.


    Hummm...
    As I was about to post this I went back and changed the if statement to this...
    if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission && $Host::AutoResetServer )
    

    Should this work if $Host::AutoResetServer = 0; is in my config file? If so how do I add the server.cs back into the vl2 file? Do I just rename the vl2 to a zip, then add the file and rename it back to a vl2?

    You were right Blackhart about Tricon. There is an option in there to do what I want, but I don't want Tricon to do just this one thing if I can get the above working. Thanks for your help.
  • edited February 2009
    I would look into simply writing a package to do as you want, or edit that part of server.cs. Then again, if you used packages you can more easily test and edit as you go along. I suppose the resetting forced by default is a measure against running out of tagged strings. Here's an example of a package:
    package RemoveTanks 
    { 
        function StationVehiclePad::onAdd(%this, %obj) 
        { 
            Parent::onAdd(%this, %obj); 
            %obj.assaultVehicle = "Removed";
            %obj.scoutFlyer = "Removed";
            %obj.bomberFlyer = "Removed"; 
            %obj.scoutVehicle = "Removed"; 
            if(%obj.ready) 
                return 
            %obj.ready = true; 
            %obj.setRechargeRate(%obj.getDatablock().rechargeRate); 
            if($CurrentMissionType $= %obj.missionTypesList || %obj.missionTypesList $="") 
                %this.schedule(0, "createStationVehicle", %obj); 
        }
    //function DefaultGame::missionLoadDone(%game) {
    
    //Parent::missionLoadDone(%game);
    
    //if (Sky.visibleDistance $= "" || Sky.visibleDistance == 0) {
    // This script plays it safe. You better have a map that works.
    //error("WARNING! This map will not work with NoFog Snipe!");
    //BasicSniperShot.maxRifleRange = 700;
    //}
    //else
    //BasicSniperShot.maxRifleRange = Sky.visibleDistance;
    //}
    //function alxGetWaveLen(%wavFile) {
    //		if ( strstr( %wavFile , ".wav" ) == -1 ) return $MaxMessageWavLength + 1;
    //		echo("Length check: " @ %wavFile);
    //		parent::alxGetWaveLen(%wavFile);
    //	}
    }; 
    activatepackage(RemoveTanks);
    


    Conversely you can just unpack the vl2 into the scripts folder and run from that, the scripts will be used over any scripts.vl2 found by the game. Makes editing a lot easier, but packages do have their places.
  • General discussion is not necessarily the best place for this thread, can we get a move from our moderators?
  • Hummm I have no idea how to get a package to work. I'll just unpack the vl2 file and edit the server.cs file directly. It's only a single line I have to edit. Thanks for the advice and help Blackhart.

    I was wondering as well why the server auto resets when the last human drops. The only thing I could come up with is that it saves on server resources. If a server is just running with bots it's consuming resources, but I wonder why they didn't leave the option in the prefs file for server owners. ??
  • if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission && $Host::AutoResetServer == 1 )
    

    Changing the if statement in the server.cs file worked just fine. The server now allows the bots to battle it out when the last human player leaves. Then when the map is over the server just hangs out and waits for a human to join before the map starts. Good stuff!!
  • Moved to Server Support and stickied.
  • You could also find these lines and comment them out:
       // reset the server if everyone has left the game
    //   if ( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission )
    //      schedule(0, 0, "resetServerDefaults");
    
    That will stop the server from restarting and let the bots fight.
  • edited February 2009
    I knew I had something on packages:

    "Be careful with packages :)
    =

    Wizard_TPG
    TAC Development Team
    http://www.tribes-universe.com/tac/
    Wizardsworld
    http://www.tribalwar.com/wizard/
    Original Message
    From: Wizard_TPG=20
    To: [email protected]
    Sent: Thursday, November 23, 2000 8:12 AM
    Subject: Package Overview


    This document is designed as an overview to explain the basic usage of
    the package functions included in Tribes 2 Coding. A package is
    basically used to temporarily replace an existing function (or numbers
    of functions) with new code. For those that understand inheritance, a
    package is a child of the original function. In the most basic form it
    will simply replace the existing code in the function.

    Basic Form
    Here is a very basic example.

    Original Functions:

    function Armour::BlaBla1 (%this,%obj)
    {
    echo("Dum de Dum Dum");
    }

    function Vehicle::BlaBla2 (%player,%col,%obj)
    {
    echo("Stupid ground hurt me!");
    }

    The package:

    package TestPack1
    {
    function Armour::BlaBla1 (%this,%obj)
    {
    echo("I hate foo!");
    }

    function Vehicle::BlaBla2 (%player,%col,%obj)
    {
    echo("Arghhhhhh");
    parent::BlaBla2(%player,%col,%obj);
    }
    };

    When you exec a package it stays dormant until it is activated. So to
    activate this package we would us the command:
    ActivatePackage(TestPack1);

    Now on running the function Armour::BlaBla1 returned is:
    I hate foo!

    If we deactivate the package by using the command
    DeactivatePackage(TestPack1);=20
    The output would return to:
    Dum de Dum Dum

    Note: This package can be re-activated at any time.

    Inheritance
    Pretty awesome huh? Now we can start to get into the more powerful side
    of the package. Inheritance. I am not going ot explain inheritance but
    am just gonn aexplain what you can do with a package. There is another
    command in T2 that is used in the example above. This command actually
    brings the code from the previous function into our package function so
    we are just "adding" code to it.

    In the example above.....prior to activation we get
    Stupid ground hurt me!

    and after activating we get
    Arghhhhhh
    Stupid ground hurt me!

    Once again, as above, this can be deactivated and activated as you see
    fit at any time.


    Running Multiple Packages
    So what happens if you run a package that alters a function, and then
    run another that alters the same function? Well.....no problems, it
    works. If you then deactivate the second package that is fine as well.
    You must remember though, that the second package sees the first package
    as its "parent" and, should you deactivate the first package without
    deactivating the second package, BOTH will be deactivated.

    Heres an example.
    Original Function
    function Armour::BlaBla1 (%this,%obj)
    {
    echo("Dum de Dum Dum");
    }

    package TestPak1
    {
    function Armour::BlaBla1 (%this,%obj)
    {
    echo("id like to punch you in the.....");
    parent::BlaBla1 (%this,%obj);
    }
    };

    package TestPak2
    {
    function Armour::BlaBla1 (%this,%obj)
    {
    echo("Go and ..... yourself.");
    parent::BlaBla1 (%this,%obj);
    }
    };

    If both packages are activated you would get the followign output:
    Go and ..... yourself.
    id like to punch you in the.....
    Dum de Dum Dum

    if the second package is deactivated you would get
    id like to punch you in the.....
    Dum de Dum Dum

    If both packages were activate and the first package was deactivated you
    get
    Dum de Dum Dum

    What can and cannot be included in a package
    It is important to know what you can and cannot include in a package. A
    package may ONLY contain functions. It may not contain datablocks,
    variables or function calls. These may, or course, be contained within
    functions within the package, but not directly in the package.

    ie. This will give a line error:

    package TestPak1
    {
    $TestVal =3D 1;

    function Armour::BlaBla1 (%this,%obj)
    {
    echo("id like to punch you in the.....");
    parent::BlaBla1 (%this,%obj);
    }
    };

    whereas this is fine:

    package TestPak1
    {
    function Armour::BlaBla1 (%this,%obj)
    {
    $TestVal =3D 1;
    echo("id like to punch you in the.....");
    parent::BlaBla1 (%this,%obj);
    }
    };

    Summary:
    Packages are a very powerful tool and should be used, especially for mod
    creation. Lorne said yesterday, "Its almost like cheating". I agree,
    it is almost too easy. Watch me cheat :)

    Wizard_TPG
    [email protected]"
  • How do I find a players "guid" to give them auto admin? I've looked in the console and nothing more than a player id appears.

    Thanks.
  • listplayers(); should bring up a list of players with their GUID noted. You can also use echo(%client.guid); if you have their ID.

    Also, another command line switch that's handy (though it could just as easily be done in a script) if you want to be able to connect to the server console via telnet is:
    -telnetParams port# passFull passRead
  • Thanks Krash!
Sign In or Register to comment.