ID:155793
 
Good day to you all!

I just started on the byond guide, even trough i have been on byond for close to 1/2 years.
I know that the community talks alot about usr in a proc, and i to got a question about it.

My question is: Is using [usr] for in a string that is in a proc just as bad as usr in a proc??
mob
{
Login()
{
world << "Hello, to [usr]."
}
}


Or do you need to use src in a text to as long as the string is in a proc?
mob
{
Login()
{
world << "Hello, to [src]."
}
}


I appreciate it that you took the time to read my post.


-Ndangerman
The thing is, usr might not be who you think it is in procs (as they can be executed by all kinds of other atoms), and thus using usr, regardless how you're using it, isn't that good an idea.

Usr in proc is only safe if you're 100% sure only ONE person, that being the 'usr', can call the proc.

This includes things as Mouse functions (Click(), DblClick(), MouseDrag(), ...), client/Topic(), client movement, ...
mob/Login() is also safe, until you implement a saving/loading system where the player is loaded into a mob, then Login() won't be called by the usr any more.


I'm sure people like Lummox or Nadrew can give more explanation about this, though.

More info can be found here.
In response to Emasym
I appreciate it that you could anwers my question so fast.

I also would like to thank your for taking the time to help me.

I am going to check the link for sure!



-Ndangerman