CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
inet_NexSessionInfo.h
1 /*--------------------------------------------------------------------------------*
2  Copyright (C)Nintendo All rights reserved.
3 
4  These coded instructions, statements, and computer programs contain proprietary
5  information of Nintendo and/or its licensed developers and are protected by
6  national and international copyright laws. They may not be disclosed to third
7  parties or copied or duplicated in any form, in whole or in part, without the
8  prior written consent of Nintendo.
9 
10  The content herein is highly confidential and should be handled accordingly.
11  *--------------------------------------------------------------------------------*/
12 
13 
14 #pragma once
15 
16 #include <nn/pia/inet/inet_Definitions.h>
17 
18 #if NN_PIA_ENABLE_NEX
19 
20 #include <nn/pia/inet/inet_NexSessionTypes.h>
21 
22 #include <nn/pia/common/common_FixedString.h>
23 #include <nn/pia/common/common_DateTime.h>
24 #include <nn/pia/session/session_ISessionInfo.h>
25 
26 namespace nn
27 {
28 namespace pia
29 {
30 namespace inet
31 {
32 
33 /*!
34 @brief インターネット通信のセッション情報クラスです。
35 
36 @see session::ISessionInfo
37 */
39 {
40 public:
42  virtual ~NexSessionInfo();
43 
44  /*!
45  @brief セッションのゲームモードを取得します。
46  @return セッションのゲームモードを返します。
47  */
48  virtual uint32_t GetGameMode() const;
49 
50  /*!
51  @brief セッションの ID を取得します。
52  @return セッションの ID を返します。
53  */
54  virtual uint32_t GetSessionId() const;
55 
56  /*!
57  @brief セッションに関連付けられているコミュニティの ID を取得します。
58  @return セッションに関連付けられているコミュニティの ID を返します。
59  */
60  virtual uint32_t GetCommunityId() const;
61 
62  /*!
63  @brief セッションに参加している人数を取得します。
64  @return セッションに参加している人数を返します。
65  */
66  virtual uint16_t GetCurrentParticipantNum() const;
67 
68  /*!
69  @brief セッションに参加できる最小人数を取得します。
70  @return セッションに参加できる最小人数を返します。
71  */
72  virtual uint16_t GetMinParticipantNum() const;
73 
74  /*!
75  @brief セッションに参加できる最大人数を取得します。
76  @return セッションに参加できる最大人数を返します。
77  */
78  virtual uint16_t GetMaxParticipantNum() const;
79 
80  /*!
81  @brief セッションが参加募集受付状態かどうかを取得します。
82  @return セッションが参加募集受付状態なら true, 参加募集締切状態なら false を返します。
83  */
84  virtual bool IsOpened() const;
85 
86  /*!
87  @brief セッションのアプリケーション定義データを取得します。
88  @details セッションに設定したアプリケーション定義データを取得します。
89  @param[out] pBuffer セッションのアプリケーション定義データのコピー用バッファのポインタ。
90  @param[in] size セッションのアプリケーション定義データのコピー用バッファのサイズ。アプリケーション定義データの最大長は ApplicationDataBufferSizeMax です。
91  @return 正常に情報を取得できた場合、成功の Result が返ります。
92  @retval ResultInvalidArgument バッファが NULL ポインタです。プログラミングエラーです。このエラーが返らないようにソースコードを修正してください。
93  @retval ResultInvalidState アプリケーション定義データが設定されていません。プログラミングエラーです。このエラーが返らないようにソースコードを修正してください。
94  @retval ResultBufferShortage 設定されているアプリケーション定義データのサイズがバッファのサイズよりも大きいため、コピーできません。プログラミングエラーです。このエラーが返らないようにソースコードを修正してください。
95  */
96  virtual Result GetApplicationData(void* pBuffer, uint32_t size) const;
97 
98  /*!
99  @brief セッションのアプリケーション定義データの長さを取得します。
100  @return セッションのアプリケーション定義データの長さが返ります。
101  */
102  virtual uint32_t GetApplicationDataSize() const;
103 
104  /*!
105  @brief セッションの属性を取得します。
106  @param[in] idx 取得する属性のインデックス。AttributeSizeMax である必要があります。
107  @param[out] pAttribute 指定されたインデックスのセッションの属性格納先のポインタ。
108  @return 正常に情報を取得できた場合、成功の Result が返ります。
109  @retval ResultInvalidArgument 引数が不正です。プログラミングエラーです。このエラーが返らないようにソースコードを修正してください。
110  */
111  virtual Result GetAttribute(uint8_t idx, uint32_t* pAttribute) const;
112 
113  /*!
114  @brief セッションにユーザーパスワードが設定されているかどうかを確認します。
115  @return ユーザーパスワードが設定されている場合は true が返ります。
116  */
117  virtual bool IsRestrictedByUserPassword() const;
118 
119  /*!
120  @cond PRIVATE
121  @brief セッションにシステムパスワードが設定されているかどうかを確認します。
122  @return システムパスワードが設定されている場合は true が返ります。
123  */
124  virtual bool IsRestrictedBySystemPassword() const;
125  //! @endcond
126 
127  /*!
128  @brief セッションタイプを取得します。
129  @return 設定されているセッションタイプが返ります。
130  */
131  virtual SessionType GetSessionType() const;
132 
133  /*!
134  @brief ホストマイグレーション時にセッションを自動的に参加締切状態にする設定を取得します。
135  @return ホストマイグレーション時にセッションを自動的に参加締切状態にする設定が返ります。
136  */
137  virtual bool IsAutoCloseSession() const;
138 
139  /*!
140  @brief セッションのホストのプリンシパル ID を取得します。
141  @return セッションのホストのプリンシパル ID が返ります。
142  */
143  virtual PrincipalId GetHostPrincipalId() const;
144 
145  /*!
146  @brief セッションの検索条件に指定したプリンシパル ID を取得します。
147  @return セッションの検索条件に指定したプリンシパル ID が返ります。
148  */
149  virtual PrincipalId GetTargetPrincipalId() const;
150 
151  /*!
152  @brief セッションのマッチメイクの優先度を取得します。
153  @return セッションのマッチメイクの優先度が返ります。
154  */
155  virtual uint8_t GetSelectionPriority() const;
156 
157  /*!
158  @brief セッションが開始された時刻を取得します。
159  @return セッションが開始された時刻が返ります。
160  */
161  virtual const common::DateTime& GetStartedTime() const;
162 
163  /*!
164  @brief セッション情報をクリアします。
165  */
166  virtual void Clear();
167 
168  /*!
169  @brief セッション情報をコピーします。
170  @param[in] rhs コピーするセッション情報
171  */
172  void Copy(const NexSessionInfo& rhs);
173 
174  /*!
175  @brief コピーコンストラクタ。
176  @param[in] rhs コピーするセッション情報
177  */
178  NexSessionInfo(const NexSessionInfo& rhs);
179 
180  /*!
181  @brief 代入演算子です。
182  @param[in] rhs 代入するオブジェクトです。
183  @return 本オブジェクトへの参照。
184  */
186 
187  /*!
188  @brief デバッグに有用な情報をプリントします。
189  @param[in] flag トレースフラグの論理和。詳細は @ref TraceFlag 型を参照してください。
190  */
191  virtual void Trace(uint64_t flag) const;
192 
193  /*!
194  @cond PRIVATE
195  */
196  virtual void SetGameMode(uint32_t gameMode);
197  virtual void SetSessionId(uint32_t sessionId);
198  virtual void SetCurrentParticipantNum(uint16_t participants);
199  virtual void SetMinParticipantNum(uint16_t participants);
200  virtual void SetMaxParticipantNum(uint16_t participants);
201  virtual void SetOpen(bool isOpened);
202  virtual void SetAttribute(uint8_t index, uint32_t attribute);
203  virtual void SetApplicationData(const void* pData, uint32_t size);
204  virtual void SetUserPasswordEnabled(bool isEnabled);
205  virtual void SetSystemPasswordEnabled(bool isEnabled);
206  virtual void SetSessionType(SessionType sessionType, bool isAutoCloseSession);
207  virtual void SetHostPrincipalId(PrincipalId principalId);
208  virtual void SetTargetPrincipalId(PrincipalId principalId);
209  virtual void SetSelectionPriority(uint8_t priority);
210  virtual void SetStartedTime(const common::DateTime& time);
211  virtual void SetCommunityId(uint32_t communityId);
212  /// @endcond
213 
214 protected:
215  uint32_t m_GameMode;
216  uint32_t m_SessionId;
217  uint16_t m_CurrentParticipantNum;
218  uint16_t m_MinParticipantNum;
219  uint16_t m_MaxParticipantNum;
220  bool m_bIsOpened;
221 
222  uint32_t m_Attribute[AttributeSizeMax];
223  uint8_t m_ApplicationData[ApplicationDataBufferSizeMax];
224  uint32_t m_ApplicationDataSize;
225  bool m_bUserPasswordEnabled;
226  bool m_bSystemPasswordEnabled;
227 
228  SessionType m_SessionType;
229  bool m_IsAutoCloseSession;
230  PrincipalId m_HostPrincipalId;
231  PrincipalId m_TargetPrincipalId;
232  uint8_t m_SelectionPriority;
233  common::DateTime m_StartedTime;
234  uint32_t m_CommunityId;
235 };
236 }
237 }
238 } // end of namespace nn::pia::inet
239 
240 #endif