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 2021-01-25 00:00:00Z and 2021-01-26 00:00:00Z
Avatar
I cant tag you chillerbot
Avatar
i think u just have to say ChillerDragon
Avatar
just like in teeworlds ChillerDragon
Avatar
ChillerDragon: stop irc
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 08:53:09Z
henlo @cgt
08:53
can we chat somewhere non here?
11:46
d39a179 Improve error messages when you can't join team - def- aa43e32 Merge #3538 - bors[bot]
Avatar
9a3e8bb Add set_view camera position command - ChillerDragon a3ae016 Merge #3531 - bors[bot]
Avatar
Question, where can i see the source of the ddnet discord bot? I just wanted to implement them on our server
12:22
nvm, i just found it
Avatar
$about
Avatar
Author icon
DDNet#9607
Stats
91 Guilds 1622 Channels 7712 Users
Process
115.58 MiB 0.10% CPU 11 Threads
Bot
15h 36m 7s Uptime 112.44ms Latency
Latest commits
9292b0c fix typo (27 hours ago) 467d0f5 format expire timestamp (2 days ago) c6b2585 remove unwanted moderator pings (2 days ago)
Avatar
the commits link to the repository
Avatar
thank you!
Avatar
$invite
Avatar
u can invite him btw
12:26
it*
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 13:57:13Z
oh lol ddnet code base has Config() now but its a trap xd
Avatar
it's a trap?
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 13:57:30Z
im so used to 0.7 base so i just used Config() in ddnet code and its a crash
13:57
ye
13:57
its nullptr
13:57
dangerous
Avatar
fix pls
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 13:57:50Z
u
Avatar
no
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 13:58:04Z
i probably forgot to set something up
13:58
its in my own component
13:58
yea lets see if i feel motivated to dig in there
13:58
who did that thing again forgot the name
Avatar
Kaffeine?
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 13:58:48Z
yea sounds aboutright
13:58
ur brain is so good
13:59
remember and shit
13:59
guess ima use g_Config for now^^
13:59
also @cagnet troll
13:59
omg typo
14:00
@cgt come search me ingame tw chat is best im online all day tho mostly afk
Avatar
How do I find out my DDNet version?
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 16:13:27Z
local console
16:13
top right
16:13
oh remote console also works
16:13
@NeXus
Avatar
Ah got it ty
Avatar
how many players does a server see in a day?
17:17
I still want to try my "one port per player" idea at some point
Avatar
Sure, that's a nice idea, I also thought about that yesterday in the shower 😄
Avatar
What was the idea behind that?
Avatar
first the idea would be that the kernel can drop packets much faster than we can
17:19
so if they don't attack the main port, the kernel can drop the packets. so they'll send garbage to the main port
17:20
then we limit the amount of traffic we accept on the main port
Avatar
So we drop with iptables?
Avatar
resulting in no one being able to connect and no one being dropped
17:20
hopefully*
17:20
the amount of traffic on the main port? yes, iptables
Avatar
On GER2: grep "player is ready" servers/*.log* | sed -e "s/.*addr=<{\(.*\):[0-9]*\}>.*/\1/" | sort | uniq | wc -l 9175
Avatar
hm, that's a significant fraction of the /16 space we have 😦
17:21
needs to be more dynamic than once per day apparently
Avatar
We don’t need it to be unique, do we?
Avatar
not necessarily, but reduces thinking needed
Avatar
Also I’m not very familiar with how the kernel handles traffic on different ports
17:23
I have a worrying feeling that the massive load on the main port might affect the others anyway
Avatar
even if we tell the kernel to drop udp packets on the main port?
Avatar
Also another performance concern I’d have is the 64 new sockets we need to care about. Though I hear epoll has fairly decent behaviour
Avatar
yes, 64 new sockets, epoll might be fine
17:24
web servers handle more than 64 sockets, I think
Avatar
Avatar
heinrich5991
even if we tell the kernel to drop udp packets on the main port?
nftables is quite close to the userspace almost on the edge of the network stack. I’m just not sure what the performance characteristics of the layers below are
17:26
That one cloudflare blog where they were trying to drop as fast as possible, they got a huuge increase going from dropping in nftables to dropping on the NIC with a BPF filter
Avatar
I mean we can manage a BPF filter as well 😉
17:27
if we get access to state that lets us track how much we already saw this second
Avatar
There is significant work being done in the kernel is what I mean, but yeah I think it might be worth a test
Avatar
My master thesis is about ebpf
Avatar
@TsFreddie to the rescue
Avatar
And I still have no idea how bpf filters workpepesweat
Avatar
Nooooooo
17:28
@heinrich5991 I guess this will be a breaking network change tho
Avatar
I can probably write ebpf programs. And I know there's a bpf syscall but that's all I know tbh
Avatar
not breaking
17:29
"not breaking"
17:29
only breaking for those on the old protocol during DoS
Avatar
More backwards compat code on the server? ;P
Avatar
ye
Avatar
Which protocol is the "old protocol"
Avatar
So I guess we establish a traditional tw connection on the main port, the client sends something like STARTTLS or FTP PASV. We give them a port to contact us on and we kill the connection?
Avatar
yes
Avatar
I’d be concerned about an attack trying to occupy all ports on the server
Avatar
hm?
17:31
we allow 64 players per server
Avatar
Yes, but if people try to connect, we can’t reserve them a slot. As that gives the old (connecting) attack
Avatar
apparently we need to verify their IP address before giving them another port
Avatar
I guess the handshake we have rn is enough for that?
Avatar
yes
17:33
but the handshake in its current form is brittle and should be changed at the next opportunity
17:33
one lost packet and you're stuck forever
17:33
(the third packet specifically)
Avatar
The only concern that remains is a non spoofed attack that just keeps asking for a new port, but I guess we can mitigate that with a hashmap of ip:clientport to serverport and never give a new one and limit ports per ip
17:35
Sounds like a solid idea to me, lmk if you ever decide to implement it 😄
Avatar
last time you weren't that sold on the idea, but I also haven't implemented it since last time 😛
17:35
so "some day, maybe"
Avatar
I don’t remember my concern back then
17:36
But I was fairly convinced it wouldn’t work so I wonder what my argument was ;P
Avatar
who would ddos ddnet anyway
Avatar
doesn't really matter, it happens
Avatar
is it always SP | Someone
troll 1
f3 1
Avatar
please don't discuss specific DoSers, that's basically what they're after 😉
Avatar
Avatar
baby frog
is it always SP | Someone
he donates ddnet btw
Avatar
Yeah, he's not an attacker, just a troll
Avatar
is he even in this disc?
17:38
but
17:38
who knows troll
Avatar
Just looked up some xdpfilter
17:40
Feel like magic
Avatar
Xdp is the pinnacle of filtering
17:40
Filtering packets at the lowest possible level
17:42
NICs with offloaded xdp are genius
Avatar
A curated list of awesome projects related to eBPF. - zoidbergwill/awesome-ebpf
Avatar
Avatar
Learath2
NICs with offloaded xdp are genius
my supervisor wants me to process data with ebpf on nvme controller.
18:02
pepesweat
Avatar
Trafalgar Law 2021-01-25 18:04:17Z
Why I can just download map so fucking slowly on my srv?
18:04
Needs like 20 sec
Avatar
ddnet? vanilla? 0.6? 0.7?
Avatar
Trafalgar Law 2021-01-25 18:04:38Z
ddnet
Avatar
client is 0.6 or 0.7?
Avatar
Trafalgar Law 2021-01-25 18:04:50Z
0.6
Avatar
ddnet or vanilla 0.6? 😄
Avatar
Trafalgar Law 2021-01-25 18:05:14Z
Its not just me, there is something on my srv i guess
Avatar
If it's ddnet client your map is just massive
18:05
the udp fast download can only do so much, ddnet servers use http downloads to get around that
Avatar
probs a custom server
18:06
(custom map)
Avatar
I think @deen did add a couple maps that are played a lot to the map server
18:07
Anyway, if the map is on maps.ddnet.tw people should get http downloads
Avatar
http download is really unstable in china btw. Many players got stuck at connecting.
Avatar
Yeah needs a CDN for china 😛
Avatar
@Trafalgar Law u can try sv_fast_download 1 sv_high_bandwidth 1
Avatar
Is there a way to fallback to udp download a bit faster.
Avatar
but if the http download times out it should fall back to udp automatically
Avatar
But it takes awhile to timeout http
Avatar
Trafalgar Law 2021-01-25 18:09:24Z
Already both on @Deleted User
Avatar
I'm sure there is a http timeout config somewhere, but that might create issues with ddnet-info.json
Avatar
mhh with SDL 2.0.14 i cannot minize the client anymore... very annoying
18:09
why must this lib always be buggy <.<
Avatar
@Trafalgar Law what is your m_SvMapWindow
18:10
sv_map_window *
Avatar
Like can we fallback to udp download a bit earlier and if the http went through just drop the downloaded udp data.
Avatar
Trafalgar Law 2021-01-25 18:10:33Z
15
Avatar
@TsFreddie smells like a great way to have race conditions 😛
Avatar
@Trafalgar Law you can go up to 100, but raise it slowly, too high and more people will have to fall back to slower download
Avatar
But we do have a tutorial for straight up turning the setting off in our chat so it's not really a big deal.
Avatar
I wonder if we can get a mirror of the map db in china
Avatar
Actually. If http timeout are we still trying http on next connection
18:13
Can we fallback to udp until they restart the game.
Avatar
@TsFreddie yes because I think the saner assumption is that we broke the server or it's overwhelmed for a sec and it'll be back
Avatar
Avatar
TsFreddie
Can we fallback to udp until they restart the game.
Would be great for china, not sure how good it'd be for everyone else though
18:14
How is it failing? Does the download even start?
Avatar
I don't think so
18:14
Most ppl just say they are stuck at connecting
Avatar
next time it happens try to get us a console/log pls
Avatar
Sure
18:16
I got pretty good connection to ddnet.tw at home so might be difficult to come by myself
18:17
Wait. I might turned http download off ages ago maybe that why I think I have pretty good connection
18:17
pepesweat I'll check tomorrow I guess
Avatar
maybe we can get a server in china to host the maps, tho we'd need to host BIND to send people from china a different ip
Avatar
Are ddnet.tw CDNed
18:20
Is*
Avatar
I think even a South Korea mirror might be worth it
18:22
Mainland bandwidth is so limited and probably it'd be better off covering the east instead of only china I guess?
Avatar
The location we could discuss, I'd guess the larger issue is actually setting up BIND and stuff 😛
18:23
We don't host dns now
18:23
right
18:23
Can server hint which map mirror client should use
18:24
Like why would one want to use a Asian mirror when connecting to GER.
18:25
doge
Avatar
Actually, why do we even need it to be automatic?
Avatar
Also probably enables mods for hosting their own http map database
Avatar
You could host a mirror in china and just tell people to change their cl_map_download_url
18:28
I mean I could just tell them to turn off http download. it is not that slow on chn servers and they don't seems to venture out for other servers (yet)
18:28
I think the issue is I can't tell everyone to change
Avatar
Huh, the udp downloads are soo slow
18:29
I guess you got used to it there
Avatar
Funny story, I ordered ziploc bags and they shipped them in a larger ziploc bag
Avatar
If it is at least semi automatic, I don't need to paste the solution every time someone have the same problem. Plus there are lots of players who just don't care about joining a community
Avatar
I’ll look into BIND for you
18:31
Maybe it’s not as PITA as I remember ;P
Avatar
Maybe look into letting the server decide the URL as well. Maybe it is easier idk
Avatar
There are security implications of that which I’m not really sure I want to think about right now 😉
18:33
Right.
18:34
Triggering AV for starter I guess
18:35
I'll see if we have cheaper way to host files in the meantime
Avatar
@Learath2 I think GET requests should mostly be fine
18:37
hmmmmm
18:37
you don't only get a GET request but also if they match a certain SHA256
18:37
that might be less fine
Avatar
jump_amount How many jumps you have 2 (default) for tune zone
Avatar
someone that codes please
19:09
explain me how the fuck lambdas work
19:09
Task.Run(() => CarregarDataAtual()); (edited)
Avatar
which language is that? it looks like it tells the language to run CarregarDataAtual() at some later point in time
19:10
CarregarDataAtual() is LoadActualDate() (english translation) (edited)
19:10
Queues the specified work to run on the thread pool and returns a Task object that represents that work.
Avatar
Ik task.run does that, but the lambda
Avatar
i.e. it tells C# to run the function CarregarDataAtual() at some later time
Avatar
I dont understand the lambda ;_; (edited)
Avatar
the lambda is the function that is called at a later time
19:11
e.g. if you have a function public static int Return7() { return 7; } (edited)
19:12
that's the same as a lambda () => 7
19:13
a lambda is a shorter way to define a function
Avatar
anonymous function is lit
Avatar
Avatar
std
CarregarDataAtual() is LoadActualDate() (english translation) (edited)
Are u catalan?
19:34
poggers
Avatar
Avatar
Ryozuki
Are u catalan?
Catalunya no existe ql
Avatar
Ql weon
Avatar
@Ryozuki im brazillian
19:37
Ot looked so similar
Avatar
oh @heinrich5991 thansk
Avatar
In catalan it would be CarregarDataActual()
19:38
its spanish,franchise and italian native
19:38
that's why
19:38
portuguese ± spanish
Avatar
It has similarities but it's not the same
19:39
As in other languages
Avatar
Linguistics time
Avatar
yeah its similar
19:40
If i had nitroll
19:40
Someone put the catalan one
19:40
trollet
Avatar
Func<int, int> square = x => x * x; Console.WriteLine(square(5)); // Output: // 25
Avatar
yes 🙂
Avatar
Lambdas are fun
19:41
o
Avatar
Avatar
Ryozuki
Someone put the catalan one
19:41
It doesn't exist
Avatar
Its called flag_spain on some servers
19:42
I think its in fng sv
19:42
19:42
justatest
Avatar
my brain slow
Avatar
@heinrich5991 i like that rust has FnOnce for functions meant to be called 1 time only
19:42
bluekitty
Avatar
Avatar
Pepe
flag_spain
Its not rly the catalan flag tho, its the catalan flag for independence
Avatar
there is no catalan flag because it doesnt exist
Avatar
my code is a mess but im lazy to fix it
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:17:29Z
relatable
20:17
did u try using shell instead of C# ?
20:19
yo @std look at this code then u feel like ur code is clean af https://raw.githubusercontent.com/chidraqul/chidraqul/master/chidraqul.cs
Avatar
//weed :3
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:21:29Z
xd
20:21
did it help?
Avatar
what the actual f is that
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:21:50Z
my game in C#
Avatar
its a console game?
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:21:55Z
ye
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:22:19Z
i used multiple string variables instead of an char array
20:22
cuz i did not know that arrays are a thing
Avatar
yeah I was going to say that
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:23:08Z
ChillerDragon i guess u didnt know about arrays back then?
20:23
what is that code even
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:23:15Z
xd
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:23:16Z
i guess its just troll
20:23
best part
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:23:30Z
xd
20:23
where it all comes together
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:23:45Z
is it generated by some script
20:23
how can u maintain this
Avatar
lemme try compiling it
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:23:56Z
its handwritten
20:24
Ryozuki: i did not know better back then
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:24:07Z
u have a lot of time in ur hands
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:24:17Z
not enough time to learn to code tho
Avatar
nvm rider will take long to make another null project
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:24:22Z
so i just started with what i knew
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:24:28Z
ChillerDragon well u waste ur time doing this stuff
20:24
no wonderu dont have time to learn actual code
20:24
xd
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:24:37Z
xd
20:24
i had big fun
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:24:49Z
to me it looks like hell
20:24
how is this fun xd
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:24:51Z
i was watching this 5 min yt video
20:24
he explained what a srting is
20:25
and a if statement
20:25
and how to hello world
20:25
and i was like nice ima build a game with this
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:25:24Z
u should save this
20:25
its art
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:25:29Z
its saved
20:25
i tried to rewrite in rust
20:25
3 times
20:25
and gave up
20:25
cuz rust so hard
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:25:59Z
lmao
20:26
i think its hard cuz its hard to know what this code does
Avatar
debugging async code is annoying (edited)
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:26:49Z
i would learn more asm but im 2 lazy to learn the register names
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:27:04Z
use comments
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:27:06Z
nice table u got there tho
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:27:06Z
:D
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:27:14Z
; +-----------------------------------+
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:27:14Z
ye also needed em register names
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:27:15Z
; | 8-bit | 16-bit | 32-bit | 64-bit |
20:27
; +--------+--------+--------+--------+
20:27
; | al | ax | eax | rax |
20:27
; | bl | bx | ebx | rbx |
20:27
; | cl | cx | ecx | rcx |
20:27
; | dl | dx | edx | rdx |
20:27
; | sil | si | esi | rsi |
20:27
; | dil | di | edi | rdi |
20:27
; | bpl | bi | ebp | rbp |
20:27
; | spl | sp | esp | rsp |
20:27
; | r8b | r8w | r8d | r8 |
20:27
; | r9b | r9w | r9d | r9 |
20:27
; | r10b | r10w | r10d | r10 |
20:27
; | r11b | r11w | r11d | r11 |
20:27
; | r12b | r12w | r12d | r12 |
20:27
; | r13b | r13w | r13d | r13 |
20:27
; | r14b | r14w | r14d | r14 |
20:27
; | r15b | r15w | r15d | r15 |
20:27
; +--------+--------+--------+--------+
20:27
epic
20:27
discord didnt send it all
20:27
lmao
20:27
oh its doing it now
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:28:00Z
rip
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:28:01Z
looks scuffed
20:28
monospace terminal ftw
Avatar
i fear assembly
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:28:16Z
im sure it looks fine in the only usuable discord client
20:28
cordless
20:28
i think it was also handwritten table Ryozuki xd
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:28:57Z
ChillerDragon is the assembly game the same as the cs game?
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:28:59Z
i cant remember a single thing tho
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:29:03Z
the assembly looks clean af
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:29:08Z
yea same functionality
20:29
feature complete
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:29:14Z
nice
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:29:20Z
no joke :D the cs game is far more complex
20:29
the asm is not even working prototype
Avatar
guys I think im dumb
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:29:34Z
ah
20:29
u troll
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:29:38Z
hehe
Avatar
im loading 2k results from a mysql database and getting the last with Linq
20:29
is this good
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:29:44Z
yea i think the asm only had keypresses
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:29:54Z
why load 2k then
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:30:04Z
2k?
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:30:15Z
just load the last
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:30:21Z
wat
20:30
im dumb
20:30
almost 2k**
20:30
20:30
1644
20:31
that's still a lot
Avatar
[quakenet] Ryozuki BOT 2021-01-25 20:31:49Z
idk what u doing, but if u only need 1 result, u filter, order and limit
Avatar
SELECT * FROM table_name ORDER BY id DESC LIMIT 1
20:35
k done I guess
Avatar
any C++ language expert here?
20:36
why does std::atomic_int i = 0; not compile?
20:36
"use of deleted function 'std::atomic<int>::atomic(const std::atomic<int>&)"
20:37
it seems to call the constructor implicitly, but why?
Avatar
wish I was
Avatar
Avatar
heinrich5991
any C++ language expert here?
!ʎø1øʞıƝg 2021-01-25 20:41:00Z
std::atomic_int i = 0; As u notice function doesn't much
20:41
did u call it
20:41
@heinrich5991 It's not a member
20:42
atomic_int is not part of the function std
Avatar
atomic_int is a type, not a function. it should exist: https://en.cppreference.com/w/cpp/atomic/atomic
Avatar
!ʎø1øʞıƝg 2021-01-25 20:43:05Z
ah i see
20:43
i think it's the compiler version
Avatar
[quakenet] ChillerDragon BOT 2021-01-25 20:43:34Z
poor heinrich when u his level u can only answer but never get answered :D
Avatar
!ʎø1øʞıƝg 2021-01-25 20:44:19Z
xD wait hein
20:44
@heinrich5991 I found something
20:45
Avatar
you don't need to hurry, I'm still interested in the answer tomorrow 😉
Avatar
!ʎø1øʞıƝg 2021-01-25 20:45:15Z
u call the functio nafter
20:45
u can't set value before
20:45
do it after
20:45
@heinrich5991 Was this helpful?
Avatar
it's not helping me with my problem, but that is probably because I haven't told you the full situation
Avatar
!ʎø1øʞıƝg 2021-01-25 20:46:50Z
nope u did nt
Avatar
I don't have a problem getting something past the compiler, std::atomic_int i = {0}; or std::atomic_int i{0}; both seem to work
Avatar
!ʎø1øʞıƝg 2021-01-25 20:47:21Z
yes
Avatar
I'm more specifically interested in why std::atomic_int i = 0; fails to compile
Avatar
works fine for me
Avatar
it seems like the most natural way to write this, and the = operator is overloaded for int
20:47
@Deleted User compiler version?
Avatar
clang 12
20:48
std++20
Avatar
!ʎø1øʞıƝg 2021-01-25 20:48:05Z
i think it's value needs to be measured or must be stored using {} because it's a retarded function
20:48
🤡
Avatar
no gnu extensions
Avatar
!ʎø1øʞıƝg 2021-01-25 20:48:37Z
@heinrich5991 /usr/include/c++/6/atomic:620:17: note: after user-defined conversion: constexpr std::atomic::atomic(std::atomic::integral_type) constexpr atomic(integral_type i) noexcept : base_type(__i) { }
20:48
Found your issue
Avatar
apparently C++17 and higher accept this?
Avatar
possibly
Avatar
!ʎø1øʞıƝg 2021-01-25 20:49:19Z
main.cpp:5:23: error: use of deleted function ‘std::atomic::atomic(const std::atomic&)’ std::atomic_int foo = 0;
20:49
Well
20:49
i can't really give u a explanation here but it seems it's bein a bitch
Avatar
^^
Avatar
!ʎø1øʞıƝg 2021-01-25 20:50:10Z
example of shit coding language xD
20:50
I am learning python anyway
20:50
only got basic knowlegde of c++ now
Avatar
i dont see how it violates the std tho
20:50
since c++11 it allows non atomic types in = operator
Avatar
!ʎø1øʞıƝg 2021-01-25 20:51:31Z
Avatar
segfaults
20:51
undefined behavior
20:51
so much annoying stuff 😄
Avatar
!ʎø1øʞıƝg 2021-01-25 20:52:22Z
true
20:52
debugging
20:52
sucks
20:53
Well heinrich u can work further now
Avatar
@heinrich5991 does std::atomic_int i = int(0); work?
Avatar
nope
Avatar
ok very strange
Avatar
it still tries to convert to atomic_int first
Avatar
!ʎø1øʞıƝg 2021-01-25 20:54:33Z
@Deleted User yes it does
Avatar
it seems that deleted constructors still take part in overload resolution in <=C++14
Avatar
!ʎø1øʞıƝg 2021-01-25 20:54:53Z
hm
20:54
Show us the code
20:55
u do have the libs includes right
Avatar
c++ #include <atomic> std::atomic_int i = int(0); int main() { return 0; }
Avatar
ah as global var?
Avatar
a.cpp:2:26: error: use of deleted function ‘std::atomic<int>::atomic(const std::atomic<int>&)’ 2 | std::atomic_int i = int(0); | ^ In file included from a.cpp:1: /usr/include/c++/10.2.0/atomic:759:7: note: declared here 759 | atomic(const atomic&) = delete; | ^~~~~~ /usr/include/c++/10.2.0/atomic:763:17: note: after user-defined conversion: ‘constexpr std::atomic<int>::atomic(std::atomic<int>::__integral_type)’ 763 | constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } | ^~~~~~
Avatar
gues it prefers some constexpr bcs of global constructors
Avatar
also fails as a local var
Avatar
oh ok
20:57
is that gcc?
Avatar
yes
Avatar
oh yeah breaks with c++11, even with clang
Avatar
both g++ 10.2.0 and clang++ 11.0.1 fail this
Avatar
!ʎø1øʞıƝg 2021-01-25 20:58:05Z
20:58
@heinrich5991 Fixed
20:58
Remove int
20:58
#include <atomic> std::atomic_int i = int(0); int main() { return 0; } #include <iostream> // std::cout #include <atomic> // std::atomic, std::memory_order_relaxed #include <thread> // std::thread std::atomic_int i = {0}; int main() { std::cout << "yo Number: " << i; return 0; }
Avatar
(yes, that code works)
Avatar
!ʎø1øʞıƝg 2021-01-25 20:59:50Z
Well
20:59
What did you expect
Avatar
well u can also use the constructor directly
Avatar
!ʎø1øʞıƝg 2021-01-25 21:00:02Z
true
Avatar
the question is why is it implictly converted
Avatar
!ʎø1øʞıƝg 2021-01-25 21:00:16Z
std::atomic_int i = {0}; it's already an int
21:00
so u are trying to int a int
Avatar
well, I didn't expect any fix because I already said that I got it to work 😉
Avatar
!ʎø1øʞıƝg 2021-01-25 21:00:21Z
🤡
Avatar
I was wondering why it doesn't work with the statement above
Avatar
!ʎø1øʞıƝg 2021-01-25 21:00:37Z
ah
Avatar
and the int thing was added because @Deleted User suggested trying it
Avatar
!ʎø1øʞıƝg 2021-01-25 21:00:50Z
Did i help you?
21:00
Did WE help you?
21:01
xD Well Can't give myself all the credit
Avatar
you helped a little bit in that we discovered that it works with C++17 and up
21:02
but my original question is still unsolved (it's not about getting the code to work)
21:02
sorry 😦
Avatar
!ʎø1øʞıƝg 2021-01-25 21:02:20Z
ah np atleat it's workin
Avatar
Avatar
heinrich5991
I'm more specifically interested in why std::atomic_int i = 0; fails to compile
I watched an entire talk on this but I forgot the reason :///
21:03
wait let me find it
Avatar
Avatar
Learath2
I watched an entire talk on this but I forgot the reason :///
!ʎø1øʞıƝg 2021-01-25 21:03:45Z
Simply Fixes
Avatar
okay, here a question where I'm interested in getting the code to compile
21:04
:
Avatar
!ʎø1øʞıƝg 2021-01-25 21:04:39Z
xD
21:04
u can't compile :
Avatar
c++ #include <memory> void abc(int *ptr) { delete ptr; } int main() { std::unique_ptr<int, decltype(abc)> p = std::unique_ptr<int, decltype(abc)>(new int()); return 0; }
Avatar
!ʎø1øʞıƝg 2021-01-25 21:05:03Z
oh that u can
21:05
xD
Avatar
I would paste the error, but it's literally 99 lines
Avatar
!ʎø1øʞıƝg 2021-01-25 21:05:32Z
/usr/include/c++/6/tuple:147:13: error: field ‘std::_Head_base<1ul, void(int*), false>::_M_head_impl’ invalidly declared function type
Avatar
!ʎø1øʞıƝg 2021-01-25 21:05:37Z
/usr/include/c++/6/bits/unique_ptr.h:171:14: error: no matching function for call to ‘std::tuple::tuple()’
Avatar
tho i'd have thought int(0) would have worked then
Avatar
@Deleted User I don't think this is a problem with most vexing parse
Avatar
@heinrich5991 It's because = is copy construction, atomic variables are not CopyConstructable
Avatar
@Learath2 ah, is = in initialization special?
21:07
In C++ atleast
Avatar
ah
Avatar
ohh, i thought that was obv, but its not entirly deleted
Avatar
but there's also a constructor that takes int
Avatar
it allows int as type
Avatar
Avatar
[quakenet] ChillerDragon
@cgt come search me ingame tw chat is best im online all day tho mostly afk
Alright, ill find you tomorrow
Avatar
i think its bcs 0 is a constructor call
21:08
bcs of the link above
Avatar
= implies copy construction, I don't think it's allowed to "fall back" to another constructor
Avatar
hm ok
21:08
got an idea about my other question? ^^
Avatar
Looks a bit like a xy question
Avatar
I want a function called when the unique_ptr goes out of scope
Avatar
@Deleted User operator= is not used in initializations
Avatar
so I don't have to manually manage that object I got from a library
21:10
that seemed like a perfect job for std::unique_ptr's deleter
Avatar
I watched another talk on this, let me dig it out 😄
Avatar
!ʎø1øʞıƝg 2021-01-25 21:10:44Z
@heinrich5991 Did u try #include <tuple>
Avatar
I watched a lot of cppcon the last month or so
Avatar
tuple in cpp is strange sometimes
Avatar
#include <tuple> does not help
21:11
(and I'd have been surprised if the headers did not work on their own) (edited)
21:12
@Learath2 how did you watch all the C++ talks? ^^
Avatar
I lose motivation when studying math, so instead of wasting the time completely watching stupid shit I watch cppcon or gdc talks
21:13
@heinrich5991 can you atleast paste the error somewhere so I can take a look?
21:13
don't have a compiler at hand
Avatar
Avatar
heinrich5991
so I don't have to manually manage that object I got from a library
i remember doign smth like this wrapping sdl in smart pointers
21:13
std::uniqueptr<SDL_Window, decltype(&SDL_DestroyWindow)> _window;
21:13
std::unique_ptr<SDL_Window, decltype(&SDL_DestroyWindow)> _window_;
Avatar
an extra & required?
Avatar
@Learath2 i accept that, but why does it not use the conversion constructor with int
21:14
isntead casts it to atomic first
21:14
in c++20 it does not
21:14
is it bcs of the noexcept?
Avatar
no not the noexcept
21:14
I'll take a look one sec
21:15
Something about copy construction was relaxed in C++17 that I'm having trouble remembering
Avatar
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
Avatar
oh god
Avatar
cpp errors are so hard to figure out
Avatar
clang++ error is a bit saner
Avatar
idk even what im doing xd
Avatar
Well I don't think your Deleter fits "DefaultConstructible"
21:17
Or "MoveConstructible"
Avatar
!ʎø1øʞıƝg 2021-01-25 21:17:50Z
@heinrich5991 Can u try std::unique_ptr<std::decay (edited)
Avatar
Anyway you need a struct with a overload on () there
Avatar
my vim shows saner errors
Avatar
ouch
Avatar
Deleter must be FunctionObject or lvalue reference to a FunctionObject or lvalue reference to function, callable with an argument of type unique_ptr<T, Deleter>::pointer
Avatar
I made it compile
21:18
sdl_window is a struct
Avatar
it's missing the deleter argument on unique_ptr
21:18
😄
Avatar
show code
Avatar
!ʎø1øʞıƝg 2021-01-25 21:18:43Z
xD
21:18
gj yho
Avatar
plus a couple of & apparently
21:19
c++ std::unique_ptr<int, decltype(&abc)> p = std::unique_ptr<int, decltype(&abc)>(new int(), &abc); (edited)
Avatar
!ʎø1øʞıƝg 2021-01-25 21:19:39Z
@heinrich5991 Go code teeworlds mmo
21:19
🤡
Avatar
I maintain that that is still wrong
Avatar
why though?
Avatar
ah so my sdl code showed that
Avatar
!ʎø1øʞıƝg 2021-01-25 21:20:08Z
xD
Avatar
i just didnt know u needed abc after int too
21:20
this is all dark magick to me
21:20
ah
21:21
ofc u need it
Avatar
decltype(&abc) is not a FunctionObject, it's not an lvalue reference to one, I don't think it's an lvalue reference to a function
Avatar
im blind
Avatar
https://en.cppreference.com/w/cpp/memory/unique_ptr claims that Deleter must be a FunctionObject, and https://en.cppreference.com/w/cpp/named_req/FunctionObject says that All pointers to functions satisfy this requirement.
Avatar
imagine having to import to print
21:21
thanks rust exists
Avatar
why not have an IDE that imports it automatically
Avatar
because that's probably NP hard for C++ or something
21:22
or even halting problem hard or so
Avatar
next upo
Avatar
what are u even doin xD
21:23
porting SDL to c++?
Avatar
hackign the mainframe
Avatar
throwing out mysqlcppconn
Avatar
@Deleted User i just posting sdl cuz what heinrich wanted to do reminded me of this
21:24
which i once used
Avatar
oh
Avatar
@heinrich5991 abc and &abc are lvalue references to functions, decltype(&abc) doesn't feel like it to me, but I guess if the compiler likes it who am I to judge
Avatar
another forgotten project
21:24
if the compiler likes it then its gods word
21:24
pepeH
21:25
"throwing out mysqlcppconn"
21:25
out of ddnet?
Avatar
yes
Avatar
u are making ur own mysql driver?
Avatar
or at least trying
21:25
no
21:25
using the C API
Avatar
instead of that mysqlcppconn that nobody but us uses
21:26
is the c lib small
Avatar
it's smaller than the C plus the C++ lib
21:26
the C++ lib uses the C lib
Avatar
AH I remember what was bothering me
21:29
Your Deleter is not default constructible, so you are not using the constructor I think you are using
21:29
Storing a pointer to the function on each instance of your unique pointer wasting space
21:30
Though since you are probably only using it once it doesn't matter here
Avatar
the function type is unique, no?
21:30
I thought each function had its own type, that only decays to the function pointer
21:30
or is that lambdas?
21:31
anyway, I'm considering moving to a default-constructible class
21:31
will that not waste space? it'd depend on which class is laid out first, no?
21:31
each class has a minimum size of 1?
21:31
I think I saw some weird hackery that ensures that the first item of a tuple can consume no space, but does std::unique_ptr store the allocator as the first element of the tuple?
Avatar
Any idea why vanilla is running smoother for me than ddnet? On intel igpu as well as nvidia gpu and on linux as well as windows
Avatar
u have opengl 3.3?
Avatar
Didn't make a difference
Avatar
did you restart?
Avatar
cl_refresh_rate 0
Avatar
Yep :D
Avatar
should make a huge difference
Avatar
gfx_refresh_rate 0
21:33
i think this is for integrated gpus
21:33
maybe makes something
Avatar
@timakro why always random shutdown (trashmap)
Avatar
Avatar
Cøke
@timakro why always random shutdown (trashmap)
When?
Avatar
all the time when i use it
21:34
im playing and random shutdown
Avatar
Would be helpful if you could tell me the time so I could check the logs
Avatar
23.01 feuerfaust ace server
21:36
1 time shutdown and 1 time connection problems and the server was down
Avatar
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
21:36
here is what I meant
Avatar
nice 🙂
21:36
I'm using p3 rn, so all is good
21:37
I thought functions had unique types though, but maybe that's just rust
Avatar
Sorry, I can't really put it in standardese as it's iirc a consequence of a couple things at once
21:37
it looks like that sdl thing too
21:37
funny
Avatar
I know if you don't want to waste space you want to use a default-constructible class there
Avatar
Avatar
Ryozuki
poggers
monkalaugh
Avatar
if functions had unique types, they could be default-constructible
21:38
as their type already specifies which function it is
Avatar
functions are not constructible at all to begin with iirc
Avatar
ah
Avatar
where is Patiga?
Avatar
@Patiga
21:39
i couldn't ping him rn
21:40
ok, nvm
21:40
sorry for disturbing, but are there any auto-generated documentations for twmap? (edited)
Avatar
@gerdoe if he publishes it yes
21:42
on docs.rs
Avatar
you can always generate it on your own with cargo doc
Avatar
i told him but he said its not rdy
Avatar
okey, i guess going through the source will be better xd
Avatar
just do cargo doc
21:44
if u have it as a dep cargo doc builds that doc too iirc
Avatar
yes
Avatar
thanks guys 😄
21:44
if u use vim
21:44
i recommend to install rusty-man
21:44
and use this
21:45
" Uses rusty-man and nvim emulated terminal to show docs command! -nargs=* Rm belowright split | resize 15 | te rusty-man <args>
21:45
monkalaugh
21:46
(u need to cargo doc first tho)
Avatar
im done with vim xd, i don't know how to use it properly
Avatar
my vim workflow with rust poggers
Avatar
Avatar
heinrich5991
each class has a minimum size of 1?
Btw about this, there is EBO so classes with no data members can be (and are by gcc, clang and msvc) optimized to 0 size
Avatar
nothing changed since your last twitch stream
Avatar
ah now that i placed the license i could actually publish o.o
Avatar
Avatar
gerdoe
nothing changed since your last twitch stream
pepeH
Avatar
though there will def be some breaking changes soon
Avatar
ill switch to ayu theme for vim soon
21:48
if there is just swap 0.x to 0.y
21:49
u can even release prerelease versions
Avatar
Avatar
Patiga
though there will def be some breaking changes soon
just notice us where are they :D
Avatar
0.1.0-alpha.0
21:50
actually my hover is more than enough
Avatar
Avatar
timakro
Any idea why vanilla is running smoother for me than ddnet? On intel igpu as well as nvidia gpu and on linux as well as windows
any update oni this or more info?
Avatar
tsFreddie's textrender refactor/improving was also in ddnet codebase, yep?
Avatar
@Cøke You found a bug that's there since the upgrade to Python 3 on Dec 27 2019
Avatar
Avatar
gerdoe
tsFreddie's textrender refactor/improving was also in ddnet codebase, yep?
no
Avatar
Funny that this problem persisted for over a year and nobody told me
Avatar
ddnet has a different text renderer
Avatar
so it should be even better with GL 3.3
Avatar
gl 3.3 makes a rather large difference, it not making any gives me concern
21:54
maybe it's failing to initialize a gl 3.3 context at all?
Avatar
but even with old GL it should be around as fast as vanilla
Avatar
definitely
21:55
I'd suggest trying with clean settings just to make sure
Avatar
@timakro and that means?
Avatar
@Cøke It's fixed now
Avatar
i also wrote a different packing algorithm a month ago, but im not sure if it packs worse or around as good as our current impl https://github.com/Jupeyy/ddnet/tree/pr_simpler_text_algo
21:59
so i didnt pr it
Avatar
Is there a fps graph?
Avatar
strg shift g in debug mode (edited)
22:00
*g
Avatar
@gerdoe @Ryozuki the crate is now on crates.io https://crates.io/crates/twmap
Avatar
nice u used teeworlds and ddnet keyword
22:13
22:13
API documentation for the Rust twmap crate.
22:14
@Patiga /// to document in rust btw
22:14
it would be cool if u added documentation = "https://docs.rs/twmap" and repository = "repo"
22:15
so crates.rs links to it
22:16
also, if uwant a module level doc u use //!
22:16
at the top
Avatar
the documentation link already exists for me
Avatar
so if u add the readme content with //! on ur file it will show up in the docs
22:17
oh it appeared now
22:17
no repo tho
Avatar
yea, gonna add 👍
22:17
add #![deny(missing_docs)]
22:17
if u want to 100% document ur crate
22:18
#![forbid(unsafe_code)] is nice too
22:19
oh they updated the dark theme on github
22:19
22:20
more contrast
Avatar
my crate uses unsafe ^^
Avatar
@Patiga also i recommend running cargo clippy
22:21
it may help improve code
22:21
22:21
does twmap use libtw2?
22:22
clippy poggers
Avatar
hm, I find the + 1 clearer
Avatar
@heinrich5991 oh the thing u always tell me about
22:25
i never heard about this macro
22:25
cool to know
Avatar
it's kinda new
22:25
it used to be in a crate
Avatar
1.42.0
Avatar
we at 1.49
22:26
how old is 42?
Avatar
not old enough for debian
Avatar
debian stable has 1.41.1
Avatar
well debian soon releases new
22:27
also i always use rustup
22:27
instead of pkg manager
22:27
idk if its a thing other ppl do
Avatar
I think it's good if code compiles without you adding some language-specific stuff
Avatar
@heinrich5991 can u add the matches dep for older rust versions and use native macro on new?
Avatar
you could, yes
22:28
but that's annoying
22:28
here, zero dependencies
22:33
@Patiga possible bug
22:33
or maybe not
22:33
xd
Avatar
ye
Avatar
ye to not or to yes
22:34
hmm
Avatar
it doesn't look like a bug
22:34
because there is a filter before the map
Avatar
i wouldnt use a print on a library crate btw
22:34
add the log crate and use log
Avatar
thats a binary
22:34
true
22:35
monkaS sry
22:36
nothing feels better than a happy clippy monkalaugh
Avatar
In posix shell I want to filter out the lines which begin with a specific string but that string is variable. The problem with | grep "^$str" is that there could be special characters in $str which would be interpreted as a regex. Any shell pro here can help me?
Avatar
Avatar
Ryozuki
nothing feels better than a happy clippy monkalaugh
why "clippy"
22:40
is it random?
Avatar
clippy like the ms office assistant
Avatar
ah i see
Avatar
u mean the name?
22:40
ah ye
Avatar
classic
Avatar
He gave me nightmares
22:44
The microsoft dog was cool
Avatar
@TsFreddie is there an easy way to determine whether you're behind the great firewall of china? ^^
23:12
how would one detect this to change the map server to the one in china
Avatar
Since our maps2.ddnet.tw doesn't work well for players in China

Checklist

  • [ ] Tested the change ingame
  • [ ] 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
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's ...
Avatar
e16dd5c HTTP Map Download: Time out faster - def- f08812b Merge #3543 - bors[bot]
Avatar
@heinrich5991 well geoip
23:40
everyone in china is behind the great firewall, no?
Avatar
9c44ac8 Add donation of 4.20 € by Flappe - def-
Avatar
@Learath2 but the client doesn't necessarily know its own ip address, would have to check that too
Avatar
@deen we host the dns, so when they do the request we check the geolocation and give them the correct ip
Avatar
atm cloudflare hosts the dns
Exported 801 message(s)