17 #include <nn/pia/pia_Definitions.h>
18 #include <nn/pia/pia_Assert.h>
19 #include <nn/pia/common/common_RootObject.h>
20 #include <nn/pia/common/common_Trace.h>
21 #include <nn/pia/common/common_Report.h>
22 #include <nn/pia/session/session_Session.h>
23 #include <nn/pia/clone/clone_CloneProtocol.h>
24 #include <nn/pia/sync/sync_SyncProtocol.h>
25 #include <nn/pia/lan/lan_LanJoinRandomSessionSetting.h>
27 #if NN_PIA_NINTENDOSDK_WIN
28 #define NN_PIA_FRAMEWORK_ENABLE_NEX 0
32 #define NN_PIA_FRAMEWORK_ENABLE_NEX 1
34 #define NN_PIA_FRAMEWORK_ENABLE_NEX 0
39 #if NN_PIA_A || NN_PIA_B
40 #define NN_PIA_FRAMEWORK_ENABLE_PLAY 0
41 #define NN_PIA_FRAMEWORK_ENABLE_DIRECT 1
43 #define NN_PIA_FRAMEWORK_ENABLE_PLAY 0
44 #define NN_PIA_FRAMEWORK_ENABLE_DIRECT 0
47 #define NN_PIA_FRAMEWORK_ENABLE_INET (NN_PIA_FRAMEWORK_ENABLE_NEX || NN_PIA_FRAMEWORK_ENABLE_PLAY)
49 #if NN_PIA_FRAMEWORK_ENABLE_NEX
50 #include <nn/pia/inet/inet_NexJoinRandomSessionSetting.h>
54 #define NN_PIA_FRAMEWORK_ENABLE_PLAY_SETTING 0
56 #if NN_PIA_FRAMEWORK_ENABLE_PLAY
57 #include <nn/pia/play/play_PlayJoinRandomSessionSetting.h>
61 #if NN_PIA_FRAMEWORK_ENABLE_DIRECT
62 #include <nn/pia/direct/direct_DirectNetworkSetting.h>
63 #if !NN_PIA_B // iosでもビルドが通るように
68 #if NN_PIA_CTR || NN_PIA_NINTENDOSDK_NX || NN_PIA_FRAMEWORK_ENABLE_DIRECT
69 #define NN_PIA_ENABLE_LOCAL 1
71 #define NN_PIA_ENABLE_LOCAL 0
75 #define NN_PIA_EXPERIMENT_FRAMEWORK_JOINT_SESSION 1
78 #include <nn/pia/local/local_UdsNetworkSetting.h>
79 #elif NN_PIA_NINTENDOSDK
80 #include <nn/pia/local/local_LdnNetworkSetting.h>
81 #include <nn/socket.h>
82 #include <nn/account.h>
83 #include <nn/account/account_Selector.h>
85 #include <nn/err/err_Types.h>
102 NetworkType_Local = 0,
156 #if NN_PIA_FRAMEWORK_ENABLE_NEX
163 #if NN_PIA_FRAMEWORK_ENABLE_PLAY
165 gpg::GameServices* pGameServices;
168 #if NN_PIA_NINTENDOSDK
174 nn::account::UserHandle userHandle;
193 #if NN_PIA_FRAMEWORK_ENABLE_NEX
200 #if NN_PIA_FRAMEWORK_ENABLE_PLAY
201 pGameServices = NULL;
204 #if NN_PIA_NINTENDOSDK
218 #if NN_PIA_FRAMEWORK_ENABLE_NEX
219 PIA_TRACE_EX(
common::TraceFlagFramework,
"[InitializeInetSetting] totalMemorySize:%u, emergencyMemorySize:%u, isAutoInitialize:%d, gameId:%u, accessKey:%s",
totalMemorySize,
emergencyMemorySize,
isAutoInitializeAndLogin,
gameId,
accessKey.
GetCharArray());
221 #if NN_PIA_FRAMEWORK_ENABLE_PLAY
224 #if NN_PIA_NINTENDOSDK
225 PIA_TRACE_EX(
common::TraceFlagFramework,
"[InitializeInetSetting] hostName:%s, port:%u, hostUri:%s, userName:%s, password:%s", hostName.GetCharArray(), port, hostUri.GetCharArray(), userName.GetCharArray(), password.GetCharArray());
237 #if NN_PIA_FRAMEWORK_ENABLE_NEX
244 #if NN_PIA_FRAMEWORK_ENABLE_PLAY
245 appActivity = setting.appActivity;
246 pGameServices = setting.pGameServices;
249 #if NN_PIA_NINTENDOSDK
250 hostName.
Copy(setting.hostName);
252 hostUri.
Copy(setting.hostUri);
253 userName.Copy(setting.userName);
254 password.Copy(setting.password);
255 userHandle = setting.userHandle;
299 #elif NN_PIA_NINTENDOSDK
300 int localCommunicationVersion;
301 #elif NN_PIA_FRAMEWORK_ENABLE_DIRECT
304 jclass piaDirectClass;
305 jobject contextObject;
327 #elif NN_PIA_NINTENDOSDK
328 localCommunicationVersion = local::LdnLocalCommunicationVersionMin;
329 #elif NN_PIA_FRAMEWORK_ENABLE_DIRECT
346 #elif NN_PIA_NINTENDOSDK
353 #if NN_PIA_FRAMEWORK_ENABLE_PLAY
357 struct InitializePlaySetting
359 InitializePlaySetting()
492 nn::pia::common::StringStream ss;
497 if (i + 1 < sync::SyncProtocol::DataIdNum)
506 PIA_TRACE_EX(
common::TraceFlagFramework,
"[InitializeSyncSetting] dataUnitSize:%s, timeoutFrame:%u, dataCompressionLevel:%u, isAutoInitialize:%d, isChangeDelayEnabled:%d", ss.CStr(),
timeoutFrame,
dataCompressionLevel,
isAutoInitialize,
isChangeDelayEnabled);
599 #if NN_PIA_NINTENDOSDK
600 bool isAutoInitializeLdn;
629 #if NN_PIA_NINTENDOSDK
630 isAutoInitializeLdn =
false;
649 #if NN_PIA_NINTENDOSDK
650 isAutoInitializeLdn = setting.isAutoInitializeLdn;
660 #if NN_PIA_NINTENDOSDK
661 PIA_TRACE_EX(
common::TraceFlagFramework,
"[SessionStartupSetting] maxNumOfRelayRoutesAssignedToStation:%u, maxRttOfRelayRoute:%u, playerInfo.nameStringLanguage:%u, playerInfo.playerId.id[0]:%llu, playerInfo.playerId.id[1]:%llu, playerInfo.screenName:%s, signatureKeyData:%s, signatureKeyDataSize:%u, isAutoInitializeLdn:%d, isInetHostMigrationEnabled:%d",
maxNumOfRelayRoutesAssignedToStation,
maxRttOfRelayRoute,
playerInfo.
nameStringLanguage,
playerInfo.
playerId.id[0],
playerInfo.
playerId.id[1],
playerInfo.
screenName.
GetCharArray(),
signatureKeyData.
GetCharArray(),
signatureKeyDataSize, isAutoInitializeLdn,
isInetHostMigrationEnabled);
663 PIA_TRACE_EX(
common::TraceFlagFramework,
"[SessionStartupSetting] maxNumOfRelayRoutesAssignedToStation:%u, maxRttOfRelayRoute:%u, playerInfo.nameStringLanguage:%u, playerInfo.playerId.id[0]:%llu, playerInfo.playerId.id[1]:%llu, playerInfo.screenName:%s, signatureKeyData:%s, signatureKeyDataSize:%u, isInetHostMigrationEnabled:%d",
maxNumOfRelayRoutesAssignedToStation,
maxRttOfRelayRoute,
playerInfo.
nameStringLanguage,
playerInfo.
playerId.id[0],
playerInfo.
playerId.id[1],
playerInfo.
screenName.
GetCharArray(),
signatureKeyData.
GetCharArray(),
signatureKeyDataSize,
isInetHostMigrationEnabled);
703 #if NN_PIA_FRAMEWORK_ENABLE_NEX
720 #if NN_PIA_FRAMEWORK_ENABLE_NEX
731 #if NN_PIA_FRAMEWORK_ENABLE_NEX
734 NN_PIA_UNUSED(setting);
779 #if NN_PIA_FRAMEWORK_ENABLE_PLAY
783 struct PlayJoinRandomSessionSetting :
public JoinRandomSessionSetting
785 play::PlayJoinRandomSessionSetting playJoinRandomSessionSetting;
790 PlayJoinRandomSessionSetting()
791 : JoinRandomSessionSetting()
802 playJoinRandomSessionSetting.Reset();
808 void Copy(
const PlayJoinRandomSessionSetting& setting)
810 playJoinRandomSessionSetting.Copy(setting.playJoinRandomSessionSetting);
814 PlayJoinRandomSessionSetting& operator=(
const PlayJoinRandomSessionSetting& rhs)
const;
869 PIA_TRACE_EX(
common::TraceFlagFramework,
"[SetEmulationParamArg] sendThreadPacketLossRatio:%d, receiveThreadPacketLossRatio:%d, sendThreadLatencyEmulationMin:%d, sendThreadLatencyEmulationMax:%d, receiveThreadLatencyEmulationMin:%d, receiveThreadLatencyEmulationMax%d",
sendThreadPacketLossRatio,
receiveThreadPacketLossRatio,
sendThreadLatencyEmulationMin,
sendThreadLatencyEmulationMax,
receiveThreadLatencyEmulationMin,
receiveThreadLatencyEmulationMax);
877 struct InitializeTuneSetting
879 bool isAutoInitialize;
881 InitializeTuneSetting()
888 isAutoInitialize =
false;