|
coastline 0.0.4
|
The streams of the packets of network play: bytes and bits, the most significant first. More...
#include "common/packedvalue.h"
Go to the source code of this file.
Classes | |
| class | NetStream |
| A stream of the bytes and bits of a packet, read and written from the most significant bit. More... | |
| struct | NetPlayerProgress |
| A player of network play and the progress that ranks it. More... | |
Macros | |
| #define | NET_STREAM_BUFFER_SIZE 0x200 |
| The size of the buffer of a NetStream. | |
| #define | NET_PLAYER_STREAM_COUNT 16 |
| The number of entries of g_aNetPlayerStreams. | |
| #define | NET_PACKET_MAX_SIZE 256 |
| The largest size of a packet of a NetStream, in bytes. | |
Functions | |
| int | CompareNetworkPlayerProgressDescending (const void *pA, const void *pB) |
| Order two NetPlayerProgress entries for qsort() by their progress, the greatest first. | |
| bool | WriteTimeSyncPacket (NetStream *pStream, unsigned char bPlayer, unsigned nTime, unsigned nValue) |
| Write a packet of the time of a player: the player with the tag 0xc0, the time in 24 bits, and a 16-bit value, when the packet fits. | |
| bool | WritePlayerRankingPacket (NetStream *pStream, unsigned char bPlayer) |
| Write a packet of the positions of the players: the player with the tag 0x20 and the positions of g_adwNetPlayerRankPosition, two to a byte with the first in the low 4 bits, when the packet fits. | |
| bool | WritePlayerStatusPacket (NetStream *pStream, unsigned char bPlayer, int nState, int nStatusValue, unsigned char bOptionA, unsigned char bOptionB, unsigned char bOptionC, const char *szPlayerName, unsigned dwOwner) |
| Write a player's state, options, and owner, followed by a name or countdown for states that include them. | |
| bool | WriteGameSettingsPacket (NetStream *pStream, unsigned char bPlayer) |
| Write the maximum player count, track, weather, allowed cars, and tyre and suspension settings. | |
| void | DeserializeVehicleState (KeyframeState *pState, NetStream *pStream) |
Decode a full network vehicle keyframe from the bit stream into pState. | |
| unsigned | SendLocalVehicleStateUpdate (KeyframeState *state) |
| Accumulate vehicle state over three frames and send full or delta snapshots on schedule. | |
| unsigned | SendKeyframePacket (KeyframeState *state) |
| Send a complete vehicle keyframe as an unreliable network packet. | |
| unsigned | SendDeltaKeyframePacket (KeyframeState *state, KeyframeState *base) |
Send a vehicle keyframe compressed against base as an unreliable network packet. | |
| void | EncodeKeyframeBitstreamFull (NetStream *stream, KeyframeState *state) |
| Encode orientation, position, motion, progress, lights, and effects as a full keyframe. | |
| unsigned | GetInterpolatedRemoteVehicleState (KeyframeState *state, int slotIndex) |
| Interpolate or predict the vehicle state of a remote player from buffered snapshots. | |
| void | EncodeKeyframeBitstreamDelta (NetStream *stream, KeyframeState *state, KeyframeState *base) |
Encode a keyframe against base, shortening position and progress fields. | |
| void | DeserializeKeyframeDelta (KeyframeState *pState, const KeyframeState *pBase, NetStream *pStream) |
Reconstruct position and progress relative to pBase from a delta keyframe. | |
Variables | |
| NetStream | g_aNetPlayerStreams [NET_PLAYER_STREAM_COUNT] |
| The streams of the players of network play. | |
| NetPlayerProgress | g_aNetPlayerProgressSort [NET_PLAYER_STREAM_COUNT] |
| The players of network play, sorted by their progress. | |
| int | g_adwNetPlayerRankPosition [NET_PLAYER_STREAM_COUNT] |
| The position of each network player in the race, from 0 to 15. | |
| KeyframeState | g_LastSentKeyframe |
| The last complete local vehicle state sent to the other players. | |
| float | g_afKeyframeAccumMax [7] |
| The largest values accumulated for the seven keyframe fields before the next send. | |
| int | g_dwVehicleStateSendCounter |
| The number of local vehicle state updates since the network race started. | |
| unsigned | g_dwNetRaceStartCountdownTime |
| The clock time at which the network race countdown ends, in milliseconds. | |
The streams of the packets of network play: bytes and bits, the most significant first.
| #define NET_STREAM_BUFFER_SIZE 0x200 |
The size of the buffer of a NetStream.
| #define NET_PLAYER_STREAM_COUNT 16 |
The number of entries of g_aNetPlayerStreams.
| #define NET_PACKET_MAX_SIZE 256 |
The largest size of a packet of a NetStream, in bytes.
| int CompareNetworkPlayerProgressDescending | ( | const void * | pA, |
| const void * | pB ) |
Order two NetPlayerProgress entries for qsort() by their progress, the greatest first.
| pA | The first entry. |
| pB | The second entry. |
| bool WriteTimeSyncPacket | ( | NetStream * | pStream, |
| unsigned char | bPlayer, | ||
| unsigned | nTime, | ||
| unsigned | nValue ) |
Write a packet of the time of a player: the player with the tag 0xc0, the time in 24 bits, and a 16-bit value, when the packet fits.
| pStream | The stream. |
| bPlayer | The player, in the low 6 bits. |
| nTime | The time, in its low 24 bits. |
| nValue | The 16-bit value after the time. |
| bool WritePlayerRankingPacket | ( | NetStream * | pStream, |
| unsigned char | bPlayer ) |
Write a packet of the positions of the players: the player with the tag 0x20 and the positions of g_adwNetPlayerRankPosition, two to a byte with the first in the low 4 bits, when the packet fits.
| pStream | The stream. |
| bPlayer | The player, in the low 5 bits. |
| bool WritePlayerStatusPacket | ( | NetStream * | pStream, |
| unsigned char | bPlayer, | ||
| int | nState, | ||
| int | nStatusValue, | ||
| unsigned char | bOptionA, | ||
| unsigned char | bOptionB, | ||
| unsigned char | bOptionC, | ||
| const char * | szPlayerName, | ||
| unsigned | dwOwner ) |
Write a player's state, options, and owner, followed by a name or countdown for states that include them.
| bool WriteGameSettingsPacket | ( | NetStream * | pStream, |
| unsigned char | bPlayer ) |
Write the maximum player count, track, weather, allowed cars, and tyre and suspension settings.
| void DeserializeVehicleState | ( | KeyframeState * | pState, |
| NetStream * | pStream ) |
Decode a full network vehicle keyframe from the bit stream into pState.
| unsigned SendLocalVehicleStateUpdate | ( | KeyframeState * | state | ) |
Accumulate vehicle state over three frames and send full or delta snapshots on schedule.
| unsigned SendKeyframePacket | ( | KeyframeState * | state | ) |
Send a complete vehicle keyframe as an unreliable network packet.
| unsigned SendDeltaKeyframePacket | ( | KeyframeState * | state, |
| KeyframeState * | base ) |
Send a vehicle keyframe compressed against base as an unreliable network packet.
| void EncodeKeyframeBitstreamFull | ( | NetStream * | stream, |
| KeyframeState * | state ) |
Encode orientation, position, motion, progress, lights, and effects as a full keyframe.
| unsigned GetInterpolatedRemoteVehicleState | ( | KeyframeState * | state, |
| int | slotIndex ) |
Interpolate or predict the vehicle state of a remote player from buffered snapshots.
| void EncodeKeyframeBitstreamDelta | ( | NetStream * | stream, |
| KeyframeState * | state, | ||
| KeyframeState * | base ) |
Encode a keyframe against base, shortening position and progress fields.
| void DeserializeKeyframeDelta | ( | KeyframeState * | pState, |
| const KeyframeState * | pBase, | ||
| NetStream * | pStream ) |
Reconstruct position and progress relative to pBase from a delta keyframe.
|
extern |
The streams of the players of network play.
|
extern |
The players of network play, sorted by their progress.
|
extern |
The position of each network player in the race, from 0 to 15.
|
extern |
The last complete local vehicle state sent to the other players.
|
extern |
The largest values accumulated for the seven keyframe fields before the next send.
|
extern |
The number of local vehicle state updates since the network race started.
|
extern |
The clock time at which the network race countdown ends, in milliseconds.