Game Development Community

Rpc giving "invalid packet" sigtrap

by Ichijoji · in Torque Game Engine · 07/03/2006 (2:45 pm) · 0 replies

Hello again,
Sorry for posting so much, but this seems like a problem outside the scope of my code and I have to use this library. I'm working on setting up some basic networking and I have the initialization code set up and running, but when I try to actually start sending some information around the network I get crashes in my rpc calls.

My rpc is declared like this:
class nTNLConnection : public TNL::GhostConnection
{
    //other stuff
    TNL_DECLARE_RPC(rpcRegisterBehavior,());
};
and implemented like this:
TNL_IMPLEMENT_RPC   (nTNLConnection, rpcRegisterBehavior, (), (), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirServerToClient, 0) {
    printf("got a register behavior signal from server\n");
}
and I'm calling the function like this:
connection->rpcRegisterBehavior();
As far as I know, this is all how it should be, but when I run it I get an invalid packet error like this:
#3  0x01dd26af in TNL::Platform::forceQuit () at platform.cpp:325
#4  0x01dd58e9 in TNL::Assert::processAssert (
    filename=0x1e3714c "netConnection.cpp", lineNumber=202,
    message=0x1ed3800 "Invalid Packet.") at assert.cpp:63
#5  0x01dc7299 in TNL::NetConnection::setLastError (
    fmt=0x1e36142 "Invalid Packet.") at netConnection.cpp:202
#6  0x01dbf62f in TNL::EventConnection::readPacket (this=0xa244b00,
    bstream=0xbf96e6e0) at eventConnection.cpp:402
#7  0x01dc13a9 in TNL::GhostConnection::readPacket (this=0xa244b00,
    bstream=0xbf96e6e0) at ghostConnection.cpp:417
#8  0x01a54ff9 in nTNLConnection::readPacket (this=0xa244b00,
    stream=0xbf96e6e0) at tnl/ntnlconnection.cc:171
#9  0x01dc76ef in TNL::NetConnection::readRawPacket (this=0xa244b00,
    bstream=0xbf96e6e0) at netConnection.cpp:253
#10 0x01dc8d13 in TNL::NetConnection::sendPacket (this=0xa2542e8,
    stream=0xbf96e6e0) at netConnection.cpp:721
#11 0x01dc8a8e in TNL::NetConnection::checkPacketSend (this=0xa2542e8,
    force=false, curTime=20073) at netConnection.cpp:689
#12 0x01dcb288 in TNL::NetInterface::processConnections (this=0xa24a378)
    at netInterface.cpp:323
I use rpc's just like this several times before this call and they all work perfectly, but for some reason this crashes. There is some other traffic going to the same client from other code (exactly what I'm not sure, but there must be because other things are syncronized over the network), could that be what's making this crash, or am I completely misusing the rpc structure?