CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
inet_NexSessionTypes.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 <RendezVous/Services/MatchMaking/src/Common/GatheringID.h>
21 #include <RendezVous/Services/Jugem/Matchmake/src/Common/MatchmakeConstants.h>
22 
23 namespace nn
24 {
25 namespace pia
26 {
27 namespace inet
28 {
29 const uint32_t InvalidSessionId = INVALID_GATHERINGID;
30 const uint16_t InvalidParticipantsNum = 0xffff;
31 #if (NEX_CURRENT_VERSION_NUMBER >= NEX_VERSION_NUMBER(4, 0, 2))
32 const uint32_t SessionInfoListSizeMax = 1000; //!< 検索可能なセッション数の最大長
33 #else
34 const uint32_t SessionInfoListSizeMax = 300; //!< 検索可能なセッション数の最大長
35 #endif
36 const uint32_t CommunityInfoListSizeMax = 100; //!< 検索可能なコミュニティ数の最大長
37 #if (NEX_CURRENT_VERSION_NUMBER >= NEX_VERSION_NUMBER(4, 2, 0))
38 const uint32_t ParticipantArraySizeMax = nn::nex::MAX_PRINCIPALID_SIZE_TO_FIND_MATCHMAKE_SESSION; //!< 検索条件に指定できるユーザーのプリンシパル ID の配列の最大長
39 #elif (NEX_CURRENT_VERSION_NUMBER >= NEX_VERSION_NUMBER(4, 0, 2))
40 const uint32_t ParticipantArraySizeMax = 300; //!< 検索条件に指定できるユーザーのプリンシパル ID の配列の最大長
41 #else
42 const uint32_t ParticipantArraySizeMax = 100; //!< 検索条件に指定できるユーザーのプリンシパル ID の配列の最大長
43 #endif
44 const uint32_t AttributeSizeMax = 6; //!< セッションに指定可能な属性の数
45 const uint32_t AttributeArraySizeMax = 100; //!< 検索条件に指定できる属性値の配列の最大長
46 const uint32_t ApplicationDataBufferSizeMax = 512; //!< アプリケーション定義のデータとして設定できる最大サイズ
47 const uint32_t DescriptionLengthMax = 256; //!< セッションに設定できる説明文字列の最大長
48 const uint8_t SearchCriteriaListSizeMax = 2; //!< ランダムマッチメイク時に設定できる検索条件の最大数
49 const uint32_t SessionMatchmakeKeywordLength = 32; //!< あいことばマッチメイク時に設定できるあいことばの文字列長
50 
51 const uint32_t SessionSystemPasswordLengthMax = nn::nex::MATCHMAKE_SESSION_SYSTEM_PASSWORD_LENGTH; //!< システムパスワードの文字列長
52 const uint32_t SessionUserPasswordLengthMax = nn::nex::MAX_MATCHMAKE_SESSION_USER_PASSWORD_LENGTH; //!< ユーザーパスワードの文字列長
53 const uint32_t SessionUpdateSelectionPriorityIntervalTimeMin = nn::nex::UPDATE_PROGRESS_SCORE_MINIMUM_INTERVAL_TIME; //!< ゲーム進行度の最小アップデート間隔
54 const uint8_t SessionSelectionPriorityMax = nn::nex::MAX_PROGRESS_SCORE; //!< 設定可能なゲーム進行度の最大値
55 const uint32_t SessionBroadenRangeAttributeIndex = nn::nex::MATCHMAKE_SESSION_BROADEN_RANGE_ATTRIBUTE_INDEX; //!< レンジ拡大形式でセッションを選ぶ際の基準とする属性値のインデックス
56 
57 const uint32_t AdditionalParamKeyLength = 8;
58 const uint32_t AdditionalParamKeySizeMax = 3;
59 const uint32_t AdditionalParamStringLength = 64;
60 const uint32_t AdditionalParamStringSizeMax = 1;
61 
62 const uint32_t SearchCriteriaResultRandomOffset = 0xffffffff;
63 const uint32_t SearchCriteriaResultSizeMax = 100;
64 
65 const uint32_t CountryCodeLengthMax = 2; //!< @if NIN_DOC 国コードとして設定できる文字列長 @endif
66 
67 #if NN_PIA_CTR
68 const uint32_t PrincipalIdArraySizeMax = 100; //!< ブロックリスト管理に指定可能なユーザーのプリンシパル ID の配列の最大長
69 #endif
70 
71 /*!
72  @brief セッションタイプを表す列挙型です。
73  */
75 {
76  SessionType_Anybody = 0 //!< 誰でも参加可能
77 #if NN_PIA_ENABLE_SESSION_TYPE_FRIEND
78  ,
79  SessionType_Friend //!< ホストとフレンド関係を結んでいる場合のみ参加可能
80 #endif
81 };
82 
83 /*!
84  @brief ランダムマッチメイク実行時に参加するセッションの選択方法を表す列挙型です。
85  */
87 {
88  SelectionMethod_Random = 0, //!< ランダムに選択
89  //SELECTION_METHOD_NEAREST_NEIGHBOR, //!< 属性値が最も近いセッションを選択
90  //SELECTION_METHOD_BROADEN_RANGE, //!< レンジ拡大形式で選択
91  SelectionMethod_BroadenRangeWithSelectionPriority, //!< レンジ拡大形式 + マッチメイク優先度により選択
92  SelectionMethod_ScoreBased //!< スコア換算形式により選択
93 };
94 
95 /*!
96 @cond PRIVATE
97 @brief パラメータを格納する構造体です。
98 */
99 struct ParamVariant
100 {
101  enum ValueType
102  {
103  ValueType_Invalid = 0,
104  ValueType_Uint64,
105  ValueType_Int64,
106  ValueType_Uint32,
107  ValueType_Int32,
108  ValueType_Bool,
109  ValueType_Double
110  };
111 
112  ParamVariant()
113  {
114  value.valUint64 = 0;
115  valueType = ValueType_Invalid;
116  }
117 
118  ParamVariant(uint64_t val)
119  {
120  value.valUint64 = val;
121  valueType = ValueType_Uint64;
122  }
123  ParamVariant(int64_t val)
124  {
125  value.valInt64 = val;
126  valueType = ValueType_Int64;
127  }
128  ParamVariant(uint32_t val)
129  {
130  value.valUint32 = val;
131  valueType = ValueType_Uint32;
132  }
133  ParamVariant(int32_t val)
134  {
135  value.valInt32 = val;
136  valueType = ValueType_Int32;
137  }
138  ParamVariant(bool val)
139  {
140  value.valBool = val;
141  valueType = ValueType_Bool;
142  }
143  ParamVariant(double val)
144  {
145  value.valDouble = val;
146  valueType = ValueType_Double;
147  }
148 
149  union Value
150  {
151  uint64_t valUint64;
152  int64_t valInt64;
153  uint32_t valUint32;
154  int32_t valInt32;
155  bool valBool;
156  double valDouble;
157  } value;
158 
159  ValueType valueType;
160 };
161 //! @endcond
162 }
163 }
164 } // end of namespace nn::pia::inet
165 
166 #endif