1. When making a thread, please tag your thread accordingly using the menu to the left of the textfield where you name your thread where applicable. Server Advertisements and Mod Releases should be contained to their respective subforums.

Tutorial Player specifiers

Discussion in 'Multiplayer' started by OmnipotentEntity, Jun 9, 2014.

  1. OmnipotentEntity

    OmnipotentEntity Code Monkey Forum Administrator

    Some documentation on an upcoming feature that may change, but the basics are set in stone. Because we're doing nightlies soon, I figured I would make a tutorial.

    Referencing players in starbound can be tricky, because there is quite a bit of naming freedom. Names are unicode and can contain arbitrary codepoints, hidden format specifiers, or even be an empty string!

    This is intended as a guide to how servers handle names and how players may be referenced uniquely by admins for the purpose of passing their name to commands.

    First, it's possible to simply list all of the clients on the server by using /list

    You'll receive output that looks like:

    Code:
    $1 : Rob Zapper : $$a8244a9197cc0c9bdc0acf08e6911c28
    $2 : $$deadbeef : $$b45933aabedc39e53da0ffa38d0115a6
    Each line is a user.

    The first field is the client Id. The second is the player's *server* nickname, which can be different than the displayed nickname in cases where there would be a name collision. The server nickname is the one that matters.

    The final field is the player's UUID, which will never change between connections for the same player character, unlike the clientId and server nickname.

    You can address players by their client ID, server nickname or UUID in every command that requires a player specifier.

    For instance, the /kick command is structured as follows:

    /kick playerSpecifier [optionalReason]

    So to kick Rob Zapper you can do:

    /kick $1
    /kick "Rob Zapper"
    /kick Rob\ Zapper
    /kick $$a8244a9197cc0c9bdc0acf08e6911c28

    However, if you try to kick $$deadbeef, the parser will want to try to kick a player with the Uuid deadbeef.

    Fortunately, if it doesn't find a Uuid with the name given it just passes it back as a name. It's smart!

    But what if a malicious user joins?

    Code:
    $1 : Rob Zapper : $$a8244a9197cc0c9bdc0acf08e6911c28
    $2 : $$deadbeef : $$b45933aabedc39e53da0ffa38d0115a6
    $3 : $1 : $$b8b48c10efc611e3ac100800200c9a66
    It seems that there is a user named $1 who is causing trouble. But if you try to /kick $1 you'll just kick poor Rob Zapper.

    You can kick this player by clientId or Uuid, or even by explicit nickname.

    /kick $3
    /kick $$b8b48c10efc611e3ac100800200c9a66
    /kick @$1

    A player specifier with @ before it will be interpreted directly as a nickname without going through further parsing.

    @ works with quotes as well:

    @Rob\ Zapper
    @"Rob Zapper"
    "@Rob Zapper"

    all work.

    It seems that a Chinese player has joined and needs some help; however, his English is a bit shaky and he seems to want to show you something.

    Well, the easiest way would be to warp to him (once I get warping in...):

    Code:
    $1 : Rob Zapper : $$a8244a9197cc0c9bdc0acf08e6911c28
    $2 : $$deadbeef : $$b45933aabedc39e53da0ffa38d0115a6
    $4 : □□□ : $$6a25b2c0efc811e3ac100800200c9a66
    It seems his name is Unicode that your font cannot display. You can use his Uuid or his clientId.

    However, if you can find out the codepoints in use you can use \uxxxx to type is name directly. This is coming soon but not quite in yet. (Escaped unicode name display.)

    For instance the unicode snowman: ☃

    Is U+2603, so you can use \u2603 to specify a player with the name ☃. But if you can type a ☃ you can just use that too.

    The take away is in most cases you don't have to do anything special at all. Most of the time it will just work, but if someone is trying to exploit the system you can work around it easily and there are many possibilities.
     
    Last edited: Jun 9, 2014
    Sock_Bunny, SpaceRobo, Archer and 5 others like this.
  2. 0xE1

    0xE1 Scruffy Nerf-Herder

    Yay for such possibilities and dedication!

    Thanks for interesting and an interactive stream :3
     
    Last edited: Jun 9, 2014

Share This Page