Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2018-10-12 00:00:00Z and 2018-10-13 00:00:00Z
Avatar
mem_copy(&pPacket->m_aChunkData[pPacket->m_DataSize], &SecurityToken, sizeof(SecurityToken));
07:31
m_aChunkData is a unsigned char
07:31
and securitytoken is a int
07:31
is securitytoken never over 256?
07:31
or how this works
Avatar
it probably just interprets each of the four bytes of the integer as separate characters
Avatar
why not use a variableint for this
07:32
i guess...
07:32
but if it would do that
Avatar
if securitytoken is 0x11223344 then chunkdata = { 0x11, 0x22, 0x33, 0x44
Avatar
a variableint would be better i think
Avatar
or reverse if endian
07:32
idk how variable int works but thats how memcpy works
Avatar
variableint is whats used to pack ints
07:33
idk why it doesnt use it on security token
07:33
07:33
it uses memcpy
Avatar
so i guess securitytoken is never over 256
07:34
or i dont understand
Avatar
it separates it to 4 bytes?
07:34
with magick
07:34
?
Avatar
[2:32 AM] onby: if securitytoken is 0x11223344 then chunkdata = { 0x11, 0x22, 0x33, 0x44
Avatar
u sure memcpy does that
Avatar
with pointer arithmetic i believe memcpy typecasts everything to some char type internally
07:34
im almost 100% sure
07:34
it might be the opposite order but same idea
Avatar
i could do that
07:35
but i dont know if i have to do it big endian or little endian
Avatar
whats wrong with how it works currently
Avatar
or system endianness?
07:35
nothing, i want to know endianess used for this
07:35
now
07:35
xD
07:35
system endianess?
07:35
what if server is big endian
07:35
and u little endian
07:35
i dont understand
07:36
variableint solves that
07:36
from what i read here
Avatar
unsigned char a[4] = { 0 }; unsigned int b = 0x11223344; memcpy(a, &b, sizeof(b)); printf("%x %x %x %x\n", a[0], a[1], a[2], a[3]); prints 44 33 22 11
07:37
xd
Avatar
u are little endian
07:37
most systems are little endian nowadays
Avatar
ok so ill do that
Avatar
ive never seen a big endian system before
07:38
i know it exists but still
Avatar
struck.pack on python
Avatar
i want to make a headless client on python
07:38
and learn machine learning
07:38
xddd
Avatar
why not c++? sounds cool tho
07:39
i think python is better for this
07:39
cuz its more used in scienctific things
07:39
or idk
07:39
anyway im using python
07:40
this famous ml lib uses python
07:40
are u making a bot troll
Avatar
im making the smartest bot
07:41
troll
Avatar
tho first i have to get through actually connecting to a sv xd
07:42
yesterday spent 2 hours porting huffman
07:42
pain
Avatar
i made a ~800 line textonly client but its kinda fucky
07:42
but c++ so i could copy everything from tw that i needed lool
Avatar
but u used teeworlds code right
07:43
yeah
Avatar
i guess security token is always packed with 4 bytes even if it doesnt need to?
Avatar
yes sizeof(securitytoken) always same size
Avatar
im just gonna ask this here
🇺 2
07:48
does anyone know how does teeworlds apply color to a tee
Avatar
with love
Avatar
settings->tee
Avatar
...
Avatar
like the game code
07:49
does it apply some kind of a mask or what
07:49
and how does it get color codes
Avatar
u mean how is the color stored? or sent? or rendered?
Avatar
rendered
07:49
idfk lol
Avatar
blend?
07:50
idk
07:50
i didnt see much rendering code
07:50
maybe look at the opengl shaders or smth
Avatar
or look at src/base/color.h ?
Avatar
lemme try somethin
Avatar
@Aleksandar vec3 CSkins::GetColorV3(int v) { return HslToRgb(vec3(((v>>16)&0xff)/255.0f, ((v>>8)&0xff)/255.0f, 0.5f+(v&0xff)/255.0f*0.5f)); } vec4 CSkins::GetColorV4(int v) { vec3 r = GetColorV3(v); return vec4(r.r, r.g, r.b, 1.0f); } (edited)
Avatar
thats helpful
Avatar
@noby cancer
Avatar
const int TeamColors[2] = {65387, 10223467}; if(m_Team >= TEAM_RED && m_Team <= TEAM_BLUE) { m_RenderInfo.m_ColorBody = g_GameClient.m_pSkins->GetColorV4(TeamColors[m_Team]); m_RenderInfo.m_ColorFeet = g_GameClient.m_pSkins->GetColorV4(TeamColors[m_Team]); } (edited)
Avatar
kinda
Avatar
@noby use triple backsticks
Avatar
also yeah triple backticks xd
Avatar
@noby no u
Avatar
now im trying to apply some color to a tee in css
Avatar
anyone knows if the high res time from time_get() on system.h is in ns or s
07:56
@noby !
Avatar
it depends on ur OS
Avatar
but how it stores at the end
07:56
teeworlds
Avatar
on mac it is long long time_freq() { return 1000000000; } on linux it is long long time_freq() { return 1000000; } and then windows is sum other shit
Avatar
windows is this
07:57
it uses this
07:58
ill just use ns on python
Avatar
@noby
troll 2
08:15
tw code xD
08:15
i saw this
08:15
in network.cpp or something right
Avatar
network_conn
Avatar
@noby on a ringbuffer u append or prepend new data?
08:18
i guess append
Avatar
i think append makes more sense right
08:19
then u can start from the bginning
08:19
i havent done too much with ring buffer tho
Avatar
this is my ringbuffer on python
08:20
so ez
Avatar
thats it?
08:21
a deque with max length
08:21
if u append and it goes over max len it deletes first
08:21
i ws wondering how it was a ring lol
08:21
ringbuffer.h on tw
08:21
its lot more code tho xD
Avatar
yes i saw xd
Avatar
lucky i dont have to implement it
Avatar
neither do i because i stole the code troll
Avatar
well in case you still need to do the master/server info stuff for your python client: https://github.com/DaRealFreak/Teeworlds-ServerInfo
small module to retrieve the registered servers from the master server and request the player information of each server. - DaRealFreak/Teeworlds-ServerInfo
Avatar
teeworlds 0.7 release when??
11:22
its fridaythonkery
Avatar
@Dev so what exactly happened to ddnet in 11.4.4? the client gets this freeze on almost done loadign the browser for 4 times. but since i updated to 11.4.4 its also on older clients. how is it connected and when will it be fixed?
Avatar
I'm guessing it's because of the master server issue
11:43
It'll probably be fixed when one of us can reproduce it and profile it.
11:44
I'd also be up to fixing it if someone gets me some profiling data
Avatar
@noby found more gold
Avatar
hahhahaha
Avatar
@Learath2 what do you need?
Avatar
@Ryozuki xd
11:49
@noby
Avatar
Well you can try gprof
11:49
Avatar
@Learath2 whats gprof?
Avatar
good profiler
11:50
for linux
Avatar
@noby coder was not smart when he did it apparently
Avatar
in case u cant tell by the code
Avatar
@Learath2 dont you have that issue?
Avatar
Nope. But it might just be that all the computers I have are too strong for it to be noticable
Avatar
i have a pretty good computer aswell, wonder how that could be the difference 😄
Avatar
I also compile my own copy of the client. That could be it.
🤖 2
Avatar
for me its also on self-compiled client
Avatar
Release profile?
Avatar
but maybe because 11.4.4 fcked something up, as i said now older clients from me have it too.
11:53
yes, sure
Avatar
If the older clients have it too I doubt its a client issue at all
11:54
Maybe we have a blocking network call somewhere
Avatar
but its somehow introduced in 11.4.4
11:54
and: ive used a seperate config directory for the older client i tested
11:54
it was 11.3 or so
Avatar
Bugs are not infectious diseases :P
Avatar
what do you mean by that?
Avatar
If the bug was introduced in 11.4.4 it cant affect any version before.
Avatar
how is it possible then? 😄
11:57
oh
11:57
wait a sec learath
Avatar
That's why I said maybe its the DoS on the masters and we have a blocking network call somewhere
Avatar
its not about pc speed
Avatar
i dont know what i did yesterday, but ive just tested it with 11.3.1 again and it seems like there are no freezes
Avatar
my pc is new too
11:58
if, then network
Avatar
Well doesn't happen on mine. Could be network
11:58
Maybe you disabled gfx threaded?
Avatar
nah xd
11:59
well my network isnt bad either
11:59
but could be the routing
Avatar
i might be on to something
12:00
give me 5 minutes
Avatar
have u turned off all filter @Learath2 ?
12:00
so all 600servers showing
Avatar
I'm outside now
Avatar
ok
Avatar
But yes I had unchecked it
Avatar
mh ok
Avatar
At which stage does it seem to lag?
Avatar
at the end
Avatar
While sending out the serverinfo requests? Or initially talkikg to the masters?
Avatar
more when all servers are loaded already
12:02
thats why i wondered if there is some request to the master server that is blocking
Avatar
Hmm maybe the bubblesort?
Avatar
well the profiler shows that
12:03
but i never had this insane lag before
12:03
11.3
12:03
was it altered lately?
12:03
Well you could try not sorting the serverlist
Avatar
yeah the lag is smaller but still there
12:07
got it
12:07
sec
Avatar
its the sorting for sure
12:08
but the question is what was different in 11.3
Avatar
maybe its because all servers are filled up with those spoof tees?
Avatar
you mean client side?
Avatar
maybe the client sorts the players from the serverinfo?
Avatar
yes
12:10
thats why i wonder
12:10
if they are added client sided
Avatar
okay so
Avatar
then this would be the reason
12:10
bcs the lag happens if i sort to player count
Avatar
i have this issue also on older clients. if i use my normal config directory.
12:10
i have many friends added and that seems to affect it a bit
Avatar
i also noticed the lag, i always sort by player count
Avatar
and if i use a plain settings file there is no such freeze
Avatar
i dunno @fokkonaut i use 11.3 and 11.4 right now both same config
12:11
lag only happens in 11.4
Avatar
for me also on 11.3.1
Avatar
i mean a very smal lag is ok
12:11
some kind of
12:11
but in 11.4 its insane
Avatar
no its not related to sorting by players
12:12
that would be strange indeed
Avatar
but i get less lag if i sort to server name
Avatar
my guess is that its just always sorting the player list for each server and thats causing the lag since the spoof attack
Avatar
this bug definitely has to do with the spoof
Avatar
it's for sure the sorting
Avatar
if you turn on every single filter, thereare no freezes
Avatar
but why not in 11.3 @timakro testing right now
12:13
was there a client side change?
Avatar
let me test older versions as well
Avatar
@timakro for me its also in 11.3.1
Avatar
compiling 1.13 ...
12:15
11.3*
Avatar
and @Deleted User i noticed if you have every filter enabled (or almost every) and refresh and then untick some AFTER you have refrshed, the lag will happen then
Avatar
yeah that would make sense if the sorting happens again
Avatar
@Deleted User dont you have that bug in 11.3?=
Avatar
i mean the sorting is shit, a small lag is legit
12:16
not that strong
12:16
just the normal fps drops
Avatar
i will give you my config, try it again
Avatar
in 11.4 i have freezes
Avatar
i will profile it with valgrind
Avatar
well i did too, it showed the sorting algorithm
Avatar
yes same problem on 11.3
Avatar
it's funny that you seem to have the same lags, on 11.4 i get much stronger ones xD
Avatar
@timakro did you test with default config or your own?
Avatar
if they would have been in older version i would have noticed i think
Avatar
for me the lags began with 11.4.4, also on older clients. but maybe because in that time the spoofing began again
Avatar
my own
Avatar
@timakro try with default (edited)
Avatar
yes the attacker didn't fill up the servers all the time
Avatar
and this bug only happens on the INTERNET tab
Avatar
never tried ddnet with valgrind
12:20
cant get it to work
12:20
oh maybe just super slow
Avatar
yeah
12:20
its insanly slow xD
12:20
because SDL leaks too much xd
Avatar
wow i have like 2 fps in the menus
Avatar
NASA PC
Avatar
well got a 4 core 3.2ghz Phenom processor
Avatar
for my ancient motherboard
Avatar
@fokkonaut what CPU do u have?
12:24
maybe u don't notice the difference between 11.4 adn 11.3
Avatar
Intel Core i5-7500, 3.4ghz
Avatar
mhh so also pretty old
12:24
or weak
Avatar
its good
12:24
1.5 years old
12:24
or max 2
Avatar
but could be your RAM too
Avatar
have 16gb
Avatar
but what speed /latency xd
Avatar
what u mean
Avatar
nvm dude
12:25
its just weird that i am pretty sure 11.3 runs better
12:25
i also tested clang instead of gcc to be sure its not some compiler optimazation missing
12:26
12:27
getfriendstate looks pretty bad
Avatar
as i said, removing all my friends did work better
Avatar
aaaah, it's probably iterating over all players to find friends
Avatar
indeed
Avatar
yeah, should be optimized with the ongoing attack
12:30
I had a similar problem wiht ddnet.tw/status getting slowed down 😃
Avatar
hmm i tried just returning 0 from that function but it doesnt fix it completely
12:30
i'll try the skin scan as well
Avatar
but @deen why should 11.3 run smoother? lol
Avatar
it doesnt for me at least
Avatar
but your callgrind looks also different
12:31
12:32
mine shows alot more usage in the filter
Avatar
this filteredbla...?
Avatar
well the sort already
12:32
in your case the two threads just run differently or smth
12:33
or the start just took to long for u xD
Avatar
depends on what you do while its running probably
12:33
it took forever
Avatar
so it could be that for u both lag, but you dont notice 11.4 lags longer xD
12:34
that's the only explaination i would have tbh xd
Avatar
ok so i tried not running the functions
  • the friends function GetFriendState was a huge improvement
  • the skin function SkinScan changed nothing i could notice
still it doesn't fix it completely for my pc
12:35
are you sure you tested 11.3 with the attacks going on
Avatar
@timakro you have gfx_asyncrender_old 1 I hope
Avatar
its 1 for me yes
Avatar
what is that setting?
Avatar
i tested both right now
Avatar
0 could make the GUI rendering wait for CPU thread to be done
Avatar
it's either a new compiler version or new code
12:37
i use the website releases
12:37
i compiled myself with clang and gcc
12:37
11.3 runs better
12:37
and i made sure im in release build xDDDDDD
Avatar
tbh i didn't pay attention to how bad it is really
12:38
but i have the problem in both versions
12:40
quick fix would be just not doing the friends check for "(connecting)"
Avatar
ill try that
Avatar
The magic scripts that make DDNet run. Contribute to ddnet/ddnet-scripts development by creating an account on GitHub.
12:41
😉
Avatar
The magic scripts that make DDNet run. Contribute to ddnet/ddnet-scripts development by creating an account on GitHub.
12:41
actually that one
Avatar
is that the website serverstatus?
Avatar
e02a995 Remove unused cl_eventthread - def-
Avatar
i don't remember the lag beeing that bad, whats going on
Avatar
@Deleted User did you check that the compiler flags are the same when compiling? Otherwise I guess some new feature made it worse
12:45
or how bad it is varies over time, depending on how many servers are getting attacked right now
Avatar
i'm not sure anymore if that fix works at all, now its terrible i feel like its getting worse each time i test
Avatar
there is a "filter connecting players" in client already btw
Avatar
yes
12:50
its seems to be on default
Avatar
so that was changed xD
Avatar
does it help though?
Avatar
11.3 does have it
12:50
thx
Avatar
it helps by not showing you thousands of (connecting)
Avatar
now i can die in peace
12:51
doesnt*
Avatar
why is it turned off for you in 1.14?
Avatar
its on
Avatar
but 11.3 doesnt have the option
12:51
that's probs the root of the lag
Avatar
but
12:51
it's no difference if on or off
12:51
in 11.4
12:52
in perfoirmance ofc
Avatar
you can also turn it off and it doesnt refresh players and it just shows (connecting)
12:52
it might just be about whats displayed and not stop those heavy calculations
Avatar
well but when i turn it off, shouldnt the behauvior be like in 11.3?
12:54
the flags are the same @deen
12:56
That's the change
12:56
I guess calling FilteredPlayers() at all is already expensive
12:56
Maybe we should rather store m_NumFilteredPlayers
Avatar
yeah
12:56
i saw that too now
Avatar
I guess that explains why people have slower server browser :/
12:57
all my fault
12:57
your NASA pc is just too strong for tw players
Avatar
its a joke for a good pc xD
Avatar
I'm not running DDNet client on the multi-million dollar servers at work 😄
Avatar
haha who knows ^^
Avatar
but yeah, my CPU is overclocked, so single threaded is probably fast enough that I didn't notice
12:59
developers should always have slower machines than users to make sure something like that doesn't happen 😄
12:59
Someone want to fix it?
Avatar
nice, so i have the perfect conditions to become a developer
Avatar
:o i have a nice pc
13:01
@timakro lot of ppl doesnt even have a dedicated gpu and u got one (edited)
13:01
monkaS
Avatar
can you create a virtual computer setup as long as its slower than your real PC? 🤔
Avatar
@deen how many cores and what frequency?
Avatar
It's only an i7 6700k locked at its turbo frequency, so 4 cores at 4.2 GHz
Avatar
you still have the casing which doesn't need fans?
13:04
1 CPU fan and 1 PSU fan is all I have
Avatar
okay now i figured out what was going on with my testing i think
13:05
not sure sec
13:06
i think i upgraded during my tests to your commit and then it became terrible ^^
Avatar
it's probs RAM bound anyway
13:07
too much data to sort
Avatar
okay so reverting deens change (or fixing it) + the GetFriendState fix are good for me
Avatar
@deen How would you implement this differently?
13:13
your chang
13:13
e
Avatar
calculate it once and store it
13:13
instead of recalculating all the time
Avatar
all the time?
13:14
you mean that?
13:18
@deen I don't have the lag "all the time" it stops after a few seconds
Avatar
all calls to FilteredPlayers()
Avatar
oh i get it now, saving it on the serverinfo struct
Avatar
small question: since the ddos I'm getting no results from the master servers or always between 0 and 2 The data I've got f.e. is (lis2 packet) b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfflis2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff3\xfe\xb7\xf9 l' does anyone have a hunch why I'm only getting 0-2 while the vanilla client or ddnet client still finds all servers? (edited)
14:00
sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) sock.setblocking(False) ... sock.sendto(packet, (server.ip, server.port)) I'm getting normal responses and it worked before the ddos without any problems, it looks like it would get filtered to me but not sure how (edited)
14:00
https://status.tw/?p=services has the same problem, worked fine before the ddos started
Avatar
different source port?
14:27
ah, you're using python
14:28
check in wireshark/tcpdump how the packets differ
Avatar
same happens with the php port $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); socket_set_nonblock($sock); ... socket_sendto($sock, $packet, strlen($packet), 0, $server->getAttribute('ip'), $server->getAttribute('port')); but yeah guess I'll have to check for differences after work even though it's strange that it happens only since the ddos on the master servers
Avatar
So what was it?
Avatar
no 0.7 yet 😦
Avatar
@fokkonaut
Avatar
guys
18:49
ive already seen it @heinrich5991
Avatar
yea, me too. 0.7 is out 🙂
Avatar
@fokkonaut where oy says he will release it?
Avatar
in a forum thread
18:50
it's called "RIP Teeworlds"
18:51
@heinrich5991 is it going to get released tomorrow?
Avatar
ask oy
18:54
@heinrich5991 no more admin?!
Avatar
?
Avatar
you dont have the admin tag
18:56
role*
Avatar
yes. it involved too much work
18:58
and also too much demands from community members, and people being toxic to me without me doing anything against it
18:58
I think I'm happier now
Avatar
@heinrich5991 keep in mind, you can't please everyone
Avatar
is that a fake screenshot?
Avatar
no its real
Avatar
it still says 0.6.4 for me
Avatar
Cellegen | HU 2018-10-12 20:24:04Z
0.7 feelsamazingman feelsamazingman
20:25
nobos refresh the domain
20:25
kappa i dont see it too monkaS
Exported 466 message(s)