qstat.c
/* Packet from Descent3 master server (PXO)
 */
Packet from Descent3 master server (PXO)
Packet from Descent3 master server ( PXO )
query_status_t deal_with_descent3master_packet(struct qserver *server, char *rawpkt, int pktlen)
{
	int i = 0, lastpacket = 0;
	char *names = rawpkt + 0x1f;
	char *ips = rawpkt + 0x29f;
	char *ports = rawpkt + 0x2ef;
	debug( 2, "deal_with_descent3master_packet %p, %d", server, pktlen );
	while (i < 20)
	{
		if (*names)
		{
			char *c;
			server->master_pkt_len += 6;
			server->master_pkt = (char*)realloc(server->master_pkt, server->master_pkt_len);
			c = server->master_pkt + server->master_pkt_len - 6;
			memcpy(c, ips, 4);
			memcpy(c + 4, ports, 2);
		}
		else if (i > 0)
		{
			lastpacket = 1;
		}
		names += 0x20;
		ips += 4;
		ports += 2;
		i++;
	}
	ack_descent3master_packet(server, rawpkt + 0x1a);
	server->n_servers = server->master_pkt_len / 6;
	server->next_player_info = - 1;
	server->retry1 = 0;
	if (lastpacket)
	{
		return DONE_AUTO;
	}
	return INPROGRESS;
}
query_status_t deal_with_descent3master_packet ( struct qserver * server , char * rawpkt , int pktlen ) { int i = 0 , lastpacket = 0 ; char * names = rawpkt + 0x1f ; char * ips = rawpkt + 0x29f ; char * ports = rawpkt + 0x2ef ; debug ( 2 , " " , server , pktlen ) ; while ( i < 20 ) { if ( * names ) { char * c ; server -> master_pkt_len += 6 ; server -> master_pkt = ( char * ) realloc ( server -> master_pkt , server -> master_pkt_len ) ; c = server -> master_pkt + server -> master_pkt_len - 6 ; memcpy ( c , ips , 4 ) ; memcpy ( c + 4 , ports , 2 ) ; } else if ( i > 0 ) { lastpacket = 1 ; } names += 0x20 ; ips += 4 ; ports += 2 ; i ++ ; } ack_descent3master_packet ( server , rawpkt + 0x1a ) ; server -> n_servers = server -> master_pkt_len / 6 ; server -> next_player_info = - 1 ; server -> retry1 = 0 ; if ( lastpacket ) { return DONE_AUTO ; } return INPROGRESS ; }
Packet from Descent3 master server (PXO)
Packet from Descent3 master server ( PXO )