Code:
Problem description:
First off, my code has ..() in client/new. That works fine. I can connect to my game when I Host it, but when hosted on my shell, it does connection closed, then connection failed.
ID:139316
![]() Mar 6 2011, 1:36 pm
|
|
![]() Mar 6 2011, 4:24 pm
|
|
Try setting . to ..() instead of just calling ..().
|
Kaiochao wrote:
Try setting . to ..() instead of just calling ..(). I'm terribly sorry, a bit confused. What "."? I already have ..() |
. is the default return value of the current procedure (i.e. what the proc will return if no other return statement is processed).
..() just represents the return value of the original procedure, so you're basically just telling the parent procedure to do its default thing and throw away the return value. The problem is, client.new() returns a mob to connect to, but you're throwing away that mob and returning null which disallows connections. .=..() This will carry out the original proc's instructions AND make sure that the default return value of the proc is the same as the return value of the parent proc. |
Cody123100 wrote:
. is the default return value of the current procedure (i.e. what the proc will return if no other return statement is processed). > .=..() This will carry out the original proc's instructions AND make sure that the default return value of the proc is the same as the return value of the parent proc. No good. Also I can connect if I host it locally |
proc name: New (/client/New) Just an FYI, I am in fact calling src, not usr. It's counting src as null, with src.mob. Is it lacking a mob for some reason? What would cause that? I don't have any "mob/Login", or any of that? |
At the time of client/New(), you won't have a mob set. The return value of ..() in client/New() is the newly connected client.mob. You want to perform your initial mob specific actions after the call to ..()
|
Stephen001 wrote:
At the time of client/New(), you won't have a mob set. The return value of ..() in client/New() is the newly connected client.mob. You want to perform your initial mob specific actions after the call to ..() Thank you! Im clueless as to why I moved the ..() to the bottom though, it worked before, rofl |