CTR Pia  4.11.3
Game Communication Engine
inet_NexLanNetworkFactory.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: inet_NexLanNetworkFactory.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/transport/transport_NetworkFactory.h>
19 
20 namespace nn
21 {
22 namespace pia
23 {
24 namespace inet
25 {
26 
27 /*!
28 @cond PRIVATE
29 @brief This class creates the necessary classes for networks using the NEX library (LAN communication) (factory pattern).
30 
31 @details This feature is for library developers. It is normally not available to application developers.
32 If the game server is on the same LAN, applications can execute network-related processes that are compatible with the NEX library (such as sending and receiving data, and managing sessions) without any NAT traversal. To do so, an application must pass an instance of the <tt>NexLanNetwork</tt> factory class to the <tt>@ref nn::pia::transport::Transport</tt> or <tt>@ref nn::pia::session::Session</tt> class objects.
33 
34 @see nn::pia::transport::Transport::Setting, nn::pia::session::Mesh::Setting
35 
36 @date 2014-08-01 Added the <tt>CreateMatchOpenRecruitmentJob</tt> and <tt>CreateMatchCloseRecruitmentJob</tt> functions.
37 @date 2013-07-17 Initial version.
38 
39 
40 */
41 class NexLanNetworkFactory : public nn::pia::transport::NetworkFactory
42 {
43 public:
44 
45 /*!
46 @brief Instantiates an object.
47 */
48  NexLanNetworkFactory() {}
49 
50 /*!
51 @brief Destroys the object.
52 */
53  virtual ~NexLanNetworkFactory() {}
54 
55 /*!
56 @brief Instantiates an <tt>InputStream</tt> object.
57 */
58  virtual nn::pia::common::IPacketInput* CreateInputStream();
59 
60 /*!
61 @brief Instantiates an <tt>OutputStream</tt> object.
62 */
63  virtual nn::pia::common::IPacketOutput* CreateOutputStream();
64 
65 /*!
66 @brief Instantiates a <tt>ConnectStationJob</tt> object.
67 */
68  virtual nn::pia::transport::ConnectStationJob* CreateConnectStationJob();
69 
70 /*!
71 @brief Instantiates a <tt>DisconnectStationJob</tt> object.
72 */
73  virtual nn::pia::transport::DisconnectStationJob* CreateDisconnectStationJob();
74 
75 /*!
76 @brief Instantiates a <tt>CreateMeshJob</tt> object.
77 */
78  virtual nn::pia::common::StepSequenceJob* CreateCreateMeshJob();
79 
80 /*!
81 @brief Instantiates a <tt>JoinMeshJob</tt> object.
82 */
83  virtual nn::pia::common::StepSequenceJob* CreateJoinMeshJob();
84 
85 /*!
86 @brief Instantiates a <tt>LeaveMeshJob</tt> object.
87 */
88  virtual nn::pia::common::StepSequenceJob* CreateLeaveMeshJob();
89 
90 /*!
91 @brief Instantiates a <tt>GenerateMatchmakeSystemPasswordJob</tt> object.
92 */
93  virtual nn::pia::common::StepSequenceJob* CreateGenerateMatchmakeSystemPasswordJob();
94 
95 /*!
96 @brief Instantiates a <tt>ClearMatchmakeSystemPasswordJob</tt> object.
97 */
98  virtual nn::pia::common::StepSequenceJob* CreateClearMatchmakeSystemPasswordJob();
99 
100 /*!
101 @brief Gets the length of the session's <tt>MatchmakeSessionSystemPassword</tt>.
102 Generates a maintenance region from this value.
103 */
104  virtual u32 GetMatchmakeSessionSystemPasswordSize() const;
105 
106 /*!
107 @brief Generates a maintenance region for the session's <tt>MatchmakeSessionSystemPassword</tt>.
108 */
109  virtual wchar_t* CreateMatchmakeSessionSystemPassword(u32 size);
110 
111 /*!
112 @brief Builds the required protocol.
113 */
114  virtual nn::Result CreateProtocols();
115 
116 /*!
117 @brief Instantiates a <tt>ProcessHostMigrationJob</tt> object.
118 */
119  virtual nn::pia::common::StepSequenceJob* CreateProcessHostMigrationJob();
120 
121 /*!
122 @brief Instantiates a <tt>LeaveWithHostMigrationJob</tt> object.
123 */
124  virtual nn::pia::common::StepSequenceJob* CreateLeaveWithHostMigrationJob();
125 
126 /*!
127 @brief Creates a <tt>KickoutManageJob</tt> object.
128 */
129  virtual nn::pia::common::StepSequenceJob* CreateKickoutManageJob();
130 
131 /*!
132 @brief Constructs a concrete instance of the <tt>PacketHandler</tt> class.
133 */
134  virtual transport::PacketHandler* CreatePacketHandler();
135 
136 /*!
137 @brief Gets whether a signature is required.
138 */
139  virtual bool IsSignatureRequired() const;
140 
141 /*!
142 @brief Creates a <tt>Storage</tt> object for setting the signature.
143 */
144  virtual nn::pia::session::SignatureSettingStorage* CreateSignatureSettingStorage();
145 
146 /*!
147 @brief Gets whether multiple-candidate host migration is allowed.
148 */
149  virtual bool IsMultiCandidatePermitted() const;
150 
151 /*!
152 @brief Gets whether the use of the relay communication feature is allowed.
153 */
154  virtual bool IsRelayConnectionPermitted() const;
155 
156 /*!
157 @brief Gets whether the use of joint session features is allowed.
158 */
159  virtual bool IsJointSessionPermitted() const;
160 
161 /*!
162 @brief Gets the total size of the header portion of packets at the network layer. The value is in bytes.
163 */
164  virtual size_t GetHeaderSize() const
165  {
166  return 20 + 8;
167  } // IP header (20 bytes) + UDP header (8 bytes)
168 
169 /* For the auto-matchmaking feature. */
170 /*!
171 @brief Instantiates a <tt>CreateSessionJob</tt> object for the session.
172 */
173  virtual common::StepSequenceJob* CreateMatchCreateSessionJob();
174 
175 
176 /*!
177 @brief Instantiates an <tt>AutoMatchmakeSessionJob</tt> object for the session.
178 */
179  virtual common::StepSequenceJob* CreateMatchAutoMatchmakeSessionJob();
180 
181 
182 /*!
183 @brief Instantiates a <tt>BrowseMatchmakeSessionJob</tt> object for the session.
184 */
185  virtual common::StepSequenceJob* CreateMatchBrowseMatchmakeSessionJob();
186 
187 
188 /*!
189 @brief Instantiates a <tt>JoinSessionJob</tt> object for the session.
190 */
191  virtual common::StepSequenceJob* CreateMatchJoinSessionJob();
192 
193 
194 /*!
195 @brief Instantiates a <tt>LeaveSessionJob</tt> object for the session.
196 */
197  virtual common::StepSequenceJob* CreateMatchLeaveSessionJob();
198 
199 
200 /*!
201 @brief Instantiates a <tt>DestroySessionJob</tt> object for the session.
202 */
203  virtual common::StepSequenceJob* CreateMatchDestroySessionJob();
204 
205 /*!
206 @brief Instantiates a <tt>JointSessionJob</tt> object for joint sessions.
207 */
208  virtual common::StepSequenceJob* CreateJointSessionJob();
209 
210 /*!
211 @brief Instantiates a <tt>ModifyAttributeJob</tt> object for the session.
212 */
213  virtual common::StepSequenceJob* CreateModifyAttributeJob();
214 
215 /*!
216 @cond PRIVATE
217 @brief Instantiates a <tt>UpdateSessionSetting</tt> object for the session.
218 */
219  virtual common::StepSequenceJob* CreateUpdateSessionSettingJob();
220  //! @endcond
221 
222 /*!
223 @cond PRIVATE
224 @brief Instantiates a <tt>UpdateApplicationBufferJob</tt> object for the session.
225 */
226  virtual common::StepSequenceJob* CreateUpdateApplicationDataJob();
227  //! @endcond
228 
229 /*!
230 @brief Instantiates an <tt>IMatchmakeSession</tt> object for the session.
231 */
232  virtual session::IMatchmakeSession* CreateMatchmakeSession();
233 
234 /*!
235 @brief Instantiates an <tt>ISessionInfoList</tt> object for the session.
236 */
237  virtual session::ISessionInfoList* CreateSessionInfoList(u8 browseSessionInfoListNum);
238 
239 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
240  virtual session::IMatchmakeReferee* CreateMatchmakeReferee();
241 
242  virtual common::StepSequenceJob* CreateRefereeStartGameJob();
243 
244  virtual common::StepSequenceJob* CreateRefereeEndGameJob();
245 
246  virtual common::StepSequenceJob* CreateRefereeEndGameWithoutReportJob();
247 
248  virtual common::StepSequenceJob* CreateRefereeGetOrCreateStatsJob();
249 #endif
250 /*!
251 @brief Instantiates a <tt>MeshLayerController</tt> object for the session.
252 */
253  virtual session::MeshLayerController* CreateMatchMeshLayerController();
254 
255  virtual bool GetNecessaryBind() const;
256 
257  virtual bool GetNecessaryServer() const;
258 
259  virtual session::HostMigrationMode GetHostMigrationMode() const;
260 
261  virtual u8 GetBrowseSessionInfoListMax() const;
262 
263 /* For the auto-matchmaking feature. */
264 
265 protected:
266 private:
267 };
268 /*! @endcond */
269 }
270 }
271 } // end of namespace nn::pia::inet
virtual session::HostMigrationMode GetHostMigrationMode() const
Gets the host migration mode.
Definition: assert.h:115
virtual session::ISessionInfoList * CreateSessionInfoList(u8 browseSessionInfoListNum)
Instantiates an ISessionInfoList object for the session.
An interface (factory pattern) for generating the classes needed by the network.
Definition: transport_NetworkFactory.h:89
virtual bool GetNecessaryServer() const
Gets whether a server is required.
virtual session::MeshLayerController * CreateMatchMeshLayerController()
Instantiates a MeshLayerController object for the session.
virtual bool GetNecessaryBind() const
Gets whether a call to Bind is required.
virtual u8 GetBrowseSessionInfoListMax() const
Gets the maximum number of session search results.
virtual session::IMatchmakeSession * CreateMatchmakeSession()
Instantiates an IMatchmakeSession object for the session.