-
Notifications
You must be signed in to change notification settings - Fork 2
Udp network protocol
Ben M. Ward edited this page Aug 4, 2017
·
4 revisions
This protocol plays fast and loose, and in general packet loss is acceptable and expected.
Each packet starts with a 1-byte Type. The enum below specifies it:
/*************************************
* UDP Packet ID's taken directly from
* D1X-Rebirth source
*************************************/
enum UDP_PacketType
{
UPID_VERSION_DENY = 1, // Netgame join or info has been denied due to version difference.
UPID_GAME_INFO_REQ, // Requesting all info about a netgame.
UPID_GAME_INFO, // Packet containing all info about a netgame.
UPID_GAME_INFO_LITE_REQ, // Requesting lite info about a netgame. Used for discovering games.
UPID_GAME_INFO_LITE, // Packet containing lite netgame info.
UPID_DUMP, // Packet containing why player cannot join this game.
UPID_ADDPLAYER, // Packet from Host containing info about a new player.
UPID_REQUEST, // New player says: "I want to be inside of you!" (haha, sorry I could not resist) / Packet containing request to join the game actually.
UPID_QUIT_JOINING, // Packet from a player who suddenly quits joining.
UPID_SYNC, // Packet from host containing full netgame info to sync players up.
UPID_OBJECT_DATA, // Packet from host containing object buffer.
UPID_PING, // Packet from host containing his GameTime and the Ping list. Client returns this time to host as UPID_PONG and adapts the ping list.
UPID_PONG, // Packet answer from client to UPID_PING. Contains the time the initial ping packet was sent.
UPID_ENDLEVEL_H, // Packet from Host to all Clients containing connect-states and kills information about everyone in the game.
UPID_ENDLEVEL_C, // Packet from Client to Host containing connect-state and kills information from this Client.
UPID_PDATA_H, // Packet from Host to all Clients containing all players movement data.
UPID_PDATA_C, // Packet from Client to Host containing his movement data.
UPID_MDATA_P0, // Packet containing multi buffer from a player. Priority 0 - no ACK needed.
UPID_MDATA_P1, // Packet containing multi buffer from a player. Priority 1 - ACK needed. Also contains pkt_num
UPID_MDATA_ACK // ACK packet for UPID_MDATA_P1.
};