Game Development Community

Objects attached to gameconnection are deleted when onDrop is ..

by Thomas Huehn · in Torque Game Engine · 05/07/2007 (6:19 am) · 1 replies

Hi,

i've added an array object (from the array resource) to the GameConnection (%client) which is created when the client enter the game.

I want to save the array to file when the client disconnect and added this at GameConnection::onClientLeaveGame which is called from GameConnection::onDrop.

My Problem is this object doesnt exists when onDrop is called. I guess all attached objects like camera, player and my array is deleted before. The object reference still exists in the client-object.

I take also a look at gameConnection.cc , but i cant find where this happens.

I hope somebody can help me ;)

#1
05/07/2007 (7:13 am)
Found out where it got the cleanup :D

"MissionCleanup.delete();" is called on endMission in missionload.cs which remove the objects before onclient disconnect is called when the mission end before the client disconnect.

so i added the save function call to GameConnection::endMission(%this) and all works fine :D