Feature request: redirect to clone on full
Feature request: redirect to clone on full
Is it possible to redirect players to another server (a clone or a waiting server) when your server becomes full? If not, would this be interesting enough for the devs to pick it up?
- DDMJ
- Reverse Outside Corner Grinder
- Posts: 1882
- Joined: Thu Jun 08, 2006 12:15 am
- Location: LA, CA, USA, NA
- Contact:
Re: Feature request: redirect to clone on full
There's a MOVE_TO command. Just make a script that reads the number of players and executes the MOVE_TO command when a new client enters.
Re: Feature request: redirect to clone on full
How would I go about scripting something like this? Does AA have some of platform for writing plugins or do I have to edit the source? I actually was more hoping to do this for popular servers so that I wouldn't have to wait for WWctf to empty
, as opposed to using the feature myself.

- AI-team
- Shutout Match Winner
- Posts: 1020
- Joined: Tue Jun 23, 2009 6:17 pm
- Location: Germany/Munich
- Contact:
Re: Feature request: redirect to clone on full
sty+ct is what you should be looking for =)
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
-
- Dr Z Level
- Posts: 2246
- Joined: Sun Mar 20, 2005 4:03 pm
- Location: IM: luke@dashjr.org
Re: Feature request: redirect to clone on full
This is a fairly simple feature to implement. As of now, it's available on servers I host (on request). I will also push it to trunk next time I do something there. For a one-time $15, I will publish my 0.2.8 branch with it or (at your option) send it only to you. 
For $25 (total), I'll even assign the copyright on the code to implement this feature to you. The only practical value to this is if someone wants to license it outside the GPL terms (for example, to make an X-Box or iPhone port), they will need to include you in their negotiations (or strip out the feature...). Might also be worth bragging rights depending on the community.

For $25 (total), I'll even assign the copyright on the code to implement this feature to you. The only practical value to this is if someone wants to license it outside the GPL terms (for example, to make an X-Box or iPhone port), they will need to include you in their negotiations (or strip out the feature...). Might also be worth bragging rights depending on the community.

Re: Feature request: redirect to clone on full
I haven't found such a feature on sty+ct.AI-team wrote:sty+ct is what you should be looking for =)
I'm good thanks. If you won't charge me, could you please bump this thread next time you commit to trunk?Luke-Jr wrote:This is a fairly simple feature to implement. As of now, it's available on servers I host (on request). I will also push it to trunk next time I do something there. For a one-time $15, I will publish my 0.2.8 branch with it or (at your option) send it only to you.
For $25 (total), I'll even assign the copyright on the code to implement this feature to you. The only practical value to this is if someone wants to license it outside the GPL terms (for example, to make an X-Box or iPhone port), they will need to include you in their negotiations (or strip out the feature...). Might also be worth bragging rights depending on the community.
- AI-team
- Shutout Match Winner
- Posts: 1020
- Joined: Tue Jun 23, 2009 6:17 pm
- Location: Germany/Munich
- Contact:
Re: Feature request: redirect to clone on full
There's is none. You have to code it yourself~z~ wrote:I haven't found such a feature on sty+ct.AI-team wrote:sty+ct is what you should be looking for =)

Code: Select all
<?php
$max_clients = 32; // EDIT THIS LINE
$server_move_to = "IP ADDRESS"; // EDIT THIS LINE
$port_move_to = "SERVER PORT"; // EDIT THIS LINE
$num_players = 0; // the rest should be kept as it is
while (1) {
$line = rtrim(fgets(STDIN, 1024));
if (preg_match("/^PLAYER_ENTERED/", $line)) {
$keywords = preg_split("/ /", $line);
$player_id = trim($keywords[1]);
$player_ip = $keywords[2];
$player_name = "";
if ($num_players == $max_clients) {
echo "MOVE_TO $player_id $server_move_to:$port_move_to\n";
break 2;
}
$num_players +=1;
}
if (preg_match("/^PLAYER_LEFT/", $line)) {
$num_players -=1;
}
}
?>
If not: http://crazy-tronners.com/wiki/index.ph ... g_a_Server
Last edited by AI-team on Wed Aug 11, 2010 4:55 pm, edited 4 times in total.
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
- kyle
- Reverse Outside Corner Grinder
- Posts: 1963
- Joined: Thu Jun 08, 2006 3:33 pm
- Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
- Contact:
Re: Feature request: redirect to clone on full
actually that won't necessarily work, and $max_clients would have to be 1 less than full. Unless you update the $num_players on PLAYER_ENTERED before the check.
This should be PLAYER_LEFT
This should be PLAYER_LEFT
Code: Select all
if (preg_match("/^PLAYER_ENTERED/", $line)) {
$num_players -=1;
}

- AI-team
- Shutout Match Winner
- Posts: 1020
- Joined: Tue Jun 23, 2009 6:17 pm
- Location: Germany/Munich
- Contact:
Re: Feature request: redirect to clone on full
Ops , copy-paste fail 
EDIT: I also noticed the break fail (missing 2 )

EDIT: I also noticed the break fail (missing 2 )

"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
-
- Dr Z Level
- Posts: 2246
- Joined: Sun Mar 20, 2005 4:03 pm
- Location: IM: luke@dashjr.org
Re: Feature request: redirect to clone on full
Committed to trunk in bzr-etrunk-rev 996 (I didn't have anything else to push, but it's been long enough to know nobody cares to sponsor this development...)