3488: Implement network statistics for recvmmsg r=heinrich5991 a=def-

![screenshot-20210109@114810](https://user-images.githubusercontent.com/2335377/104089616-9b490200-5270-11eb-8956-26c8c930f3c4.png)

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2021-01-09 13:55:15 +00:00 committed by GitHub
commit fc2a49d15b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1629,12 +1629,11 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *buffer, int maxsize, MMSGS
if(m->pos < m->size)
{
sockaddr_to_netaddr((struct sockaddr *)&(m->sockaddrs[m->pos]), addr);
// TODO: network_stats
//network_stats.recv_bytes += bytes;
//network_stats.recv_packets++;
bytes = m->msgs[m->pos].msg_len;
*data = (unsigned char *)m->bufs[m->pos];
m->pos++;
network_stats.recv_bytes += bytes;
network_stats.recv_packets++;
return bytes;
}
#else