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

/*
function clientCmdUpdateBridgeLength(%ghostID)
{
   %object = ServerConnection.resolveGhostID(%ghostID);
   if (isObject(%object) == false)
   {
      return;
   }
   
   schedule(500, 0, "ClientUpdateBridgeLength", %object, %ghostID);
}

function ClientUpdateBridgeLength(%object, %ghostID)
{
   //%object.adjustLengthToWaterway();
   
   //%length = %object.getLinkCount();
   //%object.updateServerLength(%length);
   
   // now wait until the bridge has completely ghosted its children
   // before sending a place construction call
   schedule(0, 0, "ClientBridgeConstruction", %ghostID);
}
*/

function ClientBridgeConstruction(%ghostID)
{
   %client = ClientGroup.getObject(0);
   serverCmdPlaceConstruction(%client, %ghostID);
   //commandToServer('PlaceConstruction', %ghostID);
}

function SLLinkObj::updateServerLength(%object, %length)
{
   %ghostID = ServerConnection.getGhostID(%object);
   %client = ClientGroup.getObject(0);
   serverCmdUpdateServerLink(%client, %ghostID, %length);
   //commandToServer('UpdateServerLink', %ghostID, %length);
}

function clientCmdRemoveAllClientNodes(%ghostID)
{
  %object = ServerConnection.resolveGhostId(%ghostID);
  RemoveAllClientNodes(%object);
  %client = ClientGroup.getObject(0);
  serverCmdRemoveAllServerNodes(%client, %ghostID);
  //commandToServer('RemoveAllServerNodes', %ghostID);
}
