Use player ID as an alternative to names

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Use player ID as an alternative to names

Post by dukevin »

It would be really useful if there could be a way to reference players by their ID to perform various commands on. Like "rename_player 3 noob" or "kill 2" or "spawn_zone zombieOwner 2 3 ...". This currently only works for banning and kicking.

Making this work would allow for maps with zombie zones in the xml (cannot spawn zombies without a player target), preforming admin commands on people who have all unicode characters, and many more possibilities (yes, many possibilities :) ).

Seeing how this has already been done for banning and kicking, it shouldn't be that hard to implement to the other functions?
Image
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Re: Use player ID as an alternative to names

Post by dlh »

Commands like rename_player, etc. actually function the way you describe, but sty+ct disabled this behavior. Here's a comment about it:

Code: Select all

Removed by ed so players are not selected by id number, just names, So players with a number for a name do not confuse things
Also, if a player has a name with only special characters you can kick them by using a transcribed version of their name. Example: öî → KICK oi. Remember that for commands that take a player name as an argument, you do not need to supply the full name—only a unique substring is required.
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Re: Use player ID as an alternative to names

Post by dukevin »

dlh wrote:Commands like rename_player, etc. actually function the way you describe, but sty+ct disabled this behavior. Here's a comment about it:

Code: Select all

Removed by ed so players are not selected by id number, just names, So players with a number for a name do not confuse things
That's quite interesting, thanks for the info. So a non sty+ct server would allow any command with player arguments to be substituted with player ID's?


Is there a command that turns the sty+ct override off?


Also, on a side note, if you /op a person with unicode characters to a useless access level, you can see how the name is transcribed.
Image
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1876
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Re: Use player ID as an alternative to names

Post by kyle »

yes this is something we did in sty+ct because when our scripts interacted with the server, if a player was named 1 it would do the action on the person with an ID of 1, here is what was done.
Image
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Re: Use player ID as an alternative to names

Post by dukevin »

kyle wrote:yes this is something we did in sty+ct because when our scripts interacted with the server, if a player was named 1 it would do the action on the person with an ID of 1, here is what was done.
I see...

As a feature request, could there be a way to discern between the two? Perhaps when referencing a person by ID, the parameter could be "rename_player ID:1 noob". If a person were actually named "ID:1", performing a command on them would be referencing them by a substring like "rename_player D:1".

Or perhaps it might be easier to have a command to toggle ID referencing on and off?
Image
User avatar
Z-Man
God & Project Admin
Posts: 11589
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Use player ID as an alternative to names

Post by Z-Man »

That's a tough interface design problem. What do you do about players named ID:1?
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Re: Use player ID as an alternative to names

Post by dukevin »

Z-Man wrote:That's a tough interface design problem. What do you do about players named ID:1?
dukevin wrote:If a person were actually named "ID:1", performing a command on them would be referencing them by a substring like "rename_player ID".
Image
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Re: Use player ID as an alternative to names

Post by epsy »

# at the beginning could work as an escape sequence and could be extended in the future. A double ## at the beginning of the mention translates to one # in the player name. ; terminates the sequence and & would split members in the matching sequence. No need to escape anything else.

Code: Select all

Player name    Mention by name     Mention by ID
Player 1       player_1            #id=1;
#id=1337;      ##id=1337;          #id=2;
First #1       first_#1 or first_1 #id=3;
(I forgot if # gets to be an evil character or not in the last line)
User avatar
Z-Man
God & Project Admin
Posts: 11589
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Use player ID as an alternative to names

Post by Z-Man »

dukevin: and if members of the ID clan are around?

epsy: I'm not too hot about another set of escape rules, but that would work. I'd prefer the shorthand #1, #2 instead of #id=1; #id=2; (of course, # followed by non-digits could still be reserved for extensions) and I don't understand what & would do. Also, how does first_1 match first_#1?
Tobe
Round Winner
Posts: 215
Joined: Wed Jan 14, 2009 12:31 am
Location: Miami, FL

Re: Use player ID as an alternative to names

Post by Tobe »

Wouldn't quotes (ex: suspend "ID:1") work for player names work too?
<-- Proud co-leader of Rogue Tronners
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Re: Use player ID as an alternative to names

Post by dukevin »

Z-Man wrote:dukevin: and if members of the ID clan are around?
Use a different substring. Instead of "ID" use "D:1" for kicking someone named ID:1. I hardily think people will be named such though.
Image
User avatar
Z-Man
God & Project Admin
Posts: 11589
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Use player ID as an alternative to names

Post by Z-Man »

Tobe: what about names with quotes, then?
dukevin: no, you don't want to kick THEM. You want to kick the player named ID:1. And, of course, not D:1, who is also around.
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Re: Use player ID as an alternative to names

Post by dukevin »

Z-Man wrote: dukevin: no, you don't want to kick THEM. You want to kick the player named ID:1. And, of course, not D:1, who is also around.
no, that's not what I meant.
for kicking:
  • Their name | Their ID | What to type

    2 | ID:1 | kick 2 or kick ID:1
    ID:1 | ID:2 | kick ID or another substring of their name like D:1 or :1
    ->}ID | ID:1 | kick ID or another substring
Image
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Re: Use player ID as an alternative to names

Post by Tank Program »

What about simply a second set of commands for dealing with IDs? An automatic extension of some sort. If kick_player goes by name, kick_player_id automatically resolves the name from id and goes to kick_player.
Image
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Re: Use player ID as an alternative to names

Post by dukevin »

Tank Program wrote:What about simply a second set of commands for dealing with IDs? An automatic extension of some sort. If kick_player goes by name, kick_player_id automatically resolves the name from id and goes to kick_player.
do this for every command that takes in a player name as an argument? And how would this work for zombie zones set to go after player ID:1?
If all this is too complicated, could there be an option to turn the ct override off?
Image
Post Reply