Jump to content

Patch for etadmin_mod


Helmut Honigdachs

Recommended Posts

HH-Funclan ET Tools: vim syntax highlighting | etadmin_mod fixes


I decided to publish some more of our ET tools & modifications... so here it is: our etadmin_mod patch :)

You will always find the latest version of the patch and the readme file on our website:
http://download.hh-funclan.de/tools/etadmin_mod/hhpatch/
I will quote them here so you can have a look without following that link.

Patch:
--- clean/etadmin_mod.pl	2007-10-08 16:30:19.000000000 +0200
+++ etadmin_mod.pl	2007-10-15 20:32:00.000000000 +0200
@@ -4310,8 +4310,7 @@
				 if ( ( $type eq "KICK" || $type eq "MUTE" )
					  && &get_admin_level( $tmphash{$target}{'guid'} ) > 0 )
				 {
-					&cancelvote( $line, 0,
-						   "You can't ^1$type^7 a " . $level{ &get_admin_level( $tmphash{$target}{'guid'} ) } . "^7!" );
+					&cancelvote( $line, 0, "You can't ^1$type^7 " . $tmphash{$target}{'name'} . "^7!" );
					 &log("Canceled vote to $vote");
					 next;
				 }
@@ -5385,14 +5384,12 @@
		 {
			 foreach my $guid ( keys %warnings_bn )
			 {
-				my $wt = $config{'bad_name_grace_period'} > 0 ? int( $config{'bad_name_grace_period'} * 0.66 ) : 0;
-				if ( $wt && time - $warnings_bn{$guid} >= 20 && $tmp_warn2{$guid}{'status'} < 2 )
+				my $timeleft = $config{'bad_name_grace_period'} - (time - $warnings_bn{$guid});
+				if(($timeleft % 10 == 0) && !($timeleft == $config{'bad_name_grace_period'} || $timeleft < 1))
				 {
					 if ( &guid_check($guid) )
					 {
-						&say("$tmp_warn2{$guid}{'name'} ^1-> 10 seconds before kick. Please change your name!");
-						$tmp_warn2{$guid}{'status'} = 2;
-						&log("Warning 1 -> $tmp_warn2{$guid}{'name'}");
+						&say("$tmp_warn2{$guid}{'name'} ^1-> $timeleft seconds before kick. Please change your name!");
					 }
					 else
					 {
@@ -5400,7 +5397,7 @@
					 }
 
				 }
-				elsif ( time - $warnings_bn{$guid} >= $config{'bad_name_grace_period'} )
+				elsif($timeleft < 1) 
				 {
 
					 # NEVER KICK SOMEONE, that is on the slot and has a DIFFERENT GUID
@@ -5694,7 +5691,7 @@
		 {
			 $cmd = "chat $tmphash{$client}{'name'}^7:";
		 }
-		elsif ( $config{'et_mod'} == 2 && &etpro_pm_check($mod_version) )
+		elsif ( $config{'et_mod'} == 2 )
		 {
			 $cmd = 'm "' . &convert_name( $tmphash{$client}{'name'} . '"', 0, 0 );
		 }
@@ -5715,50 +5712,24 @@
		 $cmd = "say";
	 }
 
-	if ( $config{'et_mod'} >= 2 )
-	{
-
-		# Running etpro / headshot. Has no linebreaks yet ...
-		my @data = split( /\n/, $message );
-
-		# More then one row ?
-		if ( $#data > 0 )
-		{
-
-			# OK, every line need (except the last) need spaces at the end.
-			for my $count ( 0 .. $#data - 1 )
-			{
-				my $line_length;
-				if ( $config{'et_mod'} == 2 )
-				{
-					$line_length = $intermission ? 97 : 62;
-				}
-				elsif ( $config{'et_mod'} == 3 )
-				{
-					$line_length = $intermission ? 70 : 70;
-				}
-				my $length = length( &convert_line( $data[$count] ) );
-				if ( $length < $line_length )
-				{
-					$data[$count] .= "^0";
-					for ( 1 .. $line_length - $length )
-					{
-						$data[$count] .= $_ != $line_length - $length ? "_" : "^7 ";
-					}
-				}
-			}
-		}
-		$message = join( '', @data );
-	}
-
	 # $ schuetzen
	 #$message =~ s/\$/\\\$/g if( $config{'input_type'} ne "udp");
-	$message =~ s/\n/\\n/g;
-	$message =~ s/"//g;
 
-	&cmd("$cmd \"$message\"");
+	if($position eq "chatclient" && $config{'et_mod'} >= 2) {
+		# etpro/headshot
+		# linebreak workaround
+		my @data = split(/\n/, $message);
+		for(@data) {
+			$_ =~ s/\n/\\n/g;
+			$_ =~ s/"//g;
+			&cmd("$cmd \"$_\"");
+		}
+	} else {
+		$message =~ s/\n/\\n/g;
+		$message =~ s/"//g;
+		&cmd("$cmd \"$message\"");
+	}
	 $last = time();
-
 }
 
 sub etpro_pm_check
@@ -7464,6 +7435,7 @@
		 $command =~ s/<PLAYER_CLASS>/$CLASS{$tmphash{$client_id}{'class'}}/g;
		 $command =~ s/<PLAYER_TEAM>/$SIDE{$tmphash{$client_id}{'team'}}/g;
		 $command =~ s/<ADMIN_?LEVEL>/$admin_level/g;
+		$command =~ s/<MAP_?NAME>/$mapname/g;
 
		 #print "Name: $name ($convert_name)\n";
		 #print $command."\n";
@@ -7622,36 +7594,30 @@
 
		 #my $counter = 0;
 
-		for (@players)
-		{
-			if ( $_ =~ /^\s*(\d+)\s*\d+\s+999\s+/ )
+		if(!$gamestart) {
+			# still warmup, we won't allow spec999
+			&say("^1*ATTENTION*:^7 $name, please don't use ^1spec999^w during ^3warmup^w!");
+		} else  {
+			for (@players)
			 {
-
-				# Only push players in teams to spectator.
-				push( @exec, "forceteam $1 s" ) if ( $tmphash{$1}{'team'} == 1 || $tmphash{$1}{'team'} == 2 );
-
-			#$counter ++;
-			#if ($counter % 16 == 0) {
-			#	my $exec = join( '; ', @exec );
-			#	&log("Executing: $exec");
-			#	&rcon( "set etadmin \"$exec; say ^3spec999: ^7Moving " . ( $#exec + 1 ) . " players to spectator.\"");
-			#	&rcon( "vstr etadmin" );
-			#	@exec = ();
-			#}
+				if ( $_ =~ /^\s*(\d+)\s*\d+\s+999\s+/ )
+				{
+					# Only push players in teams to spectator.
+					push( @exec, "forceteam $1 s" ) if ( $tmphash{$1}{'team'} == 1 || $tmphash{$1}{'team'} == 2 );
+				}
+			}
+			if ( $#exec > -1 )
+			{
+				my $exec = join( '; ', @exec );
+				&log("Executing: $exec") if ( $config{'debug'} );
+				&cmd( "set etadmin \"$exec; say ^3spec999: ^7Moving " . ( $#exec + 1 ) . " players to spectator.\"" );
+				&cmd("vstr etadmin");
+			}
+			else
+			{
+				&say( "^3spec999: ^7Moving 0 players to spectator." . $warning, @say_params );
			 }
		 }
-		if ( $#exec > -1 )
-		{
-			my $exec = join( '; ', @exec );
-			&log("Executing: $exec") if ( $config{'debug'} );
-			&cmd( "set etadmin \"$exec; say ^3spec999: ^7Moving " . ( $#exec + 1 ) . " players to spectator.\"" );
-			&cmd("vstr etadmin");
-		}
-		else
-		{
-			&say( "^3spec999: ^7Moving 0 players to spectator." . $warning, @say_params );
-		}
-
	 }
	 elsif (	$config{'admin_functions'}
			 && $data[0] eq "admintest"
@@ -7963,6 +7929,12 @@
					  @say_params );
			 }
		 }
+	} elsif ($config{'admin_functions'} && $data[0] eq "pmute" && &admin_check($guid, "slap", $base)) {
+		my $target = $data[1];
+		my $found = 0;
+		($target, $found) = &part2complete($target, 0);
+
+		&say("$name slaps $target around a bit with a big large trout.");
	 }
	 elsif ( $config{'admin_functions'} && $data[0] eq "pmute" )
	 {
@@ -8459,23 +8431,6 @@
					 }
				 }
 
-				if ( $cmd eq "bani" )
-				{
-
-					if ( !$tmphash{$target}{'etpro_guid'} )
-					{
-						&say( "^3bani:^7 Sorry, no etpro guid found!", @say_params );
-						return;
-					}
-
-					# Win98 workaround:
-					if ( $tmphash{$target}{'etpro_guid'} eq "52FF6283916A9467908E6A771CB70285FB41C5E7" )
-					{
-						&say( "^3bani:^7 Sorry, you ^1can't ^7ban this client (win98 etpro guid bug)!", @say_params );
-						return;
-					}
-				}
-
				 # admin check:
				 if ( &get_admin_level( $tmphash{$target}{'guid'} ) >= &get_admin_level($guid) )
				 {
@@ -8522,25 +8477,12 @@
				 }
				 else
				 {
-					if ( $cmd eq "bani" )
-					{
-						&shrub_ban(
-									$config{'shrubbot_cfg'},   "add",
-									$tmphash{$target}{'guid'}, $timestamp,
-									&convert_name( $name, 0, 0 ), $ip,
-									$reason, &convert_name( $tmphash{$target}{'name'}, 0, 0 ),
-									$tmphash{$target}{'etpro_guid'}
-								  );
-					}
-					else
-					{
-						&shrub_ban(
-									$config{'shrubbot_cfg'},   "add",
-									$tmphash{$target}{'guid'}, $timestamp,
-									&convert_name( $name, 0, 0 ), $ip,
-									$reason, &convert_name( $tmphash{$target}{'name'}, 0, 0 )
-								  );
-					}
+					&shrub_ban(
+						$config{'shrubbot_cfg'},   "add",
+						$tmphash{$target}{'guid'}, $timestamp,
+						&convert_name( $name, 0, 0 ), $ip,
+						$reason, &convert_name( $tmphash{$target}{'name'}, 0, 0 )
+					);
 
					 &log(   "Banned: $target ("
						   . &convert_name( $tmphash{$target}{'name'} )

Readme:
These patches contain fixes for the etadmin_mod.
Created by the HH-Funclan (http://www.hh-funclan.de).
2007 by Helmut Honigdachs, adminteam at hh-funclan dot de
http://download.hh-funclan.de/tools/etadmin_mod/hhpatch/
Latest Release: r2, 15.10.2007

Bugfixes and changes:
	* When a player tries to kickvote a protected player, etadmin_mod will no
	  longer display the level of the protected player, but instead a message
	  like "You can't kick <player>!".
	* Fixed the kick_badnames behaviour, that was totally screwed up.
	* Fixed the dispatching of ETPro private messages. Someone screwed that
	  up, too; etadmin_mod tried to emulate linebreaks by filling up the lines
	  with underscores, which made multiline PMs totally unreadable. With the
	  patch applied, etadmin_mod will simply dispatch each line as a single
	  PM.
	* Fixed the issue with nonworking PMs after etadmin_mod was restarted.
	  This was caused by a now unnecessary version check; etadmin_mod wouldn't
	  dispatch PMs until it had found out the ETPro version, which was only
	  logged after map changes.
	* Added the <MAPNAME> magic word for use in the etadmin.cfg. You will need
	  this when you want to use the mappoll.pl addon.
	* Fixed !spec999: it is no longer useable in warmup. This will prohibit
	  players with a fast connection to spec players with slow connections
	  during map beginnings. We recommend you to enable !spec999 for Level 0
	  so that ordinary players can issue it too, this patch will reduce it's
	  abuse.
	* Added !slap from IRC :)
	  I was too lazy to add a suitable config option, so !slap uses the !pmute
	  permission. If you can issue !pmute, then you can issue !slap. We don't
	  want our Level 0 users to have spam commands;)
	* Changed !bani behaviour to !ban behaviour.
	  Originally introduced as an improvement to !ban, !bani didn't only ban
	  the PunkBuster GUID, but also the ETPro GUID, which is hardware based
	  and therefore theoretically better. Eventually, it became clear that
	  ETPro GUIDs are broken and easily fakeable (you can't fake PunkBuster
	  GUIDs, only create random new ones). If you use !bani, you will sooner
	  or later encounter a cheater that fakes ETPro GUIDs from other players,
	  and thereby making you ban innocent players without even noticing. Note
	  that this patch won't stop etadmin_mod from enforcing already banned
	  ETPro GUIDs, so read the section "Removing ETPro GUIDs from
	  shrubbot.cfg" after applying it.

Applying the patch:
	(You will need the GNU utilities patch and wget to apply the patch, but
	maybe except from cygwin, every Linux distribution should ship these by
	default.)
	1) Change into your etadmin_mod/bin directory.
	   $ cd /path/to/etadmin_mod/bin
	2) Make a backup copy of the etadmin_mod.pl file.
	   $ cp etadmin_mod.pl etadmin_mod.pl.bak
	3) Download the patch.
	   wget http://download.hh-funclan.de/tools/etadmin_mod/hhpatch/latest.patch
	4) Apply the patch.
	   $ patch < latest.patch
	   If patch says "patching file etadmin_mod.pl", everything went fine.
	5) Restart the etadmin_mod.
	   $ cd ..
	   $ ./etadmin_mod.sh restart

Removing ETPro GUIDs from shrubbot.cfg:
	(You will need the editor vim to do this.)
	1) Change into your etadmin_mod/etc directory.
	   $ cd /path/to/etadmin_mod/etc
	2) Make a backup copy of the shrubbot.cfg file.
	   $ cp shrubbot.cfg shrubbot.cfg.bak
	3) Open the shrubbot.cfg in vim.
	   $ vim shrubbot.cfg
	4) Type the following command exactly into vim. Make sure that you haven't
	   accidentally pressed any other keys until now; if in doubt, press ESC
	   2-3 times. After you have typed the command, press ENTER. vim will then
	   remove all lines beginning with "eguid".
	   :g/^eguid.*/d
	5) Save the file and close vim with the following command (again, press
	   ENTER to execute it).
	   :wq

What are all those files in download.hh-funclan.de/tools/etadmin_mod/hhpatch/?
	readme.txt
		This readme file.
	r1.patch, r2.patch, ...
		The patch itself. The number identifies the revision. Always use the
		latest (highest) revision, the old version are just archived here for
		your convenience.
	latest.patch
		This is a symlink (something like a copy) to the latest patch, also
		provided for your convenience [and for mine, cause I don't need to
		update the readme everytime I release a new revision;)].

EDIT: Updated the path and the readme quoting to reflect path changes. Edited by Helmut Honigdachs
Link to post
Share on other sites
  • 3 weeks later...

i have coded stuff into ETadmin_mod myself, and i must say its one of the biggest coding mess i have ever seen...

 

anyway, could you at least post what functionality does it add to the ETadmin_mod?

Link to post
Share on other sites

et_admin was a fantastic mod for it's time, but it was also a mod meant to run over a mod, or with etmain. That means it has to work with etpro, etpub, shrub, and etmain. It was also meant for linux, but can be run on Windows servers with Cygwin, if you've got .ssh install access. Mostly it's age tends to make it what it is, but don't condemn it in any way, it did very, very well for it's time.

 

For the pub-style mods these days, it's not needed. They've all got their own native shrubbot support, admin-commands and abilities. For etpro, KMOD was released, and a new version is being worked on that makes it massively more adept and adds many features et_admin does not have. It's also coded in lua, so the coding is much easier to keep clean. Added to which, it is much simpler to install, and can run on either server-platform, Linux or Windows, without the need for an over-lay program.

Edited by RoadWarrior
Link to post
Share on other sites
  • 1 month later...

@Necromancer: see "Bugfixes and changes" in the readme,

 

@RoadWarrior: I know about kmod, but I've never tested it. It seems to have some nice features (things that are not possible without lua, because lua is so tightly integrated into the game), but I believe there are many things that kmod can't do. [Just wanted to look into the kmod source to see how it works, but the download link is dead :/]

For example, I've written an etadmin_mod extension that allows players to vote whether they like the maps (!like / !dislike), and the results (2743 votes so far) are stored in a MySQL database. That's what I like about the etadmin_mod: it's extensible until the cows come home - it's perl, you can execute other programs, connect to databases, everything. I don't think that lua could do this.

On the other hand, many things that are going on inside the game can only be controlled with lua, not so good with reading logs and sending rcon commands (that's what etadmin_mod does). But you could always integrate the lua features into etadmin_mod, while you cannot integrate perl functionality into lua. If I had the time, I'd rewrite etadmin_mod and would create a program that's more powerful than kmod and etadmin_mod together :)

 

It's also coded in lua, so the coding is much easier to keep clean.

Hell no! :) Mark wrote etadmin_mod as an utter mess of spaghetti code, but that's not Perl's fault. You can write wonderful object oriented code in Perl, and if I'd rewrite etadmin_mod, I would do exactly that. No way you could do that in lua :-p
Link to post
Share on other sites

You may want to try etphp, its similar to etadmin mod, but instead of reading the log, it starts the game and uses the console output, so its much faster then etadmin mod.

The good thing is, in conjunction with qmm (http://qmm.planetquake.gamespy.com/) and some plugins, you can run it with every quake3 based game. Well etphp surelly needs some adaption but its almost compatible..

 

Etadmin mod with qmm would give similar abilities - that it can run with any quake3 game.

 

Etphps website got crapped, so I suppose you wont find any download. Also the original version is done for competition organisitation and registering of guids for matches. While I am modifiyng and using it on public servers..

Also its still buggy cause I got not much time for it.. but if anybody wants a copy tell me..

 

The good thing is the code is well done (at least I think so compared to etadmin mod), and its easy to extend.

Besides since etphp is buggy - since I got my hands on it.

 

Nice map polling :D I made something similar, ratemap, but it allows for voting in a range, e.g. 1-5. Also written in php. But it was one to run along with vsp, but I think it should be easy to run it without.

I got a question, how about merging these votes? Mine range from 1-5, yours are 0/1? right?

the pag is slow to load, but it will, it shows maps some stats, and ratings... I want since long build a massice database of maps with ratings .. how bout a cooperation?

http://bunker5.aaxxss.com/jaymod/stats/pub...cfg-default.php

 

ps: if there is any interest in these files.. I got no prob to share, but I havent availabe for download (since until now 0 interest).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.