OROCHI
 
Loading...
Searching...
No Matches
GxSysP2P Class Reference

P2P通信システム More...

#include <GxSysP2P.h>

Inheritance diagram for GxSysP2P:
Collaboration diagram for GxSysP2P:

Public Member Functions

アクセサ
GX_FORCE_INLINE GxP2PSessionManager::ASYNC_RESULT getAsyncResult (void) const
 非同期処理結果取得
 
GX_FORCE_INLINE GxP2PSessionManager::ERROR_TYPE getError (void) const
 エラー情報取得
 
const GxP2PStationgetStation (void) const
 自分ステーション取得
 
const GxP2PStationgetStation (u32 index) const
 指定ステーション取得
 
const GxP2PStationgetStationHost (void) const
 ホストステーション取得
 
u32 getStationNum (void) const
 ステーション数取得
 
u32 getStationId (void) const
 ステーションID取得
 
GX_FORCE_INLINE b32 isServedSessionManager (void) const
 セッション処理動作中判定
 
GX_FORCE_INLINE b32 isServedMessageManager (void) const
 メッセージ通信稼働中判定
 
GX_FORCE_INLINE b32 isServedSyncManager (void) const
 同期通信稼動中判定
 
GX_FORCE_INLINE b32 isServedDuplicateManager (void) const
 非同期オブジェクト通信稼動中判定
 
GX_FORCE_INLINE b32 isServedRemoteManager (void) const
 リモートコールバック稼動中判定
 
b32 isJoined (void) const
 セッション参加中判定
 
b32 isHost (void) const
 セッションホスト判定
 
b32 isReady (void) const
 ゲームセッション準備確認 (ホスト専用)
 
b32 isGameSession (void) const
 ゲームセッション中判定
 
constexpr GxP2PSessionManagergetSessionManager (void) const
 セッションマネージャ
 
constexpr GxP2PMessageManagergetMessageManager (void) const
 メッセージ通信マネージャ
 
constexpr GxP2PSyncManagergetSyncManager (void) const
 同期通信マネージャ
 
constexpr GxP2PDuplicateManagergetDuplicateManager (void) const
 非同期オブジェクト通信マネージャ
 
constexpr GxP2PRemoteManagergetRemoteManager (void) const
 リモートコールバックマネージャ
 
- Public Member Functions inherited from GxSysP2PBase
 GxSysP2PBase (void)
 コンストラクタ
 
 ~GxSysP2PBase (void) override
 デストラクタ
 
- Public Member Functions inherited from GxSysBase
template<typename T >
T * getModule (void) const
 モジュールを取得
 
 GxSysBase (void)
 デフォルトコンストラクタ
 
 ~GxSysBase (void) override
 デストラクタ
 
virtual b32 initialize (const GxClassBase *pInitialiInformation=nullptr)
 初期化
 
b32 isLocked (void)
 クリティカルセクションのロック状態を確認する
 
void sleep (f32 time)
 スリープ(スクリプト用)
 
- Public Member Functions inherited from GxClassBase
constexpr GxClassBase (void)
 コンストラクタ
 
constexpr GxClassBase (const GxClassBase &base)
 コピーコンストラクタ
 
 ~GxClassBase (void) override
 デストラクタ
 
- Public Member Functions inherited from GxClassBaseRoot
constexpr GxClassBaseRoot (void)
 コンストラクタ
 
constexpr GxClassBaseRoot (const GxClassBaseRoot &)
 コピーコンストラクタ
 
virtual ~GxClassBaseRoot (void)
 デストラクタ
 
constexpr GxClassBaseRootoperator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRttigetRtti (void) const =0
 Rttiの取得
 
virtual GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 
- Public Member Functions inherited from SingletonBase< GxSysP2PBase >
 SingletonBase (void)
 コンストラクタ
 
 ~SingletonBase (void)
 デストラクタ
 

Protected Attributes

メンバ変数
GxP2PSessionManager_pSessionManager
 セッションマネージャ
 
GxP2PMessageManager_pMessageManager
 メッセージ通信マネージャ
 
GxP2PSyncManager_pSyncManager
 同期通信マネージャ
 
GxP2PDuplicateManager_pDuplicateManager
 非同期オブジェクト通信マネージャ
 
GxP2PRemoteManager_pRemoteManager
 リモートコールバックマネージャ
 

定義

enum  NETWORK_SERVICE {
  NETWORK_SERVICE_MESSAGE = 0x00000001 , NETWORK_SERVICE_SYNC = 0x00000002 , NETWORK_SERVICE_DUPLICATE = 0x00000004 , NETWORK_SERVICE_REMOTE = 0x00000010 ,
  NETWORK_SERVICE_UPNP = 0x00001000 , NETWORK_SERVICE_ALL = 0xFFFFFFFF
}
 ネットワークサービス More...
 
enum class  NETWORK_RESULT { SUCCESS = 0 , ERROR_INVALID = -1 }
 ネットワーク処理開始結果定義 More...
 
static constexpr u32 STATION_MAX = GxP2PSessionManager::NETWORK_GAMER_MAX
 接続ステーション最大
 

初期化

 GxSysP2P (void)
 デフォルトコンストラクタ
 
void terminate (void) override
 終了処理
 
virtual NETWORK_RESULT startNetwork (GxP2PSessionManager::EVENT_CALLBACK_FUNCTION eventCallback=GxSysP2P::callbackEvent, u32 port=GxP2PSessionManager::DEFAULT_USE_PORT, u32 magicNumber=GxP2PSessionManager::DEFAULT_MAGIC_NUMBER, nu32 systemLinkPort=GxP2PSessionManager::DEFAULT_SYSTEM_LINK_PORT)
 ネットワーク処理開始
 
virtual void endNetwork (void)
 ネットワーク処理終了
 
virtual b32 startService (u32 serviceFlags)
 サービス開始
 
virtual void endService (u32 serviceFlags)
 サービス終了
 
static void loadModule (void)
 モジュールのロード
 
static void unloadModule (void)
 モジュールのアンロード
 

操作

void update (void) override
 更新
 
b32 createSession (GxP2PSessionManager::CREATE_MODE mode)
 セッション作成
 
b32 joinSession (GX_CSTR address)
 セッション参加 (IP文字列指定)
 
b32 joinSession (u32 address)
 セッション参加 (IP数値指定)
 
b32 joinSession (const GxP2PSessionManager::GxSessionInformation &session)
 セッション参加 (セッション指定)
 
b32 leaveSession (void)
 セッション離脱
 
b32 searchSession (GxP2PSessionManager::GxSessionInformation *pDst, u32 *pNum)
 セッション探索
 
b32 kickoutSession (const GxP2PStation &station)
 セッションメンバーキックアウト
 
b32 createSessionAsync (GxP2PSessionManager::CREATE_MODE mode)
 セッション作成 [非同期]
 
b32 joinSessionAsync (GX_CSTR address)
 セッション参加 [非同期] (IP文字列指定)
 
b32 joinSessionAsync (u32 address)
 セッション参加 [非同期] (IP数値指定)
 
b32 joinSessionAsync (const GxP2PSessionManager::GxSessionInformation &session)
 セッション参加 [非同期] (セッション指定)
 
b32 leaveSessionAsync (void)
 セッション離脱 [非同期]
 
b32 searchSessionAsync (GxP2PSessionManager::GxSessionInformation *pDst, u32 *pNum)
 セッション探索 [非同期]
 
b32 kickoutSessionAsync (const GxP2PStation &station)
 セッションメンバーキックアウト [非同期]
 
void readyGameSession (void)
 ゲームセッション準備
 
b32 startGameSession (const GxP2PSessionManager::GxSessionParameter *pParam=nullptr)
 ゲームセッション開始 (ホスト専用)
 
b32 endGameSession (void)
 ゲームセッション終了 (ホスト専用)
 
static void callbackEvent (GxP2PSessionManager::EVENT type, GxP2PSessionManager::ERROR_TYPE error, u32 stationId)
 イベントコールバック
 

Additional Inherited Members

- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 
- Static Public Member Functions inherited from SingletonBase< GxSysP2PBase >
static GX_FORCE_INLINE GxSysP2PBasegetSingleton (void)
 参照を取得
 
static constexpr GxSysP2PBasegetSingletonPointer (void)
 ポインタを取得
 
- Protected Types inherited from GxSysBase
enum class  LOCK_TYPE { SEQUENTIAL_THREAD_SAFE , THREAD_SAFE }
 ロックタイプ More...
 
- Protected Member Functions inherited from GxSysBase
void terminateGxModules (void)
 GXモジュールの終了処理
 
void lock (LOCK_TYPE type=LOCK_TYPE::THREAD_SAFE)
 クリティカルセクションに入る
 
void unlock (LOCK_TYPE type=LOCK_TYPE::THREAD_SAFE)
 クリティカルセクションを出る
 
template<typename T >
T * addModule (void)
 モジュールを作成
 
template<typename T >
void removeModule (void)
 モジュールを削除
 

Detailed Description

P2P通信システム

Member Enumeration Documentation

◆ NETWORK_RESULT

enum class GxSysP2P::NETWORK_RESULT
strong

ネットワーク処理開始結果定義

Enumerator
SUCCESS 

成功

ERROR_INVALID 

失敗:想定外 (プログラムエラー)

◆ NETWORK_SERVICE

ネットワークサービス

Enumerator
NETWORK_SERVICE_MESSAGE 

メッセージ通信

NETWORK_SERVICE_SYNC 

同期ロックステップ通信

NETWORK_SERVICE_DUPLICATE 

非同期オブジェクトコピー通信

NETWORK_SERVICE_REMOTE 

リモートコールバック

NETWORK_SERVICE_UPNP 

UPnP.

NETWORK_SERVICE_ALL 

ALL.

Member Function Documentation

◆ callbackEvent()

void GxSysP2P::callbackEvent ( GxP2PSessionManager::EVENT type,
GxP2PSessionManager::ERROR_TYPE error,
u32 stationId )
static

イベントコールバック

Parameters
type[in] イベントタイプ
error[in] エラー番号
stationId[in] イベント対象ステーションID
Note
アプリケーション側でイベントコールバックを上書きする場合は、
Here is the call graph for this function:

◆ createSession()

GX_FORCE_INLINE b32 GxSysP2P::createSession ( GxP2PSessionManager::CREATE_MODE mode)

セッション作成

Parameters
mode[in] セッション作成モード
Returns
成功ならtrue
Here is the call graph for this function:

◆ createSessionAsync()

GX_FORCE_INLINE b32 GxSysP2P::createSessionAsync ( GxP2PSessionManager::CREATE_MODE mode)

セッション作成 [非同期]

Parameters
mode[in] セッション作成モード
Returns
成功ならtrue
Here is the call graph for this function:

◆ endGameSession()

GX_FORCE_INLINE b32 GxSysP2P::endGameSession ( void )

ゲームセッション終了 (ホスト専用)

Returns
成功ならtrue
Here is the call graph for this function:

◆ endService()

void GxSysP2P::endService ( u32 serviceFlags)
virtual

サービス終了

Parameters
serviceFlags[in] 終了サービスフラグ (NETWORK_SERVICE_~ 定義の合成指定)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStation() [1/2]

GX_FORCE_INLINE const GxP2PStation * GxSysP2P::getStation ( u32 index) const

指定ステーション取得

Returns
指定ステーションポインタ (nullptrの場合:セッション不参加)
Here is the call graph for this function:

◆ getStation() [2/2]

GX_FORCE_INLINE const GxP2PStation * GxSysP2P::getStation ( void ) const

自分ステーション取得

Returns
自分ステーションポインタ (nullptrの場合:セッション不参加)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStationHost()

GX_FORCE_INLINE const GxP2PStation * GxSysP2P::getStationHost ( void ) const

ホストステーション取得

Returns
ホストステーションポインタ (nullptrの場合:セッション不参加)
Here is the call graph for this function:

◆ getStationId()

GX_FORCE_INLINE u32 GxSysP2P::getStationId ( void ) const

ステーションID取得

Returns
ステーションID (GX_INVALID_HANDLEの場合:セッション不参加)
Here is the call graph for this function:

◆ getStationNum()

GX_FORCE_INLINE u32 GxSysP2P::getStationNum ( void ) const

ステーション数取得

Returns
有効ステーション数
Here is the call graph for this function:

◆ isGameSession()

GX_FORCE_INLINE b32 GxSysP2P::isGameSession ( void ) const

ゲームセッション中判定

Returns
ゲームセッション中ならtrue
Here is the call graph for this function:

◆ isHost()

GX_FORCE_INLINE b32 GxSysP2P::isHost ( void ) const

セッションホスト判定

Returns
ホストならtrue
Here is the call graph for this function:

◆ isJoined()

GX_FORCE_INLINE b32 GxSysP2P::isJoined ( void ) const

セッション参加中判定

Returns
セッション参加中ならtrue
Here is the call graph for this function:

◆ isReady()

GX_FORCE_INLINE b32 GxSysP2P::isReady ( void ) const

ゲームセッション準備確認 (ホスト専用)

Returns
準備完了済みならtrue
Note
参加中プレイヤーの準備完了状態を判定します。
Here is the call graph for this function:

◆ joinSession() [1/3]

GX_FORCE_INLINE b32 GxSysP2P::joinSession ( const GxP2PSessionManager::GxSessionInformation & session)

セッション参加 (セッション指定)

Parameters
session[in] 接続先セッション情報
Returns
成功ならtrue
Here is the call graph for this function:

◆ joinSession() [2/3]

GX_FORCE_INLINE b32 GxSysP2P::joinSession ( GX_CSTR address)

セッション参加 (IP文字列指定)

Parameters
address[in] ホストIPアドレス (文字列)
Returns
成功ならtrue
Here is the call graph for this function:

◆ joinSession() [3/3]

GX_FORCE_INLINE b32 GxSysP2P::joinSession ( u32 address)

セッション参加 (IP数値指定)

Parameters
address[in] ホストIPアドレス(数値)
Returns
成功ならtrue
Here is the call graph for this function:

◆ joinSessionAsync() [1/3]

GX_FORCE_INLINE b32 GxSysP2P::joinSessionAsync ( const GxP2PSessionManager::GxSessionInformation & session)

セッション参加 [非同期] (セッション指定)

Parameters
session[in] 接続先セッション情報
Returns
成功ならtrue
Here is the call graph for this function:

◆ joinSessionAsync() [2/3]

GX_FORCE_INLINE b32 GxSysP2P::joinSessionAsync ( GX_CSTR address)

セッション参加 [非同期] (IP文字列指定)

Parameters
address[in] ホストIPアドレス (文字列)
Returns
成功ならtrue
Here is the call graph for this function:

◆ joinSessionAsync() [3/3]

GX_FORCE_INLINE b32 GxSysP2P::joinSessionAsync ( u32 address)

セッション参加 [非同期] (IP数値指定)

Parameters
address[in] ホストIPアドレス(数値)
Returns
成功ならtrue
Here is the call graph for this function:

◆ kickoutSession()

GX_FORCE_INLINE b32 GxSysP2P::kickoutSession ( const GxP2PStation & station)

セッションメンバーキックアウト

Parameters
station[in] キックアウト対象メンバーステーション
Returns
成功ならtrue
Here is the call graph for this function:

◆ kickoutSessionAsync()

GX_FORCE_INLINE b32 GxSysP2P::kickoutSessionAsync ( const GxP2PStation & station)

セッションメンバーキックアウト [非同期]

Parameters
station[in] キックアウト対象メンバーステーション
Returns
成功ならtrue
Here is the call graph for this function:

◆ leaveSession()

GX_FORCE_INLINE b32 GxSysP2P::leaveSession ( void )

セッション離脱

Returns
成功ならtrue
Here is the call graph for this function:

◆ leaveSessionAsync()

GX_FORCE_INLINE b32 GxSysP2P::leaveSessionAsync ( void )

セッション離脱 [非同期]

Returns
成功ならtrue
Here is the call graph for this function:

◆ searchSession()

GX_FORCE_INLINE b32 GxSysP2P::searchSession ( GxP2PSessionManager::GxSessionInformation * pDst,
u32 * pNum )

セッション探索

Parameters
pDst[out] セッション情報格納先ポインタ
pNum[in,out] 取得セッション数 (セッション情報格納可能サイズ)
Returns
成功ならtrue
Note
探索完了時には実際に発見した数が pNum に格納されます
Here is the call graph for this function:

◆ searchSessionAsync()

GX_FORCE_INLINE b32 GxSysP2P::searchSessionAsync ( GxP2PSessionManager::GxSessionInformation * pDst,
u32 * pNum )

セッション探索 [非同期]

Parameters
pDst[out] セッション情報格納先ポインタ
pNum[in,out] 取得セッション数 (セッション情報格納可能サイズ)
Returns
成功ならtrue
Note
LAN内セッションを探索します。
Here is the call graph for this function:

◆ startGameSession()

GX_FORCE_INLINE b32 GxSysP2P::startGameSession ( const GxP2PSessionManager::GxSessionParameter * pParam = nullptr)

ゲームセッション開始 (ホスト専用)

Parameters
pParam[in] ゲームセッションパラメータポインタ (※ディフォルト設定でよい場合はnullptr指定)
Returns
成功ならtrue
Here is the call graph for this function:

◆ startNetwork()

ネットワーク処理開始

Parameters
eventCallback[in] 登録イベントコールバック関数
port[in] 使用ポート (UDP)
magicNumber[in] 使用マジックナンバー (下位24bitが有効)
systemLinkPort[in] システムリンクポート (UDP) ※セッションLAN探索用
Returns
成功ならNETWORK_RESULT_SUCCESS
Here is the call graph for this function:

◆ startService()

b32 GxSysP2P::startService ( u32 serviceFlags)
virtual

サービス開始

Parameters
serviceFlags[in] 開始サービスフラグ (NETWORK_SERVICE_~ 定義の合成指定)
Returns
成功ならtrue
Here is the call graph for this function:

◆ terminate()

void GxSysP2P::terminate ( void )
overridevirtual

終了処理

Reimplemented from GxSysBase.

Here is the call graph for this function:

◆ update()

void GxSysP2P::update ( void )
overridevirtual

更新

Reimplemented from GxSysBase.

Here is the call graph for this function:

The documentation for this class was generated from the following files: