coastline 0.0.4
Loading...
Searching...
No Matches
directplay.h File Reference

Network play over DirectPlay: the session and its players, the messages between them, and the threads that receive the messages and exchange the streams of a race. More...

#include <windows.h>
#include <dplay.h>
#include <dplobby.h>
#include "common/assetnames.h"
#include "common/ghost.h"
#include "common/networkrace.h"
#include "common/racephases.h"
Include dependency graph for directplay.h:

Go to the source code of this file.

Classes

struct  DirectPlayInfo
 The DirectPlay object of the game and its local player. More...
struct  ServiceProvider
 A service provider of DirectPlay found by EnumConnections. More...
struct  NetworkSessionSettings
 The settings of a network session the game hosts. More...
struct  NetworkJoinCredentials
 The local user and optional authentication fields used when joining a session. More...
struct  NetPeerSlot
 A peer of a network game. More...
struct  SessionSlot
 A player in a slot of the session. More...
struct  NetPlayerSlot
 A network player of a race. More...

Macros

#define SERVICE_PROVIDER_COUNT   16
 The number of entries of g_aServiceProviders.
#define NET_PEER_SLOT_COUNT   16
 The number of entries of g_aNetPeerSlots.
#define PLAYER_SLOT_STACK_SIZE   16
 The number of entries of g_anDepartedPlayerSlotStack and g_anJoinedPlayerSlotStack.
#define NET_PLAYER_SLOT_COUNT   16
 The number of entries of g_aNetPlayerSlots.
#define SESSION_SLOT_COUNT   8
 The number of entries of g_aSessionSlots.
#define WM_NETWORK_NOTICE   0x501
 The message the main window receives with a notice of network play in locked global memory as the second parameter.

Functions

int GetSelectedServiceProvider (GUID **ppGuid)
 Report the GUID of the service provider chosen.
HRESULT DirectPlaySendLocked (IDirectPlay3A *pDirectPlay, DPID dpidFrom, DPID dpidTo, DWORD dwFlags, void *pData, DWORD dwSize)
 Send a message of DirectPlay under g_DirectPlaySendCritSec.
HRESULT SendNetworkMessage6 (DirectPlayInfo *pInfo, DPID dpidPlayer)
 Send message 6 of the game, which names a player, from the local player to every player.
HRESULT SendNetworkMessage3 (DirectPlayInfo *pInfo)
 Send message 3 of the game from the local player to every player, unless the sends are blocked.
HRESULT SendNetworkReadyMessage (DirectPlayInfo *pInfo, DWORD dwReady)
 Send whether the slot of a player is ready from the local player to every player, unless sends are blocked.
HRESULT SendNetworkMessage4 (DirectPlayInfo *pInfo, DPID dpidPlayer)
 Send message 4 of the game, which identifies a player to boot, from the local player to every player, unless sends are blocked.
HRESULT SendNetworkRaceStateMessage (DirectPlayInfo *pInfo, DWORD dwState)
 Send a state of the race from the local player to every player, unless sends are blocked.
HRESULT SendNetworkMessage7 (DirectPlayInfo *pInfo, DPID dpidPlayer)
 Send message 7 of the game, which names a player, from the local player to every player.
void ResetNetworkStreamWithTimestamp (NetStream *pStream)
 Empty a stream and write the time of the worker thread of network play at its start.
unsigned GetElapsedFrameCount (void)
 Get the frames of network play since g_dwNetClockBaseMs, at three for each tenth of a second.
void WriteTimestampToStream (NetStream *pStream)
 Empty a stream and write the current frame of network play at its start.
HRESULT DestroyLocalDirectPlayPlayer (void)
 Destroy the local player of DirectPlay, when there is one.
void ClampFloat (float *pValue)
 Limit a value to the range from -1 to 1.
void ClampWorldCoordinate (float *pValue)
 Limit a coordinate to the range from 0 to 2048.
void ClampTerrainHeightCoordinate (float *pHeight)
 Limit a height to the range from -256 to 256.
bool InitializeDirectPlay (void)
 Create DirectPlay, connecting through a lobby when one launched the game, and start the receive thread and the network timer.
HRESULT CreateDirectPlayReceiveThread (HINSTANCE hInstance, DirectPlayInfo *pInfo)
 Clear a DirectPlay info, create its player event, and start the thread that receives the messages of its player.
HRESULT ShutdownDirectPlaySession (DirectPlayInfo *pInfo)
 Stop the receive thread, destroy the local player, and close and release DirectPlay.
DWORD WINAPI DirectPlayReceiveThreadProc (void *pParameter)
 Receive the messages of the local player until the stop event is signalled.
HRESULT ReceiveAndDispatchDirectPlayMessages (DirectPlayInfo *pInfo)
 Receive and handle every waiting message of the local player, growing the buffer of the messages in global memory as a message needs, until the receive fails.
HRESULT ConnectFromDirectPlayLobby (DirectPlayInfo *pInfo)
 Connect to the session of the lobby that launched the game, and create the local player in it.
int JoinNetworkSession (void)
 Join the selected session and initialise network play after a successful connection.
HRESULT JoinDirectPlaySession (IDirectPlay3A *pDirectPlay, const GUID *instance, NetworkJoinCredentials *credentials, DirectPlayInfo *pInfo)
 Open a session, create the local player, and load its race settings.
HRESULT CreateDirectPlaySession (IDirectPlay3A *pDirectPlay, NetworkSessionSettings *pSettings, DirectPlayInfo *pInfo)
 Create an eight-player session and its local host player.
void HostNetworkSession (void)
 Create a session using the selected settings and initialise host network state.
HRESULT UpdateNetworkSessionSettings (void)
 Publish the selected track, weather, car class, and lap count to the current session.
bool InitializeNetworkMutexes (int nReason)
 Create every mutex of network play and reset the state of the network.
void CopySessionNameToBuffer (NetworkSessionSettings *pSettings)
 Copy g_szSessionName into the settings of a session when it is longer than one character, and clear whether the session is secure.
HRESULT EnumeratePlayerAddress (HWND hWnd, IDirectPlayLobby2A *pLobby)
 Enumerate the parts of the address of the local player for the lobby.
BOOL WINAPI EnumAddressCallback (REFGUID guidDataType, DWORD dwDataSize, const void *pData, void *pContext)
 Walk the strings of the modem part of an address, and skip any other part.
HRESULT CreateDirectPlayObject (IDirectPlay3A **ppDirectPlay)
 Create the DirectPlay object.
HRESULT CreateDirectPlayLobby (IDirectPlayLobby2A **ppLobby)
 Create the DirectPlay lobby and enumerate the address of the local player.
HRESULT RefreshNetworkSessionList (IDirectPlay3A *pDirectPlay)
 Enumerate the sessions of the selected service provider again.
HRESULT EnumerateNetworkPlayers (GUID *instance, LPDPENUMPLAYERSCALLBACK2 callback, void *context, DWORD flags)
 Refresh player entries, enumerate players, and broadcast the local ready flag.
BOOL CALLBACK EnumSessionsCallback_AddSessionToList (LPCDPSESSIONDESC2 description, DWORD *timeout, DWORD flags, void *context)
 Add an available session to the menu, then enumerate its players.
BOOL WINAPI EnumConnectionsCallback_StoreServiceProvider (const GUID *pGuidServiceProvider, void *pConnection, DWORD dwConnectionSize, const DPNAME *pName, DWORD dwFlags, void *pContext)
 Store a service provider of IPX, TCP/IP, modem, or serial in g_aServiceProviders, and skip any other.
void ShowNetworkErrorMessage (const char *pszFormat, HRESULT hResult)
 Show an error of network play with its DirectPlay error name.
const char * GetDirectPlayErrorString (HRESULT hResult)
 Give the name of a DirectPlay error.
void InitializeDirectPlayForDesktopWindow (void)
 Initialise DirectPlay for the main window.
bool RequestNetworkPause (void)
 Request a pause from the other players of a network game, when no request waits.
bool SetNetworkReadyToStartFlag (void)
 Mark the local player ready to start a network race.
void TickNetworkPauseRequest (void)
 Send the request to pause of a network game.
void MaybeSendAllPlayersReadyPacket (void)
 Send the local player information once every active vehicle has a session player.
int CountActivePlayerSlots (void)
 Count active vehicles with a driver assigned.
int SendNetworkStreamReliable (DirectPlayInfo *pInfo, NetStream *pStream)
 Send a stream to the server, or process it locally when hosting.
int SendNetworkStreamUnreliable (DirectPlayInfo *pInfo, NetStream *pStream)
 Send a stream to every player and process it locally when hosting.
int SendPlayerInfoPacket (DirectPlayInfo *pInfo, unsigned char bPlayer, unsigned char bCar, unsigned char bColorR, unsigned char bColorG, unsigned char bColorB, DPID dpidOwner, const char *szPlayerName, int nState, unsigned char bTag)
 Send a player's car, colour, owner, and status in a reliable packet.
LRESULT WINAPI HandleNetworkWindowMessage (HWND hWnd, UINT nMessage, WPARAM wParam, LPARAM lParam)
 Give a message of the main window to the network play.
char * GetSlotPlayerName (int nSlot)
 Copy a player's name under its slot mutex into the shared name buffer.
int SendTimeSyncReply (DirectPlayInfo *pInfo, unsigned timestamp)
 Send a reliable reply with the timestamp received from the server.
void SyncNetworkClockFromServer (unsigned serverFrame, unsigned localTime, unsigned echoedFrame, unsigned roundTrip)
 Adjust the network clock when a sampled reply improves the round-trip measurement.
void LoadNetworkPlayerColors (void)
 Copy the local player's assigned colour into the first vehicle.
int SendPlayerJoinPacket (DirectPlayInfo *pInfo, unsigned char player, unsigned char red, unsigned char green, unsigned char blue, const char *name, unsigned char tag)
 Send the joining player's car, colour, and name in a reliable packet.
int GetPlayerPingMs (int nSlot)
 Get the time of the last round trip to the player of a slot, under the mutex of the slot.
DPID GetSlotPlayerId (int nSlot)
 The player of the session in a slot of a peer, read under the mutex of the slot.
int GetSlotStatusThreadSafe (int nSlot)
 The status of a slot of a peer, read under the mutex of the slot.
int GetNormalizedSlotStatusFlags (int nSlot)
 The status of a slot of a peer in its low 6 bits, less 4, under the mutex of the slot.
void SetSlotStatusThreadSafe (int nSlot, int dwStatus)
 Set the status of a slot of a peer under the mutex of the slot.
unsigned ReadPlayerSlotColorRgb (int slotIndex, unsigned char *red, unsigned char *green, unsigned char *blue)
 Read a peer's selected car and RGB colour under its slot mutex.
void SetGlobalStatusString (const char *pszStatus)
 Set the line of status of network play under the mutex of the notices.
void StopNetworkWorkerThread (void)
 Stop the thread that works for the host of a network game, wait for it, and close it and its stop event.
void PromoteReadyNetworkPlayersToStart (void)
 Move the players of a network game that are ready to the start.
void RankNetworkPlayersByProgress (void)
 Rank the players of a network game by their progress.
void ResetAllNetworkPlayerStreams (void)
 Empty the streams of every player of a network game.
void BuildNetworkPlayerStatusPackets (void)
 Write the packets of the status of the players of a network game into their streams.
int FlushNetworkPlayerStreams (DirectPlayInfo *pInfo)
 Send the streams of the players of a network game.
DWORD WINAPI NetworkWorkerThreadProc (LPVOID pParameter)
 Do the work of the host of a network game once a second, sleeping until each second.
void CreateNetworkPlayerSlotMutexes (void)
 Create the mutexes of the slots of the players of a network game.
void ResetAllPlayerSlots (void)
 Reset race and peer states, timing, and finishing positions for every network player.
HRESULT SendNetworkFinishPositionMessage (DirectPlayInfo *pInfo, DPID dpidPlayer, DWORD dwPosition)
 Broadcast a player's finishing position with guaranteed delivery.
void StartNetworkWorkerThread (void)
 Start the thread that works for the host of a network game.
bool InitializeNetworkThreading (void)
 Create the mutexes of the slots of the players and start the worker thread of a network game.
DWORD GetElapsedTimeSinceStart (void)
 Get the time since the network session started.
void HandleDirectPlaySystemMessage (DirectPlayInfo *pInfo, DPMSG_GENERIC *pMessage, DWORD dwSize, DPID dpidFrom, DPID dpidTo)
 Handle a message of the system of DirectPlay as the host or a client.
void ClearNetworkPlayerSlotsByOwner (DPID dpidOwner)
 Free the slots of the network players a player of the session controls.
void HandlePlayerDisconnect (DPID dpidPlayer)
 Remove a player that departed from a race of the network.
void ProcessMultiplayerPackets (DirectPlayInfo *pInfo, void *pData, DWORD dwSize, DPID dpidFrom, DPID dpidTo)
 Handle the packets of a secure message as the host.
int FindNetworkSlotByPlayerId (DPID dpidPlayer)
 Find a player's active slot, or the first free slot for a new player.
void ProcessNetworkDataStream (DirectPlayInfo *pInfo, void *pData, DWORD dwSize, DPID dpidFrom, DPID dpidTo)
 Handle the packets of a secure message as a client.
void HandleDirectPlaySystemMessageHost (DirectPlayInfo *pInfo, DPMSG_GENERIC *pMessage, DWORD dwSize, DPID dpidFrom, DPID dpidTo)
 Handle a message of the system of DirectPlay for the host of the session.
void HandleDirectPlaySystemMessageClient (DirectPlayInfo *pInfo, DPMSG_GENERIC *pMessage, DWORD dwSize, DPID dpidFrom, DPID dpidTo)
 Handle a message of the system of DirectPlay for a client of the session.
HRESULT GetDirectPlaySessionDesc (IDirectPlay3A *pDirectPlay, DPSESSIONDESC2 **ppDesc)
 Get the description of the session of DirectPlay in a buffer of locked global memory.
HRESULT LoadNetworkSettings (void)
 Read the track, the weather, the class of car, the laps, and the name of the network session from its description, and choose a car of the class that can be chosen.
void ResetSessionSlotTable (void)
 Free every slot of the session and unblock the sends.
int GetNetworkPlayerSlotStatus (int nSlot)
 The state of a network player of a race, under the mutex of its slot.
int GetNetworkPeerChannelStatus (int nSlot)
 The state of a network player as its own peer reports it, under the mutex of the entry.
void DestroyNetworkGroups (void)
 Remove entries from the menu of network sessions.
void InitializeNetworkServiceProvider (void)
 Start the service provider of network play chosen.
HRESULT CreateServiceProviderAddress (void **ppAddress, DWORD *pdwSize)
 Build the compound address for the selected DirectPlay service provider.
bool InitServiceProviderAndStartTimer (void)
 Start the service provider chosen and the timer of network play of the main window, and mark the DirectPlay session open.
bool InitServiceProviderAndStartSession (void)
 Start the service provider chosen and the timer of network play as InitServiceProviderAndStartTimer() does, then enumerate the sessions again while the list of sessions exists.
HRESULT CloseAndReleaseDirectPlay (void)
 Destroy the groups and the local player, close and release DirectPlay, and count one DirectPlay object less.
void MarkSessionListEntrySeen (DPID dpidPlayer)
 Mark the slot of a player of the session as found, or give the player the first free slot.
BOOL CALLBACK EnumPlayersCallback_AddPlayerToList (DPID dpidPlayer, DWORD dwPlayerType, LPCDPNAME pName, DWORD dwFlags, void *pContext)
 Add a non-spectator player to the network player menu.
void PurgeStaleSessionListEntries (void)
 Free each slot of the session whose player was not found since the last purge.
int GetSessionSlotFlag (DPID dpidPlayer)
 Get the flag of the slot of a player of the session.
HRESULT SendNetworkChatMessage (HWND hWindow, DirectPlayInfo *pInfo, bool bNotice)
 Post the local chat line to the window and broadcast its text with guaranteed delivery.
void HandleMultiplayerSessionMessage (DirectPlayInfo *pInfo, void *pMessage, DWORD dwSize, DPID dpidFrom, DPID dpidTo)
 Handle a message another player of the session sent.
HRESULT GetDirectPlayPlayerName (IDirectPlay3A *pDirectPlay, DPID dpidPlayer, DPNAME **ppName)
 Retrieve a player's DirectPlay name in globally allocated, locked memory.
HRESULT FormatNetworkChatLine (IDirectPlay3A *pDirectPlay, DPID dpidPlayer, const char *text, char **ppLine, bool bNotice)
 Format a chat line with the sender's name in globally allocated, locked memory.
int ToggleSelectedSessionSlotFlag (void)
 Toggle the local player's session slot flag.
bool ShutdownNetworkSubsystem (int nReason)
 End the network play of a game.
void ShutdownDirectPlay (void)
 End network play, free the connection data of the service providers, write the count of DirectPlay objects left to the debugger, and release the lobby.
void FreeServiceProviderConnectionData (void)
 Free the connection data of every service provider.
void DisconnectNetworkSession (void)
 Exit the session of DirectPlay.

Variables

DirectPlayInfo g_DirectPlayInfo
 The DirectPlay object of the game and its local player.
DirectPlayInfo * g_pDirectPlayInfo
 The DirectPlay info other routines read, g_DirectPlayInfo once DirectPlay starts.
DPID g_dwNetCarSetupSelectedPlayerId
 The DirectPlay identifier of the player selected during network car setup.
ServiceProvider g_aServiceProviders [SERVICE_PROVIDER_COUNT]
 The service providers, indexed by IPX, TCP/IP, modem, and serial in that order.
int g_dwServiceProviderIndex
 The index in g_aServiceProviders of the service provider chosen.
unsigned g_dwNetWorkerCurrentTime
 The time of the worker thread of network play, written at the start of a packet.
unsigned g_dwNetClockBaseMs
 The time network play started counting frames from, in milliseconds.
unsigned g_dwNetLastKeyframeFrame
 The frame of the last key frame written to a stream.
unsigned g_dwNetRaceStartFrame
 The frame a network race starts on.
char g_szModemPhoneNumber []
 The telephone number of a modem connection.
char g_szModemDeviceName []
 The device of a modem connection.
int g_dwLaunchedFromLobby
 Whether a lobby launched the game.
int g_dwLobbyIsHost
 Whether the lobby made the game the host.
int g_dwSessionEnumPending
 Whether an enumeration of sessions is waiting for a reply.
UINT_PTR g_dwNetworkTimerId
 The timer of the main window that drives network play.
IDirectPlayLobby2A * g_pDirectPlayLobby
 The DirectPlay lobby.
int g_bDirectPlayReceiveThreadStarted
 Whether the critical section of DirectPlay sends exists.
CRITICAL_SECTION g_DirectPlaySendCritSec
 The critical section of DirectPlay sends.
HANDLE g_hDirectPlayReceiveStopEvent
 The event that stops the receive thread.
DWORD g_dwDirectPlayReceiveThreadId
 The identifier of the receive thread.
HANDLE g_hDirectPlayReceiveThread
 The thread that receives the messages of the local player.
char g_szSessionName []
 The name of the network session.
char g_szDirectPlayErrorBuffer [16]
 The name of an error GetDirectPlayErrorString() does not know, written in hexadecimal.
int g_dwDirectPlaySessionActive
 Whether a DirectPlay session is open.
int g_nNetPauseRequestTicks
 The ticks a request of a pause of a network game has waited, 0 for no request.
int g_nNetUnpauseRequestTicks
 The ticks a request of the end of a pause of a network game has waited, 0 for no request.
int g_bNetReadyToStart
 Whether the local player is ready to start a network race.
int g_bNetReceiveEnabled
 Whether the messages received are processed.
int g_dwLocalNetPlayerId
 The slot of the local player of a network game, -1 before one is assigned.
const RECT g_rcNetCarSetupPlayerList
 The player list rectangle on the network car setup screen, in pixels.
int g_dwNetworkCarSetupShown
 Whether the network car setup screen has been shown.
NetPeerSlot g_aNetPeerSlots [NET_PEER_SLOT_COUNT]
 The peers of a network game.
int g_adwNetRaceOrder [NET_PEER_SLOT_COUNT]
 The order of the players of a network race.
char g_szNetStatusString []
 The line of status of network play the game shows.
int g_bNetStatusStringDirty
 Whether g_szNetStatusString changed since it was shown.
int g_anDepartedPlayerSlotStack [PLAYER_SLOT_STACK_SIZE]
 The slots of the players that departed, for the race to remove.
int g_nDepartedPlayerStackTop
 The index of the top of g_anDepartedPlayerSlotStack.
int g_anJoinedPlayerSlotStack [PLAYER_SLOT_STACK_SIZE]
 The slots of the players that joined, for the race to add.
int g_nJoinedPlayerStackTop
 The index of the top of g_anJoinedPlayerSlotStack.
HANDLE g_hNetRaceStartMutex
 The mutex of the start of a network race.
HANDLE g_hNetReceiveMutex
 The mutex of the messages received.
HANDLE g_hNetPauseMutex
 The mutex of a pause of a network game.
HANDLE g_hNetUnpauseMutex
 The mutex of the end of a pause of a network game.
HANDLE g_hNetReadyMutex
 The mutex of the players that are ready.
HANDLE g_hNetKeyframeMutex
 The mutex of the key frames of a network race.
HANDLE g_hJoinedPlayerStackMutex
 The mutex of the stack of players that joined.
HANDLE g_hDepartedPlayerStackMutex
 The mutex of the stack of players that departed.
HANDLE g_hNetRaceOrderMutex
 The mutex of the order of a network race.
HANDLE g_hNetNotifyMutex
 The mutex of the notices of network play.
int g_bNetWorkerThreadRunning
 Whether the worker thread of the host runs.
HANDLE g_hNetWorkerStopEvent
 The event that stops the worker thread of the host.
HANDLE g_hNetWorkerThread
 The worker thread of the host.
DWORD g_dwNetWorkerThreadId
 The identifier of the worker thread of network play.
DWORD g_dwNetWorkerNextTickTime
 The time of the next tick of the worker thread of network play, in milliseconds.
DWORD g_dwNetSessionStartTime
 The time the network session started, in milliseconds.
int g_dwNetworkSendBlocked
 Whether the sends of network play are blocked.
NetPlayerSlot g_aNetPlayerSlots [NET_PLAYER_SLOT_COUNT]
 The network players of a race.
NetPlayerSlot g_aNetPeerSlotMatrix [NET_PLAYER_SLOT_COUNT][NET_PLAYER_SLOT_COUNT]
 The network players of a race as each peer reports them, by peer and then by player.
SessionSlot g_aSessionSlots [SESSION_SLOT_COUNT]
 The players in the slots of the session.
char g_szNetworkChatText []
 The chat line being edited or sent from the network menu.
int g_dwNetworkDataStreamActive
 Whether the network data stream is active.
int g_dwNetworkEscapePending
 Whether the network menu has an escape request to process.
int g_dwDirectPlayInstanceCount
 The number of DirectPlay objects that exist.

Detailed Description

Network play over DirectPlay: the session and its players, the messages between them, and the threads that receive the messages and exchange the streams of a race.

Macro Definition Documentation

◆ SERVICE_PROVIDER_COUNT

#define SERVICE_PROVIDER_COUNT   16

The number of entries of g_aServiceProviders.

◆ NET_PEER_SLOT_COUNT

#define NET_PEER_SLOT_COUNT   16

The number of entries of g_aNetPeerSlots.

◆ PLAYER_SLOT_STACK_SIZE

#define PLAYER_SLOT_STACK_SIZE   16

The number of entries of g_anDepartedPlayerSlotStack and g_anJoinedPlayerSlotStack.

◆ NET_PLAYER_SLOT_COUNT

#define NET_PLAYER_SLOT_COUNT   16

The number of entries of g_aNetPlayerSlots.

◆ SESSION_SLOT_COUNT

#define SESSION_SLOT_COUNT   8

The number of entries of g_aSessionSlots.

◆ WM_NETWORK_NOTICE

#define WM_NETWORK_NOTICE   0x501

The message the main window receives with a notice of network play in locked global memory as the second parameter.

The window frees the notice.

Function Documentation

◆ GetSelectedServiceProvider()

int GetSelectedServiceProvider ( GUID ** ppGuid)

Report the GUID of the service provider chosen.

Parameters
ppGuidReceives the GUID.
Returns
Always 0.
Ghidra address:
BRD3D: 0x1003cfc0
Ghidra address:
BRGlide: 0x10036650

◆ DirectPlaySendLocked()

HRESULT DirectPlaySendLocked ( IDirectPlay3A * pDirectPlay,
DPID dpidFrom,
DPID dpidTo,
DWORD dwFlags,
void * pData,
DWORD dwSize )

Send a message of DirectPlay under g_DirectPlaySendCritSec.

Parameters
pDirectPlayThe DirectPlay object.
dpidFromThe player that sends.
dpidToThe player that receives, or DPID_ALLPLAYERS.
dwFlagsThe flags of the send.
pDataThe message.
dwSizeThe bytes of the message.
Returns
The result of Send.
Ghidra address:
BRD3D: 0x1000c4d0
Ghidra address:
BRGlide: 0x10009a00

◆ SendNetworkMessage6()

HRESULT SendNetworkMessage6 ( DirectPlayInfo * pInfo,
DPID dpidPlayer )

Send message 6 of the game, which names a player, from the local player to every player.

Parameters
pInfoThe session.
dpidPlayerThe player the message names.
Returns
The result of the send, or 0 without DirectPlay.
Ghidra address:
BRD3D: 0x1003da90
Ghidra address:
BRGlide: 0x10037130

◆ SendNetworkMessage3()

HRESULT SendNetworkMessage3 ( DirectPlayInfo * pInfo)

Send message 3 of the game from the local player to every player, unless the sends are blocked.

The second word of the message is never written.

Parameters
pInfoThe session.
Returns
The result of the send, or 0 without DirectPlay or with the sends blocked.
Ghidra address:
BRD3D: 0x1003d9f0
Ghidra address:
BRGlide: 0x10037090

◆ SendNetworkReadyMessage()

HRESULT SendNetworkReadyMessage ( DirectPlayInfo * pInfo,
DWORD dwReady )

Send whether the slot of a player is ready from the local player to every player, unless sends are blocked.

Parameters
pInfoThe session.
dwReadyThe flag of the slot of the local player, from GetSessionSlotFlag().
Returns
The result of the send, or 0 without DirectPlay or while sends are blocked.
Ghidra address:
BRD3D: 0x1003d950
Ghidra address:
BRGlide: 0x10036ff0

◆ SendNetworkMessage4()

HRESULT SendNetworkMessage4 ( DirectPlayInfo * pInfo,
DPID dpidPlayer )

Send message 4 of the game, which identifies a player to boot, from the local player to every player, unless sends are blocked.

Parameters
pInfoThe session.
dpidPlayerThe player.
Returns
The result of the send, or 0 without DirectPlay or while sends are blocked.
Ghidra address:
BRD3D: 0x1003da40
Ghidra address:
BRGlide: 0x100370e0

◆ SendNetworkRaceStateMessage()

HRESULT SendNetworkRaceStateMessage ( DirectPlayInfo * pInfo,
DWORD dwState )

Send a state of the race from the local player to every player, unless sends are blocked.

Parameters
pInfoThe session.
dwStateThe state.
Returns
The result of the send, or 0 without DirectPlay or while sends are blocked.
Ghidra address:
BRD3D: 0x1003d9a0
Ghidra address:
BRGlide: 0x10037040

◆ SendNetworkMessage7()

HRESULT SendNetworkMessage7 ( DirectPlayInfo * pInfo,
DPID dpidPlayer )

Send message 7 of the game, which names a player, from the local player to every player.

Parameters
pInfoThe session.
dpidPlayerThe player the message names.
Returns
The result of the send, or 0 without DirectPlay.
Ghidra address:
BRD3D: 0x1003db00
Ghidra address:
BRGlide: 0x100371a0

◆ ResetNetworkStreamWithTimestamp()

void ResetNetworkStreamWithTimestamp ( NetStream * pStream)

Empty a stream and write the time of the worker thread of network play at its start.

Parameters
pStreamThe stream.
Ghidra address:
BRD3D: 0x10071bf0
Ghidra address:
BRGlide: 0x1006ab60

◆ GetElapsedFrameCount()

unsigned GetElapsedFrameCount ( void )

Get the frames of network play since g_dwNetClockBaseMs, at three for each tenth of a second.

Returns
The frames.
Ghidra address:
BRD3D: 0x10003460
Ghidra address:
BRGlide: 0x100037d0

◆ WriteTimestampToStream()

void WriteTimestampToStream ( NetStream * pStream)

Empty a stream and write the current frame of network play at its start.

Parameters
pStreamThe stream.
Ghidra address:
BRD3D: 0x100048d0
Ghidra address:
BRGlide: 0x10004c40

◆ DestroyLocalDirectPlayPlayer()

HRESULT DestroyLocalDirectPlayPlayer ( void )

Destroy the local player of DirectPlay, when there is one.

Returns
The result of DestroyPlayer, or DP_OK without a player.
Ghidra address:
BRD3D: 0x1000c4a0
Ghidra address:
BRGlide: 0x100099d0

◆ ClampFloat()

void ClampFloat ( float * pValue)

Limit a value to the range from -1 to 1.

Parameters
pValueThe value.
Ghidra address:
BRD3D: 0x100058d0
Ghidra address:
BRGlide: 0x10005c40

◆ ClampWorldCoordinate()

void ClampWorldCoordinate ( float * pValue)

Limit a coordinate to the range from 0 to 2048.

Parameters
pValueThe coordinate.
Ghidra address:
BRD3D: 0x10005900
Ghidra address:
BRGlide: 0x10005c70

◆ ClampTerrainHeightCoordinate()

void ClampTerrainHeightCoordinate ( float * pHeight)

Limit a height to the range from -256 to 256.

Parameters
pHeightThe height.
Ghidra address:
BRD3D: 0x10005930
Ghidra address:
BRGlide: 0x10005ca0

◆ InitializeDirectPlay()

bool InitializeDirectPlay ( void )

Create DirectPlay, connecting through a lobby when one launched the game, and start the receive thread and the network timer.

Returns
Whether DirectPlay started.
Ghidra address:
BRD3D: 0x1003bd80
Ghidra address:
BRGlide: 0x10035400

◆ CreateDirectPlayReceiveThread()

HRESULT CreateDirectPlayReceiveThread ( HINSTANCE hInstance,
DirectPlayInfo * pInfo )

Clear a DirectPlay info, create its player event, and start the thread that receives the messages of its player.

Parameters
hInstanceThe module of the game.
pInfoThe info to set up.
Returns
DP_OK, or E_OUTOFMEMORY when an event or the thread cannot be created.
Ghidra address:
BRD3D: 0x1000c5d0
Ghidra address:
BRGlide: 0x10009b00

◆ ShutdownDirectPlaySession()

HRESULT ShutdownDirectPlaySession ( DirectPlayInfo * pInfo)

Stop the receive thread, destroy the local player, and close and release DirectPlay.

Parameters
pInfoThe info to shut down, or null to stop the thread alone.
Returns
Always DP_OK.
Ghidra address:
BRD3D: 0x1000c510
Ghidra address:
BRGlide: 0x10009a40

◆ DirectPlayReceiveThreadProc()

DWORD WINAPI DirectPlayReceiveThreadProc ( void * pParameter)

Receive the messages of the local player until the stop event is signalled.

Parameters
pParameterThe DirectPlayInfo of the player.
Returns
Never returns. The thread exits with code 0.
Ghidra address:
BRD3D: 0x1000c440
Ghidra address:
BRGlide: 0x10009970

◆ ReceiveAndDispatchDirectPlayMessages()

HRESULT ReceiveAndDispatchDirectPlayMessages ( DirectPlayInfo * pInfo)

Receive and handle every waiting message of the local player, growing the buffer of the messages in global memory as a message needs, until the receive fails.

Parameters
pInfoThe info of the player.
Returns
Always DP_OK.
Ghidra address:
BRD3D: 0x1000c350
Ghidra address:
BRGlide: 0x10009880

◆ ConnectFromDirectPlayLobby()

HRESULT ConnectFromDirectPlayLobby ( DirectPlayInfo * pInfo)

Connect to the session of the lobby that launched the game, and create the local player in it.

The name of the player and of the session are copied from the lobby.

Parameters
pInfoThe info to fill, whose player event is already created.
Returns
DP_OK, DPERR_NOTLOBBIED when no lobby launched the game, or another error.
Ghidra address:
BRD3D: 0x10038cb0
Ghidra address:
BRGlide: 0x10032320

◆ JoinNetworkSession()

int JoinNetworkSession ( void )

Join the selected session and initialise network play after a successful connection.

Returns
Zero if DirectPlay is unavailable or joining fails, otherwise one.
Ghidra address:
BRD3D: 0x1003c260
Ghidra address:
BRGlide: 0x100358f0

◆ JoinDirectPlaySession()

HRESULT JoinDirectPlaySession ( IDirectPlay3A * pDirectPlay,
const GUID * instance,
NetworkJoinCredentials * credentials,
DirectPlayInfo * pInfo )

Open a session, create the local player, and load its race settings.

Parameters
pDirectPlayThe connected DirectPlay object.
instanceThe selected session instance.
credentialsOptional authentication fields and the local user name.
pInfoReceives the local player and session state after a successful join.
Returns
The DirectPlay result, including DPERR_CANTADDPLAYER when eight players are present.
Ghidra address:
BRD3D: 0x1003c740
Ghidra address:
BRGlide: 0x10035dd0

◆ CreateDirectPlaySession()

HRESULT CreateDirectPlaySession ( IDirectPlay3A * pDirectPlay,
NetworkSessionSettings * pSettings,
DirectPlayInfo * pInfo )

Create an eight-player session and its local host player.

Parameters
pDirectPlayThe connected DirectPlay object.
pSettingsThe session name and secure-server setting.
pInfoReceives the host player and session state after creation.
Returns
The DirectPlay result, or DP_OK when launched from a lobby.
Ghidra address:
BRD3D: 0x1003c5c0
Ghidra address:
BRGlide: 0x10035c50

◆ HostNetworkSession()

void HostNetworkSession ( void )

Create a session using the selected settings and initialise host network state.

Ghidra address:
BRD3D: 0x1003c150
Ghidra address:
BRGlide: 0x100357e0

◆ UpdateNetworkSessionSettings()

HRESULT UpdateNetworkSessionSettings ( void )

Publish the selected track, weather, car class, and lap count to the current session.

Returns
The DirectPlay result, or DPERR_INVALIDOBJECT without a connection.
Ghidra address:
BRD3D: 0x1003cda0
Ghidra address:
BRGlide: 0x10036430

◆ InitializeNetworkMutexes()

bool InitializeNetworkMutexes ( int nReason)

Create every mutex of network play and reset the state of the network.

Parameters
nReasonNot read. The callers pass 1.
Returns
Always true.
Ghidra address:
BRD3D: 0x10005b10
Ghidra address:
BRGlide: 0x10005e80

◆ CopySessionNameToBuffer()

void CopySessionNameToBuffer ( NetworkSessionSettings * pSettings)

Copy g_szSessionName into the settings of a session when it is longer than one character, and clear whether the session is secure.

Parameters
pSettingsThe settings.
Ghidra address:
BRD3D: 0x1003d130
Ghidra address:
BRGlide: 0x100367c0

◆ EnumeratePlayerAddress()

HRESULT EnumeratePlayerAddress ( HWND hWnd,
IDirectPlayLobby2A * pLobby )

Enumerate the parts of the address of the local player for the lobby.

Parameters
hWndThe main window.
pLobbyThe lobby.
Returns
The result of EnumAddress.
Ghidra address:
BRD3D: 0x1003d8a0
Ghidra address:
BRGlide: 0x10036f40

◆ EnumAddressCallback()

BOOL WINAPI EnumAddressCallback ( REFGUID guidDataType,
DWORD dwDataSize,
const void * pData,
void * pContext )

Walk the strings of the modem part of an address, and skip any other part.

Parameters
guidDataTypeThe type of the part.
dwDataSizeNot read.
pDataThe data of the part.
pContextNot read.
Returns
Always TRUE, to continue the enumeration.
Ghidra address:
BRD3D: 0x1003d850
Ghidra address:
BRGlide: 0x10036ef0

◆ CreateDirectPlayObject()

HRESULT CreateDirectPlayObject ( IDirectPlay3A ** ppDirectPlay)

Create the DirectPlay object.

Parameters
ppDirectPlayReceives the object, or null.
Returns
The result of CoCreateInstance.
Ghidra address:
BRD3D: 0x1003c520
Ghidra address:
BRGlide: 0x10035bb0

◆ CreateDirectPlayLobby()

HRESULT CreateDirectPlayLobby ( IDirectPlayLobby2A ** ppLobby)

Create the DirectPlay lobby and enumerate the address of the local player.

Parameters
ppLobbyReceives the lobby on success.
Returns
DP_OK, or the error of the creation.
Ghidra address:
BRD3D: 0x1003d7b0
Ghidra address:
BRGlide: 0x10036e50

◆ RefreshNetworkSessionList()

HRESULT RefreshNetworkSessionList ( IDirectPlay3A * pDirectPlay)

Enumerate the sessions of the selected service provider again.

Parameters
pDirectPlayThe DirectPlay object.
Returns
The result of the enumeration.
Ghidra address:
BRD3D: 0x1003cc70
Ghidra address:
BRGlide: 0x10036300

◆ EnumerateNetworkPlayers()

HRESULT EnumerateNetworkPlayers ( GUID * instance,
LPDPENUMPLAYERSCALLBACK2 callback,
void * context,
DWORD flags )

Refresh player entries, enumerate players, and broadcast the local ready flag.

Parameters
instanceThe session instance to enumerate.
callbackThe callback for each player.
contextUser data passed to the callback.
flagsDirectPlay enumeration flags.
Returns
The enumeration result, or E_FAIL without a DirectPlay object.
Ghidra address:
BRD3D: 0x1003cb10
Ghidra address:
BRGlide: 0x100361a0

◆ EnumSessionsCallback_AddSessionToList()

BOOL CALLBACK EnumSessionsCallback_AddSessionToList ( LPCDPSESSIONDESC2 description,
DWORD * timeout,
DWORD flags,
void * context )

Add an available session to the menu, then enumerate its players.

Parameters
descriptionThe session description.
timeoutUnused.
flagsDirectPlay callback flags.
contextUser data passed to the player enumeration.
Returns
False when the menu is absent or enumeration timed out, otherwise true.
Ghidra address:
BRD3D: 0x1003cb90
Ghidra address:
BRGlide: 0x10036220

◆ EnumConnectionsCallback_StoreServiceProvider()

BOOL WINAPI EnumConnectionsCallback_StoreServiceProvider ( const GUID * pGuidServiceProvider,
void * pConnection,
DWORD dwConnectionSize,
const DPNAME * pName,
DWORD dwFlags,
void * pContext )

Store a service provider of IPX, TCP/IP, modem, or serial in g_aServiceProviders, and skip any other.

Parameters
pGuidServiceProviderThe GUID of the service provider.
pConnectionThe connection data.
dwConnectionSizeThe size of the connection data.
pNameThe name of the connection.
dwFlagsNot read.
pContextNot read.
Returns
Always TRUE, to continue the enumeration.
Ghidra address:
BRD3D: 0x1003c430
Ghidra address:
BRGlide: 0x10035ac0

◆ ShowNetworkErrorMessage()

void ShowNetworkErrorMessage ( const char * pszFormat,
HRESULT hResult )

Show an error of network play with its DirectPlay error name.

Parameters
pszFormatA wsprintfA format of the message, with one s for the error name.
hResultThe error.
Ghidra address:
BRD3D: 0x1003dbc0
Ghidra address:
BRGlide: 0x10037260

◆ GetDirectPlayErrorString()

const char * GetDirectPlayErrorString ( HRESULT hResult)

Give the name of a DirectPlay error.

Parameters
hResultThe error.
Returns
The name of the error, such as "DPERR_PENDING", or the error in hexadecimal in g_szDirectPlayErrorBuffer when the error is not known.
Ghidra address:
BRD3D: 0x1003dc10
Ghidra address:
BRGlide: 0x100372b0

◆ InitializeDirectPlayForDesktopWindow()

void InitializeDirectPlayForDesktopWindow ( void )

Initialise DirectPlay for the main window.

Ghidra address:
BRD3D: 0x1000c6d0
Ghidra address:
BRGlide: 0x10009c00

◆ RequestNetworkPause()

bool RequestNetworkPause ( void )

Request a pause from the other players of a network game, when no request waits.

Returns
Always true.
Ghidra address:
BRD3D: 0x10004be0
Ghidra address:
BRGlide: 0x10004f50

◆ SetNetworkReadyToStartFlag()

bool SetNetworkReadyToStartFlag ( void )

Mark the local player ready to start a network race.

Returns
Always true.
Ghidra address:
BRD3D: 0x10004bb0
Ghidra address:
BRGlide: 0x10004f20

◆ TickNetworkPauseRequest()

void TickNetworkPauseRequest ( void )

Send the request to pause of a network game.

Ghidra address:
BRD3D: 0x10004fc0
Ghidra address:
BRGlide: 0x10005330

◆ MaybeSendAllPlayersReadyPacket()

void MaybeSendAllPlayersReadyPacket ( void )

Send the local player information once every active vehicle has a session player.

Ghidra address:
BRD3D: 0x100053f0
Ghidra address:
BRGlide: 0x10005760

◆ CountActivePlayerSlots()

int CountActivePlayerSlots ( void )

Count active vehicles with a driver assigned.

Returns
The number of active drivers.
Ghidra address:
BRD3D: 0x10005470
Ghidra address:
BRGlide: 0x100057e0

◆ SendNetworkStreamReliable()

int SendNetworkStreamReliable ( DirectPlayInfo * pInfo,
NetStream * pStream )

Send a stream to the server, or process it locally when hosting.

Sending is skipped while the network data stream is active.

Parameters
pInfoThe local session.
pStreamThe stream to send.
Returns
The stream size, or -1 when DirectPlay sending fails.
Ghidra address:
BRD3D: 0x100046d0
Ghidra address:
BRGlide: 0x10004a40

◆ SendNetworkStreamUnreliable()

int SendNetworkStreamUnreliable ( DirectPlayInfo * pInfo,
NetStream * pStream )

Send a stream to every player and process it locally when hosting.

Sending is skipped while the network data stream is active.

Parameters
pInfoThe local session.
pStreamThe stream to send.
Returns
The stream size, or -1 when DirectPlay sending fails.
Ghidra address:
BRD3D: 0x10004dd0
Ghidra address:
BRGlide: 0x10005140

◆ SendPlayerInfoPacket()

int SendPlayerInfoPacket ( DirectPlayInfo * pInfo,
unsigned char bPlayer,
unsigned char bCar,
unsigned char bColorR,
unsigned char bColorG,
unsigned char bColorB,
DPID dpidOwner,
const char * szPlayerName,
int nState,
unsigned char bTag )

Send a player's car, colour, owner, and status in a reliable packet.

Parameters
pInfoThe local session.
bPlayerThe player slot.
bCarThe car selection.
bColorRThe red component of the car colour.
bColorGThe green component of the car colour.
bColorBThe blue component of the car colour.
dpidOwnerThe DirectPlay owner of the player.
szPlayerNameThe player name, included for status values up to two.
nStateThe player status, including any flags outside the low six bits.
bTagFlags combined with the local player identifier.
Returns
The sent stream size, or -1 when DirectPlay sending fails.
Ghidra address:
BRD3D: 0x10004760
Ghidra address:
BRGlide: 0x10004ad0

◆ HandleNetworkWindowMessage()

LRESULT WINAPI HandleNetworkWindowMessage ( HWND hWnd,
UINT nMessage,
WPARAM wParam,
LPARAM lParam )

Give a message of the main window to the network play.

Parameters
hWndThe main window.
nMessageThe message.
wParamThe first parameter of the message.
lParamThe second parameter of the message.
Ghidra address:
BRD3D: 0x1003c3a0
Ghidra address:
BRGlide: 0x10035a30

◆ GetSlotPlayerName()

char * GetSlotPlayerName ( int nSlot)

Copy a player's name under its slot mutex into the shared name buffer.

Parameters
nSlotThe peer slot index.
Returns
The shared name buffer, overwritten by the next call.
Ghidra address:
BRD3D: 0x10005e70
Ghidra address:
BRGlide: 0x100061e0

◆ SendTimeSyncReply()

int SendTimeSyncReply ( DirectPlayInfo * pInfo,
unsigned timestamp )

Send a reliable reply with the timestamp received from the server.

Parameters
pInfoThe local session.
timestampThe timestamp to return.
Returns
The sent stream size, or -1 when DirectPlay sending fails.
Ghidra address:
BRD3D: 0x10004910
Ghidra address:
BRGlide: 0x10004c80

◆ SyncNetworkClockFromServer()

void SyncNetworkClockFromServer ( unsigned serverFrame,
unsigned localTime,
unsigned echoedFrame,
unsigned roundTrip )

Adjust the network clock when a sampled reply improves the round-trip measurement.

Parameters
serverFrameThe server frame in the latest sample.
localTimeThe local timestamp associated with the latest sample.
echoedFrameA prior server frame echoed by the reply.
roundTripThe measured round-trip duration.
Ghidra address:
BRD3D: 0x100034a0
Ghidra address:
BRGlide: 0x10003810

◆ LoadNetworkPlayerColors()

void LoadNetworkPlayerColors ( void )

Copy the local player's assigned colour into the first vehicle.

Ghidra address:
BRD3D: 0x100049c0
Ghidra address:
BRGlide: 0x10004d30

◆ SendPlayerJoinPacket()

int SendPlayerJoinPacket ( DirectPlayInfo * pInfo,
unsigned char player,
unsigned char red,
unsigned char green,
unsigned char blue,
const char * name,
unsigned char tag )

Send the joining player's car, colour, and name in a reliable packet.

Parameters
pInfoThe local session.
playerThe joining player slot.
redThe red component of the car colour.
greenThe green component of the car colour.
blueThe blue component of the car colour.
nameThe player name, truncated to 24 bytes in the packet.
tagFlags combined with the local player identifier.
Returns
The sent stream size, or -1 when DirectPlay sending fails.
Ghidra address:
BRD3D: 0x10004590
Ghidra address:
BRGlide: 0x10004900

◆ GetPlayerPingMs()

int GetPlayerPingMs ( int nSlot)

Get the time of the last round trip to the player of a slot, under the mutex of the slot.

Parameters
nSlotThe slot.
Returns
The time in milliseconds, and 0 for a negative time.
Ghidra address:
BRD3D: 0x10005f90
Ghidra address:
BRGlide: 0x10006300

◆ GetSlotPlayerId()

DPID GetSlotPlayerId ( int nSlot)

The player of the session in a slot of a peer, read under the mutex of the slot.

Parameters
nSlotThe slot.
Returns
The player.
Ghidra address:
BRD3D: 0x10005cf0
Ghidra address:
BRGlide: 0x10006060

◆ GetSlotStatusThreadSafe()

int GetSlotStatusThreadSafe ( int nSlot)

The status of a slot of a peer, read under the mutex of the slot.

Parameters
nSlotThe slot.
Returns
The status.
Ghidra address:
BRD3D: 0x10004a10
Ghidra address:
BRGlide: 0x10004d80

◆ GetNormalizedSlotStatusFlags()

int GetNormalizedSlotStatusFlags ( int nSlot)

The status of a slot of a peer in its low 6 bits, less 4, under the mutex of the slot.

Parameters
nSlotThe slot.
Returns
The status less 4, or 0 for a status of 4 or less.
Ghidra address:
BRD3D: 0x10005f40
Ghidra address:
BRGlide: 0x100062b0

◆ SetSlotStatusThreadSafe()

void SetSlotStatusThreadSafe ( int nSlot,
int dwStatus )

Set the status of a slot of a peer under the mutex of the slot.

Parameters
nSlotThe slot.
dwStatusThe status.
Ghidra address:
BRD3D: 0x10004a50
Ghidra address:
BRGlide: 0x10004dc0

◆ ReadPlayerSlotColorRgb()

unsigned ReadPlayerSlotColorRgb ( int slotIndex,
unsigned char * red,
unsigned char * green,
unsigned char * blue )

Read a peer's selected car and RGB colour under its slot mutex.

Parameters
slotIndexThe peer slot index.
redReceives the red colour component.
greenReceives the green colour component.
blueReceives the blue colour component.
Returns
The selected car identifier.
Ghidra address:
BRD3D: 0x10005de0
Ghidra address:
BRGlide: 0x10006150

◆ SetGlobalStatusString()

void SetGlobalStatusString ( const char * pszStatus)

Set the line of status of network play under the mutex of the notices.

Parameters
pszStatusThe line.
Ghidra address:
BRD3D: 0x10003530
Ghidra address:
BRGlide: 0x100038a0

◆ StopNetworkWorkerThread()

void StopNetworkWorkerThread ( void )

Stop the thread that works for the host of a network game, wait for it, and close it and its stop event.

Ghidra address:
BRD3D: 0x10072270
Ghidra address:
BRGlide: 0x1006b1e0

◆ PromoteReadyNetworkPlayersToStart()

void PromoteReadyNetworkPlayersToStart ( void )

Move the players of a network game that are ready to the start.

Ghidra address:
BRD3D: 0x100716e0
Ghidra address:
BRGlide: 0x1006a650

◆ RankNetworkPlayersByProgress()

void RankNetworkPlayersByProgress ( void )

Rank the players of a network game by their progress.

Ghidra address:
BRD3D: 0x10071870
Ghidra address:
BRGlide: 0x1006a7e0

◆ ResetAllNetworkPlayerStreams()

void ResetAllNetworkPlayerStreams ( void )

Empty the streams of every player of a network game.

Ghidra address:
BRD3D: 0x10071b80
Ghidra address:
BRGlide: 0x1006aaf0

◆ BuildNetworkPlayerStatusPackets()

void BuildNetworkPlayerStatusPackets ( void )

Write the packets of the status of the players of a network game into their streams.

Ghidra address:
BRD3D: 0x10071c10
Ghidra address:
BRGlide: 0x1006ab80

◆ FlushNetworkPlayerStreams()

int FlushNetworkPlayerStreams ( DirectPlayInfo * pInfo)

Send the streams of the players of a network game.

Parameters
pInfoThe session.
Ghidra address:
BRD3D: 0x10072170
Ghidra address:
BRGlide: 0x1006b0e0

◆ NetworkWorkerThreadProc()

DWORD WINAPI NetworkWorkerThreadProc ( LPVOID pParameter)

Do the work of the host of a network game once a second, sleeping until each second.

The loop never ends: it reads no stop event, so the thread never returns.

Parameters
pParameterNot read.
Returns
Never.
Ghidra address:
BRD3D: 0x10071680
Ghidra address:
BRGlide: 0x1006a5f0

◆ CreateNetworkPlayerSlotMutexes()

void CreateNetworkPlayerSlotMutexes ( void )

Create the mutexes of the slots of the players of a network game.

Ghidra address:
BRD3D: 0x10071560
Ghidra address:
BRGlide: 0x1006a4d0

◆ ResetAllPlayerSlots()

void ResetAllPlayerSlots ( void )

Reset race and peer states, timing, and finishing positions for every network player.

Ghidra address:
BRD3D: 0x100713c0
Ghidra address:
BRGlide: 0x1006a330

◆ SendNetworkFinishPositionMessage()

HRESULT SendNetworkFinishPositionMessage ( DirectPlayInfo * pInfo,
DPID dpidPlayer,
DWORD dwPosition )

Broadcast a player's finishing position with guaranteed delivery.

Parameters
pInfoThe local session.
dpidPlayerThe finishing player.
dwPositionThe finishing position.
Returns
The DirectPlay send result, or zero without a connection.
Ghidra address:
BRD3D: 0x1003db50
Ghidra address:
BRGlide: 0x100371f0

◆ StartNetworkWorkerThread()

void StartNetworkWorkerThread ( void )

Start the thread that works for the host of a network game.

Ghidra address:
BRD3D: 0x10071630
Ghidra address:
BRGlide: 0x1006a5a0

◆ InitializeNetworkThreading()

bool InitializeNetworkThreading ( void )

Create the mutexes of the slots of the players and start the worker thread of a network game.

Returns
Always true.
Ghidra address:
BRD3D: 0x10071550
Ghidra address:
BRGlide: 0x1006a4c0

◆ GetElapsedTimeSinceStart()

DWORD GetElapsedTimeSinceStart ( void )

Get the time since the network session started.

Returns
The time in milliseconds.
Ghidra address:
BRD3D: 0x100713a0
Ghidra address:
BRGlide: 0x1006a310

◆ HandleDirectPlaySystemMessage()

void HandleDirectPlaySystemMessage ( DirectPlayInfo * pInfo,
DPMSG_GENERIC * pMessage,
DWORD dwSize,
DPID dpidFrom,
DPID dpidTo )

Handle a message of the system of DirectPlay as the host or a client.

While the front end is up, a player that joins or departs is posted to the main window as a notice, a player that departs frees its slot of the session, and a new description of the session reloads the settings of the network.

Parameters
pInfoThe info of the local player.
pMessageThe message.
dwSizeThe size of the message.
dpidFromThe sender, DPID_SYSMSG.
dpidToThe receiver.
Ghidra address:
BRD3D: 0x1000c170
Ghidra address:
BRGlide: 0x100096a0

◆ ClearNetworkPlayerSlotsByOwner()

void ClearNetworkPlayerSlotsByOwner ( DPID dpidOwner)

Free the slots of the network players a player of the session controls.

Parameters
dpidOwnerThe player.
Ghidra address:
BRD3D: 0x10071480
Ghidra address:
BRGlide: 0x1006a3f0

◆ HandlePlayerDisconnect()

void HandlePlayerDisconnect ( DPID dpidPlayer)

Remove a player that departed from a race of the network.

Each slot of a peer of the player with a status is pushed on g_anDepartedPlayerSlotStack and cleared, and the line of status reports that the player left.

Parameters
dpidPlayerThe player.
Ghidra address:
BRD3D: 0x10005fe0
Ghidra address:
BRGlide: 0x10006350

◆ ProcessMultiplayerPackets()

void ProcessMultiplayerPackets ( DirectPlayInfo * pInfo,
void * pData,
DWORD dwSize,
DPID dpidFrom,
DPID dpidTo )

Handle the packets of a secure message as the host.

Parameters
pInfoThe info of the local player.
pDataThe data of the message.
dwSizeThe size of the data.
dpidFromThe sender.
dpidToThe receiver.
Ghidra address:
BRD3D: 0x100360f0
Ghidra address:
BRGlide: 0x1002f790

◆ FindNetworkSlotByPlayerId()

int FindNetworkSlotByPlayerId ( DPID dpidPlayer)

Find a player's active slot, or the first free slot for a new player.

Parameters
dpidPlayerThe player identifier.
Returns
The slot index, zero for the server, or -1 when all slots are in use.
Ghidra address:
BRD3D: 0x10036030
Ghidra address:
BRGlide: 0x1002f6d0

◆ ProcessNetworkDataStream()

void ProcessNetworkDataStream ( DirectPlayInfo * pInfo,
void * pData,
DWORD dwSize,
DPID dpidFrom,
DPID dpidTo )

Handle the packets of a secure message as a client.

Parameters
pInfoThe info of the local player.
pDataThe data of the message.
dwSizeThe size of the data.
dpidFromThe sender.
dpidToThe receiver.
Ghidra address:
BRD3D: 0x10003580
Ghidra address:
BRGlide: 0x100038f0

◆ HandleDirectPlaySystemMessageHost()

void HandleDirectPlaySystemMessageHost ( DirectPlayInfo * pInfo,
DPMSG_GENERIC * pMessage,
DWORD dwSize,
DPID dpidFrom,
DPID dpidTo )

Handle a message of the system of DirectPlay for the host of the session.

A player that departs while the front end is down frees its slots and exits the race, and the data of a secure message goes to ProcessMultiplayerPackets().

Parameters
pInfoThe info of the local player.
pMessageThe message.
dwSizeThe size of the message.
dpidFromThe sender, DPID_SYSMSG.
dpidToThe receiver.
Ghidra address:
BRD3D: 0x1000c000
Ghidra address:
BRGlide: 0x10009530

◆ HandleDirectPlaySystemMessageClient()

void HandleDirectPlaySystemMessageClient ( DirectPlayInfo * pInfo,
DPMSG_GENERIC * pMessage,
DWORD dwSize,
DPID dpidFrom,
DPID dpidTo )

Handle a message of the system of DirectPlay for a client of the session.

A player that departs while the front end is down exits the race, and the data of a secure message goes to ProcessNetworkDataStream().

Parameters
pInfoThe info of the local player.
pMessageThe message.
dwSizeThe size of the message.
dpidFromThe sender, DPID_SYSMSG.
dpidToThe receiver.
Ghidra address:
BRD3D: 0x1000bea0
Ghidra address:
BRGlide: 0x100093d0

◆ GetDirectPlaySessionDesc()

HRESULT GetDirectPlaySessionDesc ( IDirectPlay3A * pDirectPlay,
DPSESSIONDESC2 ** ppDesc )

Get the description of the session of DirectPlay in a buffer of locked global memory.

Parameters
pDirectPlayThe DirectPlay object.
ppDescReceives the description, for the caller to unlock and free.
Returns
The result of GetSessionDesc, or E_OUTOFMEMORY when the buffer cannot be allocated.
Ghidra address:
BRD3D: 0x1003d0b0
Ghidra address:
BRGlide: 0x10036740

◆ LoadNetworkSettings()

HRESULT LoadNetworkSettings ( void )

Read the track, the weather, the class of car, the laps, and the name of the network session from its description, and choose a car of the class that can be chosen.

Returns
DP_OK, the error of GetDirectPlaySessionDesc(), or DPERR_INVALIDOBJECT without DirectPlay.
Ghidra address:
BRD3D: 0x1003ce80
Ghidra address:
BRGlide: 0x10036510

◆ ResetSessionSlotTable()

void ResetSessionSlotTable ( void )

Free every slot of the session and unblock the sends.

Ghidra address:
BRD3D: 0x100586a0
Ghidra address:
BRGlide: 0x10051550

◆ GetNetworkPlayerSlotStatus()

int GetNetworkPlayerSlotStatus ( int nSlot)

The state of a network player of a race, under the mutex of its slot.

Parameters
nSlotThe slot.
Returns
The state.
Ghidra address:
BRD3D: 0x100714d0
Ghidra address:
BRGlide: 0x1006a440

◆ GetNetworkPeerChannelStatus()

int GetNetworkPeerChannelStatus ( int nSlot)

The state of a network player as its own peer reports it, under the mutex of the entry.

Parameters
nSlotThe slot of the player and of its peer.
Returns
The state.
Ghidra address:
BRD3D: 0x10071510
Ghidra address:
BRGlide: 0x1006a480

◆ DestroyNetworkGroups()

void DestroyNetworkGroups ( void )

Remove entries from the menu of network sessions.

Ghidra address:
BRD3D: 0x1003d070
Ghidra address:
BRGlide: 0x10036700

◆ InitializeNetworkServiceProvider()

void InitializeNetworkServiceProvider ( void )

Start the service provider of network play chosen.

Ghidra address:
BRD3D: 0x1003c020
Ghidra address:
BRGlide: 0x100356b0

◆ CreateServiceProviderAddress()

HRESULT CreateServiceProviderAddress ( void ** ppAddress,
DWORD * pdwSize )

Build the compound address for the selected DirectPlay service provider.

Parameters
ppAddressReceives globally allocated, locked address data on success.
pdwSizeReceives the address size in bytes on success.
Returns
The DirectPlay result, or E_OUTOFMEMORY when allocation fails.
Ghidra address:
BRD3D: 0x1003d480
Ghidra address:
BRGlide: 0x10036b20

◆ InitServiceProviderAndStartTimer()

bool InitServiceProviderAndStartTimer ( void )

Start the service provider chosen and the timer of network play of the main window, and mark the DirectPlay session open.

Returns
Always true.
Ghidra address:
BRD3D: 0x1003c230
Ghidra address:
BRGlide: 0x100358c0

◆ InitServiceProviderAndStartSession()

bool InitServiceProviderAndStartSession ( void )

Start the service provider chosen and the timer of network play as InitServiceProviderAndStartTimer() does, then enumerate the sessions again while the list of sessions exists.

Returns
Always true.
Ghidra address:
BRD3D: 0x1003c1e0
Ghidra address:
BRGlide: 0x10035870

◆ CloseAndReleaseDirectPlay()

HRESULT CloseAndReleaseDirectPlay ( void )

Destroy the groups and the local player, close and release DirectPlay, and count one DirectPlay object less.

Returns
Always DP_OK.
Ghidra address:
BRD3D: 0x1003c550
Ghidra address:
BRGlide: 0x10035be0

◆ MarkSessionListEntrySeen()

void MarkSessionListEntrySeen ( DPID dpidPlayer)

Mark the slot of a player of the session as found, or give the player the first free slot.

The flag of a new slot is set for the host and cleared for another player. A player is dropped when no slot is free.

Parameters
dpidPlayerThe player.
Ghidra address:
BRD3D: 0x1003c9f0
Ghidra address:
BRGlide: 0x10036080

◆ EnumPlayersCallback_AddPlayerToList()

BOOL CALLBACK EnumPlayersCallback_AddPlayerToList ( DPID dpidPlayer,
DWORD dwPlayerType,
LPCDPNAME pName,
DWORD dwFlags,
void * pContext )

Add a non-spectator player to the network player menu.

Parameters
dpidPlayerThe player identifier.
dwPlayerTypeUnused.
pNameThe player's DirectPlay name.
dwFlagsEnumeration flags, including the spectator flag.
pContextUnused.
Returns
False without a player menu, otherwise true.
Ghidra address:
BRD3D: 0x1003caa0
Ghidra address:
BRGlide: 0x10036130

◆ PurgeStaleSessionListEntries()

void PurgeStaleSessionListEntries ( void )

Free each slot of the session whose player was not found since the last purge.

Ghidra address:
BRD3D: 0x1003ca70
Ghidra address:
BRGlide: 0x10036100

◆ GetSessionSlotFlag()

int GetSessionSlotFlag ( DPID dpidPlayer)

Get the flag of the slot of a player of the session.

Parameters
dpidPlayerThe player.
Returns
The flag, or 0 when no slot has the player.
Ghidra address:
BRD3D: 0x100586d0
Ghidra address:
BRGlide: 0x10051580

◆ SendNetworkChatMessage()

HRESULT SendNetworkChatMessage ( HWND hWindow,
DirectPlayInfo * pInfo,
bool bNotice )

Post the local chat line to the window and broadcast its text with guaranteed delivery.

Parameters
hWindowThe window that receives the local notice.
pInfoThe local session.
bNoticeWhether to format the line as a notice rather than chat.
Returns
The DirectPlay result, or DP_OK when sending is unavailable or blocked.
Ghidra address:
BRD3D: 0x1003d210
Ghidra address:
BRGlide: 0x100368a0

◆ HandleMultiplayerSessionMessage()

void HandleMultiplayerSessionMessage ( DirectPlayInfo * pInfo,
void * pMessage,
DWORD dwSize,
DPID dpidFrom,
DPID dpidTo )

Handle a message another player of the session sent.

The return, if any, is not recovered yet.

Parameters
pInfoThe info of the local player.
pMessageThe message.
dwSizeThe size of the message.
dpidFromThe sender.
dpidToThe receiver.
Ghidra address:
BRD3D: 0x1000baf0
Ghidra address:
BRGlide: 0x10009010

◆ GetDirectPlayPlayerName()

HRESULT GetDirectPlayPlayerName ( IDirectPlay3A * pDirectPlay,
DPID dpidPlayer,
DPNAME ** ppName )

Retrieve a player's DirectPlay name in globally allocated, locked memory.

Parameters
pDirectPlayThe DirectPlay object.
dpidPlayerThe player identifier.
ppNameReceives the name on success; the caller must unlock and free it.
Returns
The DirectPlay result, or E_OUTOFMEMORY when allocation fails.
Ghidra address:
BRD3D: 0x1003d180
Ghidra address:
BRGlide: 0x10036810

◆ FormatNetworkChatLine()

HRESULT FormatNetworkChatLine ( IDirectPlay3A * pDirectPlay,
DPID dpidPlayer,
const char * text,
char ** ppLine,
bool bNotice )

Format a chat line with the sender's name in globally allocated, locked memory.

Parameters
pDirectPlayThe DirectPlay object.
dpidPlayerThe sender identifier.
textThe chat message.
ppLineReceives the line on success; the caller must unlock and free it.
bNoticeWhether to omit the colon between the sender and the text.
Returns
The DirectPlay result, or DP_OK without a DirectPlay object.
Ghidra address:
BRD3D: 0x1003d3a0
Ghidra address:
BRGlide: 0x10036a30

◆ ToggleSelectedSessionSlotFlag()

int ToggleSelectedSessionSlotFlag ( void )

Toggle the local player's session slot flag.

Returns
The new flag, or zero without a local player slot.
Ghidra address:
BRD3D: 0x10058700
Ghidra address:
BRGlide: 0x100515b0

◆ ShutdownNetworkSubsystem()

bool ShutdownNetworkSubsystem ( int nReason)

End the network play of a game.

The host stops its worker thread, the session of DirectPlay shuts down, and every mutex of network play is closed.

Parameters
nReasonNot read. The callers pass 1.
Returns
Whether the session of DirectPlay shut down.
Ghidra address:
BRD3D: 0x10005be0
Ghidra address:
BRGlide: 0x10005f50

◆ ShutdownDirectPlay()

void ShutdownDirectPlay ( void )

End network play, free the connection data of the service providers, write the count of DirectPlay objects left to the debugger, and release the lobby.

Ghidra address:
BRD3D: 0x1003bfd0
Ghidra address:
BRGlide: 0x10035660

◆ FreeServiceProviderConnectionData()

void FreeServiceProviderConnectionData ( void )

Free the connection data of every service provider.

Ghidra address:
BRD3D: 0x1003cfe0
Ghidra address:
BRGlide: 0x10036670

◆ DisconnectNetworkSession()

void DisconnectNetworkSession ( void )

Exit the session of DirectPlay.

Ghidra address:
BRD3D: 0x1003bf60
Ghidra address:
BRGlide: 0x100355f0

Variable Documentation

◆ g_DirectPlayInfo

DirectPlayInfo g_DirectPlayInfo
extern

The DirectPlay object of the game and its local player.

Ghidra address:
BRD3D: 0x10277b40
Ghidra address:
BRGlide: 0x10273328

◆ g_pDirectPlayInfo

DirectPlayInfo* g_pDirectPlayInfo
extern

The DirectPlay info other routines read, g_DirectPlayInfo once DirectPlay starts.

Ghidra address:
BRD3D: 0x10a9d008
Ghidra address:
BRGlide: 0x10ac4098

◆ g_dwNetCarSetupSelectedPlayerId

DPID g_dwNetCarSetupSelectedPlayerId
extern

The DirectPlay identifier of the player selected during network car setup.

Ghidra address:
BRD3D: 0x100ab3e0
Ghidra address:
BRGlide: 0x100aab80

◆ g_aServiceProviders

ServiceProvider g_aServiceProviders[SERVICE_PROVIDER_COUNT]
extern

The service providers, indexed by IPX, TCP/IP, modem, and serial in that order.

Ghidra address:
BRD3D: 0x10a9bff0
Ghidra address:
BRGlide: 0x10ac3080

◆ g_dwServiceProviderIndex

int g_dwServiceProviderIndex
extern

The index in g_aServiceProviders of the service provider chosen.

Ghidra address:
BRD3D: 0x10aa287c
Ghidra address:
BRGlide: 0x10ac5bd4

◆ g_dwNetWorkerCurrentTime

unsigned g_dwNetWorkerCurrentTime
extern

The time of the worker thread of network play, written at the start of a packet.

Ghidra address:
BRD3D: 0x11828d10
Ghidra address:
BRGlide: 0x1184c070

◆ g_dwNetClockBaseMs

unsigned g_dwNetClockBaseMs
extern

The time network play started counting frames from, in milliseconds.

Ghidra address:
BRD3D: 0x10220dd8
Ghidra address:
BRGlide: 0x1021c908

◆ g_dwNetLastKeyframeFrame

unsigned g_dwNetLastKeyframeFrame
extern

The frame of the last key frame written to a stream.

Ghidra address:
BRD3D: 0x10221310
Ghidra address:
BRGlide: 0x1021ce40

◆ g_dwNetRaceStartFrame

unsigned g_dwNetRaceStartFrame
extern

The frame a network race starts on.

Ghidra address:
BRD3D: 0x1022af00
Ghidra address:
BRGlide: 0x10226a30

◆ g_szModemPhoneNumber

char g_szModemPhoneNumber[]
extern

The telephone number of a modem connection.

Ghidra address:
BRD3D: 0x10a9cdf0
Ghidra address:
BRGlide: 0x10ac3e80

◆ g_szModemDeviceName

char g_szModemDeviceName[]
extern

The device of a modem connection.

Ghidra address:
BRD3D: 0x10a9cef8
Ghidra address:
BRGlide: 0x10ac3f88

◆ g_dwLaunchedFromLobby

int g_dwLaunchedFromLobby
extern

Whether a lobby launched the game.

Ghidra address:
BRD3D: 0x10a9d000
Ghidra address:
BRGlide: 0x10ac4090

◆ g_dwLobbyIsHost

int g_dwLobbyIsHost
extern

Whether the lobby made the game the host.

Ghidra address:
BRD3D: 0x10aa2884
Ghidra address:
BRGlide: 0x10ac5bdc

◆ g_dwSessionEnumPending

int g_dwSessionEnumPending
extern

Whether an enumeration of sessions is waiting for a reply.

Ghidra address:
BRD3D: 0x10aa2898
Ghidra address:
BRGlide: 0x10ac5bf0

◆ g_dwNetworkTimerId

UINT_PTR g_dwNetworkTimerId
extern

The timer of the main window that drives network play.

Ghidra address:
BRD3D: 0x10a9bfdc
Ghidra address:
BRGlide: 0x10ac306c

◆ g_pDirectPlayLobby

IDirectPlayLobby2A* g_pDirectPlayLobby
extern

The DirectPlay lobby.

Ghidra address:
BRD3D: 0x10a9bfd8
Ghidra address:
BRGlide: 0x10ac3068

◆ g_bDirectPlayReceiveThreadStarted

int g_bDirectPlayReceiveThreadStarted
extern

Whether the critical section of DirectPlay sends exists.

Ghidra address:
BRD3D: 0x10277b60
Ghidra address:
BRGlide: 0x10273348

◆ g_DirectPlaySendCritSec

CRITICAL_SECTION g_DirectPlaySendCritSec
extern

The critical section of DirectPlay sends.

Ghidra address:
BRD3D: 0x10277b28
Ghidra address:
BRGlide: 0x10273310

◆ g_hDirectPlayReceiveStopEvent

HANDLE g_hDirectPlayReceiveStopEvent
extern

The event that stops the receive thread.

Ghidra address:
BRD3D: 0x10277b5c
Ghidra address:
BRGlide: 0x10273344

◆ g_dwDirectPlayReceiveThreadId

DWORD g_dwDirectPlayReceiveThreadId
extern

The identifier of the receive thread.

Ghidra address:
BRD3D: 0x10277b58
Ghidra address:
BRGlide: 0x10273340

◆ g_hDirectPlayReceiveThread

HANDLE g_hDirectPlayReceiveThread
extern

The thread that receives the messages of the local player.

Ghidra address:
BRD3D: 0x10277b54
Ghidra address:
BRGlide: 0x1027333c

◆ g_szSessionName

char g_szSessionName[]
extern

The name of the network session.

Ghidra address:
BRD3D: 0x10a9d018
Ghidra address:
BRGlide: 0x10ac40a8

◆ g_szDirectPlayErrorBuffer

char g_szDirectPlayErrorBuffer[16]
extern

The name of an error GetDirectPlayErrorString() does not know, written in hexadecimal.

Ghidra address:
BRD3D: 0x10a9bfe0
Ghidra address:
BRGlide: 0x10ac3070

◆ g_dwDirectPlaySessionActive

int g_dwDirectPlaySessionActive
extern

Whether a DirectPlay session is open.

Ghidra address:
BRD3D: 0x10a9cffc
Ghidra address:
BRGlide: 0x10ac408c

◆ g_nNetPauseRequestTicks

int g_nNetPauseRequestTicks
extern

The ticks a request of a pause of a network game has waited, 0 for no request.

Ghidra address:
BRD3D: 0x1022aaf4
Ghidra address:
BRGlide: 0x10226624

◆ g_nNetUnpauseRequestTicks

int g_nNetUnpauseRequestTicks
extern

The ticks a request of the end of a pause of a network game has waited, 0 for no request.

Ghidra address:
BRD3D: 0x10221314
Ghidra address:
BRGlide: 0x1021ce44

◆ g_bNetReadyToStart

int g_bNetReadyToStart
extern

Whether the local player is ready to start a network race.

Ghidra address:
BRD3D: 0x1022aaa8
Ghidra address:
BRGlide: 0x102265d8

◆ g_bNetReceiveEnabled

int g_bNetReceiveEnabled
extern

Whether the messages received are processed.

Ghidra address:
BRD3D: 0x10220dd0
Ghidra address:
BRGlide: 0x1021c900

◆ g_dwLocalNetPlayerId

int g_dwLocalNetPlayerId
extern

The slot of the local player of a network game, -1 before one is assigned.

Ghidra address:
BRD3D: 0x10094294
Ghidra address:
BRGlide: 0x1007b264

◆ g_rcNetCarSetupPlayerList

const RECT g_rcNetCarSetupPlayerList
extern

The player list rectangle on the network car setup screen, in pixels.

Ghidra address:
BRD3D: 0x100ab408
Ghidra address:
BRGlide: 0x100aaba8

◆ g_dwNetworkCarSetupShown

int g_dwNetworkCarSetupShown
extern

Whether the network car setup screen has been shown.

Ghidra address:
BRD3D: 0x10aa2888
Ghidra address:
BRGlide: 0x10ac5be0

◆ g_aNetPeerSlots

NetPeerSlot g_aNetPeerSlots[NET_PEER_SLOT_COUNT]
extern

The peers of a network game.

Ghidra address:
BRD3D: 0x10221328
Ghidra address:
BRGlide: 0x1021ce58

◆ g_adwNetRaceOrder

int g_adwNetRaceOrder[NET_PEER_SLOT_COUNT]
extern

The order of the players of a network race.

Ghidra address:
BRD3D: 0x102212d0
Ghidra address:
BRGlide: 0x1021ce00

◆ g_szNetStatusString

char g_szNetStatusString[]
extern

The line of status of network play the game shows.

Its size is not recovered yet.

Ghidra address:
BRD3D: 0x10220e80
Ghidra address:
BRGlide: 0x1021c9b0

◆ g_bNetStatusStringDirty

int g_bNetStatusStringDirty
extern

Whether g_szNetStatusString changed since it was shown.

Ghidra address:
BRD3D: 0x1022af08
Ghidra address:
BRGlide: 0x10226a38

◆ g_anDepartedPlayerSlotStack

int g_anDepartedPlayerSlotStack[PLAYER_SLOT_STACK_SIZE]
extern

The slots of the players that departed, for the race to remove.

Ghidra address:
BRD3D: 0x10221288
Ghidra address:
BRGlide: 0x1021cdb8

◆ g_nDepartedPlayerStackTop

int g_nDepartedPlayerStackTop
extern

The index of the top of g_anDepartedPlayerSlotStack.

Ghidra address:
BRD3D: 0x10221318
Ghidra address:
BRGlide: 0x1021ce48

◆ g_anJoinedPlayerSlotStack

int g_anJoinedPlayerSlotStack[PLAYER_SLOT_STACK_SIZE]
extern

The slots of the players that joined, for the race to add.

Ghidra address:
BRD3D: 0x10220d90
Ghidra address:
BRGlide: 0x1021c8c0

◆ g_nJoinedPlayerStackTop

int g_nJoinedPlayerStackTop
extern

The index of the top of g_anJoinedPlayerSlotStack.

Ghidra address:
BRD3D: 0x10220dd4
Ghidra address:
BRGlide: 0x1021c904

◆ g_hNetRaceStartMutex

HANDLE g_hNetRaceStartMutex
extern

The mutex of the start of a network race.

Ghidra address:
BRD3D: 0x10220cec
Ghidra address:
BRGlide: 0x1021c81c

◆ g_hNetReceiveMutex

HANDLE g_hNetReceiveMutex
extern

The mutex of the messages received.

Ghidra address:
BRD3D: 0x1022131c
Ghidra address:
BRGlide: 0x1021ce4c

◆ g_hNetPauseMutex

HANDLE g_hNetPauseMutex
extern

The mutex of a pause of a network game.

Ghidra address:
BRD3D: 0x1022af04
Ghidra address:
BRGlide: 0x10226a34

◆ g_hNetUnpauseMutex

HANDLE g_hNetUnpauseMutex
extern

The mutex of the end of a pause of a network game.

Ghidra address:
BRD3D: 0x10220ddc
Ghidra address:
BRGlide: 0x1021c90c

◆ g_hNetReadyMutex

HANDLE g_hNetReadyMutex
extern

The mutex of the players that are ready.

Ghidra address:
BRD3D: 0x10221324
Ghidra address:
BRGlide: 0x1021ce54

◆ g_hNetKeyframeMutex

HANDLE g_hNetKeyframeMutex
extern

The mutex of the key frames of a network race.

Ghidra address:
BRD3D: 0x1022af34
Ghidra address:
BRGlide: 0x10226a64

◆ g_hJoinedPlayerStackMutex

HANDLE g_hJoinedPlayerStackMutex
extern

The mutex of the stack of players that joined.

Ghidra address:
BRD3D: 0x1022af2c
Ghidra address:
BRGlide: 0x10226a5c

◆ g_hDepartedPlayerStackMutex

HANDLE g_hDepartedPlayerStackMutex
extern

The mutex of the stack of players that departed.

Ghidra address:
BRD3D: 0x1022af30
Ghidra address:
BRGlide: 0x10226a60

◆ g_hNetRaceOrderMutex

HANDLE g_hNetRaceOrderMutex
extern

The mutex of the order of a network race.

Ghidra address:
BRD3D: 0x1022af28
Ghidra address:
BRGlide: 0x10226a58

◆ g_hNetNotifyMutex

HANDLE g_hNetNotifyMutex
extern

The mutex of the notices of network play.

Ghidra address:
BRD3D: 0x1022af24
Ghidra address:
BRGlide: 0x10226a54

◆ g_bNetWorkerThreadRunning

int g_bNetWorkerThreadRunning
extern

Whether the worker thread of the host runs.

Ghidra address:
BRD3D: 0x11828d18
Ghidra address:
BRGlide: 0x1184c078

◆ g_hNetWorkerStopEvent

HANDLE g_hNetWorkerStopEvent
extern

The event that stops the worker thread of the host.

Ghidra address:
BRD3D: 0x11826b00
Ghidra address:
BRGlide: 0x11849e60

◆ g_hNetWorkerThread

HANDLE g_hNetWorkerThread
extern

The worker thread of the host.

Ghidra address:
BRD3D: 0x11828d1c
Ghidra address:
BRGlide: 0x1184c07c

◆ g_dwNetWorkerThreadId

DWORD g_dwNetWorkerThreadId
extern

The identifier of the worker thread of network play.

Ghidra address:
BRD3D: 0x11826b04
Ghidra address:
BRGlide: 0x11849e64

◆ g_dwNetWorkerNextTickTime

DWORD g_dwNetWorkerNextTickTime
extern

The time of the next tick of the worker thread of network play, in milliseconds.

Ghidra address:
BRD3D: 0x11826b48
Ghidra address:
BRGlide: 0x11849ea8

◆ g_dwNetSessionStartTime

DWORD g_dwNetSessionStartTime
extern

The time the network session started, in milliseconds.

Ghidra address:
BRD3D: 0x1178fee8
Ghidra address:
BRGlide: 0x117b3248

◆ g_dwNetworkSendBlocked

int g_dwNetworkSendBlocked
extern

Whether the sends of network play are blocked.

Ghidra address:
BRD3D: 0x10aa288c
Ghidra address:
BRGlide: 0x10ac5be4

◆ g_aNetPlayerSlots

NetPlayerSlot g_aNetPlayerSlots[NET_PLAYER_SLOT_COUNT]
extern

The network players of a race.

Ghidra address:
BRD3D: 0x11786828
Ghidra address:
BRGlide: 0x117a9b88

◆ g_aNetPeerSlotMatrix

The network players of a race as each peer reports them, by peer and then by player.

Ghidra address:
BRD3D: 0x1178fef8
Ghidra address:
BRGlide: 0x117b3258

◆ g_aSessionSlots

SessionSlot g_aSessionSlots[SESSION_SLOT_COUNT]
extern

The players in the slots of the session.

Ghidra address:
BRD3D: 0x10aa2538
Ghidra address:
BRGlide: 0x10ac5890

◆ g_szNetworkChatText

char g_szNetworkChatText[]
extern

The chat line being edited or sent from the network menu.

Ghidra address:
BRD3D: 0x10a9dd28
Ghidra address:
BRGlide: 0x10ac4db0

◆ g_dwNetworkDataStreamActive

int g_dwNetworkDataStreamActive
extern

Whether the network data stream is active.

Ghidra address:
BRD3D: 0x10aa2894
Ghidra address:
BRGlide: 0x10ac5bec

◆ g_dwNetworkEscapePending

int g_dwNetworkEscapePending
extern

Whether the network menu has an escape request to process.

Ghidra address:
BRD3D: 0x10aa2890

◆ g_dwDirectPlayInstanceCount

int g_dwDirectPlayInstanceCount
extern

The number of DirectPlay objects that exist.

Ghidra address:
BRD3D: 0x10a9d004
Ghidra address:
BRGlide: 0x10ac4094