Tremulous Forum
General => General Discussion => Topic started by: err on September 05, 2006, 03:29:56 am
-
Don't ask me why, but I thought a build point calcultor might be useful to server admins and base builders... IE (b7 at least) freaks out about some of the javascript but you can allow it or just use moz.
http://ufo.freepgs.com/trem/TremBuildCalc.htm
-
Sweet. I notice that its on a freewebhosting thing, and that they are closing the host in december. If you need hosting, lemme know and ill put you on ssthosting.net.
-
Don't ask me why, but I thought a build point calcultor might be useful to server admins and base builders... IE (b7 at least) freaks out about some of the javascript but you can allow it or just use moz.
http://ufo.freepgs.com/trem/TremBuildCalc.htm
To make it a little snazzier, you could add a place to specify the number of build points you are allowed (and indicate how many points are left or if you've gone over your allocation).
-
In 100 years an 8 year old can code a game but substracting from a number in your head is impossible for them by then.
-
In 100 years an 8 year old can code a game but substracting from a number in your head is impossible for them by then.
Exactly... this tool will relieve hundred-year-old eight year old game programmers from the burden of sub(s)tracting from a number in my head. I think.
-
Sweet. I notice that its on a freewebhosting thing, and that they are closing the host in december. If you need hosting, lemme know and ill put you on ssthosting.net.
Paid em $3, hopefully they wont remove me. Thanks for the offer though.
:edit: If you want to host a copy anyway go for it, maybe just write "by err" on it or something.
-
If you want to host a copy anyway go for it, maybe just write "by err" on it or something.
Aye captain, I would love to include it on tremulous.info (http://tremulous.info) ;)
Danny
-
As it is it is rather pointless, it would be better if it calculated various options that make optimal usage of buildpoitnts so that you end up with none left from a starting number.
-
If the calculator would have a list with all popular servers and use the numbers of buildpoints on the specified server as the limit that would be cool. If the number of buildpoints isn't tied to actual servers I can't see the need of letting the user specify the number of buildpoints as undeference suggested, either.
-
If you need a PHP-Script to get the BuildPoints of a specifig server, ask me :)
-
Don't most servers just use the default anyway, apart from SST.
It would be easier to hardcode the numbers into a combo box, if there are only a few different ones.
-
Na, I've created a ready-to-use class for this purpose :)
-
If you need a PHP-Script to get the BuildPoints of a specifig server, ask me :)
hook it up =) any other php classes you want to share too, i'll come up with some cool ajax shit for it.
-
Megabite"]If you want to host a copy anyway go for it, maybe just write "by err" on it or something.
Aye captain, I would love to include it on tremulous.info (http://tremulous.info) ;)
Danny
No problem =)
-
You have to modify this class, but the basic things are the same ;)
/**
* Tremulous Reporter
*
* This Class will conect to a Tremulous Server and fetch the main information.
* After this, it will join the Game as Spectator and reports everythin to a
* local string.
*/
class TremulousReporter {
function __construct ($address) {
list($ip, $port) = explode(':', $address);
$this->ip = $ip;
$this->port = $port;
$this->checkstring = md5('iD-Software-'.$server.'-'.$port);
}
public function connect () {
$this->fp = fsockopen('udp://'.$this->ip, $this->port, &$errno, &$errstr, 5);
if (!$this->fp)
return false;
else {
socket_set_timeout($this->fp, 2);
$this->getStatus();
$this->getChallenge();
$this->doConnect();
return true;
}
}
public function disconnect () {
fclose($this->fp);
unset($this);
}
private function sendQuery ($command) {
fwrite($this->fp, "\xff\xff\xff\xff".$command);
}
private function getStatus () {
$this->sendQuery('getstatus');
$header = trim(fgets($this->fp, 60));
$data = trim(fgets($this->fp, 1500));
$this->server_vars = array();
$split = explode('\\', $data);
for ($i=1; $i<count>server_vars[$split[$i]] = $split[$i+1];
}
$player = '-';
while (!empty($player)) {
$player = fgets($this->fp, 100);
//print $player.'<br>';
}
}
private function getChallenge () {
$this->sendQuery('getchallenge');
$header = trim(fgets($this->fp, 23));
$data = trim(fgets($this->fp, 100));
$this->challenge_number = $data;
}
private function doConnect () {
$this->sendQuery('connect "\\protocol\\69\\challenge\\'.$this->challenge_number.'\\port\\30200"');
$header = trim(fgets($this->fp, 60));
$data = trim(fgets($this->fp, 1500));
print $data;
}
}
$reporter = new TremulousReporter('213.239.197.132:30721');
$reporter->connect();
$reporter->disconnect();
?>
-
hi,
i admire the effort you made, but i don't understand the sense of this stuff. When i'm building, i don't want to minimize the game, goto your website, calculate stuff, go back, and notice that i got killed in the meantime. Besides, i don't know why one should need to calculate something while building. You build, and when the points are empty you stop. That easy. And i never forgot to build the om or eggs and stuff, just fyi.
So please enlighten me for what purpose you use this website/script/whatever ;)
-
for ($i=1; $i<count>server_vars[$split[$i]] = $split[$i+1];
There's an issue with SGML-like tags on the forum, meaning that you have to link to it, I think.
-
@stahlsau - honestly since you asked, i created it bc i thought it would be a useful way to convince admins of servers with very high bp to bring them down a bit. It's more for server operators than builders.