CTR Pia  4.11.3
Game Communication Engine
session_Session.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: session_Session.h
4 
5  Copyright Nintendo. All rights reserved.
6 
7  These coded instructions, statements, and computer programs contain
8  proprietary information of Nintendo of America Inc. and/or Nintendo
9  Company Ltd., and are protected by Federal copyright law. They may
10  not be disclosed to third parties or copied or duplicated in any form,
11  in whole or in part, without the prior written consent of Nintendo.
12  *---------------------------------------------------------------------------*/
13 
14 
15 #pragma once
16 
17 #include <pia/session/session_definitions.h>
18 
19 #include <pia/common/common_CryptoSetting.h>
20 
21 #include <pia/transport.h>
22 
23 #include <pia/session/session_Mesh.h>
24 
25 
26 // Forward declarations (common).
27 namespace nn
28 {
29 namespace pia
30 {
31 namespace common
32 {
33 class CallContext;
34 typedef CallContext AsyncContext;
35 }
36 }
37 }
38 
39 namespace nn
40 {
41 namespace pia
42 {
43 namespace transport
44 {
45 class NetworkFactory;
46 class StationConnectionInfo;
47 }
48 }
49 }
50 
51 namespace nn
52 {
53 namespace pia
54 {
55 namespace session
56 {
57 
58 // Forward declarations.
59 class CreateSessionSetting;
60 class JoinSessionSetting;
61 class SessionStatusCheckJob;
62 class CreateSessionJob;
63 class AutoMatchmakeJob;
64 class BrowseMatchmakeJob;
65 class JoinSessionJob;
66 class DestroySessionJob;
67 class LeaveSessionJob;
68 class OpenParticipationJob;
69 //class OpenSessionJob;
70 class CloseParticipationJob;
71 //class CloseSessionJob;
72 class ConfigParticipationJobBase;
73 class GenerateMatchmakeSystemPasswordJob;
74 class ClearMatchmakeSystemPasswordJob;
75 class JointSessionJob;
76 class ModifyAttributeJob;
77 class UpdateSessionSettingJob;
78 class UpdateApplicationDataJob;
79 
80 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
81 class RefereeStartGameJob;
82 class RefereeEndGameJob;
83 class RefereeEndGameWithoutReportJob;
84 class RefereeGetOrCreateStatsJob;
85 class IMatchmakeReferee;
86 class IEndGamePersonalReport;
87 #endif
88 
89 class StationIdStatusTable;
90 class SessionProtocol;
91 class IMatchmakeSession;
92 class ISessionInfoList;
93 class MeshLayerController;
94 class MatchNetworkFactory;
95 class SessionSearchCriteria;
96 class ISessionInfo;
97 class ISessionInfoList;
98 class MeshEventListenerForSession;
99 class UpdateSessionSetting;
100 
101 /*!
102  @class nn::pia::session::Session
103  @brief This class contains processes for matchmaking and for creating and joining sessions used for P2P communication.
104 
105  @details This class implements the singleton pattern. Only a single instance can be created.
106 
107  Some of the internal processes of the <tt>Session</tt> class are registered as jobs in <tt>@ref nn::pia::common::Scheduler</tt>
108  so you must make periodic calls to <tt>@ref nn::pia::common::Scheduler::Dispatch</tt>
109 
110  @date 2015-06-30 Removed the session merge feature.
111  @date 2015-05-20 Added the <tt>Session::GetUplinkBitRate</tt> function.
112  @date 2015-05-20 Added the <tt>bitRateCheckMode</tt> member to the <tt>Setting</tt> structure to enable configuration of the bit rate detection feature.
113  @date 2015-05-20 Added the <tt>uplinkBitRateLowerLimit</tt> and <tt>bitRateCheckPacketSize</tt> members to the <tt>StartupSetting</tt> structure to enable configuration of the bit rate detection feature.
114  @date 2015-01-20 Added the <tt>GetMatchmakeSessionParticipantNum()</tt>, <tt>CancelJoinSessionAsync()</tt>, and <tt>CancelJoinRandomSessionAsync()</tt> functions.
115  @date 2015-01-20 Added a description of the specification changes to <tt>CloseParticipationAsync</tt>.
116  @date 2015-01-20 Noted that <tt>ResultGameServerProcessAborted</tt> is sometimes returned in the results of asynchronous processes related to the sessions feature.
117  @date 2015-01-07 Added the <tt>GetJoinSequence()</tt> and <tt>GetJoinMeshSequence()</tt> functions.
118  @date 2014-11-05 Deleted <tt>STATUS_CONNECTED_NETWORK</tt> from the return values for the <tt>GetStatus()</tt> function.
119  @date 2014-11-05 Changed the <tt>CheckConnection()</tt> function to <tt>CheckConnectionError()</tt>.
120  @date 2014-11-05 Added <tt>EVENT_JOINT_SESSION_HOST_CHANGED</tt>.
121  @date 2014-11-05 Added a feature for changing the search conditions for joint sessions.
122  @date 2014-11-05 Added the <tt>GetJointSessionStationId()</tt> function.
123  @date 2014-10-07 Added functions and constants related to joint session features that had been removed.
124  @date 2014-09-18 Changed the specifications so that <tt>ResultAlreadyExists</tt> is returned if you call <tt>CreateInstance()</tt> when an instance already exists.
125  @date 2014-08-11 Removed functions and constants related to the joint session feature, and added functions and constants related to the session merge feature.
126  @date 2014-02-27 Initial version.
127 */
129 {
130  friend class SessionStatusCheckJob;
131  friend class CreateSessionJob;
132  friend class AutoMatchmakeJob;
133  friend class JoinSessionJob;
134  friend class JointSessionJob;
135  friend class DestroySessionJob;
136  friend class LeaveSessionJob;
137  friend class OpenParticipationJob;
138  friend class OpenSessionJob;
139  friend class CloseParticipationJob;
140  friend class CloseSessionJob;
141  friend class SessionProtocol;
142  friend class StationIdStatusTable;
143  friend class MeshEventListenerForSession;
144  friend class MeshLayerController;
145  friend class UpdateApplicationDataJob;
146  friend class ModifyAttributeJob;
147  friend class GenerateMatchmakeSystemPasswordJob;
148  friend class ClearMatchmakeSystemPasswordJob;
149 
150 public:
151 /*!
152  @brief Stores parameters passed to the <tt>@ref nn::pia::session::Session::CreateInstance()</tt> function.
153  @see CreateInstance
154 */
155  struct Setting
156  {
157  Setting(void)
158  : pNetworkFactory(NULL),
159  networkTopology(NetworkTopology_FullMesh),
160  browsedSessionInfoListNum(0)
161 #if NN_PIA_EXPERIMENT_BAND_WIDTH_CHECK
162  ,bitRateCheckMode(BitRateCheck_Disable)
163 #endif
164  {
165  }
166 
167  transport::NetworkFactory* pNetworkFactory; //!< Pointer to a <tt>NetworkFactory</tt> specified for each network.
168  session::NetworkTopology networkTopology; //!< Specifies the network topology setting for the session.
169  u8 browsedSessionInfoListNum; //!< Size of the list that stores the session search results.
170 #if NN_PIA_EXPERIMENT_BAND_WIDTH_CHECK
171  session::BitRateCheckMode bitRateCheckMode; //!< Settings for the bitrate detection feature.
172 #endif
173  };
174 
175 /*!
176  @brief (For debugging.) This structure stores the debug feature settings that are passed to <tt>@ref nn::pia::session::Session::SetDebugSetting</tt>.
177 */
179  {
180  DebugSetting(bool argIsEnableRelayEmulation = false, bool argIsEnableMatchmakeAnalysis = false, bool argIsDisableCheckMaxSilenceTime = false)
181  : isEnableRelayEmulation(argIsEnableRelayEmulation),
182  isEnableMatchmakeAnalysis(argIsEnableMatchmakeAnalysis),
183  isDisableCheckMaxSilenceTime(argIsDisableCheckMaxSilenceTime)
184  {
185  }
186  bool isEnableRelayEmulation; //!< Settings for the connection route emulation feature for debugging.
187  bool isEnableMatchmakeAnalysis; //!< Settings for the matchmaking analysis feature.
188  bool isDisableCheckMaxSilenceTime; //!< Does not check the range set for the maximum time without communication.
189  };
190 
191 /*!
192  @brief This structure stores settings passed to <tt>@ref nn::pia::session::Session::Startup</tt>.
193 */
195  {
197  : bUsingHostMigration(true),
198  pPlayerName(NULL),
202 #if NN_PIA_EXPERIMENT_BAND_WIDTH_CHECK
204  bitRateCheckPacketSize(0),
205  bitRateMeasuringSpan(1000),
206  isSkipBitRateCheck(false),
207 #endif
208  pToken(NULL)
209  {
210  }
211  bool bUsingHostMigration; //!< Sets the use of the host migration feature. The default is <tt>true</tt> (enabled).
212  const nn::pia::transport::Station::PlayerName* pPlayerName; //!< Specifies the name and language code associated with the local station. Other members of the mesh access this information.
213  nn::pia::common::CryptoSetting::Mode cryptoMode; //!< Specifies the encryption setting mode. Defaults to <tt>common::CryptoSetting::MODE_NOTHING</tt>.
214  u32 maxSilenceTime; //!< Specifies the maximum allowable time without communication (in milliseconds). The default value is <tt>session::NN_PIA_SESSION_MAX_SILENCE_TIME_DEFAULT</tt>. The maximum value that can be set is <tt>session::NN_PIA_SESSION_MAX_SILENCE_TIME_MAX</tt>, the minimum value is <tt>session::NN_PIA_SESSION_MAX_SILENCE_TIME_MIN</tt>.
215  u32 keepAliveSendingInterval; //!< Specifies the send interval for keep-alive (in milliseconds). The default value is <tt>session::NN_PIA_SESSION_KEEP_ALIVE_INTERVAL_DEFAULT</tt>.
216 #if NN_PIA_EXPERIMENT_BAND_WIDTH_CHECK
217  s32 uplinkBitRateLowerLimit; //!< Specifies the minimum rate required by the application when using the bitrate detection feature. The value is in bits per second. The default value is <tt>session::NN_PIA_SESSION_INVALID_UPLINK_BIT_RATE_LOWER_LIMIT</tt>.
218  size_t bitRateCheckPacketSize; //!< Specifies the IP packet size used for testing when using the bitrate detection feature. The value is in bytes. The expected value is the average size of IP packet sent and received by the application. It must be a multiple of 4. The default is <tt>0</tt>.
219  s32 bitRateMeasuringSpan; //!< Sets the time to spend measuring when the bit rate detection feature is used. The value is in milliseconds. The default is <tt>1000 msec</tt>. Changing this value from the default is not recommended.
220  bool isSkipBitRateCheck; //!< Set to skip detection processes when using bitrate detection. Specify <tt>true</tt> to skip. The default is <tt>false</tt>.
221 #endif
222  const nn::pia::transport::Station::IdentificationToken* pToken; //!< Specifies a pointer to the identification token indicating the local device. If <tt>NULL</tt> is specified, an identification token with all data set to <tt>NULL</tt> is used. The default is <tt>NULL</tt>.
223  };
224 
225 /*
226  @cond PRIVATE
227  @brief Enumerates <tt>Session</tt> states.
228 */
229  enum ModuleState
230  {
231  INITIALIZED = 0, //!< Initialization complete
232  STARTUP_COMPLETE //!< Ready for matchmaking
233  };
234  //! @endcond
235 
236 /*!
237  @cond PRIVATE
238  @brief Enumerates matchmaking states.
239 */
240  enum MatchmakeStatus
241  {
242  NOT_IN_SESSION = 0, //!< Not connected.
243  JOINED_MATCHMAKE, //!< Joined a matchmaking session.
244  ESTABLISHED_SESSION, //!< Joined a session.
245  CHANGING_SESSION, //!< Being transferred to a session by the joint session feature. (Includes a period with no communication.)
246  ESTABLISHED_JOINT_SESSION //!< Already joined the joint session.
247  };
248  //! @endcond
249 
250 /*!
251  @cond PRIVATE
252  @brief Enumerates the connection status.
253 */
254  enum ConnectionStatus
255  {
256  NOT_CONNECTED, //!< Not communicating.
257  CONNECTED, //!< Communicating.
258  DISCONNECTED_SESSION, //!< Disconnected from the session. After leaving the session with <tt>@ref LeaveSessionAsync</tt> be sure to call <tt>@ref Cleanup</tt>.
259  DISCONNECTED_NETWORK //!< Disconnected from the network. Log out and then log in again.
260  };
261  //! @endcond
262 
263 /*!
264  @cond PRIVATE
265  @brief Enumerates the join-in processes.
266 */
267  enum ProcessType {
268  PROCESS_TYPE_NONE = 0, //!< If no processes are taking place. (Value for initialization.)
269  PROCESS_TYPE_MERGE_SESSION, //!< Process that takes all of the participants in the current session to join a different session. Specifies the session to join.
270  PROCESS_TYPE_MERGE_RANDOM_SESSION, //!< Process that takes all of the participants in the current session to join a different session. The session to join is determined by random matchmaking.
271  PROCESS_TYPE_DEMERGE_SESSION, //!< Process that splits a session and makes the new session independent.
272  PROCESS_TYPE_EMIGRATE_SESSION, //!< Process that migrates stations to another session. Specifies the destination session.
273  PROCESS_TYPE_EMIGRATE_RANDOM_SESSION, //!< Process that migrates stations to another session. The destination session is determined by random matchmaking.
274  PROCESS_TYPE_CREATE_JOINT_SESSION, //!< Process that creates a joint session, and brings all of the participants in the current session into it.
275  PROCESS_TYPE_JOIN_JOINT_SESSION, //!< Process that specifies a joint session, and brings all of the participants in the current session into it.
276  PROCESS_TYPE_JOIN_RANDOM_JOINT_SESSION, //!< Process that specifies a joint session through random matchmaking and brings all of the participants in the current session into it.
277  PROCESS_TYPE_DESTROY_JOINT_SESSION, //!< Process that disbands a joint session.
278  PROCESS_TYPE_LEAVE_JOINT_SESSION, //!< Process that leaves a joint session.
279  PROCESS_TYPE_MAX
280  };
281 /* @endcond */
282 
283 /*!
284  @cond PRIVATE
285  @brief Enumerated type for distinguishing asynchronous process types for leaving a mesh.
286 */
287  enum LeaveMeshProcessType {
288  LEAVE_PROCESS_TYPE_UNKNOWN = 0,
289  LEAVE_PROCESS_TYPE_LEAVE,
290  LEAVE_PROCESS_TYPE_LEAVE_WITH_HM,
291  LEAVE_PROCESS_TYPE_DESTROY
292  };
293 /* @endcond */
294 
295 /*!
296  @brief Enumerates reasons why a <tt>Session</tt> object cannot communicate.
297 
298  @details This information can be retrieved using the <tt>@ref GetSessionDisconnectReason</tt> function.
299 */
301  {
302  UNKNOWN_REASON = 0, //!< Specifies that the reason for the disconnection is unknown. One way to get this value is by calling the <tt>Session::Cleanup</tt> function during communication (without destroying or leaving the session).
303  NOT_YET_COMMUNICATED, //!< Specifies that no communication has been performed. You get this value if you never build or join a session after calling the <tt>Session::Startup</tt> function.
304  OPERATION_OF_OWN, //!< Specifies that the disconnection was caused by the local station. You get this value when the local station left the session by calling <tt>Session::LeaveSessionAsync</tt> or similar function.
305  OPERATION_OF_OTHER, //!< Specifies that the disconnection was caused by another station in the session. One way to get this value is when the local station is a client, and the host destroys the session.
306  KICKOUT_BY_USER, //!< Specifies that the local station was kicked out from the session because of a call to the <tt>Session::KickoutStation</tt> function.
307  KICKOUT_BY_SYSTEM, //!< Specifies that the disconnection from the session was caused by the library. One way to get this value is when relaying is enabled, and the library disconnects you from the session because it restricts the number of relay requests.
308  INCONSISTENT_INFO, //!< Specifies that the disconnection was caused by a desync. (The session information was no longer consistent between participants.) One way to get this value is when the station counts do not match.
309  MIGRATION_FAIL, //!< Specifies that the disconnection was caused by a failed host migration.
310  EXTERNAL_FACTOR, //!< Specifies that the disconnection was caused by something other than the session. One way to get this value is when the network connection is lost.
311  MIGRATION_FATAL_ERROR //!< Specifies that a fatal error occurred during host migration. This error can occur when the library detects that a session has broken up.
312  };
313 
314 /*!
315  @brief Enumerates session states.
316 
317  @details This information can be retrieved using the <tt>Session::GetStatus</tt> function.
318 */
319  enum Status
320  {
321  STATUS_NOT_CONNECTED, //!< Not communicating.
322  STATUS_CONNECTED_SESSION, //!< Joined a session.
323  STATUS_MIGRATING_SESSION, //!< Being transferred to a session by the joint session feature. (Includes a period with no communication.)
324  STATUS_CONNECTED_JOINT_SESSION, //!< Joined a joint session.
325  STATUS_DISCONNECTED_SESSION, //!< Disconnected from the session. Call <tt>@ref Cleanup</tt> after calling <tt>@ref LeaveSessionAsync</tt>.
326  STATUS_DISCONNECTED_NETWORK //!< Disconnected from the network. Log out and then log in again.
327  };
328 
329 /*!
330  @brief This enumerated type is passed as a parameter to the callback that sends notifications about changes in the session state.
331 
332  @details It represents the possible changes to the session state.
333 */
335  {
336  EVENT_JOIN = 0, //!< Indicates that a station has joined.
337  EVENT_LEAVE, //!< A station has left.
338  EVENT_SESSION_HOST_CHANGED, //!< Indicates that the host of the session has changed. (Only occurs when host migration is enabled.)
339  EVENT_HOST_MIGRATION_FAILED, //!< Indicates that host migration failed. (Only occurs when host migration is enabled.)
340  EVENT_JOINT_SESSION_HOST_CHANGED, //!< Indicates that the host of the joint session has changed. (Only occurs when using the joint session feature with host migration enabled.)
341  EVENT_START_SESSION_CREATE_JOINT = 11, //!< Indicates that the process of creating a joint session has started. (Only occurs when using the joint session feature.)
342  EVENT_END_SESSION_CREATE_JOINT, //!< Indicates that the process of creating a joint session has finished. (Only occurs when using the joint session feature.)
343  EVENT_START_SESSION_JOIN_JOINT, //!< Indicates that the process of joining a joint session has started. (Only occurs when using the joint session feature.)
344  EVENT_END_SESSION_JOIN_JOINT, //!< Indicates that the process of joining a joint session has finished. (Only occurs when using the joint session feature.)
345  EVENT_START_SESSION_JOINT_RANDOM, //!< Indicates that a joint session has started through random matchmaking. (Only occurs when using the joint session feature.)
346  EVENT_END_SESSION_JOINT_RANDOM, //!< Indicates that a joint session started through random matchmaking has been completed. (Only occurs when using the joint session feature.)
347  EVENT_START_SESSION_DESTROY_JOINT, //!< Indicates that the process of disbanding a joint session has started. (Only occurs when using the joint session feature.)
348  EVENT_END_SESSION_DESTROY_JOINT, //!< Indicates that the process of disbanding a joint session has finished. (Only occurs when using the joint session feature.)
349  EVENT_START_SESSION_LEAVE_JOINT, //!< Indicates that the process of leaving a joint session has started. (Only occurs when using the joint session feature.)
350  EVENT_END_SESSION_LEAVE_JOINT, //!< Indicates that the process of leaving a joint session has finished. (Only occurs when using the joint session feature.)
351  EVENT_SESSION_MIGRATION_FAILED, //!< Indicates that the session migration process for the joint session feature failed. (Only occurs when using the joint session feature.)
352  EVENT_SET_SESSION_SYSTEM_PASSWORD, //!< A system password was set on the session.
353  EVENT_CLEAR_SESSION_SYSTEM_PASSWORD //!< The system password of the session was cleared.
354  };
355 
356 /*!
357  @brief This callback function type is called when the session state changes.
358 
359  @details <b>Parameters</b>
360  <ul>
361  <li><tt><var>eventType</var></tt>: Enumerated type indicating what the state change was. For more information, see the <tt>@ref SessionEventType</tt> enumerated type.</li>
362  <li><tt><var>id</var></tt>: The <tt>StationId</tt> of the station that changed its state.</li>
363  </ul>
364 
365 */
366  typedef void (*SessionEventCallback)(SessionEventType eventType, StationId id);
367 
368 /*!
369  @brief Declares the type of the callback function for the session host to invoke when determining whether to approve join requests from clients.
370 
371  @details This function defines the callback that is invoked when the local station is the session host and it receives a join request from a client.
372  The return value is used to decide whether to approve or deny the join request.
373 
374  @param[in] pRequesterToken Specifies a pointer to the ID token of the station that sent the join request.
375 
376  @return Returns <tt>true</tt> to approve the join request, or <tt>false</tt> otherwise.
377 */
378  typedef bool (*JoiningApprovalCallback)(const nn::pia::transport::Station::IdentificationToken* pRequesterToken);
379 
380 
381  typedef common::ObjList<StationId> TStationIdList;
382 
383 /*!
384  @brief An iterator for accessing valid <tt>StationId</tt> objects in a session (non-<tt>const</tt> version).
385 */
387  {
388  public:
389  StationIdIterator(TStationIdList::Iterator it) :
390  m_Iterator(it)
391  {
392  }
393  StationId& operator*(void)
394  {
395  return *m_Iterator;
396  }
397  StationId* operator->(void)
398  {
399  return &(*m_Iterator);
400  }
401  bool operator==(const StationIdIterator& rhs) const
402  {
403  return m_Iterator == rhs.m_Iterator;
404  }
405  bool operator!=(const StationIdIterator& rhs) const
406  {
407  return !(*this == rhs);
408  }
409  StationIdIterator& operator++(void)
410  {
411  ++m_Iterator;
412  return *this;
413  }
414  private:
415  TStationIdList::Iterator m_Iterator;
416  };
417 
418 /*!
419  @brief An iterator for accessing valid <tt>StationId</tt> objects in a session (<tt>const</tt> version).
420 */
422  {
423  public:
424  StationIdConstIterator(TStationIdList::ConstIterator it)
425  : m_ConstIterator(it)
426  {
427  }
428  const StationId& operator*(void)
429  {
430  return *m_ConstIterator;
431  }
432  const StationId* operator->(void)
433  {
434  return &(*m_ConstIterator);
435  }
436  bool operator==(const StationIdConstIterator& rhs) const
437  {
438  return m_ConstIterator == rhs.m_ConstIterator;
439  }
440  bool operator!=(const StationIdConstIterator& rhs) const
441  {
442  return !(*this == rhs);
443  }
444  StationIdConstIterator& operator++(void)
445  {
446  ++m_ConstIterator;
447  return *this;
448  }
449 
450  private:
451  TStationIdList::ConstIterator m_ConstIterator;
452  };
453 
454 
455 /*!
456  @name Singleton Instance Control
457  @{
458 */
459 
460 /*!
461  @brief Creates the <tt>Session</tt> class instance (singleton pattern).
462 
463  @details If the relay emulation feature for debugging has been set by the <tt>@ref SetDebugSetting</tt> function,
464  and the network topology is not set to <tt>NetworkTopology_RelayMesh</tt>, the call to this function fails.
465 
466  @attention Do not call <tt>@ref SetDebugSetting</tt> in retail ROMs.
467 
468  @param[in] setting Parameters to set when creating the instance.
469 
470  @return Returns a <tt>Result</tt> value that indicates success if the instance is created successfully.
471 
472  @retval nn::pia::ResultNotInitialized Indicates that the <tt>session</tt> module is not initialized. Programming error. Fix your program so that this error is not returned.
473  @retval nn::pia::ResultInvalidState Indicates that the instance was created at the wrong time. Programming error. Fix your program so that this error is not returned.
474  @retval nn::pia::ResultAlreadyExists Indicates that an instance has already been created. Programming error. Fix your program so that this error is not returned.
475  @retval nn::pia::ResultInvalidArgument Indicates a problem in the parameter values or the combination thereof. Programming error. Fix your program so that this error is not returned.
476 */
477  static nn::Result CreateInstance(Session::Setting setting);
478 
479 
480 /*!
481  @brief Frees the <tt>Session</tt> class instance (singleton pattern).
482 */
483  static void DestroyInstance();
484 
485 /*!
486  @brief Gets the <tt>Session</tt> class instance (singleton pattern).
487 
488  @details Returns a null pointer if the instance has not yet been
489  created and initialized using the <tt>@ref CreateInstance</tt> function.
490 
491  @return Returns a pointer to the <tt>Session</tt> instance.
492 */
494  {
495  return s_pInstance;
496  }
497 
498 
499 /*!
500  @brief (For debugging.) Configures the <tt>Session</tt> debugging feature.
501 
502  @details This function can be called while the <tt>Session</tt> instance does not exist. Call this function before creating the <tt>Session</tt> instance with <tt>@ref CreateInstance</tt>.
503 
504  If the <tt>isEnableRelayEmulation</tt> member of the <tt>DebugSetting</tt> structure is set to <tt>true</tt>, the <tt>Session</tt> will be configured to use the relay emulation feature for debugging.
505  When the session is configured to use the relay emulation feature, the <tt>@ref CreateInstance</tt> function will not succeed unless the network topology is set to <tt>NetworkTopology_RelayMesh</tt>.
506 
507  If the <tt>isEnableMatchmakeAnalysis</tt> member of the <tt>DebugSetting</tt> structure is set to <tt>true</tt>, the <tt>Session</tt> will be configured to use the matchmaking analysis feature.
508 
509  If this function is not called, all related debugging features are disabled.
510 
511  @attention Do not call this function in retail ROMs.
512 
513  @return Returns the result of the function. On success, returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. You must make sure that the implementation of this function in your application does not return any errors.
514  If this function call fails, one or more of the following <tt>Result</tt> values is returned.
515  @retval nn::pia::ResultInvalidState Indicates that the function cannot be executed in this state. This result is returned when the <tt>Session</tt> instance has already been created. Programming error. Fix your program so that this error is not returned.
516 */
517  static nn::Result SetDebugSetting(const DebugSetting& debugSetting);
518 
519 /*!
520  end of name Singleton Instance Control
521  @}
522 */
523 
524 
525 /*!
526  @name Finish Initialization
527  @{
528 */
529 
530 /*!
531  @brief Executes the startup procedure.
532 
533  @details Call this function after the <tt>session::EndSetup()</tt> function has been called and the <tt>Session</tt> initialization process has ended.
534 
535  The use of host migration is set by the <tt>bUsingHostMigration</tt> member of the <tt>StartupSetting</tt> structure. Set to <tt>true</tt> to enable. The default is <tt>true</tt>.
536  Specify the name and language code associated with the local station in the <tt>pPlayerName</tt> member of <tt>StartupSetting</tt>. The name must be no longer than 16 characters (not including the terminating null character).
537  @if CAFE_DOC
538  Set the language code to the language used by the application. Use one of the values defined in <tt>nn::fp::Language</tt>.
539  The name and language code you specify are shared with all members of the session. When the local station joins a session, all session participants are added to Player History.
540  When another client joins the session, the new participant's name and language code are looked up and automatically added to Player History using the
541  <tt>nn::fp::AddRecentPlayRecord()</tt> function from within the library.
542  For more information about Player History, see the <i>Pia Programming Manual</i> for the Friend Presence library
543  and the <i>Pia API Reference</i> for the <tt>nn::fp::AddRecentPlayRecord()</tt> function.
544  @endif
545  @if CTR_DOC
546  Specify a language code if your application determines the languages of other regions. You can use the value returned by the <tt>nn::cfg::CTR::GetLanguage()</tt> function if you want to use the language setting of the system.
547  @endif
548 
549  You can set the communication encryption mode in the <tt>cryptoMode</tt> member of the <tt>StartupSetting</tt> structure. The default value is <tt>common::CryptoSetting::MODE_NOTHING</tt>.
550  @if CTR_DOC
551  You do not need to configure encryption for local communication because the data is encrypted in the UDS communication layer of the SDK.
552  @endif
553 
554  Specify the maximum allowable time without communication in the <tt>maxSilenceTime</tt> member of <tt>StartupSetting</tt>. If the period without communication with the station exceeds the specified period, that station is treated as disconnected.
555  Specify the keep-alive send interval in the <tt>keepAliveSendingInterval</tt> member of the <tt>StartupSetting</tt> structure. Keep alive is a feature that keeps connections alive during periods of no communication by having the system send data to stations the application is not sending data to.
556 
557  The default values for the <tt>maxSilenceTime</tt> and <tt>keepAliveSendingInterval</tt> members of <tt>StartupSetting</tt> are as follows. (These values are used if you do not modify the <tt>maxSilenceTime</tt> and <tt>keepAliveSendingInterval</tt> members of <tt>StartupSetting</tt>.)
558  <ul>
559  <li> <tt>maxSilenceTime</tt>: <tt>nn::pia::session::NN_PIA_SESSION_MAX_SILENCE_TIME_DEFAULT</tt></li>
560  <li> <tt>keepAliveSendingInterval</tt>: <tt>nn::pia::session::NN_PIA_SESSION_KEEP_ALIVE_INTERVAL_DEFAULT</tt></li>
561  </ul>
562  If you customize these values, make sure to test the actual results as you adjust them.
563 
564  In the <tt>pToken</tt> member of the <tt>StartupSetting</tt> structure, you can set an identification token that indicates the local host. The default is <tt>NULL</tt>.
565  This identification token is shared with peers during the connection process, and it is associated with and maintained in <tt>@ref nn::pia::transport::Station</tt>.
566  You are not required to specify an identification token if you do not need to use one.
567 
568  The <tt>@ref Startup</tt> function is the only way to specify and change an identification token that indicates the local host.
569  There is no supported method for changing an identification token while a session is in use.
570 
571  If the bitrate detection feature is enabled, you must set the <tt>uplinkBitRateLowerLimit</tt> and <tt>bitRateCheckPacketSize</tt> members of the <tt>@ref StartupSetting</tt> structure.
572  Both members default to an invalid value. Set the minimum bitrate (in bits per second) required by the application in <tt>uplinkBitRateLowerLimit</tt> and the IP packet size (in bytes) to use for measurements in <tt>bitRateCheckPacketSize</tt>.
573 
574  @attention Do not transition to sleep mode during a call to this function during local communication.
575 
576  @param[in] startupSetting Specifies the settings to use for startup.
577 
578  @return Returns a <tt>Result</tt> value that indicates success if the process succeeds. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
579 
580  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
581  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. This result is only returned during local communication. Programming error. Fix your program so that this error is not returned.
582 
583  @see Cleanup
584 */
585  nn::Result Startup(StartupSetting& startupSetting);
586 
587  /// @cond PRIVATE
588 /*!
589  @brief Executes the startup procedure.
590 
591  @details Call this function after the <tt>session::EndSetup()</tt> function has been called and the <tt>Session</tt> initialization process has ended.
592 
593  Host migration is configured with the first argument. Set to <tt>true</tt> to enable.
594  Specify the name and language code associated with the local station in the second parameter. The name must be no longer than 16 characters (not including the terminating null character).
595  @if CAFE_DOC
596  Set the language code to the language used by the application. Use one of the values defined in <tt>nn::fp::Language</tt>.
597  The name and language code you specify are shared with all members of the session. When the local station joins a session, all session participants are added to Player History.
598  When another client joins the session, the new participant's name and language code are looked up and automatically added to Player History using the
599  <tt>nn::fp::AddRecentPlayRecord()</tt> function from within the library.
600  For more information about Player History, see the <i>Pia Programming Manual</i> for the Friend Presence library
601  and the <i>Pia API Reference</i> for the <tt>nn::fp::AddRecentPlayRecord()</tt> function.
602  @endif
603  @if CTR_DOC
604  Specify a language code if your application determines the languages of other regions. You can use the value returned by the <tt>nn::cfg::CTR::GetLanguage()</tt> function if you want to use the language setting of the system.
605  @endif
606 
607  You can set the communication encryption mode in the third parameter.
608  @if CTR_DOC
609  You do not need to configure encryption for local communication because the data is encrypted in the UDS communication layer of the SDK.
610  @endif
611 
612  Specify the maximum allowable time without communication in the fourth parameter. If the period without communication with the station exceeds the specified period, that station is treated as disconnected.
613  Specify the keep-alive send interval in the fifth parameter. Keep alive is a feature that keeps connections alive during periods of no communication by having the system send data to stations the application is not sending data to.
614 
615  The default values for parameters four and five are listed below. The following defaults are used if you call an overload without configuration arguments.
616  <ul>
617  <li>Fourth parameter: <tt><var>nn::pia::session::NN_PIA_SESSION_MAX_SILENCE_TIME_DEFAULT</var></tt></li>
618  <li>Fifth parameter: <tt><var>nn::pia::session::NN_PIA_SESSION_KEEP_ALIVE_INTERVAL_DEFAULT</var></tt></li>
619  </ul>
620  If you customize these values, make sure to test the actual results as you adjust them.
621 
622  In the fifth parameter, you can set an identification token that indicates the local host.
623  This identification token is shared with peers during the connection process, and it is associated with and maintained in <tt>@ref nn::pia::transport::Station</tt>.
624  You are not required to specify an identification token if you do not need to use one.
625 
626  The <tt>@ref Startup</tt> function is the only way to specify and change an identification token that indicates the local host.
627  There is no supported method for changing an identification token while a session is in use.
628 
629  @attention Do not transition to sleep mode during a call to this function during local communication.
630 
631  @param[in] bUsingHostMigration Specifies whether host migration will be used.
632  @param[in] pPlayerName Specifies the name and language code associated with the local station. Other members of the session access this information.
633  @param[in] maxSilenceTime Specifies the maximum allowable time without communication (in milliseconds).
634  @param[in] keepAliveSendingInterval Specifies the send interval for keep-alive (in milliseconds).
635  @param[in] cryptoMode Specifies the encryption mode.
636  @param[in] pToken Specifies a pointer to the identification token indicating the local device. If <tt>NULL</tt> is specified, an identification token with all data set to <tt>NULL</tt> is used.
637 
638  @return Returns a <tt>Result</tt> value that indicates success if the process succeeds. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
639  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
640  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. This result is only returned during local communication. Programming error. Fix your program so that this error is not returned.
641 
642  @see Cleanup
643 */
644 /*
645  nn::Result Startup(
646  bool bUsingHostMigration,
647  const nn::pia::transport::Station::PlayerName* pPlayerName,
648  nn::pia::common::CryptoSetting::Mode cryptoMode = common::CryptoSetting::MODE_NOTHING,
649  u32 maxSilenceTime = nn::pia::session::NN_PIA_SESSION_MAX_SILENCE_TIME_DEFAULT,
650  u32 keepAliveSendingInterval = nn::pia::session::NN_PIA_SESSION_KEEP_ALIVE_INTERVAL_DEFAULT,
651 #if NN_PIA_EXPERIMENT_BAND_WIDTH_CHECK
652  s32 bandwidthLimit = nn::pia::session::NN_PIA_SESSION_INVALID_UPLINK_BIT_RATE_LOWER_LIMIT,
653 #endif
654  const nn::pia::transport::Station::IdentificationToken* pToken = NULL);
655 */
656  /// @endcond
657 
658 /*!
659  @brief Executes the cleanup procedure.
660 
661  @details Call this function after the session ends or an error occurs to restore the <tt>Session</tt> to a usable state.
662  If <tt>@ref CheckConnectionError</tt> has returned <tt>@ref ResultSessionConnectionIsLost</tt>
663  call <tt>@ref LeaveSessionAsync</tt> before calling this function.
664 
665  Call <tt>Startup</tt> again if you want to use your <tt>Session</tt> instance again after you have called the <tt>@ref Cleanup</tt> function.
666 
667  @see Startup
668 */
669  void Cleanup();
670 
671 /*!
672  end of name Finish Initialization
673  @}
674 */
675 
676 /*!
677  @name Session Operations
678  @{
679 */
680 
681 /*!
682  @brief Creates or joins a session using random matchmaking.
683  @details
684  This function cannot be used with local communications.
685  Starts an asynchronous session creation or joining process after finding a random match. The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
686  Use <tt>@ref IsCompletedJoinRandomSession</tt> to check whether the process has completed and <tt>@ref GetJoinRandomSessionResult</tt> to check the result.
687 
688  Multiple search criteria can be specified. The search starts from the first criteria and works its way down the list until it finds a session to join.
689  Up to <tt>@ref inet::SEARCH_CRITERIA_MAX_NUM</tt> search criteria can be specified. If you try to set more criteria than the maximum, <tt>nn::pia::ResultInvalidArgument</tt> is returned.
690  Sessions that are closed or full are automatically excluded from the search.
691  In addition, the last three sessions that the local station joined as a client are remembered by the server and excluded from the search. This record expires after one hour.
692 
693  @param[in] pCreateSessionSetting Specifies the settings to use when creating a session.
694  @param[in] pSearchCriteria Specifies the list of search criteria to use when searching for sessions.
695  @param[in] criteriaNum Specifies the number of criteria to use when searching for sessions.
696 
697  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully.
698 
699  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
700  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. This function is not supported in local communication. Programming error. Fix your program so that this error is not returned.
701  For Internet communication, make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
702  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
703 
704  @see IsCompletedJoinRandomSession, <tt>GetJoinRandomSessionResult</tt>
705 */
706  nn::Result JoinRandomSessionAsync(CreateSessionSetting* pCreateSessionSetting, SessionSearchCriteria* pSearchCriteria, size_t criteriaNum);
707 
708 /*!
709  @brief Checks the completion of <tt>JoinRandomSessionAsync</tt> asynchronous processing.
710  @details This function cannot be used with local communications.
711  This function checks the completion of asynchronous processes started with <tt>@ref JoinRandomSessionAsync</tt>.
712  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
713 
714  @see JoinRandomSessionAsync, <tt>GetJoinRandomSessionResult</tt>
715 */
716  bool IsCompletedJoinRandomSession() const;
717 
718 /*!
719  @brief Gets the result of <tt>JoinRandomSessionAsync</tt> asynchronous process.
720  @details This function cannot be used with local communications.
721  This function gets the results after an asynchronous process started by <tt>@ref JoinRandomSessionAsync</tt> ends.
722 
723  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
724 
725  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
726  @retval nn::pia::ResultInvalidState Returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
727  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
728  @retval nn::pia::ResultGameServerMaintenance Indicates that the game server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
729  @retval nn::pia::ResultNatCheckFailed The NAT check failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
730  @retval nn::pia::ResultDnsFailed DNS resolution failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
731  @retval nn::pia::ResultSessionIsNotFound The target session was lost or closed during the asynchronous process. Perform cleanup.
732  @retval nn::pia::ResultCancelled The asynchronous process was canceled. Perform cleanup.
733  @retval nn::pia::ResultStationConnectionFailed The connection process failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
734  @retval nn::pia::ResultStationConnectionNatTraversalFailedUnknown The NAT traversal connection process failed. The NAT type is unknown. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
735  @retval nn::pia::ResultNatTraversalFailedBothEim The NAT traversal connection process failed. The NAT type was EIM for both the local station and the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
736  @retval nn::pia::ResultNatTraversalFailedLocalEimRemoteEdm The NAT traversal connection process failed. The NAT type was EIM for the local station and EDM for the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
737  @retval nn::pia::ResultNatTraversalFailedLocalEdmRemoteEim The NAT traversal connection process failed. The NAT type was EDM for the local station and EIM for the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
738  @retval nn::pia::ResultNatTraversalFailedBothEdm The NAT traversal connection process failed. The NAT type was EDM for both the local station and the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
739  @retval nn::pia::ResultNatTraversalRequestTimeout The NAT traversal connection process failed. The NAT traversal request timed out. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
740  @retval nn::pia::ResultJoinRequestDenied The session host denied the connection request. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
741  @retval nn::pia::ResultMeshIsFull Failed to join the mesh because it was full. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
742  @retval nn::pia::ResultRelayFailedNoCandidate The relay connection failed because there were no relay route candidates. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
743  @retval nn::pia::ResultRelayFailedRttLimit The relay connection failed because the relay route RTT limit was exceeded. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
744  @retval nn::pia::ResultRelayFailedRelayNumLimit The relay connection failed because the limit on the number of relay route relay requests was exceeded. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
745  @retval nn::pia::ResultRelayFailedUnknown The relay connection failed. (Details unknown.) Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
746  @retval nn::pia::ResultInvalidSystemMessage The process was canceled because an invalid response was received from the session host. Programming error. Fix your program so that this error is not returned.
747  @retval nn::pia::ResultIncompatibleFormat Indicates that the peer is using an incompatible communication format. Returned when you try to communicate with a ROM that uses a different version of Pia that does not have communication compatibility. Programming error. Fix your program so that this error is not returned.
748  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
749  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
750  @retval nn::pia::ResultSessionWrongState The state of the joined session was irregular. Perform cleanup.
751 
752  @see JoinRandomSessionAsync, IsCompletedJoinRandomSession
753 */
754  nn::Result GetJoinRandomSessionResult() const;
755 
756 /*!
757  @brief Cancels <tt>JoinRandomSessionAsync</tt> asynchronous processes.
758 
759  @details This function cancels asynchronous processes started by <tt>JoinRandomSessionAsync</tt>.
760  The cancel process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
761  The library quickly acts to cancel the asynchronous process after this function is called, but check
762  using the <tt>@ref IsCompletedJoinRandomSession()</tt> function that the cancellation has completed.
763 
764  @return Returns the result of canceling <tt>JoinRandomSessionAsync</tt> asynchronous processing. On success, returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
765  @retval ResultInvalidState Returned when no <tt>JoinRandomSessionAsync</tt> asynchronous processing is being performed. Programming error. Fix your program so that this error is not returned.
766 
767  @see JoinRandomSessionAsync, IsCompletedJoinRandomSession, GetJoinRandomSessionResult
768 */
769  nn::Result CancelJoinRandomSessionAsync();
770 
771 /*!
772  @brief Searches for sessions.
773  @details
774 
775  This function starts an asynchronous process that searches for sessions.
776  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
777  Use <tt>@ref IsCompletedBrowseSession</tt> to check whether the process has completed and <tt>@ref GetBrowseSessionResult</tt> to check the result.
778  If the search process succeeds, the list of browsable sessions is updated and can be retrieved by calling <tt>@ref GetBrowsedSessionInfoList</tt>.
779 
780  @param[in] pSearchCriteria Specifies the search criteria to use when searching for sessions.
781 
782  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully.
783 
784  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
785  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
786  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
787 
788  @see IsCompletedBrowseSession, GetBrowseSessionResult, GetBrowsedSessionInfoList
789 */
790  nn::Result BrowseSessionAsync(SessionSearchCriteria* pSearchCriteria);
791 
792 /*!
793  @brief Checks the completion of <tt>BrowseSessionAsync</tt> asynchronous processing.
794  @details This function checks the completion of asynchronous processes started with <tt>@ref BrowseSessionAsync</tt>.
795 
796  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
797 
798  @see BrowseSessionAsync, GetBrowseSessionResult, GetBrowsedSessionInfoList
799 */
800  bool IsCompletedBrowseSession() const;
801 
802 /*!
803  @brief Gets the result of <tt>BrowseSessionAsync</tt> asynchronous processing.
804  @details This function gets the results after an asynchronous process started by <tt>@ref BrowseSessionAsync</tt> ends.
805 
806  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
807 
808  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
809  @retval nn::pia::ResultInvalidState Returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
810  @retval nn::pia::ResultCancelled The asynchronous process that was running was canceled. Perform cleanup.
811  @retval nn::pia::ResultGameServerMaintenance Indicates that the game server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
812  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
813  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
814  @if CTR_DOC
815  @retval nn::pia::ResultErrorOccurred An internal error occurred. This result is only returned during local communication. Perform cleanup.
816  @endif
817 
818  @see BrowseSessionAsync, IsCompletedBrowseSession, GetBrowsedSessionInfoList
819 */
820  nn::Result GetBrowseSessionResult() const;
821 
822 /*!
823  @brief Gets the list of sessions that were found by the <tt>BrowseSessionAsync</tt> asynchronous process.
824  @details This function gets the session list after an asynchronous process started by <tt>@ref BrowseSessionAsync</tt> ends and the result from <tt>@ref GetBrowseSessionResult</tt> indicates success.
825 
826  @return Returns a pointer to the list of sessions that were found.
827 
828  @see BrowseSessionAsync, IsCompletedBrowseSession, GetBrowseSessionResult
829 */
830  session::ISessionInfoList* GetBrowsedSessionInfoList();
831 
832 /*!
833  @brief Creates a session.
834  @details
835 
836  This function starts an asynchronous process that creates a session.
837  The local station becomes the host of the created session.
838  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
839  Use <tt>@ref IsCompletedCreateSession</tt> to check whether the process has completed and <tt>@ref GetCreateSessionResult</tt> to check the result.
840 
841  @param[in] pCreateSessionSetting Specifies the settings to use when creating the session.
842 
843  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
844 
845  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
846  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
847  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
848 
849  @see IsCompletedCreateSession, GetCreateSessionResult
850 */
851  nn::Result CreateSessionAsync(CreateSessionSetting* pCreateSessionSetting);
852 
853 /*!
854  @brief Checks the completion of <tt>CreateSessionAsync</tt> asynchronous processing.
855  @details This function checks the completion of asynchronous processes started with <tt>@ref CreateSessionAsync</tt>.
856 
857  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
858 
859  @see CreateSessionAsync, GetCreateSessionResult
860 */
861  bool IsCompletedCreateSession() const;
862 
863 /*!
864  @brief Gets the result of <tt>CreateSessionAsync</tt> asynchronous processing.
865  @details This function gets the results after an asynchronous process started by <tt>@ref CreateSessionAsync</tt> ends.
866 
867  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
868 
869  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
870  @retval nn::pia::ResultInvalidState Indicates an internal state that prevents the asynchronous process from advancing. This result is also returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
871  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
872  @retval nn::pia::ResultGameServerMaintenance Indicates that the game server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
873  @retval nn::pia::ResultDnsFailed DNS resolution failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
874  @retval nn::pia::ResultNatCheckFailed The NAT check failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
875  @retval nn::pia::ResultCancelled The asynchronous process was canceled. Perform cleanup.
876  @retval nn::pia::ResultTimeOut Timed out. This result is only returned during local communication. Perform cleanup.
877  @retval nn::pia::ResultErrorOccurred An internal error occurred. This result is only returned during local communication. Perform cleanup.
878  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
879  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
880  @retval nn::pia::ResultSessionWrongState The state of the joined session was irregular. Perform cleanup.
881 
882  @see CreateSessionAsync, IsCompletedCreateSession
883 */
884  nn::Result GetCreateSessionResult() const;
885 
886  // Session joining.
887 /*!
888  @brief Joins a session.
889  @details
890 
891  This function starts an asynchronous process that joins a session.
892 
893  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
894  Use <tt>@ref IsCompletedJoinSession</tt> to check whether the process has completed and <tt>@ref GetJoinSessionResult</tt> to check the result.
895 
896  @param pJoinSessionSetting Specifies the settings of the session to join.
897 
898  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
899 
900  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
901  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
902  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
903 
904  @see IsCompletedJoinSession, GetJoinSessionResult
905 */
906  nn::Result JoinSessionAsync(const JoinSessionSetting* pJoinSessionSetting);
907 
908 /*!
909  @brief Checks the completion of <tt>JoinSessionAsync</tt> asynchronous processing.
910  @details This function checks the completion of asynchronous processes started with <tt>@ref JoinSessionAsync</tt>.
911 
912  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
913 
914  @see JoinSessionAsync, GetJoinSessionResult
915 */
916  bool IsCompletedJoinSession() const;
917 
918 /*!
919  @brief Gets the result of <tt>JoinSessionAsync</tt> asynchronous processing.
920  @details This function gets the results after an asynchronous process started by <tt>@ref JoinSessionAsync</tt> ends.
921 
922  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
923 
924  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
925  @retval nn::pia::ResultInvalidState Returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
926  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
927  @retval nn::pia::ResultSessionIsNotFound The target session was lost or closed during the asynchronous process. Perform cleanup.
928  @retval nn::pia::ResultMatchmakeSessionIsFull The matchmaking session is full. Perform cleanup.
929  @retval nn::pia::ResultDeniedByParticipants The local station is blacklisted by a session participant. Perform cleanup.
930  @retval nn::pia::ResultParticipantInBlackList A participant on the local station's blacklist is in the session. Perform cleanup.
931  @retval nn::pia::ResultGameServerMaintenance Indicates that the game server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
932  @retval nn::pia::ResultNatCheckFailed The NAT check failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
933  @retval nn::pia::ResultDnsFailed DNS resolution failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
934  @retval nn::pia::ResultCancelled The asynchronous process was canceled. Perform cleanup.
935  @retval nn::pia::ResultInvalidState Returned when the station is not in a connection-ready state. This result is also returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
936  @retval nn::pia::ResultStationConnectionFailed The connection process failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
937  @retval nn::pia::ResultStationConnectionNatTraversalFailedUnknown The NAT traversal connection process failed. The NAT type is unknown. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
938  @retval nn::pia::ResultNatTraversalFailedBothEim The NAT traversal connection process failed. The NAT type was EIM for both the local station and the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
939  @retval nn::pia::ResultNatTraversalFailedLocalEimRemoteEdm The NAT traversal connection process failed. The NAT type was EIM for the local station and EDM for the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
940  @retval nn::pia::ResultNatTraversalFailedLocalEdmRemoteEim The NAT traversal connection process failed. The NAT type was EDM for the local station and EIM for the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
941  @retval nn::pia::ResultNatTraversalFailedBothEdm The NAT traversal connection process failed. The NAT type was EDM for both the local station and the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
942  @retval nn::pia::ResultNatTraversalRequestTimeout The NAT traversal connection process failed. The NAT traversal request timed out. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors. Perform cleanup.
943  @retval nn::pia::ResultJoinRequestDenied The session host denied the connection request. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
944  @retval nn::pia::ResultMeshIsFull Failed to join the mesh because it was full. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
945  @retval nn::pia::ResultRelayFailedNoCandidate The relay connection failed because there were no relay route candidates. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
946  @retval nn::pia::ResultRelayFailedRttLimit The relay connection failed because the relay route RTT limit was exceeded. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
947  @retval nn::pia::ResultRelayFailedRelayNumLimit The relay connection failed because the limit on the number of relay route relay requests was exceeded. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
948  @retval nn::pia::ResultRelayFailedUnknown The relay connection failed. (Details unknown.) Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
949  @retval nn::pia::ResultInvalidSystemMessage The process was canceled because an invalid response was received from the session host. Programming error. Fix your program so that this error is not returned.
950  @retval nn::pia::ResultSessionUserPasswordUnmatch The user password specified when joining does not match the user password set on the session. Perform cleanup.
951  @retval nn::pia::ResultSessionSystemPasswordUnmatch The system password specified when joining does not match the system password set on the session. Perform cleanup.
952  @retval nn::pia::ResultSessionIsClosed Attempted to join a session that is closed. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
953  @retval nn::pia::ResultHostIsNotFriend Attempted to join a session with a host that is not a friend. Perform cleanup.
954  @retval nn::pia::ResultCompanionStationIsOffline A companion client was not logged in to the game server. Perform cleanup.
955  @retval nn::pia::ResultIncompatibleFormat Indicates that the peer is using an incompatible communication format. Returned when you try to communicate with a ROM that uses a different version of Pia that does not have communication compatibility. Programming error. Fix your program so that this error is not returned.
956  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
957  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
958  @retval nn::pia::ResultSessionWrongState The state of the joined session was irregular. Perform cleanup.
959  @retval nn::pia::ResultTimeOut Timed out.
960  @if CTR_DOC
961  It could also be returned when the passphrase set with <tt>@ref nn::pia::local::UdsJoinSessionSetting</tt> is incorrect.
962  This result is only returned during local communication.
963  @endif Perform cleanup.
964  @retval nn::pia::ResultDifferentVersion Attempted to join a session with a different local network version or application version. This result is only returned during local communication. Perform cleanup.
965  @retval nn::pia::ResultErrorOccurred An internal error occurred. This result is only returned during local communication. Perform cleanup.
966 
967  @see JoinSessionAsync, IsCompletedJoinSession
968 */
969  nn::Result GetJoinSessionResult() const;
970 
971 /*!
972  @brief Cancels <tt>JoinSessionAsync</tt> asynchronous processes.
973 
974  @details This function cancels asynchronous processes started by <tt>JoinSessionAsync</tt>.
975  The cancel process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
976  The library quickly acts to cancel the asynchronous process after this function is called, but check
977  using the <tt>@ref IsCompletedJoinSession()</tt> function that the cancellation has completed.
978 
979  @return Returns the result of canceling <tt>JoinSessionAsync</tt> asynchronous processing. On success, returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
980  @retval ResultInvalidState Returned when no <tt>JoinSessionAsync</tt> asynchronous processing is being performed. Programming error. Fix your program so that this error is not returned.
981 
982  @see JoinSessionAsync, IsCompletedJoinSession, GetJoinSessionResult
983 */
984  nn::Result CancelJoinSessionAsync();
985 
986 /*!
987  @brief Leaves a session.
988  @details
989 
990  This function starts an asynchronous process that leaves a session.
991  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
992  Use <tt>@ref IsCompletedLeaveSession</tt> to check whether the process has completed and <tt>@ref GetLeaveSessionResult</tt> to check the result.
993 
994  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
995 
996  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
997  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
998 
999  @see IsCompletedLeaveSession, GetLeaveSessionResult
1000 */
1001  nn::Result LeaveSessionAsync();
1002 
1003 /*!
1004  @brief Checks the completion of <tt>LeaveSessionAsync</tt> asynchronous processing.
1005  @details This function checks the completion of asynchronous processes started with <tt>@ref LeaveSessionAsync</tt>.
1006 
1007  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1008 
1009  @see LeaveSessionAsync, GetLeaveSessionResult
1010 */
1011  bool IsCompletedLeaveSession() const;
1012 
1013 /*!
1014  @brief Gets the result of <tt>LeaveSessionAsync</tt> asynchronous processing.
1015  @details This function gets the results after an asynchronous process started by <tt>@ref LeaveSessionAsync</tt> ends.
1016 
1017  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1018 
1019  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running and <tt>Startup</tt> has been called. Programming error. Fix your program so that this error is not returned.
1020  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1021  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1022  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1023  @retval nn::pia::ResultErrorOccurred An internal error occurred. This result is only returned during local communication. Perform cleanup.
1024  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
1025 
1026  @see LeaveSessionAsync, IsCompletedLeaveSession
1027 */
1028  nn::Result GetLeaveSessionResult() const;
1029 
1030  // Starting to accept session participants.
1031 /*!
1032  @brief Starts accepting participants in the session.
1033  @details
1034 
1035  This function starts an asynchronous process that accepts participants.
1036  Only the session host can execute this function.
1037  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1038  Use <tt>@ref IsCompletedOpenParticipation</tt> to check whether the process has completed and <tt>@ref GetOpenParticipationResult</tt> to check the result.
1039 
1040  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1041 
1042  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
1043  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1044 
1045  @see IsCompletedOpenParticipation, GetOpenParticipationResult, IsHost
1046 */
1047  nn::Result OpenParticipationAsync();
1048 
1049 /*!
1050  @brief Checks the completion of <tt>OpenParticipationAsync</tt> asynchronous processing.
1051  @details This function checks the completion of asynchronous processes started with <tt>@ref OpenParticipationAsync</tt>.
1052 
1053  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1054 
1055  @see OpenParticipationAsync, GetOpenParticipationResult
1056 */
1057  bool IsCompletedOpenParticipation() const;
1058 
1059 /*!
1060  @brief Gets the result of <tt>OpenParticipationAsync</tt> asynchronous processing.
1061  @details This function gets the results after an asynchronous process started by <tt>@ref OpenParticipationAsync</tt> ends.
1062 
1063  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1064 
1065  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
1066  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1067  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
1068  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1069  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1070  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
1071 
1072  @see OpenParticipationAsync, IsCompletedOpenParticipation
1073 */
1074  nn::Result GetOpenParticipationResult() const;
1075 
1076  // Starting to accept session participants.
1077 /*!
1078  @brief Starts accepting participants in the session.
1079  @details
1080 
1081  This function starts an asynchronous process that accepts participants.
1082  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1083  Use <tt>@ref IsCompletedOpenSession</tt> to check whether the process has completed and <tt>@ref GetOpenSessionResult</tt> to check the result.
1084  All stations participating in the session must call this function.
1085  The asynchronous process ends after it can be verified that all stations that have finished joining the session have called this function.
1086  After asynchronous processes complete, the matchmaking session is in an open state.
1087 
1088  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1089 
1090  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
1091  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1092  @retval nn::pia::ResultSessionInvalidState Indicates that the host has called <tt>CloseSessionAsync</tt>. Programming error. Fix your program so that this error is not returned. For error handling in the release version, perform cleanup after calling <tt>LeaveSessionAsync</tt>.
1093 
1094  @see IsCompletedOpenSession, GetOpenSessionResult, IsHost
1095 */
1096  nn::Result OpenSessionAsync();
1097 
1098 /*!
1099  @brief Checks for completion of the <tt>OpenSessionAsync</tt> asynchronous process.
1100  @details This function checks the completion of asynchronous processes started with <tt>@ref OpenSessionAsync</tt>.
1101 
1102  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1103 
1104  @see OpenSessionAsync, GetOpenSessionResult
1105 */
1106  bool IsCompletedOpenSession() const;
1107 
1108 /*!
1109  @brief Gets the result of the <tt>OpenSessionAsync</tt> asynchronous process.
1110  @details This function gets the results after an asynchronous process started by <tt>@ref OpenSessionAsync</tt> ends.
1111 
1112  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1113 
1114  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
1115  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1116  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. This result also can be returned when the host has created and joined a joint session and passively begun an asynchronous process. Perform cleanup.
1117  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1118  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1119  @retval nn::pia::ResultSessionInvalidState Indicates that the host has called <tt>CloseSessionAsync</tt>. <tt>OpenSessionAsync</tt> was not called by all stations participating in the session within 60 seconds after the function was called. Programming error. Fix your program so that this error is not returned. For error handling in the release version, perform cleanup after calling <tt>LeaveSessionAsync</tt>.
1120  @retval nn::pia::ResultSessionInconsistentState Indicates that the process took longer than expected to complete. If the station is a client, make it check whether the other clients have called <tt>OpenSessionAsync</tt>. Perform cleanup after calling <tt>LeaveSessionAsync</tt>.
1121 
1122  @see OpenSessionAsync, IsCompletedOpenSession
1123 */
1124  nn::Result GetOpenSessionResult() const;
1125 
1126  // Closing a session to new participants.
1127 /*!
1128  @brief Closes a session to new participants.
1129  @details
1130 
1131  This function starts an asynchronous process that closes a session to new participants.
1132  Only the session host can execute this function.
1133  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1134  Use <tt>@ref IsCompletedCloseParticipation</tt> to check whether the process has completed and <tt>@ref GetCloseParticipationResult</tt> to check the result.
1135 
1136  It is possible to imagine a case where some station attempts to join the session immediately before this function is called and ends up joining after the asynchronous process has completed.
1137  For this reason, the asynchronous process ends after waiting for the session to close and for the number of participants in the matchmaking session to match the number of participants in the mesh.
1138  The asynchronous process also ends if the numbers do not match after a certain amount of time (15 seconds). In this case, <tt>@ref GetCloseParticipationResult</tt>
1139  returns <tt>ResultNegligibleFault</tt>. There could be attempts to join after the asynchronous process has ended.
1140  Handle these attempts as appropriate in the application.
1141 
1142 
1143  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1144 
1145  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
1146  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1147 
1148  @see IsCompletedCloseParticipation, GetCloseParticipationResult, IsHost
1149 */
1150  nn::Result CloseParticipationAsync();
1151 
1152 /*!
1153  @brief Checks the completion of <tt>CloseParticipationAsync</tt> asynchronous processing.
1154  @details This function checks the completion of asynchronous processes started with <tt>@ref CloseParticipationAsync</tt>.
1155 
1156  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1157 
1158  @see CloseParticipationAsync, GetCloseParticipationResult
1159 */
1160  bool IsCompletedCloseParticipation() const;
1161 
1162 /*!
1163  @brief Gets the result of <tt>CloseParticipationAsync</tt> asynchronous processing.
1164  @details This function gets the results after an asynchronous process started by <tt>@ref OpenParticipationAsync</tt> ends.
1165 
1166  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1167 
1168  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
1169  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1170  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
1171  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1172  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1173  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
1174  @retval nn::pia::ResultNegligibleFault A certain amount of time passed without the matchmaking sessions and number of participants matching. Handle appropriately in the application.
1175 
1176  @see CloseParticipationAsync, IsCompletedCloseParticipation
1177 */
1178  nn::Result GetCloseParticipationResult() const;
1179 
1180  // Closing a session to new participants.
1181 /*!
1182  @brief Closes a session to new participants.
1183  @details
1184 
1185  This function starts an asynchronous process that closes a session to new participants.
1186  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1187  Use <tt>@ref IsCompletedCloseSession</tt> to check whether the process has completed and <tt>@ref GetCloseSessionResult</tt> to check the result.
1188  All stations participating in the session must call this function.
1189 
1190  After it is confirmed that the numbers of matchmaking session and mesh participants match and that the stations that have completed connection have called this function, asynchronous processes finish.
1191  After it is complete, the matchmaking session enters a closed state. Advance processing under the assumption that after asynchronous processing is complete, the number of new participants will not increase.
1192 
1193  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1194 
1195  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
1196  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1197  @retval nn::pia::ResultSessionInvalidState Indicates that the host has called <tt>OpenSessionAsync</tt>. Programming error. Fix your program so that this error is not returned. For error handling in the release version, perform cleanup after calling <tt>LeaveSessionAsync</tt>.
1198 
1199  @see IsCompletedCloseSession, GetCloseSessionResult, IsHost
1200 */
1201  nn::Result CloseSessionAsync();
1202 
1203 /*!
1204  @brief Checks the completion of <tt>CloseSessionAsync</tt> asynchronous processing.
1205  @details This function checks the completion of asynchronous processes started with <tt>@ref CloseSessionAsync</tt>.
1206 
1207  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1208 
1209  @see CloseSessionAsync, GetCloseSessionResult
1210 */
1211  bool IsCompletedCloseSession() const;
1212 
1213 /*!
1214  @brief Gets the result of <tt>CloseSessionAsync</tt> asynchronous processing.
1215  @details This function gets the results after an asynchronous process started by <tt>@ref CloseSessionAsync</tt> ends.
1216 
1217  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1218 
1219  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
1220  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1221  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. This result also can be returned when the host has created and joined a joint session and passively begun an asynchronous process. Perform cleanup.
1222  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1223  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1224  @retval nn::pia::ResultSessionInvalidState Indicates that the host has called <tt>OpenSessionAsync</tt>. <tt>CloseSessionAsync</tt> was not called by all stations participating in the session within 60 seconds after the function was called. Programming error. Fix your program so that this error is not returned. For error handling in the release version, perform cleanup after calling <tt>LeaveSessionAsync</tt>.
1225  @retval nn::pia::ResultSessionInconsistentState Indicates that the process took longer than expected to complete. If the station is a client, have it check whether the other clients have called <tt>CloseSessionAsync</tt>. Perform cleanup after calling <tt>LeaveSessionAsync</tt>.
1226 
1227  @see CloseSessionAsync, IsCompletedCloseSession
1228 */
1229  nn::Result GetCloseSessionResult() const;
1230 
1231  // Generating a system password for a session
1232 /*!
1233  @brief Generates a system password on the server and sets the password on the session.
1234  @details
1235  This function cannot be used with local communications.
1236  This function asynchronously generates a system password on the server and sets the password on the session.
1237  The configured password is stored in the <tt><var>pSystemPassword</var></tt> parameter after the asynchronous process is complete.
1238  The client is notified by the <tt>Session::EVENT_SET_SESSION_SYSTEM_PASSWORD</tt> event and can get the configured password using <tt>@ref GetSessionSystemPassword</tt>.
1239  Only the session host can execute this function.
1240  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1241  Use <tt>@ref IsCompletedGenerateSystemPassword</tt> to check whether the process has completed and <tt>@ref GetGenerateSystemPasswordResult</tt> to check the result.
1242 
1243  @param[out] pSystemPassword Stores the system password that was set.
1244 
1245  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1246 
1247  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. This function is not supported in local communication. Programming error. Fix your program so that this error is not returned.
1248  For Internet communication, make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that the local station is the host. Programming error. Fix your program so that this error is not returned.
1249  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1250 
1251  @see IsCompletedGenerateSystemPassword, GetGenerateSystemPasswordResult, GetSessionSystemPassword, IsHost
1252 */
1253  nn::Result GenerateSystemPasswordAsync(wchar_t* pSystemPassword);
1254 /*!
1255  @brief Checks the completion of <tt>GenerateSystemPasswordAsync</tt> asynchronous processing.
1256  @details This function cannot be used with local communications.
1257  This function checks the completion of asynchronous processes started with <tt>@ref GenerateSystemPasswordAsync</tt>.
1258 
1259  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1260 
1261  @see GenerateSystemPasswordAsync, GetGenerateSystemPasswordResult
1262 */
1263  bool IsCompletedGenerateSystemPassword() const;
1264 /*!
1265  @brief Gets the result of <tt>GenerateSystemPasswordAsync</tt> asynchronous processing.
1266  @details
1267  This function cannot be used with local communications.
1268  This function gets the results after an asynchronous process started by <tt>@ref GenerateSystemPasswordAsync</tt> ends.
1269 
1270  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1271 
1272  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
1273  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1274  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
1275  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1276  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1277  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
1278 
1279  @see GenerateSystemPasswordAsync, IsCompletedGenerateSystemPassword
1280 */
1281  nn::Result GetGenerateSystemPasswordResult() const;
1282 
1283  //! @cond PRIVATE
1284  void SetSessionSystemPassword(const wchar_t* pSystemPassword, size_t length);
1285  void ResetSessionSystemPassword();
1286  //! @endcond
1287 /*!
1288  @brief Gets the system password that was set on the session with <tt>GenerateSystemPasswordAsync</tt>.
1289  @details
1290 
1291  This function cannot be used with local communications.
1292  Gets the system password that was set on the session with <tt>GenerateSystemPasswordAsync</tt>.
1293  You can get the system password set for the session after <tt>Session::EVENT_SET_SESSION_SYSTEM_PASSWORD</tt>
1294  has been reported to the registered event callback.
1295 
1296  @param[out] pSystemPassword Stores the system password that was set.
1297 
1298  @see GenerateSystemPasswordAsync
1299 */
1300  void GetSessionSystemPassword(wchar_t* pSystemPassword);
1301 
1302 /*!
1303  @brief This function clears the system password that was set on the session.
1304  @details This function cannot be used with local communications.
1305 
1306  This function asynchronously clears the system password that was set on the session.
1307  Clients are notified by the <tt>Session::EVENT_CLEAR_SESSION_SYSTEM_PASSWORD</tt> event.
1308  Only the session host can execute this function.
1309  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1310  Use <tt>@ref IsCompletedClearSystemPassword</tt> to check whether the process has completed and <tt>@ref GetClearSystemPasswordResult</tt> to check the result.
1311 
1312  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1313 
1314  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. This function is not supported in local communication. Programming error. Fix your program so that this error is not returned.
1315  For Internet communication, make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that the local station is the host. Programming error. Fix your program so that this error is not returned.
1316  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1317  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1318 
1319  @see IsCompletedClearSystemPassword, GetClearSystemPasswordResult, IsHost
1320 */
1321  nn::Result ClearSystemPasswordAsync();
1322 /*!
1323  @brief Checks the completion of <tt>ClearSystemPasswordAsync</tt> asynchronous processing.
1324  @details This function cannot be used with local communications.
1325  This function checks the completion of asynchronous processes started with <tt>@ref ClearSystemPasswordAsync</tt>.
1326 
1327  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1328 
1329  @see ClearSystemPasswordAsync, GetClearSystemPasswordResult
1330 */
1331  bool IsCompletedClearSystemPassword() const;
1332 /*!
1333  @brief Gets the result of <tt>ClearSystemPasswordAsync</tt> asynchronous processing.
1334  @details This function cannot be used with local communications.
1335  This function gets the results after an asynchronous process started by <tt>@ref ClearSystemPasswordAsync</tt> ends.
1336 
1337  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1338 
1339  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
1340  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1341  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
1342  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1343  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1344  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
1345 
1346  @see ClearSystemPasswordAsync, IsCompletedClearSystemPassword
1347 */
1348  nn::Result GetClearSystemPasswordResult() const;
1349 
1350 /*!
1351  @brief Updates the specified session search attribute.
1352  @details This function cannot be used with local communications.
1353 
1354  This function asynchronously updates the specified session search attribute.
1355  Only the session host can execute this function.
1356  The <tt><var>attributeIndex</var></tt> parameter can be set to a value between <tt>0</tt> and <tt>@ref nn::pia::inet::ATTRIBUTE_MAX_SIZE</tt> - <tt>1</tt>.
1357  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1358  Use <tt>@ref IsCompletedModifyAttribute</tt> to check whether the process has completed and <tt>@ref GetModifyAttributeResult</tt> to check the result.
1359 
1360  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1361 
1362  @retval nn::pia::ResultInvalidArgument The value specified in <tt><var>attributeIndex</var></tt> is outside the allowed range. Programming error. Fix your program so that this error is not returned.
1363  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. This function is not supported in local communication. Programming error. Fix your program so that this error is not returned.
1364  For Internet communication, make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that the local station is the host. Programming error. Fix your program so that this error is not returned.
1365  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1366 
1367  @see IsCompletedModifyAttribute, GetModifyAttributeResult, IsHost
1368 */
1369  nn::Result ModifyAttributeAsync(u32 attributeIndex, u32 newValue);
1370 /*!
1371  @brief Checks the completion of <tt>ModifyAttributeAsync</tt> asynchronous processing.
1372  @details This function cannot be used with local communications.
1373  This function checks the completion of asynchronous processes started with <tt>@ref ModifyAttributeAsync</tt>.
1374 
1375  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1376 
1377  @see ModifyAttributeAsync, GetModifyAttributeResult
1378 */
1379  bool IsCompletedModifyAttribute() const;
1380 /*!
1381  @brief Gets the result of <tt>ModifyAttributeAsync</tt> asynchronous processing.
1382  @details This function cannot be used with local communications.
1383  This function gets the results after an asynchronous process started by <tt>@ref ModifyAttributeAsync</tt> ends.
1384 
1385  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1386 
1387  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
1388  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1389  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
1390  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1391  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1392  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
1393 
1394  @see ModifyAttributeAsync, IsCompletedModifyAttribute
1395 */
1396  nn::Result GetModifyAttributeResult() const;
1397 
1398  /*!
1399  @brief Updates the specified session settings.
1400  @details This function cannot be used with local communications.
1401  This function asynchronously updates the specified session settings.
1402  Only the session host can execute this function.
1403  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1404  Use <tt>@ref IsCompletedUpdateSessionSetting</tt> to check whether the process has completed and <tt>@ref GetUpdateSessionSettingResult</tt> to check the result.
1405 
1406  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1407 
1408  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. This function is not supported in local communication. Programming error. Fix your program so that this error is not returned.
1409  For Internet communication, make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that the local station is the host. Programming error. Fix your program so that this error is not returned.
1410  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1411 
1412  @param[in] pUpdateSessionSetting Pointer to the <tt>UpdateSessionSetting</tt> derived class for gathering the settings to change.
1413 
1414  @see UpdateSessionSetting, IsCompletedUpdateSessionSetting, GetUpdateSessionSettingResult, IsHost
1415 */
1416  nn::Result UpdateSessionSettingAsync(UpdateSessionSetting* pUpdateSessionSetting);
1417 /*!
1418  @brief Checks the completion of <tt>UpdateSessionSettingAsync</tt> asynchronous processing.
1419  @details This function cannot be used with local communications.
1420  This function checks the completion of asynchronous processes started with <tt>@ref UpdateSessionSettingAsync</tt>.
1421 
1422  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1423 
1424  @see UpdateSessionSettingAsync, GetUpdateSessionSettingResult
1425 */
1426  bool IsCompletedUpdateSessionSetting() const;
1427 /*!
1428  @brief Gets the result of <tt>UpdateSessionSettingAsync</tt> asynchronous processing.
1429  @details This function cannot be used with local communications.
1430  This function gets the results after an asynchronous process started by <tt>@ref UpdateSessionSettingAsync</tt> ends.
1431 
1432  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1433 
1434  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
1435  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1436  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1437  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1438  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
1439 
1440  @see UpdateSessionSettingAsync, IsCompletedUpdateSessionSetting
1441 */
1442  nn::Result GetUpdateSessionSettingResult() const;
1443 
1444 /*!
1445  @brief Updates application-defined data.
1446  @details
1447 
1448  Asynchronously updates application-defined data (the data set in beacons during local communication).
1449  Only the session host can execute this function.
1450  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1451  Use <tt>@ref IsCompletedUpdateApplicationData</tt> to check whether the process has completed and <tt>@ref GetUpdateApplicationDataResult</tt> to check the result.
1452 
1453  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1454 
1455  @retval nn::pia::ResultInvalidArgument Either the specified <tt><var>pApplicationData</var></tt> is <tt>Null</tt> or the <tt><var>dataSize</var></tt> has exceeded the value that can be set. Programming error. Fix your program so that this error is not returned.
1456  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that the local station is the host. Programming error. Fix your program so that this error is not returned.
1457  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1458 
1459  @param[in] pApplicationData The application-defined data to update.
1460  @param[in] dataSize The size of the specified application-defined data.
1461 
1462  @see IsCompletedUpdateApplicationData, GetUpdateApplicationDataResult, IsHost
1463 */
1464  nn::Result UpdateApplicationDataAsync(const void* pApplicationData, size_t dataSize);
1465 /*!
1466  @brief Checks the completion of <tt>UpdateApplicationDataAsync</tt> asynchronous processing.
1467  @details This function checks the completion of asynchronous processes started with <tt>@ref UpdateApplicationDataAsync</tt>.
1468 
1469  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1470 
1471  @see UpdateApplicationDataAsync, GetUpdateApplicationDataResult
1472 */
1473  bool IsCompletedUpdateApplicationData() const;
1474 /*!
1475  @brief Gets the result of <tt>UpdateApplicationDataAsync</tt> asynchronous processing.
1476  @details This function gets the results after an asynchronous process started by <tt>@ref UpdateApplicationDataAsync</tt> ends.
1477 
1478  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1479 
1480  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
1481  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1482  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
1483  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
1484  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1485  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
1486  @retval nn::pia::ResultGameServerMaintenance Indicates that the server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
1487 
1488  @see UpdateApplicationDataAsync, IsCompletedUpdateApplicationData
1489 */
1490  nn::Result GetUpdateApplicationDataResult() const;
1491 
1492 /*!
1493  @brief Updates the matchmaking priority when a session with the same requirements is found.
1494  @details This function cannot be used with local communications.
1495  If the value is being updated multiple times during the session with something other than <tt>0</tt> or
1496  <tt>nn::pia::inet::SESSION_MAX_SELECTION_PRIORITY</tt>, you must wait 30 seconds between calls.
1497  Use <tt>nn::pia::session::Session::IsUpdatableSelectionPriority</tt> to check whether an update can be made.
1498  When searches are performed using <tt>nn::pia::inet::SELECTION_METHOD_BROADEN_RANGE_WITH_SELECTION_PRIORITY</tt>, matchmaking opportunities are prioritized according to the greatest matchmaking priority value.
1499  When searches are performed using <tt>nn::pia::inet::SELECTION_METHOD_SCORE_BASED</tt>, the set score calculation is used.
1500  You can check the settings by checking the progress values in the NMAS matchmaking session list.
1501 
1502  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1503 
1504  @retval nn::pia::ResultInvalidArgument The specified argument exceeds the maximum allowed value. Programming error. Fix your program so that this error is not returned.
1505  @retval nn::pia::ResultInvalidState Cannot execute because either the LAN matching feature is being used or the station is not the host. Programming error. Fix your program so that this error is not returned.
1506  @retval nn::pia::ResultTemporaryUnavailable Called within 30 seconds of the previous call with values other than <tt>0</tt> or <tt>SESSION_MAX_SELECTION_PRIORITY</tt>. Use <tt>@ref nn::pia::session::Session::IsUpdatableSelectionPriority</tt> to confirm whether an update is possible before calling.
1507  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1508 
1509  @param[in] priority The progress in the game.
1510 
1511  @see IsUpdatableSelectionPriority
1512 */
1513  nn::Result UpdateSelectionPriority(u8 priority) const;
1514 /*!
1515  @brief Returns whether <tt>UpdateSelectionPriority</tt> can be used for the value being updated.
1516 
1517  @param[in] priority The progress in the game to be updated.
1518 */
1519  bool IsUpdatableSelectionPriority(u8 priority) const;
1520 
1521  /// @cond PRIVATE
1522  MeshLayerController* GetMeshLayerControllerPtr()
1523  {
1524  return m_pMeshLayerController;
1525  }
1526  /// @endcond
1527 
1528 /*!
1529  end of name Session Operations
1530  @}
1531 */
1532 
1533 
1534 /*!
1535  @name Analyzing Session Information
1536  @{
1537 */
1538 
1539 /*!
1540  @brief Gets whether the local station is the session host.
1541 
1542  @details This function returns whether the local station is the host of a standard session.
1543 
1544  @return Returns <tt>true</tt> if the local station is the host, or <tt>false</tt> otherwise.
1545 */
1546  bool IsHost() const;
1547 
1548 /*!
1549  @cond PRIVATE
1550  @brief Gets whether the local station is the mesh host.
1551 
1552  @details This function returns whether the local station is the host of the mesh.
1553 
1554  @return Returns <tt>true</tt> if the local station is the host, or <tt>false</tt> otherwise.
1555 */
1556  bool IsMeshHost() const;
1557  /// @endcond
1558 
1559 /*!
1560  @cond PRIVATE
1561  @brief Gets whether the local station is the session owner.
1562 
1563  @return Returns <tt>true</tt> if the local station is the session owner, or <tt>false</tt> otherwise.
1564 */
1565  bool IsOwner() const;
1566  /// @endcond
1567 
1568  /// @cond PRIVATE
1569 /*!
1570  @brief Gets the <tt>StationIndex</tt> of the local station.
1571 
1572  @details This function returns <tt>STATION_INDEX_INVALID</tt> if the local station's <tt>StationIndex</tt> has not been established.
1573 
1574  @return Returns the <tt>StationIndex</tt> representing the local station.
1575 */
1576  nn::pia::StationIndex GetLocalStationIndex() const;
1577 
1578 /*!
1579  @brief Gets the <tt>StationIndex</tt> of the host.
1580 
1581  @details This function returns <tt>STATION_INDEX_INVALID</tt> if the local station is not a participant in a session.
1582  When participating in a session or a joint session, this function returns a <tt>StationIndex</tt> that specifies the session host.
1583 
1584  @return Returns the <tt>StationIndex</tt> that represents the host of the session where the local station is a participant.
1585 */
1586  nn::pia::StationIndex GetHostStationIndex() const;
1587  /// @endcond
1588 
1589 /*!
1590  @brief Checks whether an arbitrary <tt>StationId</tt> within the session is currently valid.
1591 
1592  @param[in] id Specifies the <tt>StationId</tt> being checked.
1593 
1594  @return Returns <tt>true</tt> if the specified <tt>StationId</tt> is valid, or <tt>false</tt> otherwise.
1595 */
1596  bool CheckStationIdIsValid(nn::pia::StationId id) const;
1597 
1598  /// @cond PRIVATE
1599  bool CheckStationIndexIsValid(nn::pia::StationIndex index) const;
1600  /// @endcond
1601 
1602 
1603 /*!
1604  @brief Gets the <tt>StationId</tt> that represents the local station in the session.
1605 
1606  @details This function returns <tt>STATION_ID_INVALID</tt> if the local station is not a participant in a session.
1607 
1608  @return Returns the <tt>StationId</tt> that specifies the local device.
1609 */
1611  {
1612  return m_LocalStationId;
1613  }
1614 
1615 /*!
1616  @brief Gets the <tt>StationId</tt> that represents the host of the session where the local station is a participant.
1617 
1618  @details This function returns <tt>STATION_ID_INVALID</tt> if the local station is not a participant in a session.
1619  When participating in a session or a joint session, this function returns a <tt>StationId</tt> that specifies the session host.
1620 
1621  @return Returns the <tt>StationId</tt> that represents the host of the session where the local station is a participant.
1622 */
1624  {
1625  return m_HostStationId;
1626  }
1627 
1628 /*!
1629  @brief Gets the <tt>StationConnectionInfo</tt> that specifies the local device.
1630 
1631  @details When participating in a session or a joint session, this function returns a <tt>StationConnectionInfo</tt> that represents the station itself.
1632 
1633  @param[out] pInfoOut Specifies a pointer to the object that holds the address obtained for the session host.
1634  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if execution succeeds. You must make sure that the implementation of this function in your application does not return any errors.
1635  @retval ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
1636  @retval ResultInvalidState Indicates not participating in a session. Programming error. Fix your program so that this error is not returned.
1637  @retval ResultTemporaryUnavailable Session transition in progress. Handle appropriately in the application.
1638 
1639  @return Returns the <tt>StationConnectionInfo</tt> that specifies the local device.
1640 */
1641  nn::Result GetLocalStationConnectionInfo(transport::StationConnectionInfo* pInfoOut);
1642 
1643 /*!
1644  @brief Gets the <tt>StationConnectionInfo</tt> that represents the host of the session where the local station is a participant.
1645 
1646  @details When participating in a session or a joint session, this function returns a <tt>StationConnectionInfo</tt> that specifies the session host.
1647 
1648  @param[out] pInfoOut Specifies a pointer to the object that holds the address obtained for the session host.
1649  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if execution succeeds. You must make sure that the implementation of this function in your application does not return any errors.
1650  @retval ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
1651  @retval ResultInvalidState Indicates not participating in a session. Programming error. Fix your program so that this error is not returned.
1652  @retval ResultTemporaryUnavailable Session transition in progress. Handle appropriately in the application.
1653 
1654  @return Returns the <tt>StationConnectionInfo</tt> that represents the host of the session where the local station is a participant.
1655 */
1656  nn::Result GetHostStationConnectionInfo(transport::StationConnectionInfo* pInfoOut);
1657 
1658 /*!
1659  @brief Gets the number of valid stations connected to the current session.
1660 
1661  @return Returns the number of connected stations.
1662 */
1663  u16 GetStationNum() const;
1664 
1665 /*!
1666  @brief Gets the number of stations currently participating in the matchmaking session.
1667 
1668  @details When <tt>@ref GetStatus</tt> returns <tt>STATUS_CONNECTED_SESSION</tt>, this function returns the number of stations participating in the matchmaking session.
1669  When <tt>@ref GetStatus</tt> returns <tt>STATUS_MIGRATING_SESSION</tt>, this function returns an undefined value, so do not call it in such cases.
1670  When <tt>@ref GetStatus</tt> returns <tt>STATUS_CONNECTED_JOINT_SESSION</tt>, this function returns the number of stations participating in the joint matchmaking session.
1671 
1672  @return Returns the number of stations participating in the matchmaking session.
1673 */
1674  u16 GetMatchmakeSessionParticipantNum() const;
1675 
1676 /*!
1677  @brief Gets the number of valid <tt>StationId</tt> instances in the session.
1678 
1679  @details This function returns <tt>0</tt> if the local station is not a participant in a session.
1680 
1681  @return Returns the number of valid <tt>StationId</tt> instances in the session.
1682 */
1683  u16 GetValidStationIdNum() const;
1684 
1685 
1686 /*!
1687  @brief Checks whether communication is possible with the session.
1688 
1689  @details The <tt>Result</tt> object returned by this function changes if there are any irregularities in the session or the connection.
1690  Periodically call this function to check the status.
1691 
1692  @details If communication is possible, the detailed status can be retrieved using <tt>@ref GetStatus</tt>.
1693 
1694  @details If communication with the mesh becomes impossible after joining the session, the detailed reason can be checked by calling <tt>@ref GetSessionDisconnectReason</tt>.
1695 
1696  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if communication is possible. Otherwise, one of the following <tt>Result</tt> values is returned.
1697  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
1698  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1699 */
1700  nn::Result CheckConnectionError() const;
1701 
1702 
1703 /*!
1704  @brief Gets a <tt>@ref Status</tt> object that specifies the status of the session.
1705 
1706  @details The <tt>@ref Status</tt> object returned by this function changes if there are any irregularities in the session or the connection.
1707  Periodically call this function to check the status.
1708 
1709  @return Returns the current <tt>@ref Status</tt>.
1710 */
1711  Status GetStatus() const;
1712 
1713 /*!
1714  @brief Determines whether the bitrate value may be found using the bitrate detection feature.
1715 
1716  @return Returns <tt>true</tt> if the bitrate value can be obtained. <tt>true</tt> is also returned when detection fails on a timeout, or cancel.
1717 */
1718  bool IsCompleteBitRateCheck();
1719 
1720 /*!
1721  @brief Gets the uplink bitrate of the connection measured by the bitrate detection feature.
1722 
1723  @details Note that the value returned by this function is simply a measurement of the amount of data received over a set
1724  amount of time and does not necessarily represent the actual bandwidth of the connection.
1725  Even if the connection is capable of a high bitrate, if an application has
1726  low requirements, the amount of data sent and received during the measurement
1727  process is also small, which results in a lower bits-per-second value.
1728 
1729  @param[out] pBps Stores the measured bitrate. The value is in bits per second. A negative value is set if the bitrate could not be measured.
1730 
1731  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if the call succeeds.
1732 
1733  @retval ResultNotInitialized Indicates that the instance has not been initialized. Programming error. Fix your program so that this error is not returned.
1734  @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
1735  @retval ResultInvalidState Indicates that the function was called at the wrong time. It is possible that the function was called while the bitrate detection feature was disabled. Programming error. Fix your program so that this error is not returned.
1736 */
1737  nn::Result GetUplinkBitRate(s32* pBps);
1738 
1739  /// @cond PRIVATE
1740 /*!
1741  @brief Gets a <tt>MatchmakeStatus</tt> object that specifies the matchmaking status of the session.
1742 
1743  @return Returns the current <tt>MatchmakeStatus</tt>.
1744 */
1745  MatchmakeStatus GetMatchmakeStatus() const
1746  {
1747  return m_MatchmakeStatus;
1748  }
1749  /// @endcond
1750 
1751  /// @cond PRIVATE
1752 /*!
1753  @brief Gets a <tt>ConnectionStatus</tt> object that specifies the status of the connection.
1754 
1755  @return Returns the current <tt>ConnectionStatus</tt>.
1756 */
1757  ConnectionStatus GetConnectionStatus() const
1758  {
1759  return m_ConnectionStatus;
1760  }
1761  /// @endcond
1762 
1763  /// @cond PRIVATE
1764  // private
1765  StationIdStatusTable* GetStationIdStatusTablePtr()
1766  {
1767  return m_pStationIdStatusTable;
1768  }
1769 
1770  // private
1771  SessionProtocol* GetSessionProtocolPtr()
1772  {
1773  return m_pSessionProtocol;
1774  }
1775  /// @endcond
1776 
1777 /*!
1778  @brief Gets the session ID.
1779 
1780  @return Returns the session ID of the currently joined session. Returns <tt>INVALID_SESSION_ID</tt> if not a participant in a session.
1781 */
1782  u32 GetSessionId() const
1783  {
1784  return GetCurrentSessionId();
1785  }
1786 
1787 /*!
1788  @brief Gets the session ID for the session in which the station with the specified station ID is participating.
1789  @details This function cannot be used with local communications.
1790  Gets the session ID for the session in which the station with the specified station ID is participating.
1791 
1792  @param[in] id The station ID.
1793 
1794  @return Returns the session ID for the session in which the station with the specified station ID is participating. Returns <tt>INVALID_SESSION_ID</tt> if that station is not a participant in a session.
1795 */
1796  u32 GetSessionId(StationId id) const;
1797 
1798  /// @cond PRIVATE
1799  // <tt>SessionId</tt> Getting and Setting
1800  void SetSessionId(u32 sessionId)
1801  {
1802  SetCurrentSessionId(sessionId);
1803  }
1804 
1805  void SetPrincipalId(u32 principalId)
1806  {
1807  m_PrincipalId = principalId;
1808  }
1809  u32 GetPrincipalId() const
1810  {
1811  return m_PrincipalId;
1812  }
1813  /// @endcond
1814 
1815 /*!
1816  @brief Gets an iterator for the valid <tt>StationId</tt> objects in the session (non-<tt>const</tt> version).
1817 
1818  @return Returns an iterator that points to the start of a list of <tt>StationId</tt> objects that are valid at the time the function is called.
1819  @see End
1820 */
1822  {
1823  return StationIdIterator(m_ValidStationIdList.Begin());
1824  }
1825 
1826 /*!
1827  @brief Gets an iterator for the valid <tt>StationId</tt> objects in the session (non-<tt>const</tt> version).
1828 
1829  @return Returns an iterator that points to the position after the last element in a list of <tt>StationId</tt> objects that are valid at the time the function is called.
1830  @see Begin
1831 */
1833  {
1834  return StationIdIterator(m_ValidStationIdList.End());
1835  }
1836 
1837 /*!
1838  @brief Gets an iterator for the valid <tt>StationId</tt> objects in the session (non-<tt>const</tt> version).
1839 
1840  @return Returns an iterator that points to the start of a list of <tt>StationId</tt> objects that are valid at the time the function is called.
1841  @see End
1842 */
1844  {
1845  return StationIdConstIterator(m_ValidStationIdList.ConstBegin());
1846  }
1847 
1848 /*!
1849  @brief Gets an iterator for the valid <tt>StationId</tt> objects in the session (non-<tt>const</tt> version).
1850 
1851  @return Returns an iterator that points to the position after the last element in a list of <tt>StationId</tt> objects that are valid at the time the function is called.
1852  @see Begin
1853 */
1855  {
1856  return StationIdConstIterator(m_ValidStationIdList.ConstEnd());
1857  }
1858 
1859 /*! @cond PRIVATE */
1860  /// Whether StationIdTable is being used.
1861  bool IsUsingStationIdTable() const;
1862 /*! @endcond */
1863 
1864 /*!
1865  end of name Analyzing Session Information
1866  @}
1867 */
1868 
1869 /*!
1870  @name Joint Session Feature
1871  @{
1872 */
1873 
1874 /*!
1875  @brief Joins a joint session by using random matchmaking.
1876  @details This function cannot be used with local communications.
1877  This function can only be used by the host.
1878  Starts the asynchronous process that handles joining a joint session through random matchmaking.
1879  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1880  Use <tt>@ref IsCompletedJoinRandomJointSession</tt> to check whether the process has completed and <tt>@ref GetJoinRandomJointSessionResult</tt> to check the result.
1881 
1882  When the host starts an asynchronous process using this function, the process that handles joining a joint session through random matchmaking starts automatically on the client.
1883  To track the progress of the automatically started processes, either handle the state change event or call <tt>@ref GetStatus</tt> and check the <tt>@ref Status</tt> object that is returned.
1884 
1885  Some API functions, such as those related to sending and receiving, are temporarily unavailable during the asynchronous process.
1886 
1887  @param[in] pCreateSessionSetting Specifies a pointer to the <tt>CreateSessionSetting</tt> object that specifies the settings for the new session to create.
1888  @param[in] pSearchCriterias Specifies a pointer to the beginning of the array of criteria to use when searching for a session.
1889  @param[in] criteriaNum Specifies the number of elements in the criteria array to use when searching for a session.
1890 
1891  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1892 
1893  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
1894  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running and that the local station is the host. Programming error. Fix your program so that this error is not returned.
1895 
1896  @see IsCompletedJoinRandomJointSession, GetJoinRandomJointSessionResult
1897 */
1898  nn::Result JoinRandomJointSessionAsync(
1899  CreateSessionSetting* pCreateSessionSetting,
1900  SessionSearchCriteria* pSearchCriterias,
1901  size_t criteriaNum);
1902 
1903 /*!
1904  @brief Checks the completion of <tt>JoinRandomJointSessionAsync</tt> asynchronous processing.
1905  @details This function cannot be used with local communications.
1906  This function checks the completion of asynchronous processes started with <tt>@ref JoinRandomJointSessionAsync</tt>.
1907 
1908  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1909 
1910  @see JoinRandomJointSessionAsync, GetJoinRandomJointSessionResult
1911 */
1912  bool IsCompletedJoinRandomJointSession() const;
1913 
1914 /*!
1915  @brief Gets the result of <tt>JoinRandomJointSessionAsync</tt> asynchronous process.
1916  @details This function cannot be used with local communications.
1917  This function gets the results after an asynchronous process started by <tt>@ref JoinRandomJointSessionAsync</tt> ends.
1918 
1919  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if the asynchronous process succeeds. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1920 
1921  @retval nn::pia::ResultInvalidState Indicates that the local station is not in a joint session-ready state. This result is also returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
1922  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
1923  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
1924  @retval nn::pia::ResultSessionIsNotFound The target session was lost or closed during the asynchronous process. Perform cleanup.
1925  @retval nn::pia::ResultMatchmakeSessionIsFull The target matchmaking session is full. Perform cleanup.
1926  @retval nn::pia::ResultDeniedByParticipants The local station is blacklisted by a session participant. Perform cleanup.
1927  @retval nn::pia::ResultParticipantInBlackList A participant on the local station's blacklist is in the session. Perform cleanup.
1928  @retval nn::pia::ResultSessionUserPasswordUnmatch The user password specified when joining does not match the user password set on the session. Perform cleanup.
1929  @retval nn::pia::ResultSessionSystemPasswordUnmatch The system password specified when joining does not match the system password set on the session. Perform cleanup.
1930  @retval nn::pia::ResultSessionIsClosed Attempted to join a session that is closed. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
1931  @retval nn::pia::ResultHostIsNotFriend Attempted to join a session with a host that is not a friend. Perform cleanup.
1932  @retval nn::pia::ResultGameServerMaintenance Indicates that the game server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
1933  @retval nn::pia::ResultCompanionStationIsOffline A companion client was not logged in to the game server. Perform cleanup.
1934  @retval nn::pia::ResultCompanionStationIsLeft Lost the connection with the companion station. Perform cleanup.
1935  @retval nn::pia::ResultCompanionStationDenied The companion station was not in a joint session-ready state and denied the connection. Perform cleanup.
1936  @retval nn::pia::ResultSessionMigrationFailed Failed to migrate the session. Perform cleanup.
1937  @retval nn::pia::ResultStationConnectionFailed The connection process failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
1938  @retval nn::pia::ResultStationConnectionNatTraversalFailedUnknown The NAT traversal connection process failed. The NAT type is unknown. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
1939  @retval nn::pia::ResultNatTraversalFailedBothEim The NAT traversal connection process failed. The NAT type was EIM for both the local station and the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
1940  @retval nn::pia::ResultNatTraversalFailedLocalEimRemoteEdm The NAT traversal connection process failed. The NAT type was EIM for the local station and EDM for the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
1941  @retval nn::pia::ResultNatTraversalFailedLocalEdmRemoteEim The NAT traversal connection process failed. The NAT type was EDM for the local station and EIM for the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
1942  @retval nn::pia::ResultNatTraversalFailedBothEdm The NAT traversal connection process failed. The NAT type was EDM for both the local station and the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
1943  @retval nn::pia::ResultNatTraversalRequestTimeout The NAT traversal connection process failed. The NAT traversal request timed out. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
1944  @retval nn::pia::ResultJoinRequestDenied The mesh host denied the connection request. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
1945  @retval nn::pia::ResultMeshIsFull Failed to join the mesh because it was full. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
1946  @retval nn::pia::ResultRelayFailedNoCandidate The relay connection failed because there were no relay route candidates. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
1947  @retval nn::pia::ResultRelayFailedRttLimit The relay connection failed because the relay route RTT limit was exceeded. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
1948  @retval nn::pia::ResultRelayFailedRelayNumLimit The relay connection failed because the limit on the number of relay route relay requests was exceeded. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
1949  @retval nn::pia::ResultRelayFailedUnknown The relay connection failed. (Details unknown.) Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
1950  @retval nn::pia::ResultInvalidSystemMessage The process was canceled because an invalid response was received from the mesh host. Programming error. Fix your program so that this error is not returned.
1951  @retval nn::pia::ResultIncompatibleFormat Indicates that the peer is using an incompatible communication format. Returned when you try to communicate with a ROM that uses a different version of Pia that does not have communication compatibility. Programming error. Fix your program so that this error is not returned.
1952  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
1953  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
1954  @retval nn::pia::ResultSessionWrongState The state of the joined session was irregular. Perform cleanup.
1955 
1956  @see JoinRandomJointSessionAsync, IsCompletedJoinRandomJointSession
1957 */
1958  nn::Result GetJoinRandomJointSessionResult() const;
1959 
1960  //! @cond PRIVATE
1961 /*!
1962  @brief Creates a joint session.
1963  @details This function cannot be used with local communications.
1964  This function can only be used by the host.
1965  It starts an asynchronous process that creates a joint session.
1966  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
1967  Use <tt>@ref IsCompletedCreateJointSession</tt> to check whether the process has completed and <tt>@ref GetCreateJointSessionResult</tt> to check the result.
1968 
1969  When the host starts the asynchronous process using this function, the interal process for creating the joint session starts automatically on the client.
1970  To track the progress of the automatically started processes, either handle the state change event or call <tt>@ref GetStatus</tt> and check the <tt>@ref Status</tt> object that is returned.
1971 
1972  Some API functions, such as those related to sending and receiving, are temporarily unavailable during the asynchronous process.
1973 
1974  @param[in] pCreateSessionSetting Specifies a pointer to the <tt>CreateSessionSetting</tt> object that specifies the settings for the new session to create.
1975 
1976  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
1977 
1978  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
1979  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running and that the local station is the host. Programming error. Fix your program so that this error is not returned.
1980 
1981  @see IsCompletedCreateJointSession, GetCreateJointSessionResult
1982 */
1983  nn::Result CreateJointSessionAsync(CreateSessionSetting* pCreateSessionSetting);
1984 
1985 /*!
1986  @brief Checks for completion of the <tt>CreateJointSessionAsync</tt> asynchronous process.
1987  @details This function cannot be used with local communications.
1988  This function checks the completion of asynchronous processes started with <tt>@ref CreateJointSessionAsync</tt>.
1989 
1990  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
1991 
1992  @see CreateJointSessionAsync, GetCreateJointSessionResult
1993 */
1994  bool IsCompletedCreateJointSession() const;
1995 
1996 /*!
1997  @brief Gets the result of the <tt>CreateJointSessionAsync</tt> asynchronous process.
1998  @details This function cannot be used with local communications.
1999  This function gets the results after an asynchronous process started by <tt>@ref CreateJointSessionAsync</tt> ends.
2000 
2001  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if the asynchronous process succeeds. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2002 
2003  @retval nn::pia::ResultInvalidState Indicates that the local station is not in a joint session-ready state. This result is also returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
2004  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
2005  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2006  @retval nn::pia::ResultGameServerMaintenance Indicates that the game server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
2007  @retval nn::pia::ResultCompanionStationIsOffline A companion client was not logged in to the game server. Perform cleanup.
2008  @retval nn::pia::ResultCompanionStationIsLeft Lost the connection with the companion station. Perform cleanup.
2009  @retval nn::pia::ResultCompanionStationDenied The companion station was not in a joint session-ready state and denied the connection. Perform cleanup.
2010  @retval nn::pia::ResultSessionMigrationFailed Failed to migrate the session. Perform cleanup.
2011  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2012  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
2013  @retval nn::pia::ResultSessionWrongState The created session is in an irregular state. Perform cleanup.
2014 
2015  @see CreateJointSessionAsync, IsCompletedCreateJointSession
2016 */
2017  nn::Result GetCreateJointSessionResult() const;
2018 
2019 /*!
2020  @brief Joins the specified joint session.
2021  @details This function cannot be used with local communications.
2022  This function can only be used by the host.
2023  Starts the asynchronous process to join the specified joint session.
2024  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2025  Use <tt>@ref IsCompletedJoinJointSession</tt> to check whether the process has completed and <tt>@ref GetJoinJointSessionResult</tt> to check the result.
2026 
2027  When the host starts an asynchronous process using this function, the process that handles joining a joint session through random matchmaking starts automatically on the client.
2028  To track the progress of the automatically started processes, either handle the state change event or call <tt>@ref GetStatus</tt> and check the <tt>@ref Status</tt> object that is returned.
2029 
2030  Some API functions, such as those related to sending and receiving, are temporarily unavailable during the asynchronous process.
2031 
2032  @param pJoinSessionSetting Specifies the settings of the session to join.
2033 
2034  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2035 
2036  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
2037  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running and that the local station is the host. Programming error. Fix your program so that this error is not returned.
2038 
2039  @see IsCompletedJoinJointSession, GetJoinJointSessionResult
2040 */
2041  nn::Result JoinJointSessionAsync(JoinSessionSetting* pJoinSessionSetting);
2042 
2043 /*!
2044  @brief Checks for completion of the <tt>JoinJointSessionAsync</tt> asynchronous process.
2045  @details This function cannot be used with local communications.
2046  This function checks the completion of asynchronous processes started with <tt>@ref JoinJointSessionAsync</tt>.
2047 
2048  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2049 
2050  @see JoinJointSessionAsync, GetJoinJointSessionResult
2051 */
2052  bool IsCompletedJoinJointSession() const;
2053 
2054 /*!
2055  @brief Gets the result of the <tt>JoinJointSessionAsync</tt> asynchronous process.
2056  @details This function cannot be used with local communications.
2057  This function gets the results after an asynchronous process started by <tt>@ref JoinJointSessionAsync</tt> ends.
2058 
2059  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if the asynchronous process succeeds. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2060 
2061  @retval nn::pia::ResultInvalidState Indicates that the local station is not in a joint session-ready state. This result is also returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
2062  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
2063  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2064  @retval nn::pia::ResultSessionIsNotFound The target session was lost or closed during the asynchronous process. Perform cleanup.
2065  @retval nn::pia::ResultMatchmakeSessionIsFull The target matchmaking session is full. Perform cleanup.
2066  @retval nn::pia::ResultDeniedByParticipants The local station is blacklisted by a session participant. Perform cleanup.
2067  @retval nn::pia::ResultParticipantInBlackList A participant on the local station's blacklist is in the session. Perform cleanup.
2068  @retval nn::pia::ResultSessionUserPasswordUnmatch The user password specified when joining does not match the user password set on the session. Perform cleanup.
2069  @retval nn::pia::ResultSessionSystemPasswordUnmatch The system password specified when joining does not match the system password set on the session. Perform cleanup.
2070  @retval nn::pia::ResultSessionIsClosed Attempted to join a session that is closed. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
2071  @retval nn::pia::ResultHostIsNotFriend Attempted to join a session with a host that is not a friend. Perform cleanup.
2072  @retval nn::pia::ResultGameServerMaintenance Indicates that the game server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
2073  @retval nn::pia::ResultCompanionStationIsOffline A companion client was not logged in to the game server. Perform cleanup.
2074  @retval nn::pia::ResultCompanionStationIsLeft Lost the connection with the companion station. Perform cleanup.
2075  @retval nn::pia::ResultCompanionStationDenied The companion station was not in a joint session-ready state and denied the connection. Perform cleanup.
2076  @retval nn::pia::ResultSessionMigrationFailed Failed to migrate the session. Perform cleanup.
2077  @retval nn::pia::ResultStationConnectionFailed The connection process failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
2078  @retval nn::pia::ResultStationConnectionNatTraversalFailedUnknown The NAT traversal connection process failed. The NAT type is unknown. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
2079  @retval nn::pia::ResultNatTraversalFailedBothEim The NAT traversal connection process failed. The NAT type was EIM for both the local station and the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
2080  @retval nn::pia::ResultNatTraversalFailedLocalEimRemoteEdm The NAT traversal connection process failed. The NAT type was EIM for the local station and EDM for the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
2081  @retval nn::pia::ResultNatTraversalFailedLocalEdmRemoteEim The NAT traversal connection process failed. The NAT type was EDM for the local station and EIM for the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
2082  @retval nn::pia::ResultNatTraversalFailedBothEdm The NAT traversal connection process failed. The NAT type was EDM for both the local station and the peer to which the connection failed. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
2083  @retval nn::pia::ResultNatTraversalRequestTimeout The NAT traversal connection process failed. The NAT traversal request timed out. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Perform cleanup.
2084  @retval nn::pia::ResultJoinRequestDenied The mesh host denied the connection request. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
2085  @retval nn::pia::ResultMeshIsFull Failed to join the mesh because it was full. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
2086  @retval nn::pia::ResultRelayFailedNoCandidate The relay connection failed because there were no relay route candidates. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
2087  @retval nn::pia::ResultRelayFailedRttLimit The relay connection failed because the relay route RTT limit was exceeded. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
2088  @retval nn::pia::ResultRelayFailedRelayNumLimit The relay connection failed because the limit on the number of relay route relay requests was exceeded. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
2089  @retval nn::pia::ResultRelayFailedUnknown The relay connection failed. (Details unknown.) Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
2090  @retval nn::pia::ResultInvalidSystemMessage The process was canceled because an invalid response was received from the mesh host. Programming error. Fix your program so that this error is not returned.
2091  @retval nn::pia::ResultIncompatibleFormat Indicates that the peer is using an incompatible communication format. Returned when you try to communicate with a ROM that uses a different version of Pia that does not have communication compatibility. Programming error. Fix your program so that this error is not returned.
2092  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2093  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
2094  @retval nn::pia::ResultSessionWrongState The state of the joined session was irregular. Perform cleanup.
2095 
2096  @see JoinJointSessionAsync, IsCompletedJoinJointSession
2097 */
2098  nn::Result GetJoinJointSessionResult() const;
2099 
2100 /*!
2101  @brief Leaves a joint session.
2102  @details This function cannot be used with local communications.
2103  This function is only available to the joint session host.
2104  Starts the asynchronous process of leaving a joint session.
2105 
2106  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2107  Use <tt>@ref IsCompletedLeaveJointSession</tt> to check whether the process has completed and <tt>@ref GetLeaveJointSessionResult</tt> to check the result.
2108 
2109  If the host has started the process of leaving a joint session with this function, the internal process for leaving the joint session also begins automatically for the companion stations.
2110  To track the progress of the automatically started processes, either handle the state change event or call <tt>@ref GetStatus</tt> and check the <tt>@ref Status</tt> object that is returned.
2111 
2112  Some API functions, such as those related to sending and receiving, are temporarily unavailable during the asynchronous process.
2113 
2114  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2115 
2116  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
2117  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
2118 
2119  @see IsCompletedLeaveJointSession, GetLeaveJointSessionResult
2120 */
2121  nn::Result LeaveJointSessionAsync();
2122 
2123 /*!
2124  @brief Checks for completion of the <tt>LeaveJointSessionAsync</tt> asynchronous process.
2125  @details This function cannot be used with local communications.
2126  This function checks the completion of asynchronous processes started with <tt>@ref LeaveJointSessionAsync</tt>.
2127 
2128  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2129 
2130  @see LeaveJointSessionAsync, GetLeaveJointSessionResult
2131 */
2132  bool IsCompletedLeaveJointSession() const;
2133 
2134 /*!
2135  @brief Gets the result of the <tt>LeaveJointSessionAsync</tt> asynchronous process.
2136  @details This function cannot be used with local communications.
2137  This function gets the results after an asynchronous process started by <tt>@ref LeaveJointSessionAsync</tt> ends.
2138 
2139  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if the asynchronous process succeeds. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2140 
2141  @retval nn::pia::ResultInvalidState Returns when the process cannot be made. This result is also returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
2142  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
2143  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2144  @retval nn::pia::ResultGameServerMaintenance Indicates that the game server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
2145  @retval nn::pia::ResultCompanionStationIsOffline A companion client was not logged in to the game server. Perform cleanup.
2146  @retval nn::pia::ResultCompanionStationIsLeft Lost the connection with the companion station. Perform cleanup.
2147  @retval nn::pia::ResultCompanionStationDenied The companion station was not in a joint disband-ready state and denied the connection. Perform cleanup.
2148  @retval nn::pia::ResultSessionMigrationFailed Failed to migrate the session. Perform cleanup.
2149  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2150  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
2151 
2152  @see LeaveJointSessionAsync, IsCompletedLeaveJointSession
2153 */
2154  nn::Result GetLeaveJointSessionResult() const;
2155  //! @endcond
2156 
2157 /*!
2158  @brief Disbands a joint session.
2159  @details This function cannot be used with local communications.
2160  This function is only available to the joint session host.
2161  It starts an asynchronous process that disbands a joint session.
2162 
2163  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2164  Use <tt>@ref IsCompletedDestroyJointSession</tt> to check whether the process has completed and <tt>@ref GetDestroyJointSessionResult</tt> to check the result.
2165 
2166  If the host starts a process to disband a joint session with this function, the companion-side processes for disbanding start automatically.
2167  To track the progress of the automatically started processes, either handle the state change event or call <tt>@ref GetStatus</tt> and check the <tt>@ref Status</tt> object that is returned.
2168 
2169  Some API functions, such as those related to sending and receiving, are temporarily unavailable during the asynchronous process.
2170 
2171  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2172 
2173  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
2174  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
2175 
2176  @see IsCompletedDestroyJointSession, GetDestroyJointSessionResult
2177 */
2178  nn::Result DestroyJointSessionAsync();
2179 
2180 /*!
2181  @brief Checks the completion of <tt>DestroyJointSessionAsync</tt> asynchronous processing.
2182  @details This function cannot be used with local communications.
2183  This function checks the completion of asynchronous processes started with <tt>@ref DestroyJointSessionAsync</tt>.
2184 
2185  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2186 
2187  @see DestroyJointSessionAsync, GetDestroyJointSessionResult
2188 */
2189  bool IsCompletedDestroyJointSession() const;
2190 
2191 /*!
2192  @brief Gets the result of <tt>DestroyJointSessionAsync</tt> asynchronous processing.
2193  @details This function cannot be used with local communications.
2194  This function gets the results after an asynchronous process started by <tt>@ref DestroyJointSessionAsync</tt> ends.
2195 
2196  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if the asynchronous process succeeds. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2197 
2198  @retval nn::pia::ResultInvalidState Returns when the process cannot be made. This result is also returned when the asynchronous process has not completed or has not started. Programming error. Fix your program so that this error is not returned.
2199  @retval nn::pia::ResultInvalidArgument Indicates that unexpected arguments were passed to the function when starting the asynchronous process. Programming error. Fix your program so that this error is not returned.
2200  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2201  @retval nn::pia::ResultGameServerMaintenance Indicates that the game server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
2202  @retval nn::pia::ResultCompanionStationIsOffline A companion client was not logged in to the game server. Perform cleanup.
2203  @retval nn::pia::ResultCompanionStationIsLeft Lost the connection with the companion station. Perform cleanup.
2204  @retval nn::pia::ResultCompanionStationDenied The companion station was not in a joint disband-ready state and denied the connection. Perform cleanup.
2205  @retval nn::pia::ResultSessionMigrationFailed Failed to migrate the session. Perform cleanup.
2206  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2207  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
2208 
2209  @see DestroyJointSessionAsync, IsCompletedDestroyJointSession
2210 */
2211  nn::Result GetDestroyJointSessionResult() const;
2212 
2213  // Starts accepting participants in the joint session.
2214 /*!
2215  @brief Starts accepting participants in the joint session.
2216  @details This function cannot be used with local communications.
2217  This function is only available to the joint session host.
2218  This function starts an asynchronous process that accepts joint session participants.
2219  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2220  Use <tt>@ref IsCompletedOpenJointSessionParticipation</tt> to check whether the process has completed and <tt>@ref GetOpenJointSessionParticipationResult</tt> to check the result.
2221 
2222  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2223 
2224  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
2225  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2226 
2227  @see IsCompletedOpenJointSessionParticipation, GetOpenJointSessionParticipationResult, IsJointSessionHost
2228 */
2229  nn::Result OpenJointSessionParticipationAsync();
2230 
2231 /*!
2232  @brief Checks for completion of the <tt>OpenJointSessionParticipationAsync</tt> asynchronous process.
2233  @details This function cannot be used with local communications.
2234  This function checks the completion of asynchronous processes started with <tt>@ref OpenJointSessionParticipationAsync</tt>.
2235 
2236  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2237 
2238  @see OpenJointSessionParticipationAsync, GetOpenJointSessionParticipationResult
2239 */
2240  bool IsCompletedOpenJointSessionParticipation() const;
2241 
2242 /*!
2243  @brief Gets the result of the <tt>OpenJointSessionParticipationAsync</tt> asynchronous process.
2244  @details This function cannot be used with local communications.
2245  This function gets the results after an asynchronous process started by <tt>@ref OpenJointSessionParticipationAsync</tt> ends.
2246 
2247  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2248 
2249  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
2250  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2251  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
2252  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
2253  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2254  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
2255 
2256  @see OpenJointSessionParticipationAsync, IsCompletedOpenJointSessionParticipation
2257 */
2258  nn::Result GetOpenJointSessionParticipationResult() const;
2259 
2260 /*!
2261  @brief Starts accepting participants in the joint session.
2262  @details
2263 
2264  This function starts an asynchronous process that accepts joint session participants.
2265  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2266  Use <tt>@ref IsCompletedOpenJointSession</tt> to check whether the process has completed and <tt>@ref GetOpenJointSessionResult</tt> to check the result.
2267  All stations participating in the joint session must call this function.
2268  The asynchronous process ends after it can be verified that all stations that have finished joining the session have called this function.
2269  After asynchronous processes complete, the matchmaking session is in an open state.
2270 
2271  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2272 
2273  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
2274  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2275  @retval nn::pia::ResultSessionInvalidState Indicates that the host has called <tt>CloseJointSessionAsync</tt>. Programming error. Fix your program so that this error is not returned. For error handling in the release version, perform cleanup after calling <tt>LeaveSessionAsync</tt>.
2276 
2277  @see IsCompletedOpenParticipation, GetOpenJointSessionResult, IsHost
2278 */
2279  nn::Result OpenJointSessionAsync();
2280 
2281 /*!
2282  @brief Checks the completion of <tt>OpenJointSessionAsync</tt> asynchronous processing.
2283  @details This function checks the completion of asynchronous processes started with <tt>@ref OpenJointSessionAsync</tt>.
2284 
2285  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2286 
2287  @see OpenJointSessionAsync, GetOpenJointSessionResult
2288 */
2289  bool IsCompletedOpenJointSession() const;
2290 
2291 /*!
2292  @brief Gets the result of <tt>OpenJointSessionAsync</tt> asynchronous processing.
2293  @details This function gets the results after an asynchronous process started by <tt>@ref OpenJointSessionAsync</tt> ends.
2294 
2295  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2296 
2297  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
2298  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2299  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. This result also can be returned when the host has disbanded a joint session and passively begun an asynchronous process. Perform cleanup.
2300  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
2301  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2302  @retval nn::pia::ResultSessionInvalidState Indicates that the host has called <tt>CloseJointSessionAsync</tt>. <tt>OpenJointSessionAsync</tt> was not called by all stations participating in the session within 60 seconds after the function was called. Programming error. Fix your program so that this error is not returned. For error handling in the release version, perform cleanup after calling <tt>LeaveSessionAsync</tt>.
2303  @retval nn::pia::ResultSessionInconsistentState Indicates that the process took longer than expected to complete. If the station is a client, make it check whether the other clients have called <tt>OpenJointSessionAsync</tt>. Perform cleanup after calling <tt>LeaveSessionAsync</tt>.
2304 
2305  @see OpenJointSessionAsync, IsCompletedOpenJointSession
2306 */
2307  nn::Result GetOpenJointSessionResult() const;
2308 
2309  // Closing a joint session to new participants
2310 /*!
2311  @brief Closes a joint session to new participants.
2312  @details This function cannot be used with local communications.
2313  This function is only available to the joint session host.
2314  This function starts an asynchronous process that closes a joint session to new participants.
2315  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2316  Use <tt>@ref IsCompletedCloseJointSessionParticipation</tt> to check whether the process has completed and <tt>@ref GetCloseJointSessionParticipationResult</tt> to check the result.
2317 
2318  It is possible to imagine a case where a station attempts to join the joint session immediately before this function is called and ends up joining after the asynchronous process has completed.
2319  For this reason, the asynchronous process ends after waiting for the session to close and the number of participants in the matchmaking session to match the number of participants in the mesh.
2320  The asynchronous process also ends if the numbers do not match after a certain amount of time (15 seconds). In this case, <tt>@ref GetCloseJointSessionParticipationResult</tt>
2321  returns <tt>ResultNegligibleFault</tt>. There could be attempts to join after the asynchronous process has ended.
2322  Handle these attempts as appropriate in the application.
2323 
2324 
2325  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2326 
2327  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
2328  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2329 
2330  @see IsCompletedCloseJointSessionParticipation, GetCloseJointSessionParticipationResult, IsJointSessionHost
2331 */
2332  nn::Result CloseJointSessionParticipationAsync();
2333 
2334 /*!
2335  @brief Checks for completion of the <tt>CloseJointSessionParticipationAsync</tt> asynchronous process.
2336  @details This function cannot be used with local communications.
2337  This function checks the completion of asynchronous processes started with <tt>@ref CloseJointSessionParticipationAsync</tt>.
2338 
2339  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2340 
2341  @see CloseJointSessionParticipationAsync, GetCloseJointSessionParticipationResult
2342 */
2343  bool IsCompletedCloseJointSessionParticipation() const;
2344 
2345 /*!
2346  @brief Gets the result of the <tt>CloseJointSessionParticipationAsync</tt> asynchronous process.
2347  @details This function cannot be used with local communications.
2348  This function gets the results after an asynchronous process started by <tt>@ref CloseJointSessionParticipationAsync</tt> ends.
2349 
2350  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2351 
2352  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
2353  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2354  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
2355  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
2356  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2357  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
2358  @retval nn::pia::ResultNegligibleFault A certain amount of time passed without the matchmaking sessions and number of participants matching. Handle appropriately in the application.
2359 
2360  @see CloseJointSessionParticipationAsync, IsCompletedCloseJointSessionParticipation
2361 */
2362  nn::Result GetCloseJointSessionParticipationResult() const;
2363 
2364 /*!
2365  @brief Closes a joint session to new participants.
2366  @details
2367 
2368  This function starts an asynchronous process that closes a joint session to new participants.
2369  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2370  Use <tt>@ref IsCompletedCloseJointSession</tt> to check whether the process has completed and <tt>@ref GetCloseJointSessionResult</tt> to check the result.
2371  All stations participating in the joint session must call this function.
2372 
2373  After it is confirmed that the numbers of matchmaking session and mesh participants match and that the stations that have completed connection have called this function, asynchronous processes finish.
2374  After it is complete, the matchmaking session enters a closed state. Advance processing under the assumption that after asynchronous processing is complete, the number of new participants will not increase.
2375 
2376  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2377 
2378  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that communication is not already taking place. Programming error. Fix your program so that this error is not returned.
2379  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2380  @retval nn::pia::ResultSessionInvalidState Indicates that the host has called <tt>OpenJointSessionAsync</tt>. Programming error. Fix your program so that this error is not returned. For error handling in the release version, perform cleanup after calling <tt>LeaveSessionAsync</tt>.
2381 
2382  @see IsCompletedCloseJointSession, GetCloseJointSessionResult, IsHost
2383 */
2384  nn::Result CloseJointSessionAsync();
2385 
2386 /*!
2387  @brief Checks the completion of <tt>CloseJointSessionAsync</tt> asynchronous processing.
2388  @details This function checks the completion of asynchronous processes started with <tt>@ref CloseJointSessionAsync</tt>.
2389 
2390  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2391 
2392  @see CloseJointSessionAsync, GetCloseJointSessionResult
2393 */
2394  bool IsCompletedCloseJointSession() const;
2395 
2396 /*!
2397  @brief Gets the result of <tt>CloseJointSessionAsync</tt> asynchronous processing.
2398  @details This function gets the results after an asynchronous process started by <tt>@ref CloseJointSessionAsync</tt> ends.
2399 
2400  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2401 
2402  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
2403  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2404  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. This result also can be returned when the host has disbanded a joint session and passively begun an asynchronous process. Perform cleanup.
2405  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
2406  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2407  @retval nn::pia::ResultSessionInvalidState Indicates that the host has called <tt>OpenJointSessionAsync</tt>. <tt>CloseJointSessionAsync</tt> was not called by all stations participating in the session within 60 seconds after the function was called. Programming error. Fix your program so that this error is not returned. For error handling in the release version, perform cleanup after calling <tt>LeaveSessionAsync</tt>.
2408  @retval nn::pia::ResultSessionInconsistentState Indicates that the process took longer than expected to complete. If the station is a client, have it check whether the other clients have called <tt>CloseJointSessionAsync</tt>. Perform cleanup after calling <tt>LeaveSessionAsync</tt>.
2409 
2410  @see CloseJointSessionAsync, IsCompletedCloseJointSession
2411 */
2412  nn::Result GetCloseJointSessionResult() const;
2413 
2414 /*!
2415  @brief Updates the joint session search conditions.
2416  @details This function cannot be used with local communications.
2417 
2418  Updates the joint session search conditions.
2419  Only the joint session host can execute this function.
2420  The <tt><var>attributeIndex</var></tt> parameter can be set to a value between <tt>0</tt> and <tt>@ref nn::pia::inet::ATTRIBUTE_MAX_SIZE</tt> - <tt>1</tt>.
2421  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2422  Use <tt>@ref IsCompletedModifyJointSessionAttribute</tt> to check whether the process has completed and <tt>@ref GetModifyJointSessionAttributeResult</tt> to check the result.
2423 
2424  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2425 
2426  @retval nn::pia::ResultInvalidArgument The value specified in <tt><var>attributeIndex</var></tt> is outside the allowed range. Programming error. Fix your program so that this error is not returned.
2427  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. This function is not supported in local communication. Programming error. Fix your program so that this error is not returned.
2428  For Internet communication, make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that the local station is the host. Programming error. Fix your program so that this error is not returned.
2429  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2430 
2431  @see IsCompletedModifyJointSessionAttribute, GetModifyJointSessionAttributeResult, IsJointSessionHost
2432 */
2433  nn::Result ModifyJointSessionAttributeAsync(u32 attributeIndex, u32 newValue);
2434 /*!
2435  @brief Checks the completion of <tt>ModifyJointSessionAttributeAsync</tt> asynchronous processing.
2436  @details This function cannot be used with local communications.
2437  This function checks the completion of asynchronous processes started with <tt>@ref ModifyJointSessionAttributeAsync</tt>.
2438 
2439  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2440 
2441  @see ModifyJointSessionAttributeAsync, GetModifyJointSessionAttributeResult
2442 */
2443  bool IsCompletedModifyJointSessionAttribute() const;
2444 /*!
2445  @brief Gets the result of <tt>ModifyJointSessionAttributeAsync</tt> asynchronous processing.
2446  @details This function cannot be used with local communications.
2447  This function gets the results after an asynchronous process started by <tt>@ref ModifyJointSessionAttributeAsync</tt> ends.
2448 
2449  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2450 
2451  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
2452  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2453  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
2454  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
2455  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2456  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
2457 
2458  @see ModifyJointSessionAttributeAsync, IsCompletedModifyJointSessionAttribute
2459 */
2460  nn::Result GetModifyJointSessionAttributeResult() const;
2461 
2462 /*!
2463  @brief Updates the joint session settings.
2464  @details This function cannot be used with local communications.
2465  Updates the joint session settings asynchronously.
2466  Only the joint session host can execute this function.
2467  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2468  Use <tt>@ref IsCompletedUpdateJointSessionSetting</tt> to check whether the process has completed and <tt>@ref GetUpdateJointSessionSettingResult</tt> to check the result.
2469 
2470  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2471 
2472  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. This function is not supported in local communication. Programming error. Fix your program so that this error is not returned.
2473  For Internet communication, make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that the local station is the joint session host. Programming error. Fix your program so that this error is not returned.
2474  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2475 
2476  @param[in] pUpdateSessionSetting Pointer to the <tt>UpdateSessionSetting</tt> derived class for gathering the settings to change.
2477 
2478  @see UpdateSessionSetting, IsCompletedUpdateJointSessionSetting, GetUpdateJointSessionSettingResult, IsJointSessionHost
2479 */
2480  nn::Result UpdateJointSessionSettingAsync(UpdateSessionSetting* pUpdateSessionSetting);
2481 
2482 /*!
2483  @brief Checks the completion of <tt>UpdateJointSessionSettingAsync</tt> asynchronous processing.
2484  @details This function cannot be used with local communications.
2485  This function checks the completion of asynchronous processes started with <tt>@ref UpdateJointSessionSettingAsync</tt>.
2486 
2487  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2488 
2489  @see UpdateJointSessionSettingAsync, GetUpdateJointSessionSettingResult
2490 */
2491  bool IsCompletedUpdateJointSessionSetting() const;
2492 /*!
2493  @brief Gets the result of <tt>UpdateJointSessionSettingAsync</tt> asynchronous processing.
2494  @details This function cannot be used with local communications.
2495  This function gets the results after an asynchronous process started by <tt>@ref UpdateJointSessionSettingAsync</tt> ends.
2496 
2497  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2498 
2499  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
2500  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2501  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
2502  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2503  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
2504 
2505  @see UpdateJointSessionSettingAsync, IsCompletedUpdateJointSessionSetting
2506 */
2507  nn::Result GetUpdateJointSessionSettingResult() const;
2508 
2509 /*!
2510  @brief Updates joint session application-defined data.
2511  @details
2512 
2513  Asynchronously updates joint session application-defined data.
2514  Only the joint session host can execute this function.
2515  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
2516  Use <tt>@ref IsCompletedUpdateJointSessionApplicationData</tt> to check whether the process has completed and <tt>@ref GetUpdateJointSessionApplicationDataResult</tt> to check the result.
2517 
2518  @return Returns a <tt>Result</tt> value that indicates success if the asynchronous process starts successfully. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2519 
2520  @retval nn::pia::ResultInvalidArgument Either the specified <tt><var>pApplicationBuffer</var></tt> is <tt>Null</tt> or the specified <tt><var>dataSize</var></tt> has exceeded the value that can be set. Programming error. Fix your program so that this error is not returned.
2521  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that no other asynchronous processes are running, that <tt>Startup</tt> has been called, and that the local station is the joint session host. Programming error. Fix your program so that this error is not returned.
2522  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2523 
2524  @param[in] pApplicationBuffer The application-defined data to update.
2525  @param[in] dataSize The size of the specified application-defined data.
2526 
2527  @see IsCompletedUpdateJointSessionApplicationData, GetUpdateJointSessionApplicationDataResult, IsJointSessionHost
2528 */
2529  nn::Result UpdateJointSessionApplicationDataAsync(const void* pApplicationBuffer, size_t dataSize);
2530 
2531 /*!
2532  @brief Checks the completion of <tt>UpdateJointSessionApplicationDataAsync</tt> asynchronous processing.
2533  @details This function checks the completion of asynchronous processes started with <tt>@ref UpdateJointSessionApplicationDataAsync</tt>.
2534 
2535  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise. Also returns <tt>false</tt> when there has been no asynchronous processing.
2536 
2537  @see UpdateJointSessionApplicationDataAsync, GetUpdateJointSessionApplicationDataResult
2538 */
2539  bool IsCompletedUpdateJointSessionApplicationData() const;
2540 
2541 /*!
2542  @brief Gets the result of <tt>UpdateJointSessionApplicationDataAsync</tt> asynchronous processing.
2543  @details This function gets the results after an asynchronous process started by <tt>@ref UpdateJointSessionApplicationDataAsync</tt> ends.
2544 
2545  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt>. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2546 
2547  @retval nn::pia::ResultInvalidState Indicates that the instance was not in a valid state when the function was called. Make sure that that no other asynchronous processes are running. Programming error. Fix your program so that this error is not returned.
2548  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off, there may be a problem with the access point, or the connection to the game server may have been lost. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Reconnect to AC.
2549  @retval nn::pia::ResultSessionConnectionIsLost Disconnected from the mesh. Call <tt>LeaveSessionAsync</tt> and then call <tt>Cleanup</tt>. Perform cleanup.
2550  @retval nn::pia::ResultSessionIsNotFound The target session was lost during the asynchronous process. Perform cleanup.
2551  @retval nn::pia::ResultNexInternalError This is an internal NEX error. The <tt>nn::pia::util::NetworkErrorCodeConverter::Convert</tt> function gets a NEX network error code. Check the NEX section of the network error code list. After logging out, reinitialize Pia and NEX. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Handle appropriately in the application.
2552  @retval nn::pia::ResultGameServerProcessAborted A game server-related process failed. Execute up to the logout process from the NEX server.
2553  @retval nn::pia::ResultGameServerMaintenance Indicates that the server is under maintenance. If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Execute up to the logout process from the NEX server.
2554 
2555  @see UpdateJointSessionApplicationDataAsync, IsCompletedUpdateJointSessionApplicationData
2556 */
2557  nn::Result GetUpdateJointSessionApplicationDataResult() const;
2558 
2559 /*!
2560  @brief Gets the ID of the joint session.
2561 
2562  @if CTR_DOC
2563  @details This function always returns <tt>INVALID_SESSION_ID</tt> during local communication.
2564  @endif
2565 
2566  @return Returns the session ID of the currently joined joint session. Returns <tt>INVALID_SESSION_ID</tt> if not a participant in a joint session.
2567 */
2568  u32 GetJointSessionId() const;
2569 
2570 /*!
2571  @brief Gets whether the local station is the joint session host.
2572 
2573  @details This function returns whether the local station is the host of the joint session.
2574 
2575  @return Returns <tt>true</tt> if the local station is the host, or <tt>false</tt> otherwise.
2576 */
2577  bool IsJointSessionHost() const;
2578 
2579 /*!
2580  @cond PRIVATE
2581  @brief Gets the <tt>StationIndex</tt> of the joint session host.
2582 
2583  @details This function returns <tt>STATION_INDEX_INVALID</tt> if the local station is not a participant in a joint session.
2584  When participating in a joint session, this function returns a <tt>StationIndex</tt> that specifies the joint session host.
2585 
2586  @return Returns the <tt>StationIndex</tt> that represents the host of the joint session where the local station is a participant.
2587 */
2588  StationIndex GetJointSessionHostStationIndex() const;
2589  //! @endcond
2590 
2591 /*!
2592  @brief Gets the <tt>StationId</tt> that represents the joint session host.
2593 
2594  @details This function returns <tt>STATION_ID_INVALID</tt> if the local station is not a participant in a joint session.
2595  When participating in a joint session, this function returns a <tt>StationId</tt> that specifies the joint session host.
2596 
2597  @return Returns the <tt>StationId</tt> that represents the joint session host.
2598 */
2599  StationId GetJointSessionHostStationId() const;
2600 
2601 /*!
2602  @brief Gets the <tt>StationConnectionInfo</tt> that represents the host of the joint session where the local station is a participant.
2603 
2604  @details When participating in a joint session, this function returns a <tt>StationConnectionInfo</tt> that specifies the joint session host.
2605 
2606  @param[out] pInfoOut A pointer to the object that holds the address representing the joint session host.
2607  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if execution succeeds. You must make sure that the implementation of this function in your application does not return any errors.
2608  @retval ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
2609  @retval ResultInvalidState Not participating in a joint session. Programming error. Fix your program so that this error is not returned.
2610 
2611  @return Returns the <tt>StationConnectionInfo</tt> that represents the host of the joint session where the local station is a participant.
2612 */
2613  nn::Result GetJointSessionHostStationConnectionInfo(transport::StationConnectionInfo* pInfoOut);
2614 
2615 /*!
2616  @cond PRIVATE
2617 */
2618  int GetJointSequence();
2619  //! @endcond
2620 
2621 /*!
2622  @cond PRIVATE
2623 */
2624  int GetJoinSequence();
2625  int GetJoinAutoMatchmakeSequence();
2626  int GetJoinMeshSequence();
2627  u8 GetCloseSessionSequence();
2628  u8 GetCloseJointSessionSequence();
2629  u8 GetOpenSessionSequence();
2630  u8 GetOpenJointSessionSequence();
2631  void CleanupJobsWhenJointSession();
2632  //! @endcond
2633 
2634 /*!
2635  end of name Joint Session Feature
2636  @}
2637 */
2638 
2639 
2640 /*!
2641  @name Registering and Unregistering Callback Functions
2642  @{
2643 */
2644 
2645 /*!
2646  @brief Registers the callback function that is called when the session state changes.
2647 
2648  @details This function registers the callback that is called when the session state changes (when a station joins or exits).
2649  Do not include any processes that block for long periods of time in the registering function.
2650 
2651  @param[in] callback Specifies a pointer to the callback function being registered.
2652 
2653  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if the process succeeds. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2654  @retval nn::pia::ResultInvalidState Returned when an event notification callback is already registered. Programming error. Fix your program so that this error is not returned.
2655 
2656  @see UnregisterSessionEventCallback
2657 */
2658  nn::Result RegisterSessionEventCallback(SessionEventCallback callback);
2659 
2660 /*!
2661  @brief Unregisters the callback function registered for changes to the session state.
2662 
2663  @see RegisterSessionEventCallback
2664 */
2665  void UnregisterSessionEventCallback();
2666 
2667 
2668  /// @cond PRIVATE
2669  static void NoticeEventCallback(session::Session::SessionEventType eventType, StationIndex index);
2670 
2671  void CheckStatusAtChangeMeshState();
2672  /// @endcond
2673 
2674 /*!
2675  @brief Registers the callback function for determining whether to approve or deny a join request when received by the session host.
2676 
2677  @details This function defines the callback that is invoked when the local station is the session host and it receives a join request from a client.
2678  The callback function is called by <tt>@ref nn::pia::common::Scheduler::Dispatch</tt>.
2679  Do not include any processes that block for long periods of time in the registering function.
2680 
2681  @param[in] callback Specifies a pointer to the callback function being registered.
2682 
2683  @see UnregisterJoiningApprovalCallback
2684 */
2685  void RegisterJoiningApprovalCallback(JoiningApprovalCallback callback);
2686 
2687 /*!
2688  @brief Unregisters the callback function that is called to determine whether to approve or deny a join request.
2689 
2690  @see RegisterJoiningApprovalCallback
2691 */
2692  void UnregisterJoiningApprovalCallback();
2693 
2694  //! @cond PRIVATE
2695  static bool SessionJoiningApprovalCallback(const nn::pia::transport::Station::IdentificationToken* pRequesterToken);
2696  MeshEventListener* GetMeshEventListenerPtr();
2697  transport::Transport::DisconnectionEventListener GetDisconnectionEventListener();
2698  static u8 CheckHostCandidateRankingCallback(StationIndex targetStationIndex, bool isHost);
2699  static u32 GetSessionIdCallback();
2700  //! @endcond
2701 
2702 /*!
2703  end of name Registering and Unregistering Callback Functions
2704  @}
2705 */
2706 
2707  /// @cond PRIVATE
2708  // private
2709  void JoinNotice(StationId targetStationId);
2710  /// @endcond
2711 
2712 /*!
2713  @name Synchronous Clock
2714  @{
2715 */
2716 
2717 /*!
2718  @brief Specifies the synchronous clock (the time, in milliseconds, since the session was created).
2719 
2720  @details The synchronous clock is synchronized among all the stations in the session.
2721  Clients joined in the session periodically send a clock-synchronization pulse to the session host.
2722  The host then responds to these pulses, ensuring synchronization between the host and clients.
2723  By default, synchronization pulses are sent every two seconds,
2724  but the application can also change this interval. For more information, see <tt>SetSyncClockPulseInterval()</tt> and
2725  <tt>GetSyncClockPulseInterval()</tt>.
2726 
2727  @return Returns the elapsed time, in milliseconds, since the session was created.
2728  This function returns a negative value if the station is not
2729  synchronized with the session host, such as when it has just joined a session
2730  and not yet received a response from the host.
2731 
2732  @see SetSyncClockPulseInterval, GetSyncClockPulseInterval
2733 */
2734  s64 GetTime(void) const;
2735 
2736 
2737 /*!
2738  @brief Specifies the send interval of the synchronization pulse for the synchronous clock.
2739 
2740  @param[in] interval Specifies the interval at which the synchronization pulse is sent. The value is in milliseconds.
2741  @see GetTime, GetSyncClockPulseInterval
2742 */
2743  void SetSyncClockPulseInterval(s32 interval);
2744 
2745 
2746 /*!
2747  @brief Gets the send interval of the synchronization pulse for the synchronous clock.
2748 
2749  @return Returns the interval at which synchronization pulses are sent. The value is in milliseconds.
2750  @see GetTime, SetSyncClockPulseInterval
2751 */
2752  s32 GetSyncClockPulseInterval(void) const;
2753 
2754 /*!
2755  end of name Synchronous Clock
2756  @}
2757 */
2758 
2759 /*!
2760  @name Relay Feature
2761  @{
2762 */
2763 
2764 /*!
2765  @brief Sets the maximum number of forwarding requests that can be assigned to a single station when relaying is enabled.
2766 
2767  @details The library uses this value as a metric when searching for and selecting relay paths.
2768  If you do not set a value, the library uses [<tt><var>MaximumSessionParticipants</var></tt>] × [<tt><var>MaximumSessionParticipants</var></tt>] as the default.
2769 
2770  We recommend that you set this to the same value for all participants in a session. (Operation is not guaranteed if different values are set on different clients.)
2771 
2772  This function is only available when the network topology allows relaying, and <tt>@ref Startup</tt> has not yet been called.
2773 
2774  @param[in] num Specifies the maximum value.
2775 
2776  @return Returns a <tt>Result</tt> value indicating success if the setting succeeds.
2777  @retval nn::pia::ResultInvalidState Indicates that relay connections are disabled or the <tt>Startup</tt> function has already been called. Programming error. Fix your program so that this error is not returned.
2778 */
2779  nn::Result SetMaxNumOfRelayRoutesAssignedToStation(u16 num);
2780 
2781 
2782 /*!
2783  @brief Sets the maximum total RTT for a relay route when relaying is enabled.
2784 
2785  @details The library uses this value as a metric when searching for and selecting relay paths.
2786  If you do not set a value, the library uses the default value of <tt>nn::pia::session::NN_PIA_SESSION_MAX_RTT_DEFAULT</tt>.
2787 
2788  We recommend that you set this to the same value for all participants in a session. (Operation is not guaranteed if different values are set on different clients.)
2789 
2790  This function is only available when the network topology allows relaying, and <tt>@ref Startup</tt> has not yet been called.
2791 
2792  @param[in] rtt Specifies the maximum value. The value is in milliseconds.
2793 
2794  @return Returns a <tt>Result</tt> value indicating success if the setting succeeds.
2795  @retval nn::pia::ResultInvalidState Indicates that relay connections are disabled or the <tt>Startup</tt> function has already been called. Programming error. Fix your program so that this error is not returned.
2796 */
2797  nn::Result SetMaxRtt(u16 rtt);
2798 
2799 /*!
2800  @brief Gets the connection path between the local station and an arbitrary station index when relaying is enabled. (For debugging.)
2801 
2802  @details This function is for debugging. Do not include it in retail products.
2803  The connection path between the local station and <tt><var>targetIndex</var></tt> is stored in <tt><var>pRelayIndex</var></tt>, according to the following rules.
2804  (The value of <tt><var>pRelayIndex</var></tt> does not change if the function could not retrieve the connection path.)
2805  <ul>
2806  <li>Direct connection: <tt><var>targetIndex</var></tt></li>
2807  <li>Relay connection: <tt>StationIndex</tt> of the relay requester.</li>
2808  <li>Local station: <tt>STATION_INDEX_INVALID</tt></li>
2809  <li>Not connected: <tt>STATION_INDEX_INVALID</tt></li>
2810  </ul>
2811 
2812  @details Even if you can get a valid value for the requester's <tt>StationIndex</tt>, it might not be possible to convert the value to a <tt>StationId</tt>.
2813  When this occurs, <tt>@ref transport::Transport::ConvertToStationId</tt> returns <tt>ResultNotFound</tt>.
2814  This state is only temporary and you can convert to a <tt>StationId</tt> after the internal process advances normally.
2815 
2816  @param[in] targetIndex Specifies the <tt>StationIndex</tt> with the connection path to retrieve.
2817  @param[out] pRelayIndex Specifies the <tt>StationIndex</tt> indicating the connection path.
2818 
2819  @return Returns a <tt>Result</tt> value indicating success if the value can be retrieved successfully.
2820  @retval nn::pia::ResultInvalidState Indicates that relay connections are disabled. Programming error. Fix your program so that this error is not returned.
2821  @retval nn::pia::ResultInvalidArgument The specified <tt>StationIndex</tt> is invalid, or the pointer specified in the arguments is invalid. Programming error. Fix your program so that this error is not returned.
2822 */
2823  nn::Result GetConnectionRoute(StationIndex targetIndex, StationIndex* pRelayIndex);
2824 
2825 /*!
2826  @brief Specifies connection path emulation settings between any two <tt>StationIndex</tt> objects when relaying is enabled. (For debugging.)
2827 
2828  @details This function is for debugging. Do not include it in retail products.
2829 
2830  @details When you call this function, make sure that you have enabled the connection path emulation feature by using the <tt>@ref Session::SetDebugSetting</tt> function.
2831 
2832  @details If <tt>EMULATION_TYPE_RELAY</tt> is set, the connection method for the target <tt>StationIndex</tt> is always a relay connection
2833  (even when, for example, a direct connection is possible).
2834 
2835  @details Call this function when the terminal is not connected to a session.
2836  If you call this function when the terminal has already joined a session, there is no guarantee that changing the connection path emulation settings will work.
2837 
2838  @param[in] index1 Specifies the first <tt>StationIndex</tt>.
2839  @param[in] index2 Specifies the first <tt>StationIndex</tt>.
2840  @param[in] type Specifies the connection method emulation setting.
2841 
2842  @return Returns a <tt>Result</tt> value indicating success if the setting succeeds.
2843  @retval nn::pia::ResultInvalidState Indicates that relay connections are disabled. Programming error. Fix your program so that this error is not returned.
2844  @retval nn::pia::ResultInvalidArgument Indicates that the <tt>StationIndex</tt> is invalid, or the specified <tt>EmulationType</tt> is invalid. Programming error. Fix your program so that this error is not returned.
2845 
2846  @see SetDebugSetting, ResetRelayEmulation
2847 */
2848  nn::Result RelayEmulation(StationIndex index1, StationIndex index2, Mesh::EmulationType type);
2849 
2850 /*!
2851  @brief Initializes connection path emulation settings when relay connections are enabled. (For debugging.)
2852 
2853  @details This function is for debugging. Do not include it in retail products.
2854 
2855  @details All connections are initialized to use the connection path emulation configured by the <tt>@ref RelayEmulation</tt> function.
2856  (This is equivalent to setting <tt>EMULATION_TYPE_NONE</tt> for all combinations of <tt>StationIndex</tt>.)
2857 
2858  @details Call this function when the terminal is not connected to a session.
2859  If you call this function when the terminal has already joined a session, there is no guarantee that changing the connection path emulation settings will work.
2860 
2861  @see SetDebugSetting, RelayEmulation
2862 */
2863  void ResetRelayEmulation();
2864 
2865 /*!
2866  end of name Relay Feature
2867  @}
2868 */
2869 
2870 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
2871  nn::Result GetRefereeStatsAsync(u32 initialRatingValue, u32 category);
2872  bool IsCompletedGetRefereeStats();
2873  nn::Result GetGetRefereeStatsResult();
2874 
2875  nn::Result StartGameAsync(u32 category);
2876  bool IsCompletedStartGame();
2877  nn::Result GetStartGameResult();
2878 
2879  nn::Result EndGameAsync(session::IEndGamePersonalReport* pReportArray, size_t reportArraySize);
2880  bool IsCompletedEndGame();
2881  nn::Result GetEndGameResult();
2882 
2883  nn::Result EndGameWithoutReportAsync();
2884  bool IsCompletedEndWithoutReportGame();
2885  nn::Result GetEndGameWithoutReportResult();
2886 
2887  // Returns <tt>true</tt> from when <tt>StartGameAsync</tt> is called to when <tt>EndGameAsync</tt> or <tt>EndGameWithoutReportAsync</tt> is called.
2888  bool IsInGame();
2889 #endif
2890 
2891 /*!
2892  @name Other
2893  @{
2894 */
2895 
2896 /*!
2897  @brief Gets whether host migration is enabled.
2898 
2899  @details The return value is determined based on the argument value specified in <tt>nn::pia::session::Session::Startup</tt>.
2900  @return Returns <tt>true</tt> if <tt>@ref nn::pia::session::Session::Startup</tt> was called with host migration enabled.
2901 
2902 */
2904  {
2905  return m_IsUsingHostMigration;
2906  };
2907 
2908  /// @cond PRIVATE
2909 /*!
2910  @brief Kicks a station from the session. (Host only.)
2911 
2912  @details This function can only be used by the host.
2913 
2914  @details A kick notice is conveyed to the station assigned the <tt>StationIndex</tt> specified
2915  in the argument, and that station leaves the mesh upon receiving the notice.
2916 
2917  @details Because of latency in transmitting the disconnect notification and other factors, there may be a delay between successfully calling this function, and the station leaving the mesh.
2918 
2919  @param[in] index Specifies the <tt>StationIndex</tt> assigned to the station being kicked.
2920 
2921  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if the station is successfully kicked from the session. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2922  @retval nn::pia::ResultInvalidState Indicates that a node other than the host called the function. Programming error. Fix your program so that this error is not returned.
2923  @retval nn::pia::ResultInvalidArgument Indicates that the <tt>StationIndex</tt> specified in the arguments belongs to the mesh host, or that no station in the mesh has that ID. Programming error. Fix your program so that this error is not returned.
2924  @retval nn::pia::ResultInProgress Indicates that the process to kick the station having the <tt>StationIndex</tt> specified in the arguments has already started. Handle appropriately in the application.
2925  @retval nn::pia::ResultBufferIsFull Indicates that the buffer for kicking stations or the buffer for sending kick notifications is full. It may succeed if you try again after some time has passed. Handle appropriately in the application.
2926 */
2927  nn::Result KickoutStation(nn::pia::StationIndex index);
2928  /// @endcond
2929 
2930 /*!
2931  @brief Kicks a station from the mesh. (Host only.)
2932 
2933  @details This function can only be used by the host.
2934 
2935  @details A kick notice is conveyed to the station assigned the <tt>StationId</tt> specified in
2936  the argument, and that station leaves the mesh upon receiving the notice.
2937 
2938  @details Because of latency in transmitting the disconnect notification and other factors, there may be a delay between successfully calling this function, and the station leaving the mesh.
2939 
2940  @param[in] id Specifies the station ID assigned to the station being kicked.
2941 
2942  @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess()</tt> function returns <tt>true</tt> if the station is successfully kicked from the mesh. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
2943  @retval nn::pia::ResultInvalidState Indicates that a node other than the host called the function. Programming error. Fix your program so that this error is not returned.
2944  @retval nn::pia::ResultInvalidArgument Indicates that the <tt>StationId</tt> specified in the arguments belongs to the mesh host, or that no station in the mesh has that ID. Programming error. Fix your program so that this error is not returned.
2945  @retval nn::pia::ResultInProgress Indicates that the process to kick the station having the <tt>StationId</tt> specified in the arguments has already started. Handle appropriately in the application.
2946  @retval nn::pia::ResultBufferIsFull Indicates that the buffer for kicking stations or the buffer for sending kick notifications is full. It may succeed if you try again after some time has passed. Handle appropriately in the application.
2947 */
2948  nn::Result KickoutStation(nn::pia::StationId id);
2949 
2950 /*!
2951  @brief Gets the reason why the mesh was disconnected.
2952 
2953  @details This function always returns <tt>UNKNOWN_REASON</tt> if the mesh is in a state that allows for communication.
2954 
2955  @return Returns a <tt>DisconnectReason</tt> value indicating the reason why the mesh disconnected.
2956 
2957  @see CheckConnectionError
2958 */
2959  DisconnectReason GetSessionDisconnectReason() const;
2960 
2961 /*!
2962  @brief Prints information that is useful for debugging.
2963 
2964  @param[in] flag Specifies the bitwise OR of trace flags. For more information, see the <tt>@ref TraceFlag</tt> API reference.
2965 */
2966  virtual void Trace(u64 flag) const;
2967 
2968 /*!
2969  @brief Sets the <tt>transport::Station::IdentificationToken</tt> used to determine whether inconsistency is detected in the session participation approval callback in the matchmaking analysis feature.
2970 
2971  @param[in] pToken Token used to determine whether inconsistency is detected in the session participation approval callback.
2972 */
2973  void SetMatchmakeAnalysisToken(nn::pia::transport::Station::IdentificationToken* pToken);
2974 
2975 /*!
2976  end of name Others
2977  @}
2978 */
2979 
2980 
2981  /// @cond PRIVATE
2982  bool SaveWaitingStationIndex();
2983  u32 UpdateWaitingStationIndexNum();
2984  void SetWaitingOtherClientsFlag(bool flag);
2985  /// @endcond
2986 
2987  /// @cond PRIVATE
2988  IMatchmakeSession* GetCurrentMatchmakeSession()
2989  {
2990  return m_pMatchmakeSessionPtrArray[currentIndex()];
2991  }
2992  IMatchmakeSession* GetBufferMatchmakeSession()
2993  {
2994  return m_pMatchmakeSessionPtrArray[bufferIndex()];
2995  }
2996  const IMatchmakeSession* GetCurrentMatchmakeSession() const
2997  {
2998  return m_pMatchmakeSessionPtrArray[currentIndex()];
2999  }
3000  const IMatchmakeSession* GetBufferMatchmakeSession() const
3001  {
3002  return m_pMatchmakeSessionPtrArray[bufferIndex()];
3003  }
3004  ISessionInfoList* GetSessionInfoListPtr()
3005  {
3006  return m_pSessionInfoList;
3007  }
3008 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
3009  IMatchmakeReferee* GetMatchmakeReferee()
3010  {
3011  return m_pMatchmakeRefereePtr;
3012  }
3013 #endif
3014 
3015  u32 GetCurrentSessionId() const
3016  {
3017  return m_SessionId[currentIndex()];
3018  }
3019  u32 GetBufferSessionId() const
3020  {
3021  return m_SessionId[bufferIndex()];
3022  }
3023  u8 GetCurrentMaxParticipantNum() const
3024  {
3025  return m_MaxParticipantNum[currentIndex()];
3026  }
3027  u8 GetBufferMaxParticipantNum() const
3028  {
3029  return m_MaxParticipantNum[bufferIndex()];
3030  }
3031 
3032  bool IsLeaveIgnorable()
3033  {
3034  return m_LeaveIgnorableFlag;
3035  }
3036  bool IsPostponeJoinEvent()
3037  {
3038  return m_PostponeJoinEventFlag;
3039  }
3040 
3041  void IsHostMigrateOccurred(bool b);
3042  bool IsHostMigrateOccurred();
3043  nn::pia::transport::Station::IdentificationToken* GetMatchmakeAnalysisToken();
3044  void NotifyOwnershipChange(u32 sessionId, u32 ownerId);
3045  void NotifyUpdateHost(u32 sessionId, u32 hostId);
3046  void NotifyLeave(u32 sessionId, u32 principalId);
3047  void NotifyUnregister(u32 sessionId);
3048  void SetUsingLastGidOption(bool b);
3049  /// @endcond
3050 
3051  /// @cond PRIVATE
3052  bool IsTargetMatchmakeSessionOpen()const;
3053  bool IsOpenSession(u32 sessionId = 0)const;
3054  void SetOpenSession(u32 sessionId, bool flg);
3055  u32 GetConfigParticipationTargetSessionId()const;
3056  IMatchmakeSession* GetConfigParticipationTargetMatchmakeSession();
3057  const IMatchmakeSession* GetConfigParticipationTargetMatchmakeSession()const;
3058  ModuleState GetModuleState() const
3059  {
3060  return m_ModuleState;
3061  }
3062  /// @endcond
3063 
3064 protected:
3065  bool IsProcessingJoin() const;
3066  bool IsWaitingOtherClients() const;
3067  bool IsPostponeNotice() const;
3068 
3069 private:
3070  //! @cond PRIVATE
3071 /*
3072  @brief The constructor. This constructor is private because the singleton pattern is used.
3073 */
3074  Session(Session::Setting setting);
3075 
3076 
3077 /*!
3078  @brief The destructor. This destructor is private because the singleton pattern is used.
3079 */
3080  ~Session();
3081 
3082 /*!
3083  @brief This copy constructor is private because the singleton pattern is used.
3084 */
3085  Session(const Session&);
3086 
3087 
3088 /*!
3089  @brief This assignment operator is private because the singleton pattern is used.
3090 */
3091  Session& operator=(const Session&);
3092  //! @endcond
3093 
3094  bool UpdateStationIdToBecomeHost();
3095  bool UpdateStationIdToBecomeClient();
3096 
3097  bool AddNewStationId(StationId stationId, StationIndex stationIndex, u32 uniqueId, u32 sessionId);
3098  bool RemoveStationId(StationId stationId, StationIndex stationIndex, u32 uniqueId, u32 sessionId);
3099 
3100  bool SendMatchStationInfoToOtherClient();
3101 
3102  void CleanupStatus(bool isPostponeCleanupLocalStationId = false);
3103 
3104  void ChangeStatusToDisconnectedSession();
3105  void ChangeStatusToDisconnectedNetwork();
3106 
3107  void CancelJoinProcessByFatalError();
3108 
3109  // A pointer to a singleton instance.
3110  static Session* s_pInstance;
3111 
3112  static DebugSetting s_DebugSetting;
3113 
3114  bool m_IsUsingHostMigration;
3115 
3116  //
3117  bool m_IsNecessaryServer;
3118 
3119  MeshLayerController* m_pMeshLayerController;
3120 
3121  SessionStatusCheckJob* m_pSessionStatusCheckJob;
3122  CreateSessionJob* m_pCreateSessionJob;
3123  AutoMatchmakeJob* m_pAutoMatchmakeJob;
3124  BrowseMatchmakeJob* m_pBrowseMatchmakeJob;
3125  JoinSessionJob* m_pJoinSessionJob;
3126  LeaveSessionJob* m_pLeaveSessionJob;
3127  DestroySessionJob* m_pDestroySessionJob;
3128  OpenParticipationJob* m_pOpenParticipationJob;
3129  //OpenSessionJob* m_pOpenSessionJob;
3130  CloseParticipationJob* m_pCloseParticipationJob;
3131  //CloseSessionJob* m_pCloseSessionJob;
3132  ConfigParticipationJobBase* m_pConfigParticipationJob;
3133 
3134  GenerateMatchmakeSystemPasswordJob* m_pGenerateMatchmakeSystemPasswordJob;
3135  ClearMatchmakeSystemPasswordJob* m_pClearMatchmakeSystemPasswordJob;
3136 
3137  u32 m_SessionPasswordSize;
3138  wchar_t* m_pSessionPassword;
3139 
3140  JointSessionJob* m_pJointSessionJob;
3141 
3142  ModifyAttributeJob* m_pModifyAttributeJob;
3143  UpdateSessionSettingJob* m_pUpdateSessionSettingJob;
3144  UpdateApplicationDataJob* m_pUpdateApplicationDataJob;
3145 
3146 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
3147  RefereeStartGameJob* m_pRefereeStartGameJob;
3148  RefereeEndGameJob* m_pRefereeEndGameJob;
3149  RefereeEndGameWithoutReportJob* m_pRefereeEndGameWithoutReportJob;
3150  RefereeGetOrCreateStatsJob* m_pRefereeGetOrCreateStatsJob;
3151 #endif
3152 
3153  SessionSearchCriteria* m_pPrimarySessionSearchCriteria;
3154  SessionSearchCriteria* m_pSecondarySessionSearchCriteria;
3155 
3156  SessionEventCallback m_SessionEventCallback;
3157  JoiningApprovalCallback m_JoiningApprovalCallback;
3158 
3159  StationIdStatusTable* m_pStationIdStatusTable;
3160 
3161  u32 m_SessionProtocolHandle;
3162  SessionProtocol* m_pSessionProtocol;
3163 
3164  ModuleState m_ModuleState;
3165  MatchmakeStatus m_MatchmakeStatus;
3166 
3167  ConnectionStatus m_ConnectionStatus;
3168 
3169  StationId m_LocalStationId;
3170  StationId m_HostStationId;
3171  StationId m_JointSessionHostStationId;
3172 
3173  u32 m_PrincipalId;
3174 
3175  enum AsyncProcessingName
3176  {
3177  ASYNC_NOTHING = 0,
3178  ASYNC_AUTO_MATCHMAKE,
3179  ASYNC_BROWSE_SESSION,
3180  ASYNC_CREATE_SESSION,
3181  ASYNC_JOIN_SESSION,
3182  ASYNC_LEAVE_SESSION,
3183  ASYNC_OPEN_PARTICIPATION,
3184  ASYNC_OPEN_SESSION,
3185  ASYNC_CLOSE_PARTICIPATION,
3186  ASYNC_CLOSE_SESSION,
3187  ASYNC_GENERATE_MATCHMAKE_SYSTEM_PASSWORD,
3188  ASYNC_CLEAR_MATCHMAKE_SYSTEM_PASSWORD,
3189  ASYNC_AUTO_MATCHMAKE_GAME,
3190  ASYNC_BROWSE_GAME_SESSION,
3191  ASYNC_CREATE_GAME_SESSION,
3192  ASYNC_JOIN_GAME_SESSION,
3193  ASYNC_LEAVE_GAME_SESSION,
3194  ASYNC_OPEN_GAME_SESSION_PARTICIPATION,
3195  ASYNC_CLOSE_GAME_SESSION_PARTICIPATION,
3196  ASYNC_MERGE_SESSION,
3197  ASYNC_MERGE_RANDOM_SESSION,
3198  ASYNC_DEMERGE_SESSION,
3199  ASYNC_CREATE_JOINT_SESSION,
3200  ASYNC_JOIN_JOINT_SESSION,
3201  ASYNC_JOIN_RANDOM_JOINT_SESSION,
3202  ASYNC_DESTROY_JOINT_SESSION,
3203  ASYNC_LEAVE_JOINT_SESSION,
3204  ASYNC_OPEN_JOINT_SESSION_PARTICIPATION,
3205  ASYNC_CLOSE_JOINT_SESSION_PARTICIPATION,
3206  ASYNC_OPEN_JOINT_SESSION,
3207  ASYNC_CLOSE_JOINT_SESSION,
3208  ASYNC_UPDATE_SESSION_SETTING,
3209  ASYNC_UPDATE_JOINT_SESSION_SETTING,
3210  ASYNC_UPDATE_APPLICATION_DATA,
3211  ASYNC_UPDATE_JOINT_SESSION_APPLICATION_DATA,
3212 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
3213  ASYNC_START_GAME,
3214  ASYNC_END_GAME,
3215  ASYNC_END_GAME_WITHOUT_REPORT,
3216  ASYNC_GET_OR_CREATE_REFEREE_STATS,
3217 #endif
3218  ASYNC_MODIFY_MATCHMAKE_SESSION_ATTRIBUTE,
3219  ASYNC_MODIFY_JOINT_SESSION_ATTRIBUTE
3220  };
3221 
3222  void ResetInternalAsyncState();
3223  bool IsCompletedAsyncProcess(AsyncProcessingName processingName) const;
3224  nn::Result GetAsyncProcessResult(AsyncProcessingName processingName) const;
3225  nn::Result CancelAsyncProcess(AsyncProcessingName processingName);
3226 
3227  nn::Result OpenParticipationCore(u32 sessionId, IMatchmakeSession* pMatchmakeSession, AsyncProcessingName asyncProcessName);
3228  nn::Result OpenSessionCore(u32 sessionId, IMatchmakeSession* pMatchmakeSession, AsyncProcessingName asyncProcessName);
3229  nn::Result CloseParticipationCore(u32 sessionId, IMatchmakeSession* pMatchmakeSession, AsyncProcessingName asyncProcessName);
3230  nn::Result CloseSessionCore(u32 sessionId, IMatchmakeSession* pMatchmakeSession, AsyncProcessingName asyncProcessName);
3231 
3232  nn::Result ModifyAttributeAsyncCore(u32 attributeIndex, u32 newValue, u32 targetSessionId, nn::pia::session::IMatchmakeSession* ptargetMatchmakeSession);
3233  nn::Result UpdateSessionSettingAsyncCore(UpdateSessionSetting* pUpdateSessionSetting, u32 targetSessionId);
3234  nn::Result UpdateApplicationDataAsyncCore(const void* pApplicationBuffer, size_t dataSize, u32 targetSessionId);
3235 
3236  common::CallContext m_InternalContext;
3237  AsyncProcessingName m_CurrentAsyncProcessingName;
3238 
3239  MeshEventListenerForSession* m_pMeshEventListenerForSession;
3240 
3241  void CallSessionEventCallback(SessionEventType eventType, StationId stationId);
3242 
3243  bit32 m_WaitingStationIndexBitmap;
3244  bool m_WaitingOtherClientsStationIdFlag;
3245  bool LeaveNoticeToWaitingStationIndex(StationIndex leaveStationIndex);
3246  void ClearWaitingStationIndex();
3247 
3248  bool m_LeaveIgnorableFlag;
3249  bool m_PostponeJoinEventFlag;
3250  void SetLeaveIgnorableFlag(bool isLeaveIgnorable)
3251  {
3252  m_LeaveIgnorableFlag = isLeaveIgnorable;
3253  }
3254  void SetPostponeJoinEvent(bool isPostponeJoinEvent)
3255  {
3256  m_PostponeJoinEventFlag = isPostponeJoinEvent;
3257  }
3258 
3259  u8 currentIndex() const
3260  {
3261  return m_CurrentMatchmakeSessionIndex;
3262  }
3263  u8 bufferIndex() const
3264  {
3265  return (m_CurrentMatchmakeSessionIndex == 0 ? 1 : 0);
3266  }
3267  void SetCurrentSessionId(u32 sessionId)
3268  {
3269  m_SessionId[currentIndex()] = sessionId;
3270  }
3271  void SetBufferSessionId(u32 sessionId)
3272  {
3273  m_SessionId[bufferIndex()] = sessionId;
3274  }
3275  void SetCurrentMaxParticipantNum(u8 num)
3276  {
3277  m_MaxParticipantNum[currentIndex()] = num;
3278  }
3279  void SetBufferMaxParticipantNum(u8 num)
3280  {
3281  m_MaxParticipantNum[bufferIndex()] = num;
3282  }
3283  void SwapMatchmakeSessionBuffer()
3284  {
3285  m_CurrentMatchmakeSessionIndex = bufferIndex();
3286  }
3287 
3288  u8 m_MaxParticipantNum[2];
3289  u8 m_CurrentMatchmakeSessionIndex;
3290  IMatchmakeSession* m_pMatchmakeSessionPtrArray[2];
3291  ISessionInfoList* m_pSessionInfoList;
3292  u32 m_SessionId[2];
3293 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
3294  IMatchmakeReferee* m_pMatchmakeRefereePtr;
3295 #endif
3296  void ChangeStationIdConvertEnableFlag(bool flag);
3297 
3298  TStationIdList m_ValidStationIdList;
3299  void* m_pValidStationIdListBuffer;
3300  void validateStationId(const StationId& targetStationId);
3301  void invalidateStationId(const StationId& targetStationId);
3302 
3303  u32 m_SessionIdOfJointSessionHost;
3304 
3305  // Flag for the matchmaking analysis feature.
3306  // Flag that detects events indicating that host migration has occurred.
3307  bool m_IsHostMigrateOccurred;
3308  nn::pia::transport::Station::IdentificationToken m_MatchmakeAnalysisToken;
3309 
3310  static const int CLOSE_SESSION_LIST_NUM = 4;
3311  u32 m_CloseSessionId[CLOSE_SESSION_LIST_NUM];
3312 
3313  bool m_IsUsingLastGidOption;
3314 
3315 };
3316 }
3317 }
3318 } // end of namespace nn::pia::session
Specifies that the disconnection from the session was caused by the library. One way to get this valu...
Definition: session_Session.h:307
Indicates that host migration failed. (Only occurs when host migration is enabled.)
Definition: session_Session.h:339
Indicates that the process of disbanding a joint session has started. (Only occurs when using the joi...
Definition: session_Session.h:347
Indicates that the process of creating a joint session has finished. (Only occurs when using the join...
Definition: session_Session.h:342
Status
Enumerates session states.
Definition: session_Session.h:319
Indicates that the process of leaving a joint session has started. (Only occurs when using the joint ...
Definition: session_Session.h:349
s32 uplinkBitRateLowerLimit
Specifies the minimum rate required by the application when using the bitrate detection feature...
Definition: session_Session.h:217
Stores parameters passed to the nn::pia::session::Session::CreateInstance() function.
Definition: session_Session.h:155
EmulationType
Enumerates connection path emulation settings. (For debugging.)
Definition: session_Mesh.h:308
bool isEnableRelayEmulation
Settings for the connection route emulation feature for debugging.
Definition: session_Session.h:186
const nn::pia::transport::Station::IdentificationToken * pToken
Specifies a pointer to the identification token indicating the local device. If NULL is specified...
Definition: session_Session.h:222
StationIdIterator Begin()
Gets an iterator for the valid StationId objects in the session (non-const version).
Definition: session_Session.h:1821
const nn::pia::transport::Station::PlayerName * pPlayerName
Specifies the name and language code associated with the local station. Other members of the mesh acc...
Definition: session_Session.h:212
This class contains processes for matchmaking and for creating and joining sessions used for P2P comm...
Definition: session_Session.h:128
Specifies that no communication has been performed. You get this value if you never build or join a s...
Definition: session_Session.h:303
Joined a session.
Definition: session_Session.h:322
StationIndex
Enumerates StationIndex values.
Definition: platformCtr.h:44
Definition of the StationId identifying the station within the session.
Definition: types.h:33
Definition: assert.h:115
Indicates that the host of the joint session has changed. (Only occurs when using the joint session f...
Definition: session_Session.h:340
bool isDisableCheckMaxSilenceTime
Does not check the range set for the maximum time without communication.
Definition: session_Session.h:188
(For debugging.) This structure stores the debug feature settings that are passed to nn::pia::session...
Definition: session_Session.h:178
u32 maxSilenceTime
Specifies the maximum allowable time without communication (in milliseconds). The default value is se...
Definition: session_Session.h:214
A system password was set on the session.
Definition: session_Session.h:352
The base class for the search criteria used when searching for sessions.
Definition: session_SessionSearchCriteria.h:34
StationId GetHostStationId() const
Gets the StationId that represents the host of the session where the local station is a participant...
Definition: session_Session.h:1623
StationIdConstIterator End() const
Gets an iterator for the valid StationId objects in the session (non-const version).
Definition: session_Session.h:1854
u8 browsedSessionInfoListNum
Size of the list that stores the session search results.
Definition: session_Session.h:169
Not communicating.
Definition: session_Session.h:321
DisconnectReason
Enumerates reasons why a Session object cannot communicate.
Definition: session_Session.h:300
bool bUsingHostMigration
Sets the use of the host migration feature. The default is true (enabled).
Definition: session_Session.h:211
Specifies that the disconnection was caused by a desync. (The session information was no longer consi...
Definition: session_Session.h:308
Base class that manages settings specific to session creation.
Definition: session_CreateSessionSetting.h:38
Indicates that a joint session has started through random matchmaking. (Only occurs when using the jo...
Definition: session_Session.h:345
Full-Mesh Network Topology.
Definition: session_types.h:45
Indicates that the process of joining a joint session has finished. (Only occurs when using the joint...
Definition: session_Session.h:344
Do not measure the bitrate.
Definition: session_types.h:58
Indicates that the session migration process for the joint session feature failed. (Only occurs when using the joint session feature.)
Definition: session_Session.h:351
Indicates that the process of leaving a joint session has finished. (Only occurs when using the joint...
Definition: session_Session.h:350
Stores the player name struct associated with a Station.
Definition: transport_Station.h:692
StationIdIterator End()
Gets an iterator for the valid StationId objects in the session (non-const version).
Definition: session_Session.h:1832
Indicates that the process of disbanding a joint session has finished. (Only occurs when using the jo...
Definition: session_Session.h:348
NetworkTopology
Enumerated type for configuring the network topology of a mesh created with the Session class or the ...
Definition: session_types.h:43
StationId GetLocalStationId() const
Gets the StationId that represents the local station in the session.
Definition: session_Session.h:1610
Represents the calling context.
Definition: common_CallContext.h:43
A station has left.
Definition: session_Session.h:337
static const s32 NN_PIA_SESSION_KEEP_ALIVE_INTERVAL_DEFAULT
The default value for the sending interval (in milliseconds) for keep-alive.
Definition: session_types.h:29
This structure stores settings passed to nn::pia::session::Session::Startup.
Definition: session_Session.h:194
Base class that manages settings specific to session criteria updates.
Definition: session_UpdateSessionSetting.h:30
Specifies that the disconnection was caused by something other than the session. One way to get this ...
Definition: session_Session.h:310
static const s32 NN_PIA_SESSION_MAX_SILENCE_TIME_DEFAULT
The default value for the amount of time without communication (in milliseconds) after which it is de...
Definition: session_types.h:30
transport::NetworkFactory * pNetworkFactory
Pointer to a NetworkFactory specified for each network.
Definition: session_Session.h:167
None.
Definition: common_CryptoSetting.h:49
SessionEventType
This enumerated type is passed as a parameter to the callback that sends notifications about changes ...
Definition: session_Session.h:334
Joined a joint session.
Definition: session_Session.h:324
The interface for the session information list.
Definition: session_ISessionInfoList.h:32
Being transferred to a session by the joint session feature. (Includes a period with no communication...
Definition: session_Session.h:323
An interface (factory pattern) for generating the classes needed by the network.
Definition: transport_NetworkFactory.h:89
Represents an address used to uniquely identify stations.
Definition: transport_StationConnectionInfo.h:35
size_t bitRateCheckPacketSize
Specifies the IP packet size used for testing when using the bitrate detection feature. The value is in bytes. The expected value is the average size of IP packet sent and received by the application. It must be a multiple of 4. The default is 0.
Definition: session_Session.h:218
Mode
Indicates the type of encryption algorithm.
Definition: common_CryptoSetting.h:47
StationIdConstIterator Begin() const
Gets an iterator for the valid StationId objects in the session (non-const version).
Definition: session_Session.h:1843
Specifies that the disconnection was caused by the local station. You get this value when the local s...
Definition: session_Session.h:304
Specifies that the disconnection was caused by another station in the session. One way to get this va...
Definition: session_Session.h:305
Base class that manages settings specific to session joining.
Definition: session_JoinSessionSetting.h:39
u32 GetSessionId() const
Gets the session ID.
Definition: session_Session.h:1782
An iterator for accessing valid StationId objects in a session (non-const version).
Definition: session_Session.h:386
BitRateCheckMode
Enumerated type for setting the bitrate detection feature.
Definition: session_types.h:56
Indicates that the process of joining a joint session has started. (Only occurs when using the joint ...
Definition: session_Session.h:343
static const s32 NN_PIA_SESSION_INVALID_UPLINK_BIT_RATE_LOWER_LIMIT
This constant represents an invalid bitrate in the bitrate detection feature.
Definition: session_types.h:36
Stores the ID token associated with a Station.
Definition: transport_Station.h:682
Disconnected from the session. Call Cleanup after calling LeaveSessionAsync.
Definition: session_Session.h:325
u32 keepAliveSendingInterval
Specifies the send interval for keep-alive (in milliseconds). The default value is session::NN_PIA_SE...
Definition: session_Session.h:215
Indicates that the host of the session has changed. (Only occurs when host migration is enabled...
Definition: session_Session.h:338
nn::pia::common::CryptoSetting::Mode cryptoMode
Specifies the encryption setting mode. Defaults to common::CryptoSetting::MODE_NOTHING.
Definition: session_Session.h:213
s32 bitRateMeasuringSpan
Sets the time to spend measuring when the bit rate detection feature is used. The value is in millise...
Definition: session_Session.h:219
Specifies that the disconnection was caused by a failed host migration.
Definition: session_Session.h:309
An iterator for accessing valid StationId objects in a session (const version).
Definition: session_Session.h:421
session::NetworkTopology networkTopology
Specifies the network topology setting for the session.
Definition: session_Session.h:168
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40
Indicates that a joint session started through random matchmaking has been completed. (Only occurs when using the joint session feature.)
Definition: session_Session.h:346
bool isSkipBitRateCheck
Set to skip detection processes when using bitrate detection. Specify true to skip. The default is false.
Definition: session_Session.h:220
Specifies that the local station was kicked out from the session because of a call to the Session::Ki...
Definition: session_Session.h:306
bool IsUsingHostMigration() const
Gets whether host migration is enabled.
Definition: session_Session.h:2903
static Session * GetInstance()
Gets the Session class instance (singleton pattern).
Definition: session_Session.h:493
session::BitRateCheckMode bitRateCheckMode
Settings for the bitrate detection feature.
Definition: session_Session.h:171
bool isEnableMatchmakeAnalysis
Settings for the matchmaking analysis feature.
Definition: session_Session.h:187