PageRenderTime 23ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/viewer_components/login/lllogin.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 127 lines | 18 code | 10 blank | 99 comment | 0 complexity | 58d2b86a79d55794c06de2a642f31701 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lllogin.h
  3. *
  4. * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  5. * Second Life Viewer Source Code
  6. * Copyright (C) 2010, Linden Research, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation;
  11. * version 2.1 of the License only.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  23. * $/LicenseInfo$
  24. */
  25. #ifndef LL_LLLOGIN_H
  26. #define LL_LLLOGIN_H
  27. #include <boost/scoped_ptr.hpp>
  28. class LLSD;
  29. class LLEventPump;
  30. /**
  31. * @class LLLogin
  32. * @brief Class to encapsulate the action and state of grid login.
  33. */
  34. class LLLogin
  35. {
  36. public:
  37. LLLogin();
  38. ~LLLogin();
  39. /**
  40. * Make a connection to a grid.
  41. * @param uri The 'well known and published' authentication URL.
  42. * @param credentials LLSD data that contians the credentials.
  43. * *NOTE:Mani The credential data can vary depending upon the authentication
  44. * method used. The current interface matches the values passed to
  45. * the XMLRPC login request.
  46. {
  47. method : string,
  48. first : string,
  49. last : string,
  50. passwd : string,
  51. start : string,
  52. skipoptional : bool,
  53. agree_to_tos : bool,
  54. read_critical : bool,
  55. last_exec_event : int,
  56. version : string,
  57. channel : string,
  58. mac : string,
  59. id0 : string,
  60. options : [ strings ]
  61. }
  62. */
  63. void connect(const std::string& uri, const LLSD& credentials);
  64. /**
  65. * Disconnect from a the current connection.
  66. */
  67. void disconnect();
  68. /**
  69. * Retrieve the event pump from this login class.
  70. */
  71. LLEventPump& getEventPump();
  72. /*
  73. Event API
  74. LLLogin will issue multiple events to it pump to indicate the
  75. progression of states through login. The most important
  76. states are "offline" and "online" which indicate auth failure
  77. and auth success respectively.
  78. pump: login (tweaked)
  79. These are the events posted to the 'login'
  80. event pump from the login module.
  81. {
  82. state : string, // See below for the list of states.
  83. progress : real // for progress bar.
  84. data : LLSD // Dependent upon state.
  85. }
  86. States for method 'login_to_simulator'
  87. offline - set initially state and upon failure. data is the server response.
  88. srvrequest - upon uri rewrite request. no data.
  89. authenticating - upon auth request. data, 'attempt' number and 'request' llsd.
  90. downloading - upon ack from auth server, before completion. no data
  91. online - upon auth success. data is server response.
  92. Dependencies:
  93. pump: LLAres
  94. LLLogin makes a request for a SRV record from the uri provided by the connect method.
  95. The following event pump should exist to service that request.
  96. pump name: LLAres
  97. request = {
  98. op : "rewriteURI"
  99. uri : string
  100. reply : string
  101. pump: LLXMLRPCListener
  102. The request merely passes the credentials LLSD along, with one additional
  103. member, 'reply', which is the string name of the event pump to reply on.
  104. */
  105. private:
  106. class Impl;
  107. boost::scoped_ptr<Impl> mImpl;
  108. };
  109. #endif // LL_LLLOGIN_H