|
GamemComms
A GameComms.dll re-implementation for the Nokia N-Gage
|
This is the notification interface provided by the library. More...
#include <GameBTCommsNotify.h>
Public Member Functions | |
ClientConnected | |
| virtual void | ClientConnected (TUint16 aClientId, TDesC &aClientName, TInt aError)=0 |
| Always called on the host application (with KErrNone == aError) for each sucessful connection made with a client. Also called with an error code on the host application when there is a connection error. In the second case the interpretation is different depending upon the API called prior to receiving the callback: More... | |
HostSelected | |
| virtual void | HostSelected (TInt aError)=0 |
| Called on a client application when a host is selected by the user after calling StartClientL(). More... | |
HostConnected | |
| virtual void | HostConnected (TInt aError)=0 |
| Always called on each client application after StartClientL() is called (unless no device is selected). More... | |
StartMultiPlayerGame | |
| virtual void | StartMultiPlayerGame (TInt aError)=0 |
| Always called on all applications when the game can be started (KErrNone == aError). More... | |
ContinueMultiPlayerGame | |
| virtual void | ContinueMultiPlayerGame ()=0 |
| Always called on all applications when a game can be continued after it has been paused. More... | |
PauseMultiPlayerGame | |
| virtual void | PauseMultiPlayerGame ()=0 |
| Called on all applications except the one that called CGameBTComms::PauseMultiPlayerGame() More... | |
EndMultiPlayerGame | |
| virtual void | EndMultiPlayerGame (TInt aReason)=0 |
| Notifies the game application that the game should be ended. More... | |
ConnectedClientEndedGame | |
| virtual void | ConnectedClientEndedGame (TUint16 aClientId)=0 |
| Notifies the host game application that a connected client has chosen to end their game in the following cases: More... | |
ClientDisconnected | |
| virtual void | ClientDisconnected (TUint16 aClientId, TInt aError)=0 |
| This is called on the host application when a client device has disconnected because: More... | |
HostDisconnected | |
| virtual void | HostDisconnected (TInt aError)=0 |
| This is called on a client application when the host has disconnected because: More... | |
ReceiveDataFromClient | |
| virtual void | ReceiveDataFromClient (TUint16 aClientId, TDesC8 &aData)=0 |
| Notifies the game application that some application specific data has been received from a client game. More... | |
ReceiveDataFromHost | |
| virtual void | ReceiveDataFromHost (TDesC8 &aData)=0 |
| Notifies a client game application that some application specific data has been received from the host game. More... | |
This is the notification interface provided by the library.
The application developer should provide a class implementing this interface with suitable handling for each callback method. An object of that type can then be passed to the CGameBTComms object on creation; the framework will then call that object to handle each event.
|
pure virtual |
Always called on the host application (with KErrNone == aError) for each sucessful connection made with a client. Also called with an error code on the host application when there is a connection error. In the second case the interpretation is different depending upon the API called prior to receiving the callback:
| aClientId | Indicates which client has now connected (from 1 to CGameBTComms::KMaxPlayers - 1) |
If aError != KErrNone, aClientId may be KUnknownClientId indicating there was a connection error, but that the client id was not known. Note: if an error occurs, the host automatically disconnects all sockets and no further connections are possible. CGameBTComms::StartHostL() must be called for further connection attempts.
| aClientName | If aError == KErrNone, aClientName will
|
Otherwise aClientName will have zero length.
| aError |
|
|
pure virtual |
This is called on the host application when a client device has disconnected because:
It is not called when:
| aClientId | Indicates which client has disconnected (from 1 to CGameBTComms::KMaxPlayers - 1) |
| aError | KErrNone if disconnection isn't due to an error e.g. another device receiving telephone call, otherwise another error code. |
|
pure virtual |
Notifies the host game application that a connected client has chosen to end their game in the following cases:
It is not called when:
| aClientId | Indicates which connected client has ended their game |
|
pure virtual |
Always called on all applications when a game can be continued after it has been paused.
This will be called when enough connected applications (number of players >= the minimum required for the game) have called CGameBTComms::ContinueMultiplayerGame().
|
pure virtual |
Notifies the game application that the game should be ended.
Called on all applications except the one that called CGameBTComms::EndMultiPlayerGame(). Currently all client applications (even the one that called CGameBTComms::EndMultiPlayerGame()) also receive a MGameBTCommsNotify::HostDisconnected notification beforehand.
Called in the following cases:
| aReason |
|
|
pure virtual |
Always called on each client application after StartClientL() is called (unless no device is selected).
Also called on each client after reconnection to the host using ReconnectL(). The connection is only successful if KErrNone == aError.
| aError |
|
|
pure virtual |
This is called on a client application when the host has disconnected because:
It is not called because of:
| aError | KErrNone if disconnection is not due to an error e.g. another device receiving telephone call |
|
pure virtual |
Called on a client application when a host is selected by the user after calling StartClientL().
This notification is only really of value to let the application know that the user has canceled the host selection dialog. In this case, KErrCancel == aError.
| aError |
|
|
pure virtual |
Called on all applications except the one that called CGameBTComms::PauseMultiPlayerGame()
Indicates the game should be paused. Attempting to call a SendDataxxx function whilst in the paused state will result in an error code of KErrGamePaused being returned.
|
pure virtual |
Notifies the game application that some application specific data has been received from a client game.
Note: the game must be in the play state.
| aClientId | Indicates which client the data is received from (from 1 to CGameBTComms::KMaxPlayers - 1) |
| aData | Descriptor containing the data received. Note that this must be copied if it is to be used outside the scope of this function. |
|
pure virtual |
Notifies a client game application that some application specific data has been received from the host game.
Note: the game must be in the play state.
| aData | Descriptor containing the data received. Note that this must be copied if it is to be used outside the scope of this function. |
|
pure virtual |
Always called on all applications when the game can be started (KErrNone == aError).
This means that all the necessary connections are in place (i.e the number of requested players have been connected). Note that this is only called after StartHostL() and not ReconnectL(). If KErrNotEnoughPlayers == aError, this means that there has been a comms error immediately after all the clients have connected, and some clients have been disconnected, leaving not enough players to play the game.
| aError |
|