2002-03-10 00:29:33 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2000 Peter Hunnisett
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
2000-07-10 15:19:28 +02:00
|
|
|
|
2000-08-25 23:58:05 +02:00
|
|
|
#ifndef __WINE_DPLAYX_MESSAGES__
|
|
|
|
#define __WINE_DPLAYX_MESSAGES__
|
2000-07-10 15:19:28 +02:00
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2000-07-10 15:19:28 +02:00
|
|
|
#include "windef.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "winbase.h"
|
2000-08-25 23:58:05 +02:00
|
|
|
#include "dplay.h"
|
|
|
|
#include "rpc.h" /* For GUID */
|
2000-07-10 15:19:28 +02:00
|
|
|
|
2000-08-30 01:55:06 +02:00
|
|
|
#include "dplay_global.h"
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart,
|
2000-08-25 23:58:05 +02:00
|
|
|
HANDLE hDeath, HANDLE hConnRead );
|
2000-07-10 15:19:28 +02:00
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags,
|
|
|
|
LPDPID lpdipidAllocatedId );
|
|
|
|
HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer );
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
2000-10-19 22:20:58 +02:00
|
|
|
LPCVOID lpMsgBody, DWORD dwMsgBodySize );
|
|
|
|
void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId,
|
|
|
|
LPCVOID lpMsgBody, DWORD dwMsgBodySize );
|
2001-04-12 23:10:54 +02:00
|
|
|
void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf );
|
2000-10-19 22:20:58 +02:00
|
|
|
|
|
|
|
/* Timings -> 1000 ticks/sec */
|
|
|
|
#define DPMSG_WAIT_5_SECS 5000
|
|
|
|
#define DPMSG_WAIT_30_SECS 30000
|
|
|
|
#define DPMSG_WAIT_60_SECS 60000
|
|
|
|
#define DPMSG_DEFAULT_WAIT_TIME DPMSG_WAIT_30_SECS
|
2000-07-10 15:19:28 +02:00
|
|
|
|
2000-08-25 23:58:05 +02:00
|
|
|
/* Message types etc. */
|
|
|
|
#include "pshpack1.h"
|
|
|
|
|
|
|
|
/* Non provided messages for DPLAY - guess work which may be wrong :( */
|
|
|
|
#define DPMSGCMD_ENUMSESSIONSREPLY 1
|
|
|
|
#define DPMSGCMD_ENUMSESSIONSREQUEST 2
|
2000-10-19 22:20:58 +02:00
|
|
|
#define DPMSGCMD_GETNAMETABLEREPLY 3 /* Contains all existing players in session */
|
2000-08-25 23:58:05 +02:00
|
|
|
|
|
|
|
#define DPMSGCMD_REQUESTNEWPLAYERID 5
|
|
|
|
|
|
|
|
#define DPMSGCMD_NEWPLAYERIDREPLY 7
|
2002-06-01 01:06:46 +02:00
|
|
|
#define DPMSGCMD_CREATESESSION 8 /* Might be a create nameserver or new player msg */
|
2000-08-25 23:58:05 +02:00
|
|
|
#define DPMSGCMD_CREATENEWPLAYER 9
|
2002-06-01 01:06:46 +02:00
|
|
|
#define DPMSGCMD_SYSTEMMESSAGE 10
|
2000-08-30 01:55:06 +02:00
|
|
|
#define DPMSGCMD_DELETEPLAYER 11
|
2000-08-25 23:58:05 +02:00
|
|
|
#define DPMSGCMD_DELETEGROUP 12
|
|
|
|
|
|
|
|
#define DPMSGCMD_ENUMGROUPS 17
|
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
#define DPMSGCMD_FORWARDADDPLAYER 19
|
2000-09-27 01:11:48 +02:00
|
|
|
|
2001-04-12 23:10:54 +02:00
|
|
|
#define DPMSGCMD_PLAYERCHAT 22
|
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
#define DPMSGCMD_FORWARDADDPLAYERNACK 36
|
2000-08-30 01:55:06 +02:00
|
|
|
|
2001-04-12 23:10:54 +02:00
|
|
|
#define DPMSGCMD_JUSTENVELOPE 1000
|
|
|
|
#define DPMSGCMD_JUSTENVELOPEREPLY 1001
|
|
|
|
|
2000-08-25 23:58:05 +02:00
|
|
|
/* This is what DP 6 defines it as. Don't know what it means. All messages
|
|
|
|
* defined below are DPMSGVER_DP6.
|
|
|
|
*/
|
|
|
|
#define DPMSGVER_DP6 11
|
|
|
|
|
|
|
|
/* MAGIC number at the start of all dplay packets ("play" in ASCII) */
|
|
|
|
#define DPMSGMAGIC_DPLAYMSG 0x79616c70
|
|
|
|
|
|
|
|
/* All messages sent from the system are sent with this at the beginning of
|
|
|
|
* the message.
|
2000-10-19 22:20:58 +02:00
|
|
|
* Size is 8 bytes
|
2000-08-25 23:58:05 +02:00
|
|
|
*/
|
|
|
|
typedef struct tagDPMSG_SENDENVELOPE
|
|
|
|
{
|
|
|
|
DWORD dwMagic;
|
|
|
|
WORD wCommandId;
|
|
|
|
WORD wVersion;
|
|
|
|
} DPMSG_SENDENVELOPE, *LPDPMSG_SENDENVELOPE;
|
|
|
|
typedef const DPMSG_SENDENVELOPE* LPCDPMSG_SENDENVELOPE;
|
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
/* System messages exchanged between players seems to have this
|
2002-06-01 01:06:46 +02:00
|
|
|
* payload envelope on top of the basic envelope
|
2000-10-19 22:20:58 +02:00
|
|
|
*/
|
2000-08-25 23:58:05 +02:00
|
|
|
typedef struct tagDPMSG_SYSMSGENVELOPE
|
|
|
|
{
|
|
|
|
DWORD dwPlayerFrom;
|
|
|
|
DWORD dwPlayerTo;
|
|
|
|
} DPMSG_SYSMSGENVELOPE, *LPDPMSG_SYSMSGENVELOPE;
|
|
|
|
typedef const DPMSG_SYSMSGENVELOPE* LPCDPMSG_SYSMSGENVELOPE;
|
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
/* Reply sent in response to an enumsession request */
|
2000-08-25 23:58:05 +02:00
|
|
|
typedef struct tagDPMSG_ENUMSESSIONSREPLY
|
|
|
|
{
|
|
|
|
DPMSG_SENDENVELOPE envelope;
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
DWORD dwSize; /* Size of DPSESSIONDESC2 struct */
|
|
|
|
DWORD dwFlags; /* Sessions flags */
|
|
|
|
|
|
|
|
GUID guidInstance; /* Not 100% sure this is what it is... */
|
|
|
|
|
|
|
|
GUID guidApplication;
|
|
|
|
|
|
|
|
DWORD dwMaxPlayers;
|
|
|
|
DWORD dwCurrentPlayers;
|
|
|
|
|
|
|
|
BYTE unknown[36];
|
|
|
|
#else
|
|
|
|
DPSESSIONDESC2 sd;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
DWORD dwUnknown; /* Seems to be equal to 0x5c which is a "\\" */
|
|
|
|
/* Encryption package string? */
|
|
|
|
|
|
|
|
/* At the end we have ... */
|
|
|
|
/* WCHAR wszSessionName[1]; Var length with NULL terminal */
|
|
|
|
|
|
|
|
} DPMSG_ENUMSESSIONSREPLY, *LPDPMSG_ENUMSESSIONSREPLY;
|
|
|
|
typedef const DPMSG_ENUMSESSIONSREPLY* LPCDPMSG_ENUMSESSIONSREPLY;
|
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
/* Msg sent to find out what sessions are available */
|
2000-08-25 23:58:05 +02:00
|
|
|
typedef struct tagDPMSG_ENUMSESSIONSREQUEST
|
|
|
|
{
|
|
|
|
DPMSG_SENDENVELOPE envelope;
|
|
|
|
|
|
|
|
GUID guidApplication;
|
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
DWORD dwPasswordSize; /* A Guess. This is 0x00000000. */
|
2000-08-25 23:58:05 +02:00
|
|
|
/* This might be the name server DPID which
|
|
|
|
is needed for the reply */
|
|
|
|
|
|
|
|
DWORD dwFlags; /* dwFlags from EnumSessions */
|
|
|
|
|
|
|
|
} DPMSG_ENUMSESSIONSREQUEST, *LPDPMSG_ENUMSESSIONSREQUEST;
|
|
|
|
typedef const DPMSG_ENUMSESSIONSREQUEST* LPCDPMSG_ENUMSESSIONSREQUEST;
|
|
|
|
|
|
|
|
/* Size is 146 received - with 18 or 20 bytes header = ~128 bytes */
|
|
|
|
typedef struct tagDPMSG_CREATESESSION
|
|
|
|
{
|
|
|
|
DPMSG_SENDENVELOPE envelope;
|
|
|
|
} DPMSG_CREATESESSION, *LPDPMSG_CREATESESSION;
|
|
|
|
typedef const DPMSG_CREATESESSION* LPCDPMSG_CREATESESSION;
|
|
|
|
|
2000-08-30 01:55:06 +02:00
|
|
|
/* 12 bytes msg */
|
2000-08-25 23:58:05 +02:00
|
|
|
typedef struct tagDPMSG_REQUESTNEWPLAYERID
|
|
|
|
{
|
|
|
|
DPMSG_SENDENVELOPE envelope;
|
|
|
|
|
2000-08-30 01:55:06 +02:00
|
|
|
DWORD dwFlags; /* dwFlags used for CreatePlayer */
|
2000-08-25 23:58:05 +02:00
|
|
|
|
|
|
|
} DPMSG_REQUESTNEWPLAYERID, *LPDPMSG_REQUESTNEWPLAYERID;
|
|
|
|
typedef const DPMSG_REQUESTNEWPLAYERID* LPCDPMSG_REQUESTNEWPLAYERID;
|
|
|
|
|
2000-09-27 01:11:48 +02:00
|
|
|
/* 48 bytes msg */
|
2000-08-25 23:58:05 +02:00
|
|
|
typedef struct tagDPMSG_NEWPLAYERIDREPLY
|
|
|
|
{
|
|
|
|
DPMSG_SENDENVELOPE envelope;
|
|
|
|
|
2000-08-30 01:55:06 +02:00
|
|
|
DPID dpidNewPlayerId;
|
2000-10-19 22:20:58 +02:00
|
|
|
|
2000-09-27 01:11:48 +02:00
|
|
|
/* Assume that this is data that is tacked on to the end of the message
|
|
|
|
* that comes from the SP remote data stored that needs to be propagated.
|
|
|
|
*/
|
|
|
|
BYTE unknown[36]; /* This appears to always be 0 - not sure though */
|
2000-08-25 23:58:05 +02:00
|
|
|
} DPMSG_NEWPLAYERIDREPLY, *LPDPMSG_NEWPLAYERIDREPLY;
|
|
|
|
typedef const DPMSG_NEWPLAYERIDREPLY* LPCDPMSG_NEWPLAYERIDREPLY;
|
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
typedef struct tagDPMSG_FORWARDADDPLAYER
|
|
|
|
{
|
|
|
|
DPMSG_SENDENVELOPE envelope;
|
2000-08-25 23:58:05 +02:00
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
DWORD unknown; /* 0 */
|
2000-08-30 01:55:06 +02:00
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
DPID dpidAppServer; /* Remote application server id */
|
2001-04-12 23:10:54 +02:00
|
|
|
DWORD unknown2[5]; /* 0x0, 0x1c, 0x6c, 0x50, 0x9 */
|
2000-10-19 22:20:58 +02:00
|
|
|
|
|
|
|
DPID dpidAppServer2; /* Remote application server id again !? */
|
2001-04-12 23:10:54 +02:00
|
|
|
DWORD unknown3[5]; /* 0x0, 0x0, 0x20, 0x0, 0x0 */
|
2000-10-19 22:20:58 +02:00
|
|
|
|
|
|
|
DPID dpidAppServer3; /* Remote application server id again !? */
|
|
|
|
|
|
|
|
DWORD unknown4[12]; /* ??? - Is this a clump of 5 and then 8? */
|
2004-10-23 00:27:51 +02:00
|
|
|
/* NOTE: 1 byte in front of the two 0x??090002 entries changes!
|
2001-04-12 23:10:54 +02:00
|
|
|
* Is it a timestamp of some sort? 1st always smaller than
|
|
|
|
* other...
|
|
|
|
*/
|
2000-10-19 22:20:58 +02:00
|
|
|
#define FORWARDADDPLAYER_UNKNOWN4_INIT { 0x30, 0xb, 0x0, 0x1e090002, 0x0, 0x0, 0x0, 0x32090002, 0x0, 0x0, 0x0, 0x0 }
|
2000-08-30 01:55:06 +02:00
|
|
|
|
2001-04-12 23:10:54 +02:00
|
|
|
BYTE unknown5[2]; /* 2 bytes at the end. This may be a part of something! ( 0x0, 0x0) */
|
2000-08-30 01:55:06 +02:00
|
|
|
|
2000-10-19 22:20:58 +02:00
|
|
|
} DPMSG_FORWARDADDPLAYER, *LPDPMSG_FORWARDADDPLAYER;
|
|
|
|
typedef const DPMSG_FORWARDADDPLAYER* LPCDPMSG_FORWARDADDPLAYER;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
/* This is an error message that can be received. Not sure if this is
|
2000-10-19 22:20:58 +02:00
|
|
|
* specifically for a forward add player or for all errors
|
|
|
|
*/
|
|
|
|
typedef struct tagDPMSG_FORWARDADDPLAYERNACK
|
|
|
|
{
|
|
|
|
DPMSG_SENDENVELOPE envelope;
|
|
|
|
HRESULT errorCode;
|
|
|
|
} DPMSG_FORWARDADDPLAYERNACK, *LPDPMSG_FORWARDADDPLAYERNACK;
|
|
|
|
typedef const DPMSG_FORWARDADDPLAYERNACK* LPCDPMSG_FORWARDADDPLAYERNACK;
|
|
|
|
|
|
|
|
#include "poppack.h"
|
2000-08-30 01:55:06 +02:00
|
|
|
|
2000-07-10 15:19:28 +02:00
|
|
|
#endif
|