+ unsigned char receiveMessage[NET_MAXMESSAGE];
+
+ /// used by both NQ and QW protocols
+ unsigned int outgoing_unreliable_sequence;
+
+ struct netconn_nq_s
+ {
+ unsigned int ackSequence;
+ unsigned int sendSequence;
+
+ unsigned int receiveSequence;
+ unsigned int unreliableReceiveSequence;
+ }
+ nq;
+ struct netconn_qw_s
+ {
+ // QW protocol
+ qbool fatal_error;
+
+ float last_received; // for timeouts
+
+ // the statistics are cleared at each client begin, because
+ // the server connecting process gives a bogus picture of the data
+ float frame_latency; // rolling average
+ float frame_rate;
+
+ int drop_count; ///< dropped packets, cleared each level
+ int good_count; ///< cleared each level
+
+ int qport;
+
+ // sequencing variables
+ unsigned int incoming_sequence;
+ unsigned int incoming_acknowledged;
+ qbool incoming_reliable_acknowledged; ///< single bit
+
+ qbool incoming_reliable_sequence; ///< single bit, maintained local
+
+ qbool reliable_sequence; ///< single bit
+ unsigned int last_reliable_sequence; ///< sequence number of last send
+ }
+ qw;
+
+ // bandwidth estimator
+ double cleartime; // if realtime > nc->cleartime, free to go
+ double incoming_cleartime; // if realtime > nc->cleartime, free to go (netgraph cleartime simulation only)
+
+ // this tracks packet loss and packet sizes on the most recent packets
+ // used by shownetgraph feature
+#define NETGRAPH_PACKETS 256
+#define NETGRAPH_NOPACKET 0
+#define NETGRAPH_LOSTPACKET -1
+#define NETGRAPH_CHOKEDPACKET -2
+ int incoming_packetcounter;
+ netgraphitem_t incoming_netgraph[NETGRAPH_PACKETS];
+ int outgoing_packetcounter;
+ netgraphitem_t outgoing_netgraph[NETGRAPH_PACKETS];
+
+ char address[128];
+ crypto_t crypto;
+
+ // statistic counters
+ int packetsSent;
+ int packetsReSent;
+ int packetsReceived;
+ int receivedDuplicateCount;
+ int droppedDatagrams;
+ int unreliableMessagesSent;
+ int unreliableMessagesReceived;
+ int reliableMessagesSent;
+ int reliableMessagesReceived;