//------------------------------------------------------------------------------
// File: svr_linkobject.cs
//
// Author: Michael Felice
//------------------------------------------------------------------------------

function serverCmdUpdateServerLink(%client, %ghostID, %length)
{
   %object = %client.resolveObjectFromGhostIndex(%ghostID);
   updateServerLength(%object, %length);
}

function SLLinkObj::RemoveAllClientNodes(%object)
{
   schedule(100, 0, "DeleteLinkObject", %object);
   
   /*
   %client = ClientGroup.getObject(0);
   %ghostID = %client.getGhostId(%object);
   clientCmdRemoveAllClientNodes(%ghostID);
   //commandToClient(%client, 'RemoveAllClientNodes', %ghostID);
   */
}

function DeleteLinkObject(%object)
{
   %object.deleteObject();
   
   // Reset tech manager since object is deleted
   if (isObject(GameTechManager))
   {
      %client = ClientGroup.getObject(0);
      GameTechManager.resetTech(%client);
   }
}

function serverCmdRemoveAllServerNodes(%client, %ghostID)
{
   %object = %client.resolveObjectFromGhostIndex(%ghostID);
   RemoveAllServerNodes(%object);
}
