Debugging multiplayer sessions
by Andreas Papathanasis · in Torque Game Engine · 07/30/2004 (6:56 am) · 4 replies
Hi,
I need to debug the multiplayer mode of an application built with Torque, using only one computer. Right now, the only thing that works is connecting to the local server via Garagegame's master server -that is, the LAN option does not work, and I need to be online for the dedicated server to connect to the master before I see the server as available from the client's connect screen, after clicking 'Query Master'. Is there a workaround for this -i.e., connect to the local server without needing to be online, via the 'Query LAN servers' option? If I definitely need a master server, will I need to download and build the master server source mentioned in another post? Has anyone else solved this problem before? Thanks.
I need to debug the multiplayer mode of an application built with Torque, using only one computer. Right now, the only thing that works is connecting to the local server via Garagegame's master server -that is, the LAN option does not work, and I need to be online for the dedicated server to connect to the master before I see the server as available from the client's connect screen, after clicking 'Query Master'. Is there a workaround for this -i.e., connect to the local server without needing to be online, via the 'Query LAN servers' option? If I definitely need a master server, will I need to download and build the master server source mentioned in another post? Has anyone else solved this problem before? Thanks.
#2
I would now like to ask another question regarding networking. How do you reference a ghosted object on the client? I have a Netobject-derived object declared at the server, and it is recreated on the client when it connects. How do you reference that instance, on the client? Up to now I thought that I'd use Sim::findobject, but it seems that the client side can't find the object this way (it probably knows nothing about the object's name on the server). I know that the object instance has been created on the client process successfully (for one, I can tell that it's unpackUpdate() method gets called by setting a breakpoint there), but how do I reference that instance?
07/31/2004 (5:42 am)
Thanks Ben, I just tried the obvious (%conn.connect("127.0.0.1:28000"); ) and it worked. I guess I was confused by the behavior of the query lan servers option, which doesn't seem to work correctly, but for testing purposes this temporary solution will do. I would now like to ask another question regarding networking. How do you reference a ghosted object on the client? I have a Netobject-derived object declared at the server, and it is recreated on the client when it connects. How do you reference that instance, on the client? Up to now I thought that I'd use Sim::findobject, but it seems that the client side can't find the object this way (it probably knows nothing about the object's name on the server). I know that the object instance has been created on the client process successfully (for one, I can tell that it's unpackUpdate() method gets called by setting a breakpoint there), but how do I reference that instance?
#3
07/31/2004 (11:13 am)
If it's a special global object like terrain or sky you can just have it store a global pointer to itself when it is created. Otherwise you need to use a ghost index.
#4
I don't want to make global pointers all over the place. How does the ghost index work? I've seen them for datablocks, where an object would send its id and it would be reconstructed to a datablock object on the client, but what happens with netobjects?
07/31/2004 (12:47 pm)
There are a few objects I need on the client-side, like a Level object that i have created (and has information like the scrolling speed of the screen) and a custom camera object. Wouldn't it be normal for the client to frequently access the ghost objects received from the server? I mean, is there something wrong with my design?I don't want to make global pointers all over the place. How does the ghost index work? I've seen them for datablocks, where an object would send its id and it would be reconstructed to a datablock object on the client, but what happens with netobjects?
Associate Kyle Carter
This code snippet will make your game attempt to connect to a server.
$foo = new GameConnection(); $foo.connect("host:ip");