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-04-27 00:00:00Z and 2020-04-28 00:00:00Z
Avatar
ChillerDragon, are you there?
Avatar
9fcf4db Fix string interpolation mistakes - Learath2
Avatar
@deen ^^ when you are around pls
Avatar
@Learath2 hi
Avatar
@deen can you check error.log? I think I broke something with that
07:14
Ah, that should have been an elseif not an else if
07:15
hm, shouldn't need to be
Avatar
dea35dc Fix teehistorian/index.php - def-
Avatar
@Learath2 ^
Avatar
oh the stupid closing brackets, I wonder why my IDE didn't complain at all
Avatar
^[0-9a-fA-F]{8}\-(?:[0-9a-fA-F]{4}\-){3}[0-9a-fA-F]{12}$ is probably a better regex for uuids
Avatar
you don't need to escape - outside of [] and not at the start/end of [] (edited)
Avatar
^[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ even better
Avatar
[\da-fA-F]
Avatar
[[:xdigit:]] 😛
09:40
lucky with grep u can use -E
Avatar
you don't like posix character classes?
09:41
its ugly
09:41
imo pcre is the best regex
Avatar
PCRE has posix character classes
Avatar
but most of time u dont need them
09:43
This crate provides a library for parsing, compiling, and executing regular expressions. Its syntax is similar to Perl-style regular expressions, but lacks a few features like look around and backreferences. rust regex
Avatar
You never need them, they can make regex easier to read sometimes
Avatar
why most languages cant implement a full pcre
Avatar
I think php and ruby are pretty complete pcre implementations
Avatar
backreferences are bad™ because they make the expressions no longer regular in the cs sense
09:49
that means they are no longer guranteed to run in linear time
09:49
(PCRE backreferences have exponential worst case)
Avatar
hm, is it because with regexes are supposed to be equivalent to some DFA and with backreferences we can no longer map it to a DFA?
Avatar
yes
Avatar
s/with//
Avatar
the name comes from CS, "regular languages" are exactly those that can be accepted by a DFA
Avatar
I wonder how regex engines handle backreferences
Avatar
backtracking
Avatar
backtracking as in actually going back to when the match first happened?
Avatar
no, backtracking as in "brute force with backtracking"
09:56
try to greedily match the regex, if it doesn't match, backtrack to the first position where you made a choice and make the next possible choice
Avatar
hm, what choice are they making?
Avatar
(a*)*
09:57
aaaaaaab
Avatar
ah, how much to match
Avatar
yes
09:58
(this is an example where PCRE chokes btw)
09:58
yes, this one is artificial, but people have been bitten by exponential regexes before (e.g. stackoverflow)
Avatar
I see, I wonder if someone came up with a smart way to do non-regular expressions decently efficiently
Avatar
On July 20, 2016 we experienced a 34 minute outage starting at 14:44 UTC. It took 10 minutes to identify the cause, 14 minutes to write the code to fix it, and 10 minutes to roll out the fix to a...
Avatar
This is what happens when you get too comfortable with features like these
Avatar
with linear-time regex engines, you don't have to worry about it
Avatar
I always assume a regex match is an order of magnitude more expensive then a more traditional approach
10:03
Sure that means I use less regex in my code, but whatever, I'd rather have predictable performance
Avatar
linear-time regexes give you that predictable performance
Avatar
yes, but say we use a linear-time regex engine on ddnet, then I decide to parse something in js and copy over that regex
Avatar
yea
Avatar
suddenly my linear-time regex can become an exponential cost 😛
10:05
impressed by the response time by SX btw
Avatar
34 minutes is impressive, indeed
Avatar
They probably have some builtin profiling somewhere in the code, it'd be impossible to track it down blind
10:06
or maybe some tracing of calls into the underlying engine
Avatar
my nginx will pass PHP_AUTH_USER just fine, the one on ddnet.tw wont
10:39
now it decided it'll start to pass it along
10:39
wtf?
Avatar
hmmm 😄
Avatar
ah another http header oddity
10:45
yay to not upgrading decades old software because dinosaur forgotten servers we should still be able to connect to
Avatar
elaborat
10:47
e
Avatar
hm, now that I think about it it's more of a PHP oddity
10:49
as soon as you send 1 header, php will no longer touch the headers
10:49
they are all your responsibility
Avatar
792b5fb Don't return direct links if called indirectly - Learath2
Avatar
maybe we should not be sending commits to branches to github
12:10
s/github/discord/
Avatar
Guys, I have weird problem / bug related with game.png image. With the default one, if I am in freeze, there are only two rows showing the health & shields bar. If I use custom one, done properly, dilated, without any additional images anywhere on it, I somehow have 3rd row of unknown thing
13:13
Avatar
is it bullet's sprite ?
Avatar
I have no idea, but either way, I didn't draw any additional stuff on the game.png, so I have totally no idea why anything is appearing in there
13:19
...to make it funnier, I just realized that if I don't dilate the game.png, this thing is not appearing .-.
13:21
ok, it's more complicated than that
Avatar
ok, the answer is it takes the last pixel at bottom right edge, so there has to be at least 1px space from the edge... but why?
Avatar
@Learath2
13:36
U can help?
Avatar
@Deleted User write with what already
Avatar
u can ban players in game?
Avatar
ask @Moderators
13:39
or simply write who does what on #general including server ip & port
Avatar
wrong channel
14:05
i have this one muted
14:05
dont ping mod here
14:06
general only. not a proper channel but showroom if you want to add an image to it (edited)
Avatar
@Soreu is this u lol
Avatar
only #general, not #showroom
Avatar
@noby umm, yep. Out of boredom checking all old DDNet clients for when that started appearing & when it changed. but older versions get banned from DDNet & KoG servers so tried on ur xD
Avatar
not 'older versions' but 708 specifically
14:09
and a few other old ones
Avatar
I'm going thru every single one of old DDNet
14:09
:P
Avatar
lol he wanted to bot
Avatar
If i'd want to bot, I would use better clients than DDNet 7.8.2
14:10
hmm, that got me wonder for how long I might got banned on KoG now think_bot
Avatar
dont they autokick
Avatar
didn't look that closely on the info
14:11
xd
14:12
either way, guess I have to start checking on local server now xd
Avatar
bot on lan server think_bot
troll 2
Avatar
shouldnt u try to test them by bisecting
14:13
find the halfway point between version 1 and newest and test that
14:14
then if it works try finding the halfway point between that and newest and repeat
Avatar
yeeaaa, but I'm seriously bored
Avatar
do something useful
Avatar
doing. Trying to find when that bug started appearing
Avatar
if ur gonna get banned, at least get banned while ur actually botting zzzz
ban 1
Avatar
do it properly
14:17
ok. shit won't work that way
14:17
on local server I don't have that 3rd row
14:17
wtf even
Avatar
try on vanilla server
Avatar
but why I have it on KoG, DDNet, but not local srv from latest version?
14:18
just wtf
Avatar
local server is ddnet too?
Avatar
@Soreu it's configurable
Avatar
@heinrich5991 huh?
Avatar
okay, maybe I skimmed too much
14:20
the autoban is a configuration option
Avatar
ah, that part
14:20
xd
14:21
anyway, I still don't get how comes I have it on official servers, but not on local one
Avatar
try on ctf
Avatar
in latest client I have weapon bullets here (CTF3)
14:22
in old af client too
14:23
and they do show poperly
Avatar
for every weapon?
Avatar
pistol, sg, laser, rocket
14:24
since that bug appears in freeze, i guess it's related to ninja
14:24
and can't test this one here
Avatar
on some dm1 servers there is ninja at the top
14:27
I think it actually might be bug related to KoG servers
Avatar
...because I just noticed (ye, i'm smart today) that I actually don't have it on DDNet servers
14:29
only on KoG's
14:29
weird
Avatar
second thing I noticed is that I should have made backup of client settings before lanching older ones
Avatar
does that mess up the cfg
Avatar
binds for sure
Avatar
I think only everything but binds
Avatar
but some binds also changed, especially the kp_ ones
14:43
792b5fb Don't return direct links if called indirectly - Learath2 4fea65d Merge pull request #20 from ddnet/th-final - def-
Avatar
wrote to Qshar, maybe he has idea what they messed in the server code about displaying ammo xd (edited)
Avatar
@deen ^^ :/
Avatar
hm, @deen how familiar are you with nginx? am I not passing the header correctly?
Avatar
what's wrong with it?
Avatar
@jao how do you generate the backups of the testing channels?
Avatar
@deen it won't pass the real host in X-Forwarded-Host
Avatar
proxy_pass http://localhost:17175; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_read_timeout 86400; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @Learath2
21:55
this is for a websocket i have
Exported 168 message(s)