Author Topic: Another Question From Me: Server Triggers  (Read 7833 times)

0 Members and 2 Guests are viewing this topic.

bigbigger9

  • Gnoll Fighter
  • **
  • Posts: 73
  • Reputation: +0/-0
Another Question From Me: Server Triggers
« on: September 20, 2003 11:55 pm CDT »
What kind of server triggers are there?

Edit: Like, onclientkill or something?

(Note: The reason I'm asking all these server questions, is because this is my first time doing some server scripting)
« Last Edit: December 31, 1969 06:00 pm CST by bigbigger9 »
~bigbigger9

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #1 on: September 21, 2003 12:47 am CDT »
What kind of triggers?

There are too many to list.

Think about it like this.. There is a trigger for every alteration in the game / gameplay.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

bigbigger9

  • Gnoll Fighter
  • **
  • Posts: 73
  • Reputation: +0/-0
(No subject)
« Reply #2 on: September 21, 2003 01:41 am CDT »
heh, well, like the client connected to the server, the client killing someone, the client being killed, but I'd like to focus on the client being connected or along that line.
« Last Edit: December 31, 1969 06:00 pm CST by bigbigger9 »
~bigbigger9

Dragoon

  • Gnoll Fighter
  • **
  • Posts: 52
  • Reputation: +0/-0
(No subject)
« Reply #3 on: September 21, 2003 07:51 am CDT »
Server::onClientConnect(%clientId)

if you are using base mod, that function is in server.cs.  if you are using TRPG, that function is in connectivity.cs.
« Last Edit: December 31, 1969 06:00 pm CST by Dragoon »
I r Dragoon.

bigbigger9

  • Gnoll Fighter
  • **
  • Posts: 73
  • Reputation: +0/-0
(No subject)
« Reply #4 on: September 21, 2003 11:03 am CDT »
Thanks.  :wink:
« Last Edit: December 31, 1969 06:00 pm CST by bigbigger9 »
~bigbigger9

Dragoon

  • Gnoll Fighter
  • **
  • Posts: 52
  • Reputation: +0/-0
(No subject)
« Reply #5 on: September 21, 2003 12:00 pm CDT »
function Server::onClientConnect(%clientId)
{
   if(!String::NCompare(Client::getTransportAddress(%clientId), "LOOPBACK", 8))
   {
      %clientId.isAdmin = true;
      %clientId.isSuperAdmin = true;
   }

   echo("- Connect -");
   echo((%NM=Client::getName(%clientId)) @ ", " @ (%IP=Client::getTransportAddress(%clientId)));
   echo("- - - - - -");

   Client::LogIP(%NM, %IP);

   %clientId.noghost = true;
   %clientId.messageFilter = -1;
   remoteEval(%clientId, SVInfo, version(), $Server::Hostname, $modList, $Server::Info, $ItemFavoritesKey);
   remoteEval(%clientId, MODInfo, $MODInfo);
   remoteEval(%clientId, FileURL, $Server::FileURL);

   for(%i = 0; %i < 10; %i++)
      $Client::info[%clientId, %i] = "";

   Game::onPlayerConnected(%clientId);
}

function Client::LogIP(%NM, %IP)
{
   $Connect = %NM @ " [" @ %IP @ "]";

   export("$Connect", "temp\\IPLog.txt");
   deleteVariables("$Connect");
}
« Last Edit: December 31, 1969 06:00 pm CST by Dragoon »
I r Dragoon.

bigbigger9

  • Gnoll Fighter
  • **
  • Posts: 73
  • Reputation: +0/-0
(No subject)
« Reply #6 on: September 21, 2003 01:40 pm CDT »
So just add to the function?
« Last Edit: December 31, 1969 06:00 pm CST by bigbigger9 »
~bigbigger9

Dragoon

  • Gnoll Fighter
  • **
  • Posts: 52
  • Reputation: +0/-0
(No subject)
« Reply #7 on: September 21, 2003 01:45 pm CDT »
you can do whatever the hell you want big.  nothing is hardcoded to tribes...  you can change almost everything through the code.  if you wanted, you could even do:

function Server::onClientConnect(%clientId)
{
DoConnectStuff(%clientId);
LoadPlayerSettings(%clientId);
FinalizePlayer(%clientId);
}

and make those 3 functions do whatever you want, everything can be changed, but with your level of coding, i wouldn't recommend too much of the complete re-writes, they can get very complex very fast.
« Last Edit: December 31, 1969 06:00 pm CST by Dragoon »
I r Dragoon.

bigbigger9

  • Gnoll Fighter
  • **
  • Posts: 73
  • Reputation: +0/-0
(No subject)
« Reply #8 on: September 21, 2003 02:15 pm CDT »
heh, yea. I've only done client scripting, and I'm not modding the game, I'm just adding some stuff, you'll see soon enough what this is all for, but I doubt you'll care, since most people here don't play CTF for Tribes 1. I'll be sure to be give credit to you guys for helping me out so much.
« Last Edit: December 31, 1969 06:00 pm CST by bigbigger9 »
~bigbigger9

Dragoon

  • Gnoll Fighter
  • **
  • Posts: 52
  • Reputation: +0/-0
(No subject)
« Reply #9 on: September 21, 2003 02:29 pm CDT »
actually, some of us will care, the others won't.  me personally... i won't give a damn as i have done so much with tribes that some noob scripters stuff doesn't really impress me, nothing personal...
« Last Edit: December 31, 1969 06:00 pm CST by Dragoon »
I r Dragoon.

bigbigger9

  • Gnoll Fighter
  • **
  • Posts: 73
  • Reputation: +0/-0
(No subject)
« Reply #10 on: September 21, 2003 10:50 pm CDT »
Why isn't schedule(); working in comchat.cs?

schedule("net::kick(%clientId, \"Bye.\");",5);

It works in console, just not in the comchat.cs
« Last Edit: December 31, 1969 06:00 pm CST by bigbigger9 »
~bigbigger9

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #11 on: September 21, 2003 11:58 pm CDT »
Is %clientID defined?
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

bigbigger9

  • Gnoll Fighter
  • **
  • Posts: 73
  • Reputation: +0/-0
(No subject)
« Reply #12 on: September 21, 2003 11:58 pm CDT »
Yes.

Edit: I'll try something real quick and make positive.
« Last Edit: September 22, 2003 12:02 am CDT by bigbigger9 »
~bigbigger9

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #13 on: September 22, 2003 12:02 am CDT »
schedule("net::kick(%clientId, "Bye");",5);

Try it like this for kicks and giggles.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

bigbigger9

  • Gnoll Fighter
  • **
  • Posts: 73
  • Reputation: +0/-0
(No subject)
« Reply #14 on: September 22, 2003 12:03 am CDT »
Quote from: "UnderGod"
schedule("net::kick(%clientId, "Bye");",5);

Try it like this for kicks and giggles.


I'm already kicking and giggling, but hey, why not? I'm bored.

Later: Ah, didn't even bother trying this, but I made some variables global and it worked... I have no idea why making them global worked, but hey, I don't care, as long as it worked.
« Last Edit: December 31, 1969 06:00 pm CST by bigbigger9 »
~bigbigger9