ネットワーク研究室:DirectLobby2・3概要

Back to Title Page(OpenLab)タイトルページへ戻る

最終更新日: 1998年 08月 24日 月曜日


 
DirectPlayLobbyの概要

 DirectPlayLobbyServerの利点
 IDirectPlayはメインアプリケーションのインターフェイスとして確立させ このIDirectPlayLobbyは待合所・公園などのようにアプリケーションに参加するプレイヤー を集めたり、ネットワークアドレスを管理するもので、このLobbyServerを 仲介にすることで、アプリケーションに対する適切なネットワーク上のユーザー インターフェイスを構築できるようになります。

 

 IDirectPlayLobby3で拡張されたメソッド
ConnectEx
RegisterApplication
UnregisterApplication
WaitForConnectionSettings

 

IDirectPlayLobby3での拡張された機能の説明
ConnectEx

構文

HRESULT ConnectEx(
  DWORD dwFlags,
  REFIID riid,
  LPVOID *lplpDP,
  IUnknown FAR *pUnk
  );

パラメータ

dwFlags
Flags indicating how the connection is to be done. By default (dwFlags = 0), the method returns after a connection has been established or the operation has timed out.
DPCONNECT_RETURNSTATUS
Returns immediately with the status of the connection. The application must continue calling ConnectEx until a success or error code is returned.
riid
The IID of the specific DirectPlay COM interface to be returned; for example, IID_IDirectPlay4A.
lplpDP
Pointer to a pointer to be initialized with the DirectPlay interface as specified by the riid parameter.
pUnk
Pointer to the containing IUnknown interface. This parameter is provided for future compatibility with COM aggregation features. Presently, however, IDirectPlayLobby3::ConnectEx returns an error if this parameter is anything but NULL.

返り値

成功時 DP_OK、もしくはエラーが発生したので以下の値が代入される

DPERR_CONNECTING
DPERR_INVALIDFLAGS
DPERR_INVALIDPARAMS

The method returns DPERR_CONNECTING while the connection operation is in progress. Call the methods again to get an updated status.

Remarks

There is an upper limit of one minute on connection timeout.

After this method is successfully completed, the application can skip the process of calling IDirectPlay4::InitializeConnection, IDirectPlay4::EnumSessions, and IDirectPlay4::Open. The application should not ask the user a name but instead create a player using the player name information in the DPLCONNECTION structure.

Before calling this method, the application can examine the connection settings that will be used to start the application by using the IDirectPlayLobby3::GetConnectionSettings method. The application then can modify these settings and set them by using the IDirectPlayLobby3::SetConnectionSettings method. The application should pay particular attention to the DPSESSIONDESC2 structure to ensure that the proper session properties are set, especially dwFlags, dwMaxPlayers, and the dwUser members.

RegisterApplication  

構文

HRESULT RegisterApplication(
  DWORD dwFlags,
  LPDPAPPLICATIONDESC lpAppDesc
  );

パラメータ

dwFlags
予約済み; 常に 0 .
lpAppDesc
DPAPPLICATIONDESC 構造体へのポインター。あらかじめアプリケーション登録用パラメータを代入しておくこと。

返り値

成功時 DP_OK、もしくはエラーが発生したので以下の値が代入される

DPERR_INVALIDFLAGS
DPERR_INVALIDPARAMS
UnregisterApplication

構文

HRESULT UnregisterApplication(
  DWORD dwFlags,
  REFGUID guidApplication
  );

パラメータ

dwFlags
予約済み; 常に 0
guidApplication
登録を取り消すアプリケーションのGUID。

返り値

成功時 DP_OK、もしくはエラーが発生したので以下の値が代入される

DPERR_INVALIDFLAGS
DPERR_INVALIDPARAMS
DPERR_UNKNOWNAPPLICATION

もしこのメソッドがDPERR_UNKNOWNAPPLICATION を帰すなら、そのアプリケーションの GUID はレジストリに見つからない。もしくは未登録のGUIDである。

WaitForConnectionSettings

構文

HRESULT WaitForConnectionSettings(
  DWORD dwFlags);

パラメータ

dwFlags
Flag that puts the application into wait mode or takes it out of wait mode. By default (dwFlags = 0), the method puts the application into wait mode. Setting dwFlags to DPLWAIT_CANCEL takes the application out of wait mode. As soon as the connection settings are sent by the lobby client, the application will automatically be taken out of wait mode.

返り値

成功時 DP_OK、もしくはエラーが発生したので以下の値が代入される

DPERR_INVALIDFLAGS
DPERR_UNAVAILABLE

The method returns DPERR_UNAVAILABLE if you set the flag to cancel wait mode and the application is not in wait mode.

Remarks

NECTIONSETTINGS system message. The application can then read the connection settings with GetConnectionSettings and join a session using ConnectExWhen the lobby client uses RunApplication, DirectPlay will look for any instances of the application that are waiting for connection settings. If none are found, then a new instance of the application is launched. If a waiting application is found, DirectPlay will send a DPLSYS_NEWCON.

 

Copyright (C) Kitaro 1998