ID:273615
![]() Oct 16 2010, 10:18 am
|
|
Since my last problem was solved. I've run into another. How can I get the game to clarify who's hosting the .dmb from their dream daemon? That way I can do things like give the host certain verbs, or other things.
|
I'm confused and still having trouble how to define certain verbs to the host. I went in the reference and searched host and it really didn't help me understand it much.
|
if(client.address)
If a client does not have a client.address, it's the host. As simple as that, matey. |
Gooseheaded wrote:
if(client.address) Not quite. Anything hosted in Dream Daemon will give the host an address -- usually "127.0.0.1", but it could be also be world.address or anything random if they're not logging in from the hosting computer. This is why the world.host variable exists, even though that doesn't work with non-Windows hosts. Typically for giving people verbs you define the verbs in some unused /mob type (like /mob/Host/verb) then add them to the person's verb list on login. mob/host/verb/Host_Verb() Something like that should cover most of the basic possibilities. |
Except, calling ..() before you finish what you wish to do would let Login() continue with what it normally does, and skip the following code, right?
I'm not 100% sure, but I think the ..() should be .=..() . |
Either way it'd do the normal login stuff, and Login() doesn't have a return value so . = ..() is pointless.
Usually it's just something I'll normally do -- for 'initialization' procs like New() and Login() the first thing I'll do is call ..() just so that if anything higher up in the call chain has to do anything important it gets done. Calling ..() never causes code to be entirely skipped, although it might end up sitting around doing stuff if it causes an infinite loop for some reason. (So don't do infinite loops directly in normally overridden procs, spawn() off another proc for those.) |
Read that entire thread and you will have exactly what you want.