TribesNext

Welcome, Guest. Please login or register.
Did you miss your activation email?


TribesNext >  TribesNext.com Forums >  Support >  Server Support >  Server Setup « previous next »
Pages: 1 [2] 3 Print
Author Topic: Server Setup
Eolk
Global Moderator
Posts: 838

View Profile
15: January 20, 2009, 05:40:44 PM »
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).
« Last Edit: January 20, 2009, 05:45:28 PM by Eolk »
Threatcon
Nugget³

Posts: 91

View Profile WWW
16: January 20, 2009, 06:08:02 PM »
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?

Blakhart
Juggernaught
Posts: 1625

View Profile
17: January 20, 2009, 08:10:57 PM »
mod
Threatcon
Nugget³

Posts: 91

View Profile WWW
18: February 14, 2009, 09:53:00 AM »
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.
Code:
$Host::AutoResetServer = 0;
$Host::ResetTime = 20;

Blakhart
Juggernaught
Posts: 1625

View Profile
19: February 14, 2009, 10:34:39 AM »
You may have to try an admin mod such as tricon to do what you want.
Threatcon
Nugget³

Posts: 91

View Profile WWW
20: February 14, 2009, 01:14:50 PM »
Ok I found this in server.cs...
Code:
   // 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...
Code:
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.
« Last Edit: February 14, 2009, 01:27:59 PM by Threatcon »

Blakhart
Juggernaught
Posts: 1625

View Profile
21: February 14, 2009, 01:28:35 PM »
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:

Code:
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.
« Last Edit: February 14, 2009, 01:34:29 PM by Blakhart »
Abstract
Scout

Posts: 465

View Profile
22: February 14, 2009, 01:36:29 PM »
General discussion is not necessarily the best place for this thread, can we get a move from our moderators?

I am: DisChord81/KillMachine/Atlas/Abstract, in that order.
Threatcon
Nugget³

Posts: 91

View Profile WWW
23: February 14, 2009, 07:35:04 PM »
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.  ??

Threatcon
Nugget³

Posts: 91

View Profile WWW
24: February 14, 2009, 08:03:24 PM »
Code:
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!!

Turkeh
nil

Posts: 458

View Profile
25: February 16, 2009, 07:48:06 AM »
Moved to Server Support and stickied.

Read the FAQs!

Search before posting support requests.
Eolk
Global Moderator
Posts: 838

View Profile
26: February 16, 2009, 07:51:52 AM »
You could also find these lines and comment them out:
Code:
   // 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.
Blakhart
Juggernaught
Posts: 1625

View Profile
27: February 17, 2009, 12:33:59 PM »
I knew I had something on packages:

"Be careful with packages Smiley
-------------------------------------------------------------------------=
-------

Wizard_TPG
TAC Development Team
http://www.tribes-universe.com/tac/
Wizardsworld
http://www.tribalwar.com/wizard/
----- Original Message -----
From: Wizard_TPG=20
To: t2scripters@gameshrine.com
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 Smiley

Wizard_TPG
wizardsworld@bigpond.com"
« Last Edit: February 17, 2009, 12:38:18 PM by Blakhart »
Threatcon
Nugget³

Posts: 91

View Profile WWW
28: April 21, 2009, 03:44:52 PM »
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.

Krash
Administrator
Posts: 257

View Profile
29: April 24, 2009, 11:17:47 AM »
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


Pages: 1 [2] 3 Print 
« previous next »
Jump to:  

irc.quakenet.org / #TribesNext Powered by SMF  © Simple Machines
anything