La soluzione eccola:
#define GAME_MSGID_OKAYIT 12
struct GAMEMSG_GENERIC
{
DWORD dwType;
};
struct GAMEMSG_OKAY : public GAMEMSG_GENERIC
{
DWORD dpnidPlayer; // dpnid del player creato
int idN; // id del player
t_bikeData data; //la matrix
};
//ricezione client
HRESULT WINAPI DirectPlayMessageHandler( PVOID pvUserContext,
DWORD dwMessageId,
PVOID pMsgBuffer )
{
switch( dwMessageId )
{
case DPN_MSGID_RECEIVE:
{
HRESULT hr;
PDPNMSG_RECEIVE pReceiveMsg;
pReceiveMsg = (PDPNMSG_RECEIVE)pMsgBuffer;
GAMEMSG_OKAY* pMsg = (GAMEMSG_OKAY*) pReceiveMsg->pReceiveData;
switch( pMsg->dwType )
{
if( pMsg->dwType == GAME_MSGID_OKAYIT )
Riprendi_Dati(); //della struttura
break;
}
}
}
}
--------code invio BYTE del client-------------
...
GAMEMSG_OKAY msgOkay;
msgOkay.dwType = GAME_MSGID_OKAYIT;
DPN_BUFFER_DESC bufferDesc;
bufferDesc.dwBufferSize = sizeof(GAMEMSG_OKAY);
bufferDesc.pBufferData = (BYTE*) &msgOkay;
...
-------end code--------------------
.... credo proprio che non serva a nessuno perlomeno su questo forum...

Rispondi quotando