OnGhostAvailable
by David Eustis · in Torque Game Engine · 09/29/2004 (11:41 pm) · 4 replies
I'm having a problem getting onGhostAvailable to work for me.
Here's my scenario:
1) I set up a local GhostConnection using connectLocal.
2) On the server side I create a NetObject subclass
3) I know that the object is being ghosted on the client side because onGhostAdd gets called
Am I correct in assuming that after all this has taken place, onGhostAvailable ought to be getting called on the server side at some point? For some reason, it's not being called.
I'm positive that the declaration of my onGhostAvailable subclass override is correct:
void onGhostAvailable(TNL::GhostConnection *theConnection);
So, I'm pretty stumped as to why this would not be working. Are there any other state variables in GhostConnection or NetObject that could be preventing onGhostAvailable from being called?
Thanks,
-David Eustis
Here's my scenario:
1) I set up a local GhostConnection using connectLocal.
2) On the server side I create a NetObject subclass
3) I know that the object is being ghosted on the client side because onGhostAdd gets called
Am I correct in assuming that after all this has taken place, onGhostAvailable ought to be getting called on the server side at some point? For some reason, it's not being called.
I'm positive that the declaration of my onGhostAvailable subclass override is correct:
void onGhostAvailable(TNL::GhostConnection *theConnection);
So, I'm pretty stumped as to why this would not be working. Are there any other state variables in GhostConnection or NetObject that could be preventing onGhostAvailable from being called?
Thanks,
-David Eustis
#2
10/07/2004 (3:24 pm)
OnGhostAvailable is working in the TNL examples -- Zap uses this extensively.
#3
As I described in the above post, once I had created an object on the server side, and it was ghosted onto the client side, I expected onGhostAvailable to be called on the server side.
I think the problem occured because the client didn't think it needed to send any packets to the server (even though the server was supposed to find out that the ghost object was available).
I was able to work around this problem by making a dummy rpc call from the client to the server. The rpc call did nothing, but it triggered a packet to get sent, and so onGhostAvailable was finally called on the server side.
12/10/2004 (12:12 am)
I later discovered that this problem only occured when I was using the short circuit connection (connectLocal).As I described in the above post, once I had created an object on the server side, and it was ghosted onto the client side, I expected onGhostAvailable to be called on the server side.
I think the problem occured because the client didn't think it needed to send any packets to the server (even though the server was supposed to find out that the ghost object was available).
I was able to work around this problem by making a dummy rpc call from the client to the server. The rpc call did nothing, but it triggered a packet to get sent, and so onGhostAvailable was finally called on the server side.
#4
12/10/2004 (9:12 am)
Ah, you're using the adaptive mode?
Associate Mark Frohnmayer
I'll take a look at TNLTest and see if onGhostAvailable is broken there too...