CTR Pia  4.11.3
Game Communication Engine
inet_NexSessionTypes.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: inet_NexSessionTypes.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 
19 #if NN_PIA_NEX_NEW_FEATURE_FOR_MATCHMAKE
20 #if NN_PIA_CTR
21 #pragma diag_suppress 1300
22 #endif
23 #include <nex.h>
24 #if NN_PIA_CTR
25 #pragma diag_warning 1300
26 #endif
27 #endif
28 
29 
30 namespace nn
31 {
32 namespace pia
33 {
34 namespace inet
35 {
36 
37 const size_t GATHERINGHOLDER_MAX_SIZE = 100;
38 
39 const size_t ATTRIBUTE_MAX_SIZE = 6; //!< The number of attributes that can be specified in a session.
40 const size_t ATTRIBUTE_ARRAY_MAX_SIZE = 100;
41 const size_t PARTICIPANT_ARRAY_MAX_SIZE = 16; //!< The maximum length of the Principal ID array for users that can be specified in the search conditions.
42 const size_t APPLICATION_DATA_BUFFER_MAX_SIZE = 384; //!< The maximum size that can be set as application-defined data.
43 const size_t APPLICATION_DATA_BUFFER_MAX_SIZE_INTERNAL = 512;
44 const size_t APPLICATION_DATA_BUFFER_DEFAULT_OFFSET = APPLICATION_DATA_BUFFER_MAX_SIZE_INTERNAL - APPLICATION_DATA_BUFFER_MAX_SIZE;
45 
46 const size_t DESCRIPTION_DATA_BUFFER_MAX_SIZE = 256;
47 
48 const size_t SEARCH_CRITERIA_MAX_NUM = 2; //!< The maximum number of search conditions that can be specified.
49 
50 #if NN_PIA_NEX_NEW_FEATURE_FOR_MATCHMAKE
51 const u32 SESSION_SYSTEM_PASSWORD_LENGTH = nn::nex::MATCHMAKE_SESSION_SYSTEM_PASSWORD_LENGTH; //!< The system password's string length.
52 const u32 SESSION_USER_PASSWORD_LENGTH = nn::nex::MAX_MATCHMAKE_SESSION_USER_PASSWORD_LENGTH; //!< The user password's string length.
53 
54 const u32 SESSION_UPDATE_SELECTION_PRIORITY_MINIMUM_INTERVAL_TIME = nn::nex::UPDATE_PROGRESS_SCORE_MINIMUM_INTERVAL_TIME; //!< Minimum update interval for the game progress score.
55 const u8 SESSION_MAX_SELECTION_PRIORITY = nn::nex::MAX_PROGRESS_SCORE; //!< Maximum configurable game progress score.
56 
57 const u32 SESSION_BROADEN_RANGE_ATTRIBUTE_INDEX = nn::nex::MATCHMAKE_SESSION_BROADEN_RANGE_ATTRIBUTE_INDEX; //!< Index of the base attribute value when selecting sessions with range broadening.
58 #else
59 const u32 SESSION_SYSTEM_PASSWORD_LENGTH = 16;
60 const u32 SESSION_USER_PASSWORD_LENGTH = 32;
61 
62 const u32 SESSION_UPDATE_SELECTION_PRIORITY_MINIMUM_INTERVAL_TIME = 30;
63 const u8 SESSION_MAX_SELECTION_PRIORITY = 100;
64 
65 const u32 SESSION_BROADEN_RANGE_ATTRIBUTE_INDEX = 1;
66 #endif
67 
68 const u32 MAX_IP_ADDRESS_LENGTH = 15;
69 
70 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
71 const size_t SESSION_PERSONAL_REPORT_BUFFER_MAX_SIZE = nn::nex::MatchmakeRefereeConstants::STATS_BUFFER_MAX_SIZE;
72 #endif
73 
74 
75 /*!
76  @brief Enumerates the session types.
77 */
79 {
80  SESSION_TYPE_ANYBODY = 0, //!< Anybody can participate.
81  SESSION_TYPE_FRIEND //!< Participation is only possible when there is a friend relationship with the host.
82 };
83 
84 /*!
85  @brief Enumerates the selection methods for joining sessions when random matchmaking is in force.
86 */
88 {
89  SELECTION_METHOD_RANDOM = 0, //!< Random selection.
90  //SELECTION_METHOD_NEAREST_NEIGHBOR, //!< Selects the session with the closest attribute value.
91  //SELECTION_METHOD_BROADEN_RANGE, //!< Selects using range broadening.
92  SELECTION_METHOD_BROADEN_RANGE_WITH_SELECTION_PRIORITY, //!< Selected by range broadening and matchmaking priority.
93  SELECTION_METHOD_SCORE_BASED //!< Selected by score-conversion format.
94 };
95 
96 #if NN_PIA_ENABLE_MATCHMAKE_REFEREE
97 enum PersonalGameResultFlag
98 {
99  RESULT_FLAG_NONE = nn::nex::MatchmakeRefereeConstants::PERSONAL_ROUND_RESULT_FLAG_NONE,
100  RESULT_FLAG_DISCONNECT = nn::nex::MatchmakeRefereeConstants::PERSONAL_ROUND_RESULT_FLAG_DISCONNECT,
101  RESULT_FLAG_VIOLATION = nn::nex::MatchmakeRefereeConstants::PERSONAL_ROUND_RESULT_FLAG_VIOLATION
102 };
103 
104 enum GameResult
105 {
106  GAME_RESULT_LOSS = nn::nex::MatchmakeRefereeConstants::ROUND_RESULT_LOSS,
107  GAME_RESULT_WIN = nn::nex::MatchmakeRefereeConstants::ROUND_RESULT_WIN,
108  GAME_RESULT_DRAW = nn::nex::MatchmakeRefereeConstants::ROUND_RESULT_DRAW
109 };
110 #endif
111 
112 }
113 }
114 } // End of namespace nn::pia::inet.
const size_t SEARCH_CRITERIA_MAX_NUM
The maximum number of search conditions that can be specified.
Definition: inet_NexSessionTypes.h:48
const u8 SESSION_MAX_SELECTION_PRIORITY
Maximum configurable game progress score.
Definition: inet_NexSessionTypes.h:55
const size_t ATTRIBUTE_MAX_SIZE
The number of attributes that can be specified in a session.
Definition: inet_NexSessionTypes.h:39
Anybody can participate.
Definition: inet_NexSessionTypes.h:80
Definition: assert.h:115
const size_t APPLICATION_DATA_BUFFER_MAX_SIZE
The maximum size that can be set as application-defined data.
Definition: inet_NexSessionTypes.h:42
const u32 SESSION_BROADEN_RANGE_ATTRIBUTE_INDEX
Index of the base attribute value when selecting sessions with range broadening.
Definition: inet_NexSessionTypes.h:57
const u32 SESSION_USER_PASSWORD_LENGTH
The user password&#39;s string length.
Definition: inet_NexSessionTypes.h:52
SelectionMethod
Enumerates the selection methods for joining sessions when random matchmaking is in force...
Definition: inet_NexSessionTypes.h:87
const u32 SESSION_UPDATE_SELECTION_PRIORITY_MINIMUM_INTERVAL_TIME
Minimum update interval for the game progress score.
Definition: inet_NexSessionTypes.h:54
const u32 SESSION_SYSTEM_PASSWORD_LENGTH
The system password&#39;s string length.
Definition: inet_NexSessionTypes.h:51
Participation is only possible when there is a friend relationship with the host. ...
Definition: inet_NexSessionTypes.h:81
SessionType
Enumerates the session types.
Definition: inet_NexSessionTypes.h:78
Random selection.
Definition: inet_NexSessionTypes.h:89
Selected by range broadening and matchmaking priority.
Definition: inet_NexSessionTypes.h:92
Selected by score-conversion format.
Definition: inet_NexSessionTypes.h:93
const size_t PARTICIPANT_ARRAY_MAX_SIZE
The maximum length of the Principal ID array for users that can be specified in the search conditions...
Definition: inet_NexSessionTypes.h:41