This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
matejdro's profile picture

[1.5]Ability to retreive name of the player currently using the computer

Started by matejdro, 28 July 2012 - 02:03 PM
matejdro #1
Posted 28 July 2012 - 04:03 PM
term.getUserName()

This would return name of the user that is currently using console. If nobody is using it, it will return nil. This will change to nil as soon as player presses ESC key (leaves computer GUI).

Would be useful. For example if you want to restrict certain functions of your program to specific users.

In SMP, it could even return list of all users that are currently using this computer.
Pinkishu #2
Posted 28 July 2012 - 04:31 PM
Please not, I hate magic functions <.<
matejdro #3
Posted 28 July 2012 - 04:34 PM
What is magic here?
limdingwen #4
Posted 28 July 2012 - 04:38 PM
What is magic here?
Magic as in the computer knowing something without…. yeah. Realistic ways of doing so.
matejdro #5
Posted 28 July 2012 - 04:42 PM
Yeah, you might be right. Scrap that then.
Pinkishu #6
Posted 28 July 2012 - 04:59 PM
Something like a retina scanner or fingerprint reader would be useful :)/>/>
xuma202 #7
Posted 28 July 2012 - 06:55 PM
Isn't there a player sensor for CCSensors already? That could solve this problem.
KingMachine #8
Posted 29 July 2012 - 12:31 AM
Remind me not to install CCSensors…
JJRcop #9
Posted 18 August 2012 - 05:10 AM
The computer currently has no way of even recognizing who is using the computer anyway.
You see, when you interact with the computer, the screen itself is running on the server, you can just view it.
This is so that multiple people can use the same computer, at the same time. When you press a key, it gets sent to the computer, but it gets sent "anonymously".

Now if this was even possible to implement, by some magical whatever, how would it act if two people were using the same computer? Also, a computer cannot detect if you are using it anyway..
altalus #10
Posted 18 August 2012 - 01:59 PM
A simple login program will do the trick about who is logged to the system like in most *nix systems. Of course, when a co-worker is looking at my monitor the PC doens't know it, but it knows about me who logged in :(/>/>

We could ask for a multi-user OS but that would be overkill I think.
Pinkishu #11
Posted 18 August 2012 - 02:50 PM
Well but random people can't type on my keyboard while i do @ *nix systems :(/>/>
Cranium #12
Posted 18 August 2012 - 03:42 PM
Maybe not getting the player name, but locking the computer out to everyone else but the first user to click on it. The rest just get to watch the screen, and cannot mess up the input. Multiple users typing at the same time make for an annoying problem.
altalus #13
Posted 18 August 2012 - 04:50 PM
Well but random people can't type on my keyboard while i do @ *nix systems :)/>/>

Touché :(/>/>

Maybe not getting the player name, but locking the computer out to everyone else but the first user to click on it. The rest just get to watch the screen, and cannot mess up the input. Multiple users typing at the same time make for an annoying problem.

Thats a nice idea. Not sure the time spends would be worth it but if it doesn't take too much time it would be a nice option to have :)/>/>