Code Modification Project - Kill All Players?

For all the help you need with Armagetron!
User avatar
smoothice
On Lightcycle Grid
Posts: 45
Joined: Sun Nov 09, 2008 7:54 pm

Code Modification Project - Kill All Players?

Post by smoothice »

Hey everyone...

I recently setup a server which respawns a player after 4 seconds. (I have my reasons for this... don't ask :) )

Anyway, sometimes I want to restart the round because I changed size_factor. In order to do this, I have to completely quit the armagetronad-dedicated instance and restart it or kick everybody.

Is there a command to kill all players? Or can anyone give me some input on where and how I could modify the Armagetron source to allow to do this? Thanks.
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

I believe there's a command to kill a particular player. That should be attached to identifying the player's internal game id so that it can be killed. You could copy this, and instead loop through all players and kill each one.
Image
User avatar
smoothice
On Lightcycle Grid
Posts: 45
Joined: Sun Nov 09, 2008 7:54 pm

Post by smoothice »

Ah, ok. Is there a way I can create another server command... let's say: killall? to engage the kill loop.

And where would I do that? What source file?
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

I'm not sure exactly where it is anymore. A quick fgrep reveals

Code: Select all

./ePlayer.cpp:7254:    if ( se_NeedsServer( "KILL", s, false ) )
so that might be a place to start.
Image
User avatar
DDMJ
Reverse Outside Corner Grinder
Posts: 1882
Joined: Thu Jun 08, 2006 12:15 am
Location: LA, CA, USA, NA
Contact:

Post by DDMJ »

make a file (named pwn.cfg) that contains the following:

Code: Select all

/admin KILL 1
/admin KILL 2
/admin KILL 3
[...]
/admin KILL 16
where the last entry contains the same # that max_clients is set to.

Then, just type /admin include pwn.cfg and everyone will die!

bwahaha! :twisted: :twisted: :twisted:
User avatar
Infa(mous)
Round Winner
Posts: 255
Joined: Thu Aug 14, 2008 11:27 pm

Post by Infa(mous) »

Code: Select all

kill 1
kill 2
[...]
kill 16
CENTER_MESSAGE Admin Sneezes.
:twisted: This is far more entertaining.
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

There's an idea, Durka.

You can put the /admin line in an instant chat, even, so you can do it with the touch of a button (presumably a button far away from frequently used buttons).
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
smoothice
On Lightcycle Grid
Posts: 45
Joined: Sun Nov 09, 2008 7:54 pm

Post by smoothice »

Hi again... I just decided to modify the dedicated server src to create a command called killall. It works fine. If anyone wants the code for it, I can send it (To save someone else the hassle).

Although I'm somewhat disappointed that I could've just done what Durka suggested. :P Oh well. Although, shouldn't this be something built-in already? It seems like a rather basic thing to have.
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Indeed, please post a patch. :)
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
DDMJ
Reverse Outside Corner Grinder
Posts: 1882
Joined: Thu Jun 08, 2006 12:15 am
Location: LA, CA, USA, NA
Contact:

Post by DDMJ »

Lucifer wrote:you can do it with the touch of a button (presumably a button far away from frequently used buttons).
naw, put it right next to the turn keys :P
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

DDMJ wrote:naw, put it right next to the turn keys :P
Then it really could be caused by a sneeze!
Image
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

How about ACTIVATE_FAST_FINISH?
ˌɑrməˈɡɛˌtrɑn
Pink Tomatoes
Average Program
Posts: 61
Joined: Fri Jul 25, 2008 11:24 am

Post by Pink Tomatoes »

DDMJ wrote:make a file (named pwn.cfg) that contains the following:

Code: Select all

/admin KILL 1
/admin KILL 2
/admin KILL 3
[...]
/admin KILL 16
where the last entry contains the same # that max_clients is set to.
Smoothice, please post :), function is still useful as I thought the above was made obsolete in newer versions, as it proved confusing. How does the admin know that "KICK 2" kicks the spammer on slot 2, or the very nice person called simply '2'.
User avatar
smoothice
On Lightcycle Grid
Posts: 45
Joined: Sun Nov 09, 2008 7:54 pm

Kill All Players for 0.2.8 Branch

Post by smoothice »

Ok guys, here's the patch for the 0.2.8 branch that creates a command to kill all players. (KILLALL)

I'd like to note that this code was made by maclover201 on my computer using screen sharing. It is currently implemented on all of my servers (smooth's network), and his (iD Tech). This is the first patch file I have ever created so if there are any problems with it, please tell me.
Attachments
killallplayers-patch.zip
0.2.8 patch to create command KILLALL which kills all players. (Created by maclover201 and smoothice)
(991 Bytes) Downloaded 168 times
User avatar
numinit
On Lightcycle Grid
Posts: 23
Joined: Sat Dec 06, 2008 5:52 am

Post by numinit »

Thanks for posting, Smoothice.

How it works... I just combined some of the player list code with the p->object->kill() function. It goes backwards through all the player objects on the server, and if it finds a living player kills it. :D I originally wrote it with something that shows which admin triggered it, but it got kind of glitchy because it would sometimes say that an AI or a non-admin triggered it.
Post Reply