ID:139316
 
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.
Try setting . to ..() instead of just calling ..().
In response to Kaiochao
Kaiochao wrote:
Try setting . to ..() instead of just calling ..().

I'm terribly sorry, a bit confused. What "."? I already have ..()
In response to Asellia
. 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.
In response to Cody123100
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).

..() 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.

No good. Also I can connect if I host it locally
In response to Asellia
proc name: New (/client/New)
source file: AdminBase.dm,270
usr: null
src: Asellia (/client)
call stack:
Asellia (/client): New()
runtime error: Cannot read null.TempVars
proc name: Del (/client/Del)
source file: Save System.dm,26
usr: null
src: Asellia (/client)
call stack:


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?
In response to Asellia
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 ..()
In response to Stephen001
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