client disconnected but entities remain

Posted By: Anonymous

client disconnected but entities remain - 09/01/09 11:08

(3DGS-networking)

Hi!

When I connect a client to a server and create an entity this entity remains if I "kill" the client by pressing the window-close-button (upper right x).

This happens also if I ent_remove the entity on_exit.
The EVENT_LEAVE ist triggert on the server.

How can I eliminate clients entites if the client was killed?
Posted By: Hand_Of_Law

Re: client disconnected but entities remain - 09/01/09 11:25

Do you wait for some time ?
For me it takes 5-10 seconds for entities to be removed when connection is lost.
Posted By: Anonymous

Re: client disconnected but entities remain - 09/01/09 12:56

Yes I waited but the entity still remains...

PS: I start the server with session_open....
Posted By: SchokoKeks

Re: client disconnected but entities remain - 09/03/09 09:42

use the EVENT_DISCONNECT on the entitys:
Code:
if (event_type == EVENT_DISCONNECT)
{
  wait (1);
  ent_remove(me);
}



the entities created by the clients are not automatically removed when they disconnect, you have to program that using the code above.
EDIT: of course, that event has to run on the server, not on the client that is killed.
© 2024 lite-C Forums