Connection to dedicated server crash
by Stephen Zepp · in Torque Game Engine · 07/04/2004 (7:04 am) · 26 replies
Has anyone taken HEAD and made a Mac client executable that can connect to a dedicated server across the internet?
Our base code hasn't deviated much at all from HEAD in regards to any networking, but our Mac compiled client hard crashes right after the two way connection handshake with a dedicated server. We see progress lines on the console file all the way down to "Connection accept.", but then the client itself crashes hard. The server continues to send datablock updates and such until the timeout period is met, and then resets.
Our last successful execution block appears to be:
GameConnection::readConnectAccept, called from NetInterface::handleConnectAccept. That seems to leave:
removePendingConnection(conn); // remove from the pending connection list
conn->setNetworkConnection(true);
conn->onConnectionEstablished(true); // notify the connection that it has been established
conn->setEstablished(); // installs the connection in the connection table, and causes pings/timeouts to happen
conn->setConnectSequence(connectSequence);
as our only probable errors, but I'm pretty confident that we haven't touched any of this code, so we can't figure out why it would work on both Linux and Windows builds, but not on the Mac build.
Has anyone run into anything similar, see any possible "out of the box" problems, or have any suggestions?
Thanks!
Our base code hasn't deviated much at all from HEAD in regards to any networking, but our Mac compiled client hard crashes right after the two way connection handshake with a dedicated server. We see progress lines on the console file all the way down to "Connection accept.", but then the client itself crashes hard. The server continues to send datablock updates and such until the timeout period is met, and then resets.
Our last successful execution block appears to be:
GameConnection::readConnectAccept, called from NetInterface::handleConnectAccept. That seems to leave:
removePendingConnection(conn); // remove from the pending connection list
conn->setNetworkConnection(true);
conn->onConnectionEstablished(true); // notify the connection that it has been established
conn->setEstablished(); // installs the connection in the connection table, and causes pings/timeouts to happen
conn->setConnectSequence(connectSequence);
as our only probable errors, but I'm pretty confident that we haven't touched any of this code, so we can't figure out why it would work on both Linux and Windows builds, but not on the Mac build.
Has anyone run into anything similar, see any possible "out of the box" problems, or have any suggestions?
Thanks!
#22
Lesson learned: Always keep your platforms in sync from the start. =)
05/17/2005 (5:22 am)
Thank you! With this information, we were able to find the problem. It was not a file missing from targets after all, but one file too much - a file removed from the VS project but not removed from the file system, and so it was added to the makefiles in error...Lesson learned: Always keep your platforms in sync from the start. =)
#23
Can you post the code you used to list the classes with IDs? It would be useful to include in the SDK for others to use.
05/17/2005 (10:47 pm)
That's right!Can you post the code you used to list the classes with IDs? It would be useful to include in the SDK for others to use.
#24
To find the error we dumped the class id's to the console with this function. Then cut/paste the class id's lists and sorted them alphabetically. Finally we did a diff on the the two files and found the differences.
05/18/2005 (8:09 am)
Here comes the code we used to list the classes:ConsoleMethod( GameConnection, listClassIDs, void, 2, 2, "")
{
Con::printf("--------------- Class ID listing ----------------");
for(AbstractClassRep *rep = AbstractClassRep::getClassList(); rep; rep = rep->getNextClass())
{
ConsoleObject *obj = rep->create();
if(obj)
Con::printf(" %s has id %d", rep->getClassName(), rep->getClassId(0));
delete obj;
}
}To find the error we dumped the class id's to the console with this function. Then cut/paste the class id's lists and sorted them alphabetically. Finally we did a diff on the the two files and found the differences.
#25
05/18/2005 (11:53 am)
Awesome, thanks for the code and problem-solving description! I've added this to The List.
#26
07/12/2005 (2:21 pm)
Bug #80 - added method listClassIDs to GameConnection. Slightly modified version of Dennis' code - thanks, Dennis!
Associate Kyle Carter
for(AbstractClassRep *rep = AbstractClassRep::getClassList(); rep; rep = rep->getNextClass()) { //... stuff here ... }Which iterates over all the classes registered with the type system. You can then use the various methods from line 168 of consoleObject.h to start dumping information out for comparative purposes, ie, con::printf(" %s has id %d", rep->getClassName(), rep->getClassId(0));
With a bit of experimentation you should be able to sort it out. Bear in mind that classes can get assigned more than one ID (for instance, datablocks get their own id space).