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 2020-03-13 00:00:00Z and 2020-03-14 00:00:00Z
Avatar
@heinrich5991 why did you use #define GET_INT(integer) (integer) = str_toint(Up.GetString()) instead of Up.GetInt()?
Avatar
because I figured it would be easier to implement for third-party software
14:06
feel free to change it, I think in 0.7 they changed it for the normal protocol as well @Learath2
Avatar
[quakenet] Learath2 BOT 2020-03-13 14:07:21Z
heinrich5991: I have a very tough issue with fixing the protocol compatibility in 0.7, do you have a second to brainstorm?
Avatar
Learath2: what's the issue?
Avatar
Old versions trust m_NumClient to be the amount of clients we send. But we cant know how many clients fit in the packet before we craft it
14:10
I had a very meh idea of crafting the packet until we add num clients, craft the rest of the packet and drop clients until the extra int for numclient fits, however you know that's very ugly due to the way the packer works
14:12
The only two ways I know of to pop off clients is either finding a way to iterate the packer backwards or keep note of the offsets of every client I add, both are ;(
Avatar
returning different server info depending on the requesting client is not an option?
Avatar
@heinrich5991 problem is how many clients we send to an oldclient
Avatar
ah
14:15
remember offset of last client
14:15
after each client check that the int + header + clients still fit
14:15
if not, return previous packet
14:15
(use CVariableInt directly)
Avatar
Oh I'm stupid, I tried handling it after I filled the packet
14:17
Ofc I should handle it during filling it. Thanks @heinrich5991
Avatar
you're welcome 😉
Avatar
Two heads are better then one :P
Avatar
my uni postponed the next semester by one week, corona
14:18
or rather my state (berlin) did that
Avatar
A month for italian unis
Avatar
ah
14:19
do you have other effects? 🙂
Avatar
Well I'm completely stuck in istanbul
Avatar
oh
Avatar
But friends who are stuck on the other side in italy report that the streets are completely empty and the vibe is pretty meh
Avatar
got a sensible computer at least?
Avatar
@heinrich5991 sensible enough for working on some coding
14:21
I don't deserve to play games anyway so I don't mind
Avatar
~~
Avatar
@heinrich5991 how is berlin? Italy is supposedly the worst in europe but idk
Avatar
berlin looks fine
14:23
people go about their day mostly as usual
14:24
large events are cancelled, at least the uni tries to encourage people to work from home
14:24
btw, are you into coding challenges?
14:25
I found some nice ones: https://cryptopals.com/
Avatar
ChillerDragon 2020-03-13 14:25:54Z
@heinrich5991 r u doing the ctf that liveoverflow announced?
Avatar
no, link?
Avatar
liveoverflow is a fun watch, I thought the guy was @heinrich5991 for a while 😛
Avatar
nowhere near that skilled
Avatar
ChillerDragon 2020-03-13 14:27:14Z
Wtf @Learath2
Avatar
oh
14:27
cscg
14:27
I considered participating this year
Avatar
ChillerDragon 2020-03-13 14:28:18Z
I tried but too lazy
Avatar
doit
Avatar
ChillerDragon 2020-03-13 14:28:49Z
The Perl challenge is so frustrating
Avatar
@heinrich5991 he might be more acquainted with ctfs but dont undersell yourself :P
Avatar
you're flattering me, thanks 😛
14:31
I've never really done any serious RE unfortunately
14:31
I should kick myself a little more. I'd love to do some hardware disassembly/RE
Avatar
I'm actually also really interested in some hardware work, especially "security" devices
Avatar
I'd be fine with non-security devices for starters
Avatar
That ring buffer attack on most garage doors was really interesting e.g.
Avatar
given that I have no experience
14:37
ring buffer?
Avatar
Not a ring buffer, soz. A shift register
Avatar
shift register? 🙂
Avatar
Turns out many garage doors out there use a shift register to store the transmitted code, which allows you to reduce the amount of transmissions needed by a whole lot which made all of them very easy to bruteforce
Avatar
I don't know what a shift register ist
14:43
*is
Avatar
Ah, it's a type of register you can shift bits into, and out of one at a time. Like a queue of bits
Avatar
ah
Avatar
Problem was that the cpu was checking the code every time a bit is pushed and not after getting all 12 bits
14:46
You generate a string of all possible 12 bit combinations with overlap and transmit that a couple times instead
14:47
Turns out to be a lot less bits then without overlap. The guy figured it out with one of those logic analyzers
14:47
I think there was a youtube video where he describes how he devised the attack
Avatar
Logs usage of ban, kick and muteid to a discord channel with a webhook !image
Avatar
@Learath2 happen to have the link?
15:01
also @Learath2 mind merging the antibot stuff? ^^
Avatar
@heinrich5991 I'll find you the link when I get home, I'll review the antibot stuff as soon as I'm done with this extended serverinfo patch for 0.7
15:02
@heinrich5991 is there a way to estimate the size of a packed int cheaper then Packing it?
Avatar
just pack it. should be optimized out
15:03
(if you pack it into a buffer that is not used elsewhere)
Avatar
You sure? i'd need to pack it and then subtract the buffer from the end of the packed data, is the compiler clever enough?
15:04
well I guess if any compiler is smart enough it's a C/C++ compiler, those are so aggressive with optimisations
Avatar
cant u assume max size (4 bytes per?) if its only an estimate
Avatar
unsigned char *CVariableInt_Pack(unsigned char *pDst, int i) { *pDst = (i>>25)&0x40; // set sign bit if i<0 i = i^(i>>31); // if(i<0) i = ~i *pDst |= i&0x3F; // pack 6bit into dst i >>= 6; // discard 6 bits if(i) { *pDst |= 0x80; // set extend bit while(1) { pD...
15:07
seems so
15:07
that it's optimized out
Avatar
@heinrich5991 one more little bug and I can review yours, do you know of a way to append a packer to a packer?
15:18
I tried adding the second packer as raw, but that doesn't seem to work :/
Avatar
AddRaw(.Data(), .Size()) (edited)
15:18
should work
Avatar
[quakenet] Learath2 BOT 2020-03-13 15:19:55Z
Ah I forgot to reset the packer
Avatar
the liveoverflow is apologizing for the name
15:20
rightfully so 😛
Avatar
NOOO, old clients don't trust the m_NumClients so the server looks as full as the amount of clients we send
15:21
@heinrich5991 is that an acceptable shortcoming? I don't think I can fix it
Avatar
I guess
Avatar
wasnt this a problem during ddos attacks
15:22
when the server wasnt sending players
15:22
and then not showing up
Avatar
they "fixed" it in 0.7
15:22
so you can't send short packets anymore
Avatar
Well given in the past the server wouldn't even show up if the clients didn't fit in the packet I think this is acceptable
Avatar
when in reality they only helped mitigate dos attacks
15:22
@Learath2 yes
Avatar
i guess im thinking of a different problem then
15:23
but the one i describe is where the client tries to determine playercount by counting the players the server sends
15:23
which doesnt work when the server omits player list under heavy load
Avatar
This isn&#39;t the same extended serverinfo protocol heinrich defines. However the only feasible way to get the entire thing in would be a NETVERSION bump or breaking compatibility. I vote we l...
15:30
Take a look at mine, I'll take a look at yours 😛
👀 1
Avatar
I won't merge yours though(?)
15:31
oy does that
15:33
@Learath2 why do you drop the more-players-packet if it arrives before the main packet?
Avatar
@heinrich5991 because the entry doesn't exist by then and I have no idea how to handle that
15:35
and yeah I know you won't merge, just looking for a review
Avatar
I think™ ddnet handles that
15:35
maybe you can take a look at that
15:36
for the protocol extension, I'd add a UUID, and scan the whole packet for it
15:36
just so that you're compatible with other (possible, unlikely to exist) modifications
Avatar
@heinrich5991 this isn't really a whole extension, I'm not sure if we can extend the protocol without breaking compatibility
15:39
I kept the initial packet the same so the old clients can also use it, I have "giex" for requests from the serverbrowser but that's not really a thing for ingame serverinfo updates, we'd need some way to keep track of the version of the client and whether it supports the new protocol, is that a thing vanilla wants? I'm not sure if oy would merge an extension like that
15:40
@heinrich5991 why do you have a separate ANTIBOT_MAX_CLIENTS? Shouldn't you tie that into the engines MAX_CLIENTS so there is no chance it falls out of sync?
Avatar
I have a separate ANTIBOT_MAX_CLIENTS so that the API doesn't accidentally become incompatible
15:40
hm
15:41
maybe I should add a test that they're the same and add a comment to recompile all anticheat modules if you change it
15:44
given that there are probably no protocol extensions that you could be incompatible with, I guess this is fine
15:44
(re your PR)
Avatar
Your pr LGTM, the last concern I have is how we'll build the official servers
Avatar
how do we build official servers?
Avatar
Currently we just git pull and build, I think we need a new (private)repo for the antibot code
Avatar
nah
15:45
antibot can be built sporadically and the .so can just be copied in after the build (edited)
Avatar
Does this generate an antibot.so?
Avatar
the build? yes
15:46
if you add ANTIBOT=ON to the command line
Avatar
so we just don't copy the one built along with the server and use @noby's module instead
Avatar
yes
Avatar
Great, I don't see any issues then
Avatar
\o/
Avatar
hi ping
15:47
cool to see this geting implemented
Avatar
We still should have a private repo with the antibot code we can all work on
Avatar
currently it's an almost-not-modified version of noby's
Avatar
just includes
15:49
and I believe no one except noby really wants to change that code 😄 @ @noby
Avatar
I can merge this tonight and we can try deploying it. Will add a new script to ddnet-scripts to pull from a repository and build the antibot too
Avatar
i plan on making updates
15:49
ive been constantly updating it for the past couple years rly lol
Avatar
I do trust @noby but I'd still not want to run code we can't see on ddnet servers
Avatar
yes sure
15:50
just a note regarding modification (edited)
Avatar
ye if we make a private repo for the 3 of us or whichever other admins then its fine as long as the code never leaves that repo
Avatar
Github private repo?
Avatar
would work up to a couple of members, not as a subrepo of ddnet though
Avatar
i use gitlab since free private repos
Avatar
Yep, I could own the repo, ddnet org doesn't have private repo allowance
Avatar
oh, you even have a subscription (edited)
Avatar
nah, I'm a student
15:54
we could host the repo on gitlab aswell if you prefer that
15:55
(I'm a student for atleast 2 more years so that'd be the lifetime) 😛
Avatar
its about the same right
15:56
other than offering free private. repos
Avatar
yes, github too, for up to three (four?) collaborators
Avatar
is that new
15:57
i only moved from gitlab to github because of the private repos thing
15:57
if yall can do it on github then fine by me
Avatar
Okay, I'll create the repo on github, add y'all as contributors
15:58
so when i make fixes to the anti bot code
15:58
i will push them there? and theyll be added whenever is next convienent time
Avatar
exactly
Avatar
sounds good
Avatar
can we push our glue code there, as well?
Avatar
glue code?
Avatar
@noby
15:59
yea, glue code from the other side
15:59
the code was fucking entangled 😛
Avatar
like the code that connects the
15:59
lol
Avatar
well it'd be nice if you could use the .so on your servers aswell @noby
Avatar
yes heinrich made stuff a lot cleaner in the interface
16:00
lol
Avatar
@Learath2 private repo when
Avatar
and at some point i wana use wat he did
16:00
on blocker at least, fng is a different repo cus laser stuff
Avatar
I mean I could try to help you with that code as well, if you want
16:01
so we can have one unified codebase
16:01
❤️
Avatar
@noby what is your github name?
16:01
nobody-mb has 13 repositories available. Follow their code on GitHub.
Avatar
@heinrich5991 you can push whenever
16:03
I have horrible rebound rhinitis and it's giving me headaches :/
16:06
@heinrich5991 how could ddnet handle the main packet not arriving first?
16:06
Do you queue up the packets based on NETADDR or sth?
Avatar
storing the players for that IP address
16:06
no
Avatar
I see no easy way to do that
Avatar
3c64bed .gitignore shared libraries - heinrich5991 a3163c5 Add support for dynamically loading an antibot module - heinrich5991 fdf7e4e Merge #2081 - bors[bot]
Avatar
🎉
feelsamazingman 1
Avatar
@heinrich5991 let me try building this on the server
17:16
see if it loads antibot null
Avatar
@Learath2 I already modified stuff on ddnet.tw
17:16
go there plx
17:17
(only added flags, maybe to git clean if you want a clean slate)
17:17
ah, be careful with git clean I guess
17:17
😄
17:17
git checkout -- build.sh
Avatar
I'm trying it out on ddnet.tw btw
17:18
just there for now
Avatar
k 🙂
17:19
food
Avatar
@heinrich5991 ddnet.tw:8370 now runs antibot null
Avatar
@heinrich5991 all the servers are going to be running antibot null in a second, but there is an issue
17:45
the server binary links to libantibot.so in the src folder, seems it is linked with absolute path, you need to do sth there to not do absolute paths but I'm no dynamic linkingwizard
17:47
ddnetger ldd DDRace64-Server_sql | grep antibot libantibot.so => /home/teeworlds/src/master-build/libantibot.so (0x00007f174f4ff000)
Avatar
@heinrich5991 other servers won't load the antibot or the debug message is somehow getting lost, I need to go
17:58
please take a look
Avatar
It compiled fine and I checked that it also linked fine and it can find the dynamic lib, checked it through ldd
18:03
And if I run the server manually it does load the antibot, however if i let the server restart it wont
18:03
Couldnt figure it out and had to leave
Avatar
ChillerDragon 2020-03-13 18:33:12Z
Is antibot also on 0.7 servers? 🙂
Avatar
@ChillerDragon no. antibot isn't really on 0.6 either, it's just a test phase right now
18:55
the changes needed can be seen here: https://github.com/ddnet/ddnet/pull/2081
Support for this feature is turned off by default. This feature allows to integrate with noby's anticheat feature.
Avatar
@heinrich5991 I think it broke something and I dont have my laptop with me, can you please take a look?
Avatar
I only have a couple of minutes
19:01
@Learath2 restart doesn't work, you say?
Avatar
Restart doesnt work but more importantly @nexusrf says votes are broken
Avatar
~~
Avatar
I think you should just roll it back if you dont have the time to diagnose
Avatar
what to do to rollback?
19:03
./build after checking out the commit?
Avatar
Yeah votes are broken, i can't change map rn
Avatar
@Gwendal server, port?
Avatar
@heinrich5991 I think so, am not completely sure
Avatar
ddnet ger 8309
Avatar
@Learath2 change is applied everywhere?
Avatar
jao tested with admin command and it didn't work aswell
Avatar
looks like a crash on map change
19:05
will roll back
Avatar
I think I have a build-fixup.sh there for this occasion
Avatar
looks good, ty
19:08
@Learath2 what do I need to do after executing this script?
19:10
nothing, I guess
Avatar
Can you check the script, im not a 100% sure if i do the copying
Avatar
you do
19:11
checked the script
Avatar
Thanks, had to leave urgently
Avatar
@Gwendal ger2 should be fine now, can you check? maybe try twice
19:12
1st time didn't work
19:13
ok
19:13
2nd worked
19:13
thanks!
Avatar
nice, ty
19:13
k, empty servers restarted, should be good now
19:14
classic "didn't test the map change" bug from me 😦
19:14
sorry
19:14
I should add that to the test suite
Avatar
I wonder what the crash is, you dont seem to change anything relevant
Avatar
the server crashes after the map change
19:14
probably some data structure in the antibot that thinks some player is still there
19:16
will take a look tonight, have to leave now
Avatar
ye it just go back on the map that was here before voting
19:21
and it says u got timeout
Exported 267 message(s)