AdminShip.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*-------------------------------------------------------------------------
  2. * fedsrv\AdminShip.CPP
  3. *
  4. * Implementation of CAdminShip.
  5. *
  6. * Owner:
  7. *
  8. * Copyright 1986-2000 Microsoft Corporation, All Rights Reserved
  9. *-----------------------------------------------------------------------*/
  10. #include "pch.h"
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CAdminShip
  13. TC_OBJECT_EXTERN_NON_CREATEABLE_IMPL(CAdminShip)
  14. /////////////////////////////////////////////////////////////////////////////
  15. // Construction
  16. CAdminShip::CAdminShip()
  17. {
  18. }
  19. /*-------------------------------------------------------------------------
  20. * get_Pilot()
  21. *-------------------------------------------------------------------------
  22. * Output:
  23. * a pointer to an User that is piloting this ship
  24. */
  25. STDMETHODIMP CAdminShip::get_User(IAdminUser** ppUser)
  26. {
  27. CFSShip* pfsShip = (CFSShip*)GetIGC()->GetPrivateData(); // Igc2Host(GetIGC());
  28. if (pfsShip->IsPlayer())
  29. {
  30. CFSPlayer *pfsPlayer = pfsShip->GetPlayer();
  31. RETURN_FAILED (pfsPlayer->CAdminSponsor<CAdminUser>::Make(IID_IAdminUser, (void**)ppUser));
  32. pfsPlayer->CAdminSponsor<CAdminUser>::GetLimb()->Init(pfsPlayer);
  33. }
  34. else
  35. {
  36. *ppUser = NULL;
  37. // CLEAROUT(ppUser, (IAdminUser*)NULL);
  38. }
  39. return S_OK;
  40. }