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-03-13 00:00:00Z and 2021-03-14 00:00:00Z
Avatar
!image This block is usually blank on ddrace servers, maybe don't display it if it's blank?
Avatar
meh.. please NO account system, its not tw anymore with registration ! :<
Avatar
Anyone online want to give their thoughts on this PR: https://github.com/ddnet/ddnet/pull/3654 I'm hoping to code/complete the feature later today. I think the suggestion by kamillentee might be the right approach. (edited)
Added a new chat command /swap based on the discussion in the associated issue: #1103 Swaps the character&#39;s position with another tee using the existing Save/Load functionality. Restriction...
heartw 1
Avatar
https://kornel.ski/rust-c-speed something that resonates with me, as I'm currently writing almost-C for https master servers
Avatar
Why not rust?
Avatar
eh, client part
15:57
server part is rust
Avatar
Ah, I see πŸ˜›
15:57
I would have went with python to prototype and c++ to implement
Avatar
hm. server part is rust + nginx right now
Avatar
i see lot of rust posts ppl saying x program in rust is slower than xi n java, and it was what to_lowercase does lot of unicode stuff, they just had to change it to make_ascii_lowercase
Avatar
Avatar
Ryozuki
i see lot of rust posts ppl saying x program in rust is slower than xi n java, and it was what to_lowercase does lot of unicode stuff, they just had to change it to make_ascii_lowercase
Most of these kinds of benchmarks suffer from the same silliness
15:58
I saw one where they were sorting vectors and the C++ one was creating a copy of the vector after every swap...
Avatar
oh and also the writer thing
15:59
if they dont wrap the writer in a bufwriter it flushes byte by byte
15:59
so they made the program slower than the python one
Avatar
it can be said that this is unexpected and can lead to programs being slower in rust than in C/Python/Java
Avatar
rusts likes things being explicit than implicit
16:00
actually in java u have to wrap the filewriter in a buffered writer too
Avatar
Well I have one piece of advice, don’t use languages that you are not familiar with
Avatar
so its not something uncommon
Avatar
libc automatically switches between line buffering/block buffering depending on output redirection
16:00
that can be nice for performance πŸ™‚
Avatar
Not like the languages are made for kindergartners
Avatar
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("foo.out")));
16:01
xd
16:01
fcking java
Avatar
Avatar
Learath2
Not like the languages are made for kindergartners
yeah
16:01
but they always come to the reddit rust
16:01
crying
16:01
"gottem!!!"
16:01
like they rly try hard to prove rust is nto perfomant
Avatar
are you maybe talking about "children"? kindergarteners are people who oversee children (at least in german)
Avatar
kinder
Avatar
Avatar
Ryozuki
like they rly try hard to prove rust is nto perfomant
Well they are looking in the wrong place. Rusts shortcomings sre very well documented
Avatar
they come to the rust subreddit for advice, nothing wrong with that IMO
Avatar
i know kinder is kid due to the chocalte egg
16:02
chocolate egg
16:02
iirc
16:02
Avatar
Avatar
heinrich5991
are you maybe talking about "children"? kindergarteners are people who oversee children (at least in german)
Hm, in english a kindergartner would be someone attending as a child. I think
Avatar
the rust subreddit explicitly encourages asking questions
16:03
hm interesting
16:03
false friends and all
Avatar
i guess a kindergartener would be the one taking care
Avatar
String formatting is a great place to poke at rust or the binary size
Avatar
kinder-garten means "garden for children"
Avatar
Avatar
Learath2
String formatting is a great place to poke at rust or the binary size
the blog also says something, c programs have 30mb of std lib already in the system
16:03
so they tend to be smaller
16:03
but its a bit misleading
Avatar
> ls -lh /usr/lib/libc-2.32.so -rwxr-xr-x 1 root root 2.1M Oct 14 19:00 /usr/lib/libc-2.32.so*
Avatar
I never checked in rust but with C you can pretty much not link to libc at all if you prefer
Avatar
no 30MB
Avatar
Or link statically with an already tiny one like ulibc or musl and let LTO rip
Avatar
yes, works for rust, too, but formatting is hard to avoid
Avatar
one thing i found useful is the include_bytes! macro
16:05
so useful to test stuff
Avatar
I remember reading a blog post with someone doing rust on embedded. He had to get rid of error handling in most places to not pull in fmt
Avatar
error handling or panics?
Avatar
Aah panics it was, yes
16:06
I think he managed to get it to print out a static string at the end tho
Avatar
@Ryozuki use permalinks. press y before copying the link πŸ™‚
16:08
fn parse_main<S: AsRef<[u8]>>(data: &'a S) monkalaugh
16:09
AsRef magic
Avatar
that leads to monomorphisation costs unless you immediately call another function without the type parameter
16:10
fn parse_main_inner(data: &'a [u8]) -> …
16:10
(the function will be duplicated for each type you call it with in the final executable)
Avatar
Did you see the new function syntax for C++? I never saw it in the wild even tho it’s been in since C++11
16:11
I wonder why the return type at the end took off so much
Avatar
you mean the auto -> ?
16:11
Every new language has that syntax now
Avatar
it's easier to parse and easier to grep for, I like it
16:11
and it's also the syntax in maths
16:12
easier to parse as in that you need a less complex automaton to recognize it
Avatar
It’s easier for the compiler but I’m so used to spotting it at the start of the line
Avatar
it's really nice I can grep for functions in rust via 'fn function_name'
16:13
in C I have to hope that they follow the "return type on separate line" coding convention
16:13
wireshark follows it
Avatar
That looks weird to me, I usually just grep for / function_name(.*)$/
Avatar
that also gets calls
Avatar
Discord ate my backslashes πŸ˜›
Avatar
@heinrich5991 https://github.com/edg-l/teestatus/blob/7a077f13110acf8d72614a3dd6d0b55b35069c8d/src/server.rs#L160 i always keep in mind what you said about accepting [u8] instead of vecs, you think that recommendation is applicable here still? i need to modify the contents of those buffers btw
Avatar
Avatar
heinrich5991
that also gets calls
I personally don’t mind
16:14
But I can see it being an issue in a massive codebase
16:15
the buffers should already have the size needed
16:15
so maybe using u8 is better
Avatar
take &mut [Vec<u8>] ?
Avatar
what about the inner vec
Avatar
the Vec -> &[] conversion only applies unconditionally for the outermost layer
16:16
okay, even there, unconditionally is wrong. if you need to call functions like push or reserve, take a vec there
Avatar
no i dont need
Avatar
hm
16:17
you could take a single buffer πŸ™‚
16:17
and split off as much as you need each time
Avatar
i made this a zero copy parser, it saves the recv content in the buffer and returns a view of that content as a ServerInfo struct
16:17
i needed 2 buffers due to the more packet
16:17
maybe a single buffer is better
Avatar
take a &mut [u8]
16:18
you can split it with split_mut_at (or similar) after receiving the first packet
Avatar
Hm, being zero-copy means it can’t work on architectures that can’t do unaligned access, right?
Avatar
zero copy probably means "copy the ints"?
16:19
here
Avatar
ah yea
16:19
the ints are copied i guess
16:19
its not fully zero copy
Avatar
Makes sense
Avatar
the strings are not copied tho
16:20
which theorically is most of the content?
16:20
maybe it doesnt make sense to make this 0 copy
Avatar
What if a string is unaligned? Does that fail at compilation even?
Avatar
"no unaligned access" on platforms means "the standard method of getting integers only works on aligned addresses"
16:21
(this always refers to "all platforms that I know")
16:21
strings (as character arrays) can still be unaligned
Avatar
A string slice (&str) is made of bytes (u8), and a byte slice (&[u8]) is made of bytes, so this function converts between the two. Not all byte slices are valid string slices, however: &str requires that it is valid UTF-8. from_utf8() checks to ensure that the bytes are valid UTF-8, and then does the conversion.
16:21
idk im not rly informed about this align stuff
Avatar
you can still have unaligned ints, but need different methos of accessing them
16:22
in rust you'd probably make a new type "unaligned int" that has a value function (edited)
Avatar
Avatar
heinrich5991
strings (as character arrays) can still be unaligned
Well ofc there is a way, I bet LLVM can even do the shift for you on such platforms
Avatar
Avatar
heinrich5991
you can split it with split_mut_at (or similar) after receiving the first packet
oh i get it now
Avatar
But accessing an int should be no different to accessing a char
Avatar
right now i do a little hack in the parser tho
16:23
i check if its the end by checking if there are
16:23
consecutive \0
16:23
2*
Avatar
ouch πŸ˜„
16:23
can't you pass a slice?
16:24
its cuz i found it rly simple with nom
16:24
xd
Avatar
nom probably supports "many_until_eof" or similar
Avatar
its a bit sad the packet doesnt tell u how many players are there
16:24
in the current packet
16:24
but the buffer is filled with lot of \0
16:24
because i use a bigger packet than what its filled
Avatar
no, because you ignore the recv return value
16:25
xd
Avatar
@Learath2 @heinrich5991 need your input here πŸ™‚ https://github.com/ddnet/ddnet/issues/3411
If anyone wants to summarize the discussion, feel free to. I just wanted to create the issue now.
Avatar
ok ill check that
Avatar
@Zodiac such a rush πŸ˜› I saw it, can I take a day or so to form my opinion? ^^
16:25
I like the idea
Avatar
i got a new theme for my neovim, this time is the ayu dark theme poggers
Avatar
haha I am bored and want to be productive. Blocked on /swap and accounts.
16:27
I'll look at my feature list and see if there is something else I can do
Avatar
sorry. this is such a "we're doing a change and will be stuck with it forever" PR, so I don't want to do stupid mistakes
Avatar
definitly dont call it /otp
Avatar
Yeah fair enough and if we did rush it we wouldn't have gotten the latest idea. I'll look at something different
Avatar
@heinrich5991 do you want the verification to be a code or a clickable link?
16:30
in the email
Avatar
I have not thought about this
16:30
clickable link is less friction
Avatar
i have yet to hear what deen thinks about all of this too
Avatar
code might be less susceptible to phishing
Avatar
I have given it some thought but couldn't think of a simple way to feed back to the client (edited)
16:32
Email -> website -> master server -> client but will need a way to know which client to send to
Avatar
@heinrich5991 have you thought about putting all this auth commands behind https?
16:32
emails are sensitive data afterall
16:32
a command is not encrypted
Avatar
I'm in favor of not doing this until we get an encrypted connection, but I hadn't publicly said so yet because I thought you rather want accounts than more delays ^^
Avatar
Thought you were working on the HTTPS part?
16:33
Team effort πŸ˜„
Avatar
i wonder why u meantion master servers in the accounts issue
Avatar
I'm working on the https server list, this isn't quite related to accounts, I think
16:34
the client can already speak HTTPS, that's no problem
Avatar
@heinrich5991 should the auth server-side stuff be on its own "microservice" too?
16:34
and then servers talk to it or something?
Avatar
I don't know much about that, it's probably better if others design that part
Avatar
I think it could be
Avatar
^
16:35
an HTTPS endpoint would be nice, idc how it's implemented
16:36
time to push rust into ddnet monkalaugh
Avatar
From the server side, it is rather straight forward. Never connected via a CPP client before
Avatar
I can help you with that, for me the server side isn't as straightforward
Avatar
I was going to suggest creating the backend accounts API in C#
16:36
never
Avatar
only did that in python so far, and only small projects πŸ˜„
Avatar
** waits for uproar πŸ˜„
Avatar
languages we already use in ddnet: C, C++, Python (and nim)
16:37
it would be best if it was one of those πŸ˜‰
Avatar
it would be best, it's not a strict requirement
Avatar
There is so much hate for C# due the legacy. NET Core is open-source and has so much built-in functionality. Could create the BE accounts system in a day
Avatar
it's just that every dependency makes it harder to deploy πŸ˜‰
Avatar
Python isn't a bad alternative
Avatar
c# reminds me of M$$ and u can just use java if u go that way
16:38
python being dynamic doesnt appeal to me
Avatar
C# isn't a bad language. I don't know how friction less it runs on linux. do you use it on linux @Zodiac?
Avatar
Also has a lot of support and could allow for a quick solid implementation
Avatar
@heinrich5991 to use c# on linux u have to install 300mb software called mono
Avatar
@heinrich5991 it is multi-platform
Avatar
"multi platform"
Avatar
I know it's multiplatform
16:39
using C on windows is also a PITA
Avatar
We host our C# apps on linux (edited)
Avatar
ah
Avatar
Cheaper πŸ˜„
16:40
Anyway, just a thought. The solution needs to be decided first.
16:40
I knew it wouldn't be a popular one.
16:40
I think python is also a strong option. Been meaning to learn the ins-outs of it as well
Avatar
thats so boring
Avatar
Telemetry is enabled by default but can be disabled by setting environment variable DOTNET_CLI_TELEMETRY_OPTOUT=1.
Avatar
my rust/c++/c/python compiler/interpreter doesn't come with telemetry
Avatar
Boring often means easier πŸ™‚
Avatar
not rly
16:42
i dont like how python scales due to it being dynamic typed
Avatar
@Learath2 know how I can get a std::shared_ptr of my own class?
Avatar
and nobody rly uses type hints
Avatar
I basically want to define a method on std::shared_ptr<CMyType> so I can pass myself to antoher thread
Avatar
Yeah I can't speak much about Python.
Avatar
we can use the fearless concurrency of rust instead of the nobo python GIL monkalaugh
Avatar
python would probably scale by using multiple processes there
Avatar
if u want something easy i would use golang before python
16:44
u can learn go in 1 day
16:44
but rust is the best
Avatar
C# has Tasks which pretty much gives concurrency out of the box
Avatar
Issue free
Avatar
Avatar
heinrich5991
@Learath2 know how I can get a std::shared_ptr of my own class?
You can just make_shared no?
Avatar
@Zodiac u can get data races in c# right?
16:45
greenthing
Avatar
I have a function ::SpawnTask()
16:45
that wants to pass itself to a thread
16:45
so I kind of want to ensure that my own class lives as long as the thread
16:46
the easiest way would be to already be behind a std::shared_ptr, so I could just clone that
16:46
I don't know if I can formulate that in C++ though
16:46
(or rust, for that matter)
16:47
hm, then again I'm accessing engine, and I can't guarantee that lives long enough
Avatar
The framework handles most of the complexity and protects against most of that. Can't remember the last time I had a race condition. But anyways, I am not meaning to come out as C# is the best language. Just that it gets some unnecessary hate due to the pre .NET Core days.
Avatar
ouch, bolting on concurrency on top of our code works badly
Avatar
I have also heard good things about RUST - just haven't used it myself
Avatar
well i talk about it here nearly every other day monkalaugh
Avatar
I'm going to put // Just pretend `this` and its `m_pEngine` live longer than the thread. there and call it a day
πŸ˜… 1
Avatar
Add a Menu Option Where You Can Manage Friends, Tutorial Tab Somewhere with animations and explaining stuff, ingame tab like the news for vids and other creations, Quick Chats something like rocket league has. make more stuff translateable in the language.txt files specially the quick chats would be nice to communicate with people who dont know the language you speaking, a game tab where you can share gameskins binds and etc..
Avatar
have fun with it
Avatar
@Zodiac u mentioned dota 2 in the github right?
16:53
actually dota 2 community resembles this one a lot
16:53
its all made up of old players
Avatar
we have a lot of new players
16:53
maybe not on discord
Avatar
btw the strong vote got more than 80 votes iirc
16:54
thats way more than the usual ppl chatting here
16:54
16:55
same here
16:55
there is definitly looking here and they dont talk
16:55
ppl*
Avatar
Yeah, there definitely are parallels. The same issues/danger could be had if Valve used /r/dota2 is its decision maker (edited)
Avatar
actually valve does a lot of things r/dota2 mentions
Avatar
They do use it as a source but not as the deciding vote
16:57
There are a number of times the subreddit was heavily against a decision made by Valve
16:57
They just represent a portion of a larger community
16:57
Like @heinrich5991 said there are lots of new players. Just not on discord
Avatar
#join-leave
16:58
there is quite lot of ppl joining everyday
16:58
they just dont talk
16:58
which is quite normal
16:58
blending in a discord is not easy
Avatar
Joining and being active participant are two different things
Avatar
we had 2000 players yesterday. this discord has a member count of 5000
16:59
I don't think more than 1000 of these had a discord account joined in this server
Avatar
if they are interested they would
Avatar
Especially the asian countries
16:59
Discord is banned in China
Avatar
well china is a different matter
Avatar
Which actually is our largest community
Avatar
i rly dislike the barrier
Avatar
There is also a language barrier
Avatar
i literally know nothing of whats happening there
16:59
ye
16:59
sad
Avatar
All I am saying is that there is a likelihood that the feedback we rely on is bias towards skilled players and certain demographics
17:00
It is something to be aware of. Doesn't mean to disregard the input
Avatar
its ppl who played this game for years, they rly like this game, disregarding the input would be rly bad imho
Avatar
Completely agreed πŸ™‚ It is very important to listen to the feedback. The difference is to not make it the only channel/decider.
Avatar
there are lot of games that have this type of "hidden mechanic" (strong weak hook) in this case, and learning those mechanics makes you a better player
17:02
its also a sense of effort
17:02
i rly dont want it removed
17:03
also the strong weak hook on novice you wont care most of the time
17:03
unless you optimize for top ranks
17:03
it matters most on edgehook maps and other brutal maps
Avatar
There are parts that are a lot easier if you so happen to have strong. /spec and /unspecing isn't a skill but rather a knowledge barrier.
Avatar
and nothing wrong with a knowledge barrier
Avatar
hm
Avatar
you can do that novice part
Avatar
knowledge barrier doesn't seem useful to me
Avatar
its only normal to expect players to be more invested the more they go into harder maps
Avatar
yes, removing things you have to know sounds good to me though
17:05
all else being equal
Avatar
i dont like removing things you have to know
17:05
it removes depth
17:05
a depth that lot of players love
Avatar
It is a knowledge barrier for the sake of it and creates a bad user experience
17:06
The alternative would be to have a very obvious indicator of who has strong/weak, then a clear method to /spec.
Avatar
if you create hints that tell you that /spec exists and that it can be used for changing weak/strong, then that removes a knowledge barrier
17:06
I see absolutely nothing wrong with that
Avatar
well i wasnt talking about spec tbh
17:06
there are maps without it
Avatar
and u have to plan the strong weak partsa beforehand if u want to optimize it
Avatar
BROKEN @Zodiac
Avatar
hmm. UNK?
Avatar
UNK means unknown
17:07
country
Avatar
@Cristian thanks Kenzoo - will look into it. What server and map is this?
Avatar
its block chilean srv
17:07
idk why its unk
Avatar
maybe block servers don't have server location configured
Avatar
Avatar
Ryozuki
and u have to plan the strong weak partsa beforehand if u want to optimize it
But can you see how this might be an example of favouring advanced players at the expense of new players? The situation that it benefits advanced players is minimal where most of the time it is an unnecessary extra. Where the avg player/new players unknowingly have a worse experience or find parts harder. What I am trying to get at is that we have a natural bias to older players, which we need to be aware of. To give an hypothetical. What if there a "Newbies Encouraged! " WhatsApp group and we used that to make decision on strong/weak. Do you think the same decision would have been made?
Avatar
they dont find parts harder in novice
Avatar
Or moderate
17:13
I played teeworlds for 2 years and didn't know about strong
Avatar
i dont think it matters much in moderato too
17:13
moderate
17:14
until the high end
17:14
and there is when u should already know about this
Avatar
Hammer flying is easier if the person on the top has strong
17:14
It allows you to fall down slower
Avatar
Avatar
heinrich5991
so I kind of want to ensure that my own class lives as long as the thread
As long as a class that lives long enough holds a shared ptr to your class it'll live long enough. Idk which part you are having trouble with
Avatar
hammer flying with weak in novices doesnt matter
17:14
its more useful to control the going down
17:14
which i never seen was needed in novice
Avatar
I am not trying to make this about strong πŸ™‚
17:15
I am using that as an example
17:15
In this hypothetical can we assume Strong creates a worse experience for new players
Avatar
weak sucks remove it
Avatar
remove strong
Avatar
@heinrich5991 is the mysqlcpp connector removed already on 15.3.2?
17:24
gotta know so i can update the arch aur
19:31
i want a command that bind a key so it emote at a certain frequence a certain emote (smthing like 1time/s) (edited)
Avatar
not possible
Avatar
Avatar
jao
not possible
D: sadness is huge
Avatar
@Astramast just do bind key emote [number 1-16] the emotes will be spammed depending on what setting the server uses (edited)
Avatar
Avatar
bubliman
@Astramast just do bind key emote [number 1-16] the emotes will be spammed depending on what setting the server uses (edited)
no but i dont want to spam like 300 emotes/s
20:36
i want like 1/s or smthing
Avatar
Would be amazing, Teeworlds is open source, so u can code it if u want πŸ™‚
Avatar
we need dota's high five in teeworlds. id love that xD
Avatar
@Learath2 for ping calculation, should a server be able (with a fallback provided by the master server) to select a country? or should the master server have sole control over this?
Avatar
Idk how you intend to do ping
Avatar
wanted to do ping estimates based on geolocation
Avatar
Hm, I think the master controls that
Avatar
NimzaLoader malware is unusual because it's written in a programming language rarely used by cyber criminals - which could make it harder to detect and defend against.
Avatar
"unusual"
22:33
monkalaugh
22:34
feelsbadman
22:36
22:36
actually true comments
22:36
im sure this software runs in millions of servers yet no one knows this guy who is about to be gone..
22:36
ppl only care about tv ppl feelsbadman
Avatar
deen helps make malware programming language monkalaugh
Avatar
I haven't helped with Nim for years now
Avatar
i find it funny that most ppl dont know where the test sv password "nimrocks" comes from monkalaugh
Avatar
leaks
Avatar
@heinrich5991 #📌info
Exported 373 message(s)