C++
CMsgPacker Msg(NETMSG_PING, true);
Here true
stands for a system message. Where false
would mean game message. This is used all over the code base I don't think its very descriptive.
Nicer would be
C++
CMsgPacker Msg(NETMSG_PING, MSG_SYSTEM);
The msg packer could accept an enum class as argument or we could also use something more hacky like
C++
#define MSG_SYSTEM true
#define MSG_GAME false
u8
s malloc
is used 1 11080
1 12001
1 12060
1 13002
1 13565
1 14001
1 902
2 0.7:15050
2 10034
2 12091
2 13001
2 13097
2 14071
2 15023
3 12092
3 13022
3 14010
3 15011
3 15025
3 15444
4 15012
5 20000
6 14051
6 15024
6 15032
6 15060
8 15040
10 14032
11 15013
16 15005
23 15062
23 15090
24 15054
51 0.7:-1
58 15070
61 15080
111 15081
3874 15091
#!/bin/sh
counts_file="temp_counts.txt"
> "$counts_file"
for i in $(cat ~/servers/all-locations); do
ssh $i.ddnet.org "
filtered_lines=\$(grep -A3 'server: player has entered the game.' servers/servers/*log* | sort | uniq)
filtered_lines=\$(echo \"\$filtered_lines\" | grep 'version=')
echo \"\$filtered_lines\" | sort | awk -F'version=' '{
count[\$2]++
}
END {
for (version in count)
print version, count[version]
}' | sort
" >> "$counts_file"
done
awk '{
version = $1
count = $2
counts[version] += count
} END {
for (version in counts)
print version, counts[version]
}' "$counts_file" > temp_output.txt
while read -r version count; do
echo "$version was found $count times" >> results.txt
done < temp_output.txt
rm "$counts_file" temp_output.txt
ddnet: cid=2 version=<version>
occurs in our logs? ^^cid=2
? ^^*.log
and *.log.old
but not *.log.tmp
?*.log *.log.old
servers/servers/*.log servers/servers/*.log.old
ddnet for i in $(cat ~/servers/all-locations); do ssh $i.ddnet.org "echo $i; grep -E 'ddnet: cid=[0-9]{1,2} version=903' servers/servers/*.log servers/servers/*.log.old" | wc -l; done
Out:
379
50
266
700
3194
2604
6
55
53
14
7
28
12
20
30
76
78
28
68
63
37
1574
36
4
16
7
9
9
6
Sum: 11,494
(edited)ddnet for i in $(cat ~/servers/all-locations); do ssh $i.ddnet.org "echo $i; grep -E 'ddnet: cid=[0-9]{1,2} version=903' servers/servers/*.log servers/servers/*.log.old" | wc -l; done
Out:
379
50
266
700
3194
2604
6
55
53
14
7
28
12
20
30
76
78
28
68
63
37
1574
36
4
16
7
9
9
6
Sum: 11,494
(edited)ddnet for i in $(cat ~/servers/all-locations); do ssh $i.ddnet.org "echo $i; grep -E 'ddnet: cid=[0-9]{1,2} version=[0-9]+' servers/servers/*.log servers/servers/*.log.old" | wc -l; done
$ grep -Er "ddnet: cid=[0-9]+ version=903$" | cut -d = -f3 | wc -l
193
175
* xd*.log
and *.log.old
but not *.log.tmp
? *.log*
--exclude=*.log.tmp
if you want to keep the ending wildcardrm -f
*.log
and *.log.old
but not *.log.tmp
? grep *.log{,.old}
NETMSG_INPUT
message is already packed and flushed in the CClient::SendInput
function.
Closes #8408.