X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=netconn.h;h=7d35b38352a254b9b8fb88a254194ddd2ef89b11;hb=c26c3c9f7aab77b258ff04e28e9e5d7362450a61;hp=26a4ce864c646a2012a0177ab9920e460fc5bab7;hpb=0a2edb85ad96a5fe17d5c3d694e70ab8aaf65def;p=xonotic%2Fdarkplaces.git diff --git a/netconn.h b/netconn.h index 26a4ce86..7d35b383 100755 --- a/netconn.h +++ b/netconn.h @@ -24,11 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "lhnet.h" -#define NET_NAMELEN 128 - -#define NET_MAXMESSAGE 65536 #define NET_HEADERSIZE (2 * sizeof(unsigned int)) -#define NET_DATAGRAMSIZE (MAX_DATAGRAM + NET_HEADERSIZE) // NetHeader flags #define NETFLAG_LENGTH_MASK 0x0000ffff @@ -120,9 +116,15 @@ typedef struct netconn_s lhnetsocket_t *mysocket; lhnetaddress_t peeraddress; + + // requested rate in bytes per second + int rate; // this is mostly identical to qsocket_t from quake + + // if this time is reached, kick off peer double connecttime; + double timeout; double lastMessageTime; double lastSendTime; @@ -140,7 +142,7 @@ typedef struct netconn_s int receiveMessageLength; qbyte receiveMessage[NET_MAXMESSAGE]; - char address[NET_NAMELEN]; + char address[128]; } netconn_t; extern netconn_t *netconn_list; @@ -156,7 +158,9 @@ extern int playercolor; typedef struct { // ping time for sorting servers - double ping; + int ping; + // used to calculate ping when update comes in + double querytime; // address for connecting char cname[128]; // description (seen by user) @@ -188,8 +192,17 @@ extern unsigned short ntohs (unsigned short netshort); // //============================================================================ +extern double masterquerytime; +extern int masterquerycount; +extern int masterreplycount; +extern int serverquerycount; +extern int serverreplycount; + extern sizebuf_t net_message; +extern cvar_t cl_netlocalping_min; +extern cvar_t cl_netlocalping_max; + int NetConn_SendReliableMessage(netconn_t *conn, sizebuf_t *data); //void NetConn_SendMessageNext(netconn_t *conn); //void NetConn_ReSendMessage(netconn_t *conn); @@ -206,6 +219,7 @@ void NetConn_Shutdown(void); netconn_t *NetConn_Open(lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress); void NetConn_Close(netconn_t *conn); void NetConn_Listen(qboolean state); +int NetConn_IsLocalGame(void); //int NetConn_ReceivedMessage(netconn_t *conn, qbyte *data, int length); //int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length, lhnetaddress_t *peeraddress); //int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, qbyte *data, int length, lhnetaddress_t *peeraddress);