123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- #define PORT_ANY -1
- typedef struct
- {
- byte ip[4];
- unsigned short port;
- unsigned short pad;
- } netadr_t;
- extern netadr_t net_local_adr;
- extern netadr_t net_from;
- extern sizebuf_t net_message;
- extern cvar_t hostname;
- extern int net_socket;
- void NET_Init (int port);
- void NET_Shutdown (void);
- qboolean NET_GetPacket (void);
- void NET_SendPacket (int length, void *data, netadr_t to);
- qboolean NET_CompareAdr (netadr_t a, netadr_t b);
- qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b);
- char *NET_AdrToString (netadr_t a);
- char *NET_BaseAdrToString (netadr_t a);
- qboolean NET_StringToAdr (char *s, netadr_t *a);
- qboolean NET_IsClientLegal(netadr_t *adr);
- #define OLD_AVG 0.99
- #define MAX_LATENT 32
- typedef struct
- {
- qboolean fatal_error;
- float last_received;
- float frame_latency;
- float frame_rate;
- int drop_count;
- int good_count;
- netadr_t remote_address;
- int qport;
- double cleartime;
- double rate;
- int incoming_sequence;
- int incoming_acknowledged;
- int incoming_reliable_acknowledged;
- int incoming_reliable_sequence;
- int outgoing_sequence;
- int reliable_sequence;
- int last_reliable_sequence;
- sizebuf_t message;
- byte message_buf[MAX_MSGLEN];
- int reliable_length;
- byte reliable_buf[MAX_MSGLEN];
- int outgoing_size[MAX_LATENT];
- double outgoing_time[MAX_LATENT];
- } netchan_t;
- extern int net_drop;
- void Netchan_Init (void);
- void Netchan_Transmit (netchan_t *chan, int length, byte *data);
- void Netchan_OutOfBand (netadr_t adr, int length, byte *data);
- void Netchan_OutOfBandPrint (netadr_t adr, char *format, ...);
- qboolean Netchan_Process (netchan_t *chan);
- void Netchan_Setup (netchan_t *chan, netadr_t adr, int qport);
- qboolean Netchan_CanPacket (netchan_t *chan);
- qboolean Netchan_CanReliable (netchan_t *chan);
|