[DGD] Query_port()??

Greg Lewis glewis at eyesbeyond.com
Sat Aug 24 00:46:00 CEST 2002


On Fri, Aug 23, 2002 at 04:45:46PM -0500, Lord Lerkista wrote:
> Ok, my telnet_connect() in driver.c is now:
> 
> static object telnet_connect(int port_telnet){object user,player;
> GLOBAL->set_this_player(0);
> user=find_object(USER);
> if(user==0){user=compile_object(USER);}
> user=clone_object(user);
> player=MASTER->connect();
> user->set_player(player);
> player->_F_user(user);
> type="telnet";port=port_telnet;return user;}

I don't know where to start.  Actually, I do.  Please indent your code
if you expect other people to read it, let alone look it over for you.
I'm surprised you can even read it yourself.  IIRC the DGD editor will
do this for you with I.

You originally wanted to know what port a player logged in, but it 
looks to me (from what I can read), that you are keeping a single
global port variable in the driver object.  You really need to set
this on the user object unless everybody is logging in from the
same port (in which case I have to wonder what the bloody hell this
thread has been about).

Of course this is based on what I can read of your code, which is
on the verge of generating an ENOPARSE.

> I have also
> 
> driver.c:
> int query_port(){return port;}
> 
> in simfun.c:
> static int query_port(){rlimits(-1;-1){return 
> ::find_object(DRIVER)->query_port();}}
> 
> etc...
> 
> But query_port() always returns 0

Trace statements are your friend.

-- 
Greg Lewis                          Email   : glewis at eyesbeyond.com
Eyes Beyond                         Web     : http://www.eyesbeyond.com
Information Technology              FreeBSD : glewis at FreeBSD.org

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list