CTR Pia  4.11.3
Game Communication Engine
inet_NexFacade.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: inet_NexFacade.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/inet/inet_definitions.h>
18 #include <pia/common/common_SignatureSetting.h>
19 #include <pia/transport/transport_NetworkFactory.h>
20 
21 #if NN_PIA_NEX_3
22 
23 #if NN_PIA_CTR
24 #pragma diag_suppress 1300
25 #endif
26 
27 #include <OnlineCore/src/Platform/Core/qList.h>
28 #include <OnlineCore/src/Transport/Interface/StationURL.h>
29 #include <RendezVous/Core/src/Client/Credentials.h>
30 #include <RendezVous/Core/src/Common/Constants/NotificationEvents.h>
31 #if NN_PIA_ENABLE_LOOSE_COUPLING_NEX
32 #include <RendezVous/Services/NATTraversal/src/Client/NATTraversalClient.h>
33 #endif
34 
35 #include <RendezVous/Services/MatchMaking.h>
36 
37 #include <RendezVous/Services/Jugem/Login/src/Client/NgsFacade.h>
38 
39 #if NN_PIA_ENABLE_NGS_BRIDGE
40 // n1589: Not included in NgsFacade.h.
41 #include <RendezVous\/Services/Jugem/Login/src/Client/NgsBridgeInterface.h>
42 #endif
43 
44 #include <RendezVous/Services/Jugem/Matchmake/src/Client/MatchmakeExtensionClient.h>
45 
46 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
47 #include <RendezVous/Services/Jugem/MatchmakeReferee/src/Client/MatchmakeRefereeClient.h>
48 #endif
49 
50 #if NN_PIA_CTR
51 #pragma diag_default 1300
52 #endif
53 
54 #else // Not NN_PIA_NEX_3.
55 
56 #include <Platform/Core/String.h>
57 #include <Platform/Core/qList.h>
58 #include <Plugins/Transport/Interface/StationURL.h>
59 #include <Services/Foundation/Client/Credentials.h>
60 #include <Services/MatchMaking.h>
61 #if NN_PIA_ENABLE_LOOSE_COUPLING_NEX
62 #include <Services/NATTraversalClient.h>
63 #endif
64 
65 #include <RVPackages/Jugem/Game/Login/Client/NgsFacade.h>
66 #include <RVPackages/Jugem/Game/Matchmake/Client/MatchmakeExtensionClient.h>
67 
68 #endif // end NN_PIA_NEX_3
69 
70 namespace nn
71 {
72 namespace pia
73 {
74 namespace common
75 {
76 class String;
77 }
78 }
79 }
80 
81 namespace nn
82 {
83 namespace pia
84 {
85 namespace transport
86 {
87 class StationConnectionInfo;
88 }
89 }
90 }
91 
92 namespace nn
93 {
94 namespace pia
95 {
96 namespace inet
97 {
98 #if NN_PIA_ENABLE_LOOSE_COUPLING_NEX
99 class NexNatRelay;
100 #endif
101 class NexNatTraversalClient;
102 class NexNotificationDataJob;
103 class NatTraverser;
104 class NatProperty;
105 class SocketOutputStream;
106 class SocketInputStream;
107 class Socket;
108 
109 /*!
110  @brief Represents the NEX library facade (interface wrapper) class.
111 
112  @details This is not the facade for the <tt>nn::pia::inet::Nex*</tt> classes, but for the NEX library classes.
113 
114  @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.
115  @date 2014-04-01 Added the <tt>Bind()</tt> and <tt>Unbind()</tt> functions and <tt>LoginInfo</tt>. In conjunction with that, modified the arguments for the <tt>Startup()</tt> function.
116  @date 2014-03-25 Deleted the <tt>GetNatProperty()</tt> function. Added the <tt>GetNatPropertyMapping()</tt>, <tt>GetNatPropertyFiltering()</tt>, <tt>GetNatPropertyPortIncrement()</tt>, <tt>GetNatPropertyPublicPort()</tt>, and <tt>GetNatPropertyInterfacePort()</tt> functions.
117  @date 2014-03-18 Deleted the <tt>ConvertNexStationURLToStationConnectionInfo()</tt> function. Made the <tt>ConvertNexInetAddressToInetAddress()</tt>, <tt>ConvertInetAddressToNexInetAddress()</tt>, and <tt>ConvertStationLocationToNexStationUrl()</tt> functions private.
118  @date 2014-01-15 Made changes so that the name resolution process that was being done in the <tt>StartNatSessionAsync()</tt> function now uses the socket library directly.
119  @date 2013-12-18 Added the <tt>StartNatSessionAsync()</tt>, <tt>IsCompletedStartNatSession()</tt>, <tt>GetStartNatSessionResult()</tt>, and <tt>CancelStartNatSessionAsync()</tt> functions.
120  @date 2013-11-27 Deleted <tt>ResultDnsFailed</tt> from the <tt>StartNatSession()</tt> return values and added it to the <tt>Result</tt> values that could be returned through <tt>CallContext</tt> when asynchronous processes fail.
121  @date 2013-09-18 Added the game server ID as the third parameter of the <tt>Startup()</tt> function.
122  @date 2013-09-05 Added the fact that the NEX allocator is called inside the <tt>Startup()</tt> function.
123  @date 2013-07-02 Changed the first argument of the <tt>Startup()</tt> function from <tt>nn::nex::Credentials*</tt> to <tt>nn::nex::NgsFacade*</tt>.
124  @date 2012-12-03 Added <tt>ConvertNexSignatureKeyToSignatureSetting</tt>.
125  @date 2012-12-03 Added <tt>ConvertNexStationUrlToStationConnectionInfo</tt>.
126  @date 2012-12-03 Deprecated <tt>ConvertNexStationURLToStationConnectionInfo</tt>.
127  @date 2012-12-03 Renamed the <tt>ConvertStationLocationToNexStationURL()</tt> function to <tt>ConvertStationLocationToNexStationUrl()</tt>.
128  @date 2012-12-03 Renamed the <tt>ConvertNexStationURLToStationLocation()</tt> function to <tt>ConvertNexStationUrlToStationLocation()</tt>.
129  @date 2012-11-29 Moved the parts of the <tt>nn::pia::transport::StationLocation</tt> function that bring in a dependency on NEX here.
130  @date 2012-11-21 Added the <tt>ConvertStationLocationToNexStationURL()</tt> and <tt>ConvertNexStationURLToStationLocation()</tt> functions.
131  @date 2012-11-21 Added the <tt>ConvertNexInetAddressToInetAddress()</tt> and <tt>ConvertInetAddressToNexInetAddress()</tt> functions.
132  @date 2012-05-17 Added the <tt>NexFacade::UpdateGatheringID</tt> function to get the <tt>GatheringID</tt> of the matchmaking session from the application.
133  @date 2012-05-16 Added parameters to the <tt>NexFacade::Startup function</tt>.
134  @date 2012-04-06 Initial version.
135  */
137 {
138 public:
139  //n1589: It must match NEX.
140 /*!
141  @brief The NAT port mapping type.
142 */
143  enum Mapping
144  {
145  MAPPING_UNKNOWN = 0, //!< An unknown type.
146  MAPPING_EIM, //!< Specifies endpoint independent mapping (EIM).
147  MAPPING_EDM //!< Specifies endpoint dependent mapping, symmetric (EDM).
148  };
149 
150  //n1589: It must match NEX.
151 /*!
152  @brief The NAT filtering type.
153 */
155  {
156  FILTERING_UNKNOWN = 0, //!< An unknown type.
157  FILTERING_PIF, //!< Specifies port independent filtering (PIF).
158  FILTERING_PDF //!< Specifies port dependent filtering (PDF).
159  };
160 
161 /*!
162  @brief Information about the NEX game server that was logged in to.
163 */
164  struct LoginInfo
165  {
166  LoginInfo()
167  : pNgsFacade(NULL), gameServerId(0)
168  {
169  }
170  nn::nex::NgsFacade* pNgsFacade; //!< The <tt>nn::nex::NgsFacade</tt> instance that was logged in to on the game server.
171  u32 gameServerId; //!< The game server ID specified when logging in to the game server.
172  };
173 
174 /*!
175  @brief Creates an instance (singleton pattern).
176 
177  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned. You must make sure that the implementation of this function in your application does not return any errors.
178  @retval nn::pia::ResultNotInitialized Indicates that the <tt>inet</tt> module is not initialized. Programming error. Fix your program so that this error is not returned.
179  @retval nn::pia::ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.
180  @retval nn::pia::ResultAlreadyExists Indicates that an instance has already been created. Programming error. Fix your program so that this error is not returned.
181  */
182  static nn::Result CreateInstance(void);
183 
184 /*!
185  @brief Destroys the instance (singleton pattern).
186 
187  @details This function does nothing and returns if called when an instance has not been created.
188  Returns from the function without doing anything.
189  */
190  static void DestroyInstance(void);
191 
192 /*!
193  @brief Gets the pointer to the <tt>NexFacade</tt> instance (singleton pattern).
194 
195  @return Returns a null pointer if the instance cannot be created.
196  */
197  static NexFacade* GetInstance(void)
198  {
199  return s_pInstance;
200  }
201 
202 /*!
203  @brief Converts <tt>nn::nex::StationURL</tt> to <tt>@ref nn::pia::transport::StationConnectionInfo</tt>.
204 
205  @details Converts the connection point information obtained from <tt>nn::nex::MatchmakeExtensionClient::GetMeshURLs</tt> to Pia station connection information.
206  The converted station connection information can be used with <tt>@ref nn::pia::session::Mesh::JoinMeshAsync</tt>.
207 
208  @param[in] nexStationUrlList Specifies the connection to convert. There must be one or two elements.
209  @param[in] pStationConnectionInfo Specifies the station connection to convert to.
210 
211  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned. You must make sure that the implementation of this function in your application does not return any errors.
212  @retval nn::pia::ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
213  */
214  static nn::Result ConvertNexStationUrlToStationConnectionInfo(
215  const nn::nex::qList<nn::nex::StationURL>& nexStationUrlList,
216  nn::pia::transport::StationConnectionInfo* pStationConnectionInfo);
217 
218 /*!
219  @brief Converts a <tt>NEX</tt> <tt>StationURL</tt> instance to a <tt>PiaTransport</tt> <tt>StationLocation</tt> instance.
220  @param[in] url Specifies the NEX <tt>StationURL</tt> instance.
221  @param[out] pLocation Specifies the <tt>StationLocation</tt> instance of <tt>PiaTransport</tt>.
222  @see ConvertStationLocationToNexStationUrl
223  */
224  static void ConvertNexStationUrlToStationLocation(const nn::nex::StationURL& url, transport::StationLocation* pLocation);
225 
226 /*!
227  @cond PRIVATE
228  @brief Converts a NEX <tt>InetAddress</tt> to a Pia <tt>InetAddress</tt>.
229 
230  @details This function is thread-safe.
231 
232  @param[in] nexAddress Specifies the NEX <tt>InetAddress</tt>.
233  @param[out] pAddress Specifies the Pia <tt>InetAddress</tt>.
234  @endcond
235  */
236  static void ConvertNexInetAddressToInetAddress(const nn::nex::InetAddress& nexAddress, nn::pia::common::InetAddress* pAddress);
237 
238 /*!
239  @cond PRIVATE
240  @brief Converts a Pia <tt>InetAddress</tt> to a NEX <tt>InetAddress</tt>.
241 
242  @details This function is thread-safe.
243 
244  @param[in] address Specifies the Pia <tt>InetAddress</tt>.
245  @param[out] pNexAddress Specifies the NEX <tt>InetAddress</tt>.
246  @endcond
247  */
248  static void ConvertInetAddressToNexInetAddress(const nn::pia::common::InetAddress& address, nn::nex::InetAddress* pNexAddress);
249 
250 /*!
251  @cond PRIVATE
252  @brief Converts a <tt>PiaTransport</tt> <tt>StationLocation</tt> instance to a NEX <tt>StationURL</tt> instance.
253  @param[in] location Specifies the <tt>StationLocation</tt> instance of <tt>PiaTransport</tt>.
254  @param[out] pUrl Specifies the NEX <tt>StationURL</tt> instance.
255  @see ConvertNexStationUrlToStationLocation
256  @endcond
257  */
258  static void ConvertStationLocationToNexStationUrl(const transport::StationLocation& location, nn::nex::StationURL* pUrl);
259 
260 /*!
261  @cond PRIVATE
262  @endcond
263  */
264  static bool IsBehindNat(const transport::StationLocation& location);
265 
266 /*!
267  @cond PRIVATE
268  @endcond
269  */
270  static bool IsPublic(const transport::StationLocation& location);
271 
272 /*!
273  @cond PRIVATE
274  @endcond
275  */
276  static bool IsGlobal(const transport::StationLocation& location);
277 
278 /*!
279  @cond PRIVATE
280  @endcond
281  */
282  static bool IsEdmMapping(const transport::StationLocation& location);
283 
284 /*!
285  @cond PRIVATE
286  @endcond
287  */
288  static bool IsEimMapping(const transport::StationLocation& location);
289 
290 /*!
291  @cond PRIVATE
292  @endcond
293  */
294  static void ConvertStationLocationToStationUrlNexList(
295  const nn::nex::qList<transport::StationLocation>& stationLocationList,
296  nn::nex::qList<nn::nex::StationURL>* pStationUrlList);
297 
298 /*!
299  @cond PRIVATE
300  @endcond
301  */
302  static void ConvertStationUrlToStationLocationNexList(
303  const nn::nex::qList<nn::nex::StationURL>& stationUrlList,
304  nn::nex::qList<transport::StationLocation>* pStationLocationList);
305 
306 /*!
307  @cond PRIVATE
308  @brief Converts an <tt>nex::String</tt> to a <tt>nn::pia::common::String</tt>.
309  @param[in] nexString Specifies the <tt>nex::String</tt> to convert.
310  @param[out] pString Specifies the <tt>nn::pia::common::String</tt> to convert to.
311  @endcond
312  */
313  static void ConvertNexStringToString(const nn::nex::String& nexString, nn::pia::common::String* pString);
314 
315 /*!
316  @brief Converts an <tt>nn::nex::qVector<nn::nex::qByte></tt> shared session key to an <tt>nn::pia::common::SignatureSetting</tt> instance.
317 
318  @details Converts the shared session key obtained from the game server during matchmaking into a key for the class used to configure the packet-signing feature.
319  Either configure the converted <tt>nn::pia::common::SignatureSetting</tt> instance with a buffer for the key beforehand, or use the <tt>@ref nn::pia::common::SignatureSettingWithKeyBuffer</tt> class.
320  The converted packet-signing settings are required by the <tt>@ref nn::pia::session::Mesh::Startup</tt> function.
321 
322  @param[in] nexSignatureKey Specifies the <tt>nn::nex::qVector<nn::nex::qByte></tt> instance to convert from.
323  @param[out] pSignatureSetting Specifies the <tt>nn::pia::common::SignatureSetting</tt> instance to convert to.
324 
325  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned. You must make sure that the implementation of this function in your application does not return any errors.
326  @retval nn::pia::ResultInvalidArgument Indicates that one or more arguments are invalid. Make sure that the buffer in the <tt>nn::pia::common::SignatureSetting</tt> instance is at least as large as the original data. Programming error. Fix your program so that this error is not returned.
327  */
328 
329  static nn::Result ConvertNexSignatureKeyToSignatureSetting(
330  const nn::nex::qVector<nn::nex::qByte>& nexSignatureKey,
331  nn::pia::common::SignatureSetting* pSignatureSetting);
332 
333 /*!
334  @cond PRIVATE
335  @endcond
336  */
337  static void EnableLanNetwork(bool o)
338  {
339  PIA_TRACE_EX(common::TRACE_FLAG_INET, "EnableLanNetwork:%d", o);
340  s_LanNetwork = o;
341  }
342 
343 /*!
344  @cond PRIVATE
345  @endcond
346  */
347  static bool IsLanNetwork()
348  {
349  return s_LanNetwork;
350  }
351 
352 /*!
353  @cond PRIVATE
354  @endcond
355  */
356  nn::Result CreateProtocols();
357 
358 /*!
359  @brief Registers information for the game server that was logged in to.
360 
361  @details This function registers the game server ID, and an instance of the <tt>nn::nex::NgsFacade</tt> class when a login to the NEX game server succeeds with the Pia library.
362  Call it in the interval between logging in to the NEX game server and calling the <tt>NexFacade::Startup</tt> function.
363 
364  @param[in] pLoginInfo Specifies a pointer to the NEX game server information <tt>LoginInfo</tt>.
365 
366  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned. You must make sure that the implementation of this function in your application does not return any errors.
367  @retval nn::pia::ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
368  @see Unbind, Startup
369 */
370  virtual nn::Result Bind(LoginInfo* pLoginInfo);
371 
372 /*!
373  @brief Deletes the information on the registered game server.
374 
375  @details This function deletes the game server ID's registration information, and an instance of the <tt>nn::nex::NgsFacade</tt> class from the Pia library when a login to the NEX game server succeeds.
376  Call this function in the interval between the call to the <tt>NexFacade::Cleanup</tt> function and logging out from the NEX game server.
377  @see Bind, Startup
378 */
379  virtual void Unbind();
380 
381 /*!
382  @brief Notifies the game server of game-specific events.
383  @details Notifies friends logged in to the same game server of events that have been uniquely defined in the game.
384  Log in to the gamer server and call this function in the interval between the calls to <tt>Bind</tt> and <tt>Unbind</tt>.
385  Limit the frequency of event notifications so there are no more than 10 notifications in any minute.
386 
387  @param[in] gameNotificationType The game-defined event type (<tt>nn::nex::NotificationEvents::GameNotificationEvent1</tt> through <tt>nn::nex::NotificationEvents::GameNotificationEvent8</tt>).
388  @param[in] param1 Specifies an event parameter.
389  @param[in] param2 Specifies an event parameter.
390  @param[in] strParam Specifies an event parameter string. Limit the string to no longer than 256 characters.
391  @param[in] strParamLength The length of the event parameter string. Limit the string to no longer than 256 characters.
392  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned. You must make sure that the implementation of this function in your application does not return any errors.
393  @retval nn::pia::ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
394  @retval nn::pia::ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.
395 */
396  Result UpdateNotificationDataAsync(nn::nex::NotificationEvents::NotificationEvents gameNotificationType, u32 param1, u32 param2, const wchar_t* strParam, size_t strParamLength);
397 
398 /*!
399  @brief Checks for completion of asynchronous processing by <tt>UpdateNotificationDataAsync</tt>.
400  @details After <tt>UpdateNotificationDataAsync</tt> has been called, this function checks the completion of the asynchronous process.
401 
402  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise.
403 */
404  bool IsCompletedUpdateNotificationData() const;
405 
406 /*!
407  @brief Gets the result of the <tt>UpdateNotificationDataAsync</tt> asynchronous process.
408  @details This function gets the result after <tt>UpdateNotificationDataAsync</tt> has been called, and <tt>IsCompletedUpdateNotificationData</tt> has confirmed that the process is complete.
409 
410  @return Returns the result of the <tt>UpdateNotificationDataAsync</tt> asynchronous process. The following results are returned when the process ends.
411  @retval ResultSuccess The asynchronous process succeeded.
412  @retval nn::pia::ResultInvalidState Indicates that the <tt>UpdateNotificationDataAsync</tt> function was called at the wrong time, or the asynchronous process has not completed. Programming error. Fix your program so that this error is not returned.
413  @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.
414 */
415  Result GetUpdateNotificationDataResult() const;
416 
417 /*!
418  @brief Gets the game-specific events that were sent as notifications to the game server.
419  @details Gets events, uniquely defined by the game, that friends logged in to the same game server have sent as notifications.
420  Log in to the gamer server and call this function in the interval between the calls to <tt>Bind</tt> and <tt>Unbind</tt>.
421  You normally get events using an event handler. Use this function to get events only during a login.
422 
423  @param[in] gameNotificationTypeBitMask Specify the bitmask that represents the game-defined event type to acquire. The <i>n</i>th bit corresponds to <tt>nn::nex::NotificationEvents::GameNotificationEventN</tt>.
424  @param[out] pRetrievedEventList Specifies the location for storing the acquired event list. Maintain an instance for the specified list until asynchronous processing completes.
425  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned. You must make sure that the implementation of this function in your application does not return any errors.
426  @retval nn::pia::ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
427  @retval nn::pia::ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.
428 */
429  Result RetrieveNotificationDataAsync(u8 gameNotificationTypeBitMask, nn::nex::qList<nn::nex::NotificationEvent>* pRetrievedEventList);
430 
431 /*!
432  @brief Checks for completion of the <tt>RetrieveNotificationDataAsync</tt> asynchronous process.
433  @details After calling <tt>RetrieveNotificationDataAsync</tt>, use this function to check the completion of the asynchronous process.
434 
435  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise.
436 */
437  bool IsCompletedRetrieveNotificationData() const;
438 
439 /*!
440  @brief Gets the result of the <tt>RetrieveNotificationDataAsync</tt> asynchronous process.
441  @details This function gets the result after <tt>RetrieveNotificationDataAsync</tt> has been called, and <tt>IsCompletedRetrieveNotificationData</tt> has confirmed that the process is complete.
442 
443  @return Returns the result of <tt>RetrieveNotificationDataAsync</tt> asynchronous processing. The following results are returned when the process ends.
444  @retval ResultSuccess The asynchronous process succeeded.
445  @retval nn::pia::ResultInvalidState Indicates that the <tt>RetrieveNotificationDataAsync</tt> function was called at the wrong time, or that the asynchronous process has not completed. Programming error. Fix your program so that this error is not returned.
446  @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.
447 */
448  Result GetRetrieveNotificationDataResult() const;
449 
450 /*!
451  @brief Starts the <tt>NexFacade</tt> function. This function can only be called when directly manipulated by the <tt>session::Mesh</tt> class.
452 
453  @details Call this function after logging in to the NEX game server and running the <tt>Bind</tt> function.
454  Use the NEX allocator to create instances of classes used for internal processing inside this function. These instances are managed with the NEX library and are destroyed
455  when the <tt>nn::nex::NgsFacade</tt> instance is destroyed. A new instance is not created if an instance of this class is already being managed by NEX.
456 
457  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned. You must make sure that the implementation of this function in your application does not return any errors.
458  @retval nn::pia::ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
459  @if CTR_DOC
460  @retval nn::pia::ResultInvalidState Indicates that the function was called at the wrong time or that the NEX thread mode is not supported by Pia. (The Pia library only supports unsafe transport buffer thread mode or unsafe user thread mode. We recommend using unsafe transport buffer thread mode with 3.<I>x</I> versions of NEX. Programming error. Fix your program so that this error is not returned.
461  @endif
462  @if CAFE_DOC
463  @retval nn::pia::ResultInvalidState Indicates that the function was called at the wrong time or that the NEX thread mode is not supported by Pia. (The Pia library only supports unsafe transport buffer thread mode.) Programming error. Fix your program so that this error is not returned.
464  @endif
465  @see Bind
466 */
467  virtual nn::Result Startup();
468 
469 /*!
470  @brief Cleans up the <tt>NexFacade</tt> function. This function can only be called when directly manipulated by the <tt>session::Mesh</tt> class.
471 
472  @details Call before logging out from the NEX game server.
473  */
474  virtual void Cleanup();
475 
476 /*!
477  @cond PRIVATE
478  @brief Starts a NAT session (P2P communication). This function can only be called when directly manipulated by the <tt>session::Mesh</tt> class. (To be removed in subsequent versions.)
479 
480  @details Starts a NAT session and performs the necessary preprocessing for P2P communication.
481  If calling this function, do so before calling the <tt>nn::pia::session::Mesh::Startup</tt> function.
482  The port number used for P2P communication changes every time this function is run.
483 
484  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
485  You can monitor the completion and success or failure of the process by checking the <tt>CallContext</tt> function specified in the arguments.
486 
487  This function performs DNS name resolution on the server for NAT-type detection, but only the first time it is called after the application starts.
488  The name resolution process runs in a background thread during asynchronous processes.
489  @if CTR_DOC
490  The name resolution process uses the <tt>nn::socket::GetAddrInfo()</tt> function of the socket library. Memory is allocated from the working memory specified using the <tt>nn::socket::Initialize()</tt> function when
491  the name resolution process is run. That memory is later freed when the name resolution process ends.
492  @endif
493  @if CAFE_DOC
494  The name resolution process uses the <tt>SOGetAddrInfo</tt> function of the socket library. Memory is allocated when the name resolution process is run. That memory
495  is later freed when the name resolution process ends. <b>Important:</b> If the memory allocator for the name resolution process is registered from within the application using the
496  <tt>SOResolverRegisterAllocator()</tt> function, the allocator is called from a background thread. The allocator must
497  be thread-safe.
498  @endif
499 
500  If the WAN cable of the router is unplugged before name resolution finishes, it might take 30 or more seconds for this asynchronous process to complete because it needs to wait for the name resolution process timeout.
501  This process may take over 30 seconds to complete. The name resolution process cannot be canceled.
502 
503  @if CAFE_DOC
504  When the call to this function succeeds, the background-download feature of the system is shut down.
505  The background-download feature is then enabled when the <tt>StopNatSession()</tt> function is called.
506 
507  <b>Note:</b> Background downloads may still be performed after calling this function because background stress mode only depends on the DevMenu settings.
508  @endif
509 
510  This function has been deprecated. It will be removed in a future release. Use the <tt>@ref StartNatSessionAsync</tt> function instead.
511 
512  <b>The following results may be returned by the <tt>CallContext</tt> instance when the asynchronous process ends.</b>
513  - <tt>nn::ResultSuccess</tt>: The asynchronous process succeeded.
514  - <tt>nn::pia::ResultCancelled</tt>: The asynchronous process was canceled. Perform cleanup.
515  - <tt>nn::pia::ResultInvalidState</tt>: Called at the wrong time. Programming error. Fix your program so that this error is not returned.
516  - <tt>nn::pia::ResultNetworkConnectionIsLost</tt>: The network is not available. The wireless switch may be turned off or there may be a problem with the access point. Reconnect to AC.
517  - <tt>nn::pia::ResultNatCheckFailed</tt>: 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.
518  - <tt>nn::pia::ResultDnsFailed</tt>: 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.
519 
520  @param[in] pCallContext Specifies the <tt>CallContext</tt> pointer to check the execution progress status.
521 
522  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
523  @retval nn::pia::ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
524  @retval nn::pia::ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.
525 */
526  virtual nn::Result StartNatSession(
527  common::CallContext* pCallContext);
528  //! @endcond
529 
530 /*!
531  @brief Starts a NAT session (P2P communication). This function can only be called when directly manipulated by the <tt>session::Mesh</tt> class.
532 
533  @details Starts a NAT session and performs the necessary preprocessing for P2P communication.
534  If calling this function, do so before calling the <tt>nn::pia::session::Mesh::Startup</tt> function.
535  The port number used for P2P communication changes every time this function is run.
536 
537  The started process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
538  Use <tt>@ref IsCompletedStartNatSession</tt> to check whether the process has completed and <tt>@ref GetStartNatSessionResult</tt> to check the result.
539 
540  This function performs DNS name resolution on the server for NAT-type detection, but only the first time it is called after the application starts.
541  The name resolution process runs in a background thread during asynchronous processes.
542  @if CTR_DOC
543  The name resolution process uses the <tt>nn::socket::GetAddrInfo()</tt> function of the socket library. Memory is allocated from the working memory specified using the <tt>nn::socket::Initialize()</tt> function when
544  the name resolution process is run. That memory is later freed when the name resolution process ends.
545  @endif
546  @if CAFE_DOC
547  The name resolution process uses the <tt>SOGetAddrInfo</tt> function of the socket library. Memory is allocated when the name resolution process is run. That memory
548  is later freed when the name resolution process ends. <b>Important:</b> If the memory allocator for the name resolution process is registered from within the application using the
549  <tt>SOResolverRegisterAllocator()</tt> function, the allocator is called from a background thread. The allocator must
550  be thread-safe.
551  @endif
552 
553  If the WAN cable of the router is unplugged before name resolution finishes, it might take 30 or more seconds for this asynchronous process to complete because it needs to wait for the name resolution process timeout.
554  This process may take over 30 seconds to complete. The name resolution process cannot be canceled.
555 
556  @if CAFE_DOC
557  When the call to this function succeeds, the background-download feature of the system is shut down.
558  The background-download feature is then enabled when the <tt>StopNatSession()</tt> function is called.
559 
560  <b>Note:</b> Background downloads may still be performed after calling this function because background stress mode only depends on the DevMenu settings.
561  @endif
562 
563  <b>The following results may be returned by the <tt>@ref GetStartNatSessionResult</tt> instance when the asynchronous process completes.</b>
564  - <tt>nn::ResultSuccess</tt>: The asynchronous process succeeded.
565  - <tt>nn::pia::ResultCancelled</tt>: The asynchronous process was canceled. Perform cleanup.
566  - <tt>nn::pia::ResultInvalidState</tt>: Called at the wrong time. Programming error. Fix your program so that this error is not returned.
567  - <tt>nn::pia::ResultNetworkConnectionIsLost</tt>: The network is not available. The wireless switch may be turned off or there may be a problem with the access point. Reconnect to AC.
568  - <tt>nn::pia::ResultNatCheckFailed</tt>: 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.
569  - <tt>nn::pia::ResultDnsFailed</tt>: 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.
570 
571  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
572  @retval nn::pia::ResultInvalidArgument Indicates that one or more arguments are invalid. Programming error. Fix your program so that this error is not returned.
573  @retval nn::pia::ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.
574 */
575  virtual nn::Result StartNatSessionAsync();
576 
577 /*!
578  @brief Checks the completion of <tt>StartNatSessionAsync</tt> asynchronous processing. This function can only be called when directly manipulated by the <tt>session::Mesh</tt> class.
579 
580  @details This function checks the completion of asynchronous processing after <tt>StartNatSessionAsync</tt> is called.
581 
582  @return Returns <tt>true</tt> if the asynchronous process has completed, or <tt>false</tt> otherwise.
583 */
584  virtual bool IsCompletedStartNatSession() const;
585 
586 /*!
587  @brief Gets the result of <tt>StartNatSessionAsync</tt> asynchronous processing. This function can only be called when directly manipulated by the <tt>session::Mesh</tt> class.
588 
589  @details This function gets the results after <tt>StartNatSessionAsync</tt> is called and <tt>IsCompletedStartNatSession</tt> confirms that the process has completed.
590 
591  @return Returns the result of <tt>StartNatSessionAsync</tt> asynchronous processing. The following results are returned when the process ends.
592  @retval nn::ResultSuccess The asynchronous process succeeded.
593  @retval nn::pia::ResultCancelled The asynchronous process was canceled. Perform cleanup.
594  @retval nn::pia::ResultInvalidState The <tt>StartNatSessionAsync</tt> function was called at the wrong time, or the asynchronous process has not completed. Programming error. Fix your program so that this error is not returned.
595  @retval nn::pia::ResultNetworkConnectionIsLost The network is not available. The wireless switch may be turned off or there may be a problem with the access point. Reconnect to AC.
596  @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.
597  @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.
598 */
599  virtual nn::Result GetStartNatSessionResult() const;
600 
601 /*!
602  @brief Cancels <tt>StartNatSessionAsync</tt> asynchronous processes. This function can only be called when directly manipulated by the <tt>session::Mesh</tt> class.
603 
604  @details This function cancels asynchronous processing after <tt>StartNatSessionAsync</tt> is called.
605  The cancel process advances by periodically calling the <tt>@ref nn::pia::common::Scheduler::Dispatch</tt> function.
606  The library quickly acts to cancel the asynchronous process after this function is called, but check
607  using the <tt>@ref IsCompletedStartNatSession()</tt> function that the cancellation has completed.
608 
609  @return Returns the result of canceling <tt>StartNatSessionAsync</tt> asynchronous processing. If this function call fails, one or more of the following <tt>Result</tt> values is returned.
610  @retval nn::pia::ResultInvalidState Returned when no <tt>StartNatSessionAsync</tt> asynchronous processing is being performed at the time this function is called. Programming error. Fix your program so that this error is not returned.
611 */
612  virtual nn::Result CancelStartNatSessionAsync();
613 
614 /*!
615  @brief Stops a NAT session (P2P communication). This function can only be called when directly manipulated by the <tt>session::Mesh</tt> class.
616 
617  @details Call this function before calling the <tt>nn::pia::session::Mesh::Cleanup</tt> function.
618  */
619  virtual void StopNatSession();
620 
621 /*!
622  @cond PRIVATE
623  @endcond
624  */
625  nn::Result CompleteStartNatSession(u16 port);
626 
627 /*!
628  @brief Prints information that is useful for debugging.
629 
630  @param[in] flag Specifies the trace flag. For more information, see the <tt>@ref TraceFlag</tt> API reference.
631  */
632  virtual void Trace(u64 flag) const;
633 
634 /*!
635  @brief Checks whether the <tt>NexFacade</tt> feature is in a started state.
636 
637  @return Returns <tt>true</tt> when started up.
638  */
639  bool IsStartedUp()
640  {
641  return m_IsStartedUp;
642  }
643 
644 /*!
645  @brief Checks whether the NAT session (P2P communication) has started.
646 
647  @return Returns <tt>true</tt> if started.
648  */
650  {
651  return m_IsStartedNatSession;
652  }
653 
654 /*!
655  @cond PRIVATE
656  @endcond
657  */
658  NatTraverser* GetNatTraverser()
659  {
660  return m_pNatTraverser;
661  }
662 
663 /*!
664  @cond PRIVATE
665  @brief Gets a pointer to the <tt>MatchmakeExtensionClient</tt> instance.
666  @return Returns the pointer to <tt>MatchmakeExtensionClient</tt>.
667  @endcond
668  */
669  nn::nex::MatchmakeExtensionClient* GetMatchMakingClient()
670  {
671  return &m_MatchMakingClient;
672  }
673 
674 #if NN_PIA_ENABLE_NGS_BRIDGE
675 /*!
676  @cond PRIVATE
677  @brief Gets a pointer to the <tt>NgsFacade</tt> instance specified in the <tt>Startup</tt> function.
678 
679  @return Returns a pointer to the <tt>NgsFacade</tt> instance.
680  @endcond
681  */
682  nn::nex::NgsBridgeInterface* GetNgsInterface()
683  {
684  return m_pNgsInterface;
685  }
686 #else
687 /*!
688  @cond PRIVATE
689  @brief Gets a pointer to the <tt>NgsFacade</tt> instance specified in the <tt>Startup</tt> function.
690 
691  @return Returns a pointer to the <tt>NgsFacade</tt> instance.
692  @endcond
693  */
694  nn::nex::NgsFacade* GetNgsInterface()
695  {
696  return m_pNgsInterface;
697  }
698 #endif
699 
700 /*!
701  @cond PRIVATE
702  @brief Gets the <tt>GameServerId</tt> specified in the <tt>Startup</tt> function.
703 
704  @return Returns the <tt>GameServerId</tt>.
705  @endcond
706  */
707  u32 GetGameServerId() const
708  {
709  return m_GameServerId;
710  }
711 
712 /*!
713  @brief Updates the <tt>GatheringID</tt> of the matchmaking session managed by <tt>NexFacade</tt>. This function can only be called when directly manipulated by the <tt>session::Mesh</tt> class.
714 
715  @details Any <tt>GatheringID</tt> updated by this function can be used by features such as host migration.
716 
717  @param[in] gatheringID Specify the <tt>GatheringID</tt> of the matchmaking session you are in.
718  */
719  void UpdateGatheringID(nn::nex::GatheringID gatheringID);
720 
721 /*!
722  @cond PRIVATE
723  @brief Gets the <tt>GatheringID</tt> specified in the <tt>UpdateGatheringID</tt> function.
724 
725  @return Returns the <tt>GatheringID</tt>.
726  @endcond
727  */
728  nn::nex::GatheringID GetGatheringID()
729  {
730  return m_GatheringID;
731  }
732 
733 /*!
734  @brief Gets the local NAT port mapping type.
735  @details Gets the local NAT port mapping type.
736  A correct value is available after the asynchronous process for <tt>NexFacade::StartNatSessionAsync</tt> completes.
737  @return Returns the NAT port mapping type.
738  */
739  Mapping GetNatPropertyMapping();
740 /*!
741  @brief Gets the local NAT filtering type.
742  @details Gets the local NAT filtering type.
743  A correct value is available after the asynchronous process for <tt>NexFacade::StartNatSessionAsync</tt> completes.
744  @return Returns the NAT filtering type.
745  */
746  Filtering GetNatPropertyFiltering();
747 /*!
748  @brief Gets the local NAT port increment.
749  @details Gets the local NAT port increment.
750  A correct value is available after the asynchronous process for <tt>NexFacade::StartNatSessionAsync</tt> completes.
751  @return Returns the NAT port increment.
752  */
753  u32 GetNatPropertyPortIncrement();
754 /*!
755  @brief Gets the Internet port for the local NAT.
756  @details Gets the Internet port for the local NAT.
757  A correct value is available after the asynchronous process for <tt>NexFacade::StartNatSessionAsync</tt> completes.
758  @return Returns the Internet port for the NAT.
759  */
760  u16 GetNatPropertyPublicPort();
761 /*!
762  @brief Gets the LAN port for the local NAT.
763  @details Gets the LAN port for the local NAT.
764  A correct value is available after the asynchronous process for <tt>NexFacade::StartNatSessionAsync</tt> completes.
765  @return Returns the LAN port for the NAT.
766  */
767  u16 GetNatPropertyInterfacePort();
768 
769 /*!
770  @cond PRIVATE
771  @brief Sets the base NAT-traversal timeout.
772 
773  @details Standard applications must not change the timeout due to its significant effect on connectivity.
774 
775  @param[in] timeout Specifies the timeout. The value is in milliseconds.
776 
777  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned. You must make sure that the implementation of this function in your application does not return any errors.
778  @retval nn::pia::ResultInvalidState Indicates that the function was called at the wrong time. The function returns this error when called between the <tt>Startup</tt> and <tt>Cleanup</tt> functions.
779  @endcond
780  */
781  nn::Result SetNatTraversalTimeout(s32 timeout);
782 
783 /*!
784  @cond PRIVATE
785  @endcond
786  */
787  s32 GetNatTraversalTimeout()
788  {
789  return m_NatTraversalTimeout;
790  }
791 
792 /*!
793  @cond PRIVATE
794  @brief Sets the EDM-extension timeout for NAT traversal.
795 
796  @details Standard applications must not change the timeout due to its significant effect on connectivity.
797 
798  @param[in] timeout Specifies the timeout. The value is in milliseconds.
799 
800  @return Returns the result of the function. If this function call fails, one or more of the following <tt>Result</tt> values is returned. You must make sure that the implementation of this function in your application does not return any errors.
801  @retval nn::pia::ResultInvalidState Indicates that the function was called at the wrong time. The function returns this error when called between the <tt>Startup</tt> and <tt>Cleanup</tt> functions.
802  @endcond
803  */
804  nn::Result SetNatTraversalTimeoutEdmExtension(s32 timeout);
805 
806 /*!
807  @cond PRIVATE
808  @endcond
809  */
810  s32 GetNatTraversalTimeoutEdmExtension()
811  {
812  return m_NatTraversalTimeoutEdmExtension;
813  }
814 
815 
816 #if NN_PIA_CAFE
817 /*!
818 @cond PRIVATE
819 @brief Sets whether to disable the background download feature of the system when there is a valid NAT session (during P2P communication).
820 
821 @details If <tt>true</tt> is specified for <tt><var>isSuspendBossDaemon</var></tt>, the system background download feature is suspended when the <tt>@ref StartNATSession()</tt>
822 function is called and re-enabled when the <tt>@ref StopNATSession()</tt> function is called. If you specify <tt>false</tt>, these functions have no effect on the operations of the background download feature.
823 Regardless of the setting, there is no effect on the foreground download feature of the BOSS library.
824 If you specify <tt>true</tt>, the library automatically calls the <tt>Initialize()</tt> and <tt>Finalize()</tt> functions of the <tt>ndm</tt> module.
825 
826 The default is <tt>true</tt> (disable). If your application uses ndm features directly, use this function to change this
827 setting to <tt>false</tt> before calling the <tt>@ref StartNATSession()</tt> function.
828 
829 @param[in] isSuspendBossDaemon Specifies whether to disable the background download feature of the system when there is a valid NAT session. Set to <tt>true</tt> to cancel.
830  */
831  void SetSuspendBossDaemonOnNATSession(bool isSuspendBossDaemon)
832  {
833  m_IsSuspendBossDaemon = isSuspendBossDaemon;
834  }
835  //! @endcond
836 
837 /*!
838  @cond PRIVATE
839  @brief Gets whether the background download feature of the system is disabled when there is a valid NAT session (during P2P communication).
840 
841  @return Returns whether calling the <tt>StartNatSession()</tt> function disables the background download feature of the system.
842  */
843  bool GetSuspendBossDaemonOnNATSession() const
844  {
845  return m_IsSuspendBossDaemon;
846  }
847 //! @endcond
848 #endif
849 
850 /*!
851  @cond PRIVATE
852  @brief Adds an <tt>nn::nex::NotificationEventHandler</tt> instance to <tt>NgsFacade</tt> for internal Pia processing.
853 
854  @return Returns whether the event handler was successfully added.
855  @endcond
856  */
857  bool RegisterNexNotificationEventHandler4Pia(nn::nex::NotificationEventHandler* pEventHandler);
858 
859 /*!
860  @cond PRIVATE
861  @brief Removes the <tt>nn::nex::NotificationEventHandler</tt> instance from <tt>NgsFacade</tt> for internal Pia processing.
862 
863  @return Returns whether the event handler was successfully removed.
864  @endcond
865  */
866  bool UnregisterNexNotificationEventHandler4Pia(nn::nex::NotificationEventHandler* pEventHandler);
867 
868 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
869  nn::nex::MatchmakeRefereeClient* GetMatchmakeRefereeClient()
870  {
871  return m_pMatchmakeRefereeClient;
872  }
873 #endif
874 
875 private:
876  // A pointer to a singleton instance.
877  static NexFacade* s_pInstance;
878  static bool s_LanNetwork;
879 
880 /*!
881  @brief This constructor is private because the singleton pattern is used.
882  */
883  NexFacade(void);
884 
885 /*!
886  @brief This destructor is private because the singleton pattern is used.
887  */
888  virtual ~NexFacade(void);
889 
890 /*!
891  @brief This copy constructor is private because the singleton pattern is used.
892  */
893  NexFacade(const NexFacade&);
894 
895 /*!
896  @brief This assignment operator is private because the singleton pattern is used.
897  */
898  NexFacade& operator=(const NexFacade&);
899 
900  virtual nn::Result Initialize();
901  virtual void Finalize();
902 
903 #if NN_PIA_CAFE
904  void suspendBossDaemon();
905  void resumeBossDaemon();
906 #endif
907 
908  virtual nn::Result startNatSessionCore(common::CallContext* pCallContext);
909 
910  u32 m_GameServerId;
911 #if NN_PIA_ENABLE_NGS_BRIDGE
912  nn::nex::NgsBridgeInterface* m_pNgsInterface;
913 #else
914  nn::nex::NgsFacade* m_pNgsInterface;
915 #endif
916  nn::nex::MatchmakeExtensionClient m_MatchMakingClient;
917  nn::nex::GatheringID m_GatheringID;
918 
919  u8* m_pNatTraversalClientBuffer;
920 #if NN_PIA_ENABLE_LOOSE_COUPLING_NEX
921  nn::nex::NATTraversalRelayClient* m_pNatTraversalRelayClient;
922  NexNatRelay* m_pNexNatRelay;
923 #else
924  NexNatTraversalClient* m_pNatTraversalClient;
925 #endif
926 
927  NatTraverser* m_pNatTraverser;
928 
929 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
930  u8* m_pMatchmakeRefereeClientBuffer;
931  nn::nex::MatchmakeRefereeClient* m_pMatchmakeRefereeClient;
932 #endif
933  Socket* m_pSocket;
934  SocketOutputStream* m_pOutputStream;
935  SocketInputStream* m_pInputStream;
936 
937  bool m_IsStartedUp;
938  bool m_IsStartedNatSession;
939 
940  s32 m_NatTraversalTimeout;
941  s32 m_NatTraversalTimeoutEdmExtension;
942 
943 #if NN_PIA_CAFE
944  bool m_IsSuspendBossDaemon;
945  s32 m_NdmInitializeCount;
946 #endif
947 
948  nn::nex::NotificationEventHandler* m_pNexNotificationEventHandler;
949 
950  NexNotificationDataJob* m_pNexNotificationDataJob;
951 
952  u8 m_InternalAsyncProcessType;
953  common::AsyncContext m_InternalAsyncConext;
954 };
955 }
956 }
957 } // End of namespace nn::pia::inet.
Information about the NEX game server that was logged in to.
Definition: inet_NexFacade.h:164
void Finalize(void)
Finalizes the common module.
This class maintains signature setting information.
Definition: common_SignatureSetting.h:33
static const TraceFlag TRACE_FLAG_INET
Flag for tracing the PiaInet module.
Definition: common_Trace.h:141
Definition: assert.h:115
void Unbind()
Deletes the information on the registered local address.
nn::Result Bind(u32 localAddress)
Registers a local address.
static NexFacade * GetInstance(void)
Gets the pointer to the NexFacade instance (singleton pattern).
Definition: inet_NexFacade.h:197
Specifies port independent filtering (PIF).
Definition: inet_NexFacade.h:157
Class for representing strings.
Definition: common_String.h:35
bool IsStartedNatSession()
Checks whether the NAT session (P2P communication) has started.
Definition: inet_NexFacade.h:649
Filtering
The NAT filtering type.
Definition: inet_NexFacade.h:154
Represents the calling context.
Definition: common_CallContext.h:43
Represents an address used to uniquely identify stations.
Definition: transport_StationConnectionInfo.h:35
nn::Result Initialize(void *pMem, u32 size)
Initializes the common module.
Mapping
The NAT port mapping type.
Definition: inet_NexFacade.h:143
Represents the NEX library facade (interface wrapper) class.
Definition: inet_NexFacade.h:136
u32 gameServerId
The game server ID specified when logging in to the game server.
Definition: inet_NexFacade.h:171
nn::nex::NgsFacade * pNgsFacade
The nn::nex::NgsFacade instance that was logged in to on the game server.
Definition: inet_NexFacade.h:170
Class that represents an Internet address.
Definition: common_InetAddress.h:52
bool IsStartedUp()
Checks whether the NexFacade feature is in a started state.
Definition: inet_NexFacade.h:639
Specifies endpoint independent mapping (EIM).
Definition: inet_NexFacade.h:146
Represents an address used to uniquely identify stations.
Definition: transport_StationLocation.h:59
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40