doom

a minimalistic implementation of doom
git clone git://ssnf.xyz/doom
Log | Files | Refs

d_net.h (1114B)


      1 
      2 
      3 
      4 
      5 
      6 
      7 
      8 
      9 
     10 
     11 
     12 
     13 
     14 
     15 
     16 
     17 
     18 
     19 
     20 
     21 
     22 
     23 #ifndef __D_NET__
     24 #define __D_NET__
     25 
     26 #include "d_player.h"
     27 
     28 
     29 #ifdef __GNUG__
     30 #pragma interface
     31 #endif
     32 
     33 
     34 
     35 
     36 
     37 
     38 
     39 
     40 
     41 
     42 #define DOOMCOM_ID		0x12345678l
     43 
     44 
     45 #define MAXNETNODES		8
     46 
     47 
     48 
     49 #define BACKUPTICS		12
     50 
     51 typedef enum
     52 {
     53     CMD_SEND	= 1,
     54     CMD_GET	= 2
     55 
     56 } command_t;
     57 
     58 
     59 
     60 
     61 
     62 typedef struct
     63 {
     64     
     65     unsigned		checksum;
     66     
     67     byte		retransmitfrom;
     68     
     69     byte		starttic;
     70     byte		player;
     71     byte		numtics;
     72     ticcmd_t		cmds[BACKUPTICS];
     73 
     74 } doomdata_t;
     75 
     76 
     77 
     78 
     79 typedef struct
     80 {
     81     
     82     long		id;
     83     
     84     
     85     short		intnum;		
     86     
     87     
     88     short		command;
     89     
     90     short		remotenode;
     91     
     92     
     93     short		datalength;
     94 
     95     
     96     
     97     short		numnodes;
     98     
     99     short		ticdup;
    100     
    101     short		extratics;
    102     
    103     short		deathmatch;
    104     
    105     short		savegame;
    106     short		episode;	
    107     short		map;		
    108     short		skill;		
    109 
    110     
    111     short		consoleplayer;
    112     short		numplayers;
    113     
    114     
    115     
    116     
    117     
    118     
    119     
    120     short		angleoffset;
    121     
    122     short		drone;		
    123 
    124     
    125     doomdata_t		data;
    126     
    127 } doomcom_t;
    128 
    129 
    130 
    131 
    132 void NetUpdate (void);
    133 
    134 
    135 
    136 void D_QuitNetGame (void);
    137 
    138 
    139 void TryRunTics (void);
    140 
    141 
    142 #endif
    143 
    144 
    145 
    146 
    147 
    148 
    149