ID:700728
 
(See the best response by tenkuu.)
Code:
/client/verb/sendalts2()
var/alt = input(usr,"Alts","Alts",null) as key|null
usr << "[alt]"


Problem description:
Hi, I'm having trouble with the "as key" verb argument. I was toying around with it in the hopes I could use it as a means to check somebody's Alt usernames to prevent multi-keying.

The trouble is, I cannot get then "as key" argument to do much of anything. The above code shows a list of usr's usernames. However on selecting one, the server doesn't seem to do anything with that data. I've also tried a another bit of code (basically a big elseif chain trying to determine the data-type) but that aso returns nothing at all.

Perhaps it's something to do with security? I guess such a feature could be misused.

I was hoping somebody could provide -any- example of "as key" being used. I'd like to learn how it's actually used.

Thanks for your time.
Best response
The last time someone tried using this was 4 years ago, and they also found it didn't work: http://www.byond.com/forum/?post=162647

You might want to file an official bug report for it in the bug forum.

Yeah I noticed that. Thanks for your help anyway.
posted a bug report.
Thanks
I know I posted in your other thread, but I'd like to take a minute to post to this one as well to see if maybe we can resolve the original issue. For one, this is a feature that hasn't been in major use in a long time, or at least the 8 years that I've been on BYOND. I'm not entirely sure the bug report's going to get you too far to your original goal.

Second, there's a flaw in your plan in that by introducing an input for something like this you're creating a point where you've setup a 'seam' in their gameplay experience where you end up nailing more legitimate players with an extra step in the login process in some sort of attempt to prevent multi-keying.

The usual solution (at the last time I checked) is to compare `client.address` or, more recently because you're less likely to catch family on a LAN, `client.computer_id` vars when a new player logs in. If you have two matching `computer_id`s, then odds are you don't have two people on one keyboard trying to play your game.
Sorry, I haven't checked this post since your reply.

I was merely experimenting with it to see if it could be used as a means of catching multikeyers whom have changed their ip and computer id.

Obviously, it wasn't suitable, so I ditched it.

Thanks for all your help.