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 2022-11-13 00:00:00Z and 2022-11-14 00:00:00Z
Avatar
anyone know how to fix that fucking bug when mouse goes in the 2nd screen, and put game in background when you click (edited)
00:37
doesn't work
Avatar
windowed fullscreen
00:39
or borderless i think its called
Avatar
doesn't work
00:41
unplayable, I rq
Avatar
Avatar
ReiTW
anyone know how to fix that fucking bug when mouse goes in the 2nd screen, and put game in background when you click (edited)
you need some kind of "always on top" program to make exclusive fullscreen applications not minimize when you click second monitor, theres dozens of them they all do exactly what you want https://github.com/LorenzCK/OnTopReplica
Avatar
Avatar
ReiTW
unplayable, I rq
skill issue
Avatar
Avatar
Tater
you need some kind of "always on top" program to make exclusive fullscreen applications not minimize when you click second monitor, theres dozens of them they all do exactly what you want https://github.com/LorenzCK/OnTopReplica
it was fine before
00:54
maybe cuz I run another game
00:54
idk
Avatar
Should i change to windows with wsl instead of linux if only reason behind using it is easy packaging, 'better performance' and sometimes easier development, but i cant use fav software and play fav games (wine/proton dont help) (edited)
Avatar
Avatar
ReiTW
it was fine before
the intended behavior is that the window minimizes
Avatar
@Chairn I have tried the twmap on a fresh python setup, which worked just fine once it was installed
01:22
or, at the very least import twmap worked, thats where yours broke, right?
Avatar
Avatar
ReiTW
anyone know how to fix that fucking bug when mouse goes in the 2nd screen, and put game in background when you click (edited)
It literally started happening to me too recently
06:40
I have the game on fullscreen and when there is a window under the game like browser or file explorer my mouse can get stuck on it sometimes preventing me from interacting with the game
06:41
But I didn't know that you can set ddnet to always on top
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 07:20:04Z
yo @Robyt3 got a low hanging fruit client crash in teeworlds for you :)
Avatar
Avatar
Anime.pdf
Should i change to windows with wsl instead of linux if only reason behind using it is easy packaging, 'better performance' and sometimes easier development, but i cant use fav software and play fav games (wine/proton dont help) (edited)
What games and software do we talk about^^
Avatar
Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever!
07:47
Holy
07:47
A big update
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 07:56:42Z
did u even ever try to use bevy?
08:00
its rly gud
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:07:31Z
nice
08:07
still trying to figure out multi cursor plugin :(
08:07
08:07
any idea what "M" referrs to?
08:08
or better "M-j"
Avatar
press M
08:11
and then j
08:11
M with shift iirc since its cap
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:11:36Z
so shift + m ?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:11:55Z
does not spawn cursors :(
Avatar
idk bro
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:12:31Z
sad
08:12
do u even vim
Avatar
u just dont know how to use it
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:12:43Z
rude
Avatar
blame urself
08:12
and go to a corner
08:12
and cry
08:12
PES3_WeirdSip
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:12:53Z
bra obv idk how to
08:13
because the docs make no sense or are outdated
Avatar
ok first
08:13
i dont support vim users
08:13
only neovim
08:13
im based
08:13
and why dont u use ctrl + v
Avatar
imagine a child being raised with things like neovim and rust what would they be like
Avatar
good programmers probs
Avatar
Hmm I use vis which have mutliple cursors. In normal mode I tap Ctrl+J and it spawns another cursor. Mutli-cursoring is really powerfull tbh
Avatar
or atleast a higher understanding of computers
08:14
than normies
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:14:38Z
idk how to do proper word jumping with ctrl v
08:14
ctrl+v is so blocky
Avatar
wait so what does it mean to use multiple cursors
Avatar
i'll send vid
Avatar
u dont rly need multiple cursors
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:17:11Z
08:17
i want the = attr[..] applied for like 6-2
08:18
in vscode i would do multi cursor select and copy all words and add = attr[: paste in and add ]
08:18
idk how to copy words of different length in vim
08:19
or append at the end of lines of different length
08:21
@Ryozuki how would you do that?
Avatar
Avatar
Mr.Gh0s7
i'll send vid
took me a while (played with obs)
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:22:46Z
wait the magic m is typing /M ?!
08:22
xd
08:23
can you leak your keypresses pls?
Avatar
no after I have multiple cursors I type /M to find the start of the M
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:23:19Z
a
08:23
shiet
08:23
makes sense
08:23
u use diff plugin anyways so i rip
Avatar
I use vis not a plugin xD
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:23:51Z
okay hacker
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:24:02Z
vi studio
08:24
? xd
08:24
i feel like i will never get rid of my workflow of switching from vs to vim and back whenever i see fit xd
Avatar
Avatar
[quakenet] ChillerDragon
vi studio
A vi-like editor based on Plan 9's structural regular expressions - GitHub - martanne/vis: A vi-like editor based on Plan 9's structural regular expressions
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:26:21Z
@heinrich5991 @deen u also vim mains how do you solve the problem of copying a word from one position in a line to another position in a line on multiple lines at once?
Avatar
I also found this plugin idk if it's any good though https://github.com/erf/vis-cursors
remember cursor positions in vis. Contribute to erf/vis-cursors development by creating an account on GitHub.
Avatar
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 08:34:34Z
that xkcd is tru for sure but you also learn more than doing stuff manually and you do get better at predicting when and how useful automation would be
08:36
the most profit you get is if your automation tool can be easily adapted for other repetetive tasks
08:37
good thing i never start any of my "automation" ideas
Avatar
Avatar
[quakenet] ChillerDragon
yo @Robyt3 got a low hanging fruit client crash in teeworlds for you :)
It's already fixed by https://github.com/teeworlds/teeworlds/pull/2931, which should fix all of the datafile errors. I never got around to testing this with all maps though to see if some existing maps no longer load properly.
Avatar
found a bug in my teeint
09:43
result |= ((current_byte & mask) << shift) as i32; should be result |= (current_byte as i32 & mask) << shift;
09:43
gg
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 09:43:32Z
Yea kinda expected that it might be fixed judging by the amount of pening prs ._.
09:43
Oy has been dark for a while
Avatar
tw ded
09:43
ddnet where its at
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 09:44:45Z
oof
09:45
yo @Ryozuki btw did my unit tests for the packer help you in any way or did it inspire you or something? :D
Avatar
i used some
09:46
but cvariableint had some tests
09:46
thanks to the roundtrip test i found the bug
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 09:46:53Z
pog
09:46
idk if its urs
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 09:47:11Z
no :(
Avatar
no, its by robyt
09:47
u nobo chiller
09:47
BASED
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 09:47:35Z
oof
09:47
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
09:47
i added those with nice ASCII art
Avatar
im not doing packer yet
09:48
i think ill make a packet parser now
09:48
but like rly low level
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 09:48:30Z
assembly
Avatar
nah i mean i wont put a list of packet enums or smth u know
09:48
just parsing
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 09:49:08Z
my tests are also just for AddInt()
Avatar
[quakenet] Ryozuki BOT 2022-11-13 09:50:12Z
how to disable highlights from the bridge
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 10:03:29Z
ou idk i never cared tbh
10:03
gotta rename on irc or discord :p
Avatar
Avatar
Ryozuki
nah i mean i wont put a list of packet enums or smth u know
So just CNetPacket and CNetChunk?
Avatar
Avatar
Jupstar ✪
What games and software do we talk about^^
Games like Disco Elysium, Stalker, modded among us dont work at all, from software i'd love to use Photoshop, premiere and after effects again
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 11:06:45Z
i never used photoshop or premiere but also never felt like i was missing out when using gimp and kdenlive
Avatar
kdenlive fucking sux, gimp fucking sux, at least it feels like it, i used adobe for few years and didn't get a single issue with it, kdenlive broke few my saves, had render artifacts, crashed and lagged, gimp is just confusing, buttons are located in weird placed and do weird stuff sometimes
11:11
And not mentioning a LOT of community plugins and tutorials for adobe software
Avatar
Avatar
Anime.pdf
Games like Disco Elysium, Stalker, modded among us dont work at all, from software i'd love to use Photoshop, premiere and after effects again
https://www.protondb.com/app/632470 stalker has many different games https://www.protondb.com/app/20510 but most have gold or platin
Game information for Proton, Linux, Steam Deck, and SteamOS
Game information for Proton, Linux, Steam Deck, and SteamOS
Avatar
Avatar
Jupstar ✪
https://www.protondb.com/app/632470 stalker has many different games https://www.protondb.com/app/20510 but most have gold or platin
Didnt work for me, Disco Elysium just froze on loading screen and after some time crashed because of memory overflow (around 16gb)
Avatar
some ppl post suggestions
11:15
e.g. PROTON_USE_WINED3D11=1 %command% sometimes changing proton version helps
11:16
but i cannot judge anyway
11:16
probs depends on ur setup
11:16
without amd master race u doomed on linux anyway
11:16
if u want to game
Avatar
Avatar
Anime.pdf
kdenlive fucking sux, gimp fucking sux, at least it feels like it, i used adobe for few years and didn't get a single issue with it, kdenlive broke few my saves, had render artifacts, crashed and lagged, gimp is just confusing, buttons are located in weird placed and do weird stuff sometimes
Gimps total refusal of making their UX closer to the industry standard is so annoying. It worked so well for blender too, idk why they resist it so much
11:17
Software itself is actually almost as powerful as photoshop. It just has such a freaky UX
Avatar
Linux is worst os for desktop, nothing works from the box, you need to compile and fix your system youself
Avatar
Avatar
Anime.pdf
kdenlive fucking sux, gimp fucking sux, at least it feels like it, i used adobe for few years and didn't get a single issue with it, kdenlive broke few my saves, had render artifacts, crashed and lagged, gimp is just confusing, buttons are located in weird placed and do weird stuff sometimes
anyway. since u asked what os u should use i'd say either dual boot, since u seem to use windows software that doesnt run on wine yet. Switch to linux for stuff like emulators, coding, gaming in most cases etc., else windows or windows only
Avatar
Avatar
Anime.pdf
Linux is worst os for desktop, nothing works from the box, you need to compile and fix your system youself
u meant windows xD
11:18
KDE works smooth af out of box
Avatar
Proton works surprisingly well for me. I only have to reboot into windows for genshin impact, league, valorant and tarkov. Anticheats are so intrusive now
Avatar
and is highly customizable without stupid registry hacks
Avatar
Avatar
Anime.pdf
Linux is worst os for desktop, nothing works from the box, you need to compile and fix your system youself
Hm, you don't have to use arch or gentoo you know? A lot of distros offer an OOBE like windows
Avatar
the fact that windows 11 forces me to group same apps is just a joke
11:20
anti productivity
Avatar
Avatar
Jupstar ✪
KDE works smooth af out of box
Never used kde tbh, i used ubuntu and fedora (wont mention arch cuz i couldnt set it up), it was a bit easier with fedora but both had a lot of crashes and bugs everywhere and to fix that i needed to install that that that then do that that that and after, maybe, it will work (edited)
Avatar
I personally enjoy starting from a bare bones system, but I know it's not for everyone. You have to know exactly what you want in that case, most people don't care about that level of customization and for them we have things like ubuntu, pop os, etc
Avatar
Avatar
Anime.pdf
Never used kde tbh, i used ubuntu and fedora (wont mention arch cuz i couldnt set it up), it was a bit easier with fedora but both had a lot of crashes and bugs everywhere and to fix that i needed to install that that that then do that that that and after, maybe, it will work (edited)
yeah gnome sucks
11:22
thats correct
11:22
if u come from windows u have to use kde ofc
11:22
gnome is the worst shit invented anyway xD
11:23
i used it for over 1 year. and it sucks
11:23
xD
Avatar
Avatar
Jupstar ✪
i used it for over 1 year. and it sucks
I used it for a whopping 3 hours and I concur
Avatar
Avatar
Anime.pdf
Linux is worst os for desktop, nothing works from the box, you need to compile and fix your system youself
fake
11:23
stop spreading lies
Avatar
Avatar
Ryozuki
stop spreading lies
Its the most honest opinion with no lie in it
Avatar
ur opinion is wrong
11:24
BASED
Avatar
There are no 'wrong' opinions, linux just not ready for desktop yet feelsbadman
Avatar
Fwiw when windows breaks you can't fix it at all usually. The advice is reinstall. The fact that you can fix linux is a bonus imo
Avatar
it is a wrong opinion
11:25
cuz its ready
Avatar
it is indeed
Avatar
the fact that u are using a framework, such as proton to make a non-compatible binary such as a windows only game work on linux and it have issues has nothing to do with linux being good or not
Avatar
Windows most descriptive error: STOP 0x000007AB
Avatar
if u compare use a native game
Avatar
since valve and amd joined the game, linux is useable
Avatar
you just dont know how to use linux
11:26
thats it
Avatar
steamdeck also uses KDE out of box
Avatar
its more advanced
Avatar
bcs its windows friendly
11:27
i am not saying KDE has the best out of box, but u can easily make it behave similar to windows
11:27
4-5 clicks
Avatar
windows literally copies KDE
11:27
its a meme cuz its true
Avatar
Avatar
Jupstar ✪
since valve and amd joined the game, linux is useable
It's honestly way past usable now. I've been running a pop os laptop and everything justworks. You just don't get cutting edge multiplayer games and adobe software
11:28
Avatar
Avatar
Ryozuki
the fact that u are using a framework, such as proton to make a non-compatible binary such as a windows only game work on linux and it have issues has nothing to do with linux being good or not
Default user wont appreciate your 'customisation', he cares about office programs (libre sux), games and web surfing
Avatar
not rly
11:29
95% of users
11:29
just thing a computer
11:29
is a web browser
11:29
think*
Avatar
ah yeah microsoft office.. the office programm anyone can effort xd
Avatar
and most appreciate it trust me
11:29
libre doesnt suck
Avatar
Even libre is very decent now. When did you last give it a go?
Avatar
libre is ok, but i never use it tho xd
Avatar
haters gonna hate
Avatar
when do u need it, i actually use google drive's solution more than the desktop programms xD
Avatar
Avatar
Jupstar ✪
ah yeah microsoft office.. the office programm anyone can effort xd
Dunno how you use it but i never met a single person who bought it, a lot of russian sites with pirated versions troll (edited)
11:30
Also web version is free afaik
Avatar
Avatar
Ryozuki
libre doesnt suck
It does, its hard to work with documents
Avatar
Office 365 is pretty good too if you have to use microsoft ones because, um reasons
Avatar
no ur just bad
11:31
BASED
Avatar
Idk, your criticisms sound more like from 6-7 years ago
11:32
Most of the things you mention have been ironed out by now
11:32
based youtuber
11:33
GIGACHAD
Avatar
Even my bizarro gentoo install mostly justworks now and gentoo is the most finnicky distro of them all
Avatar
@Learath2 the problem with most people about "linux desktop" is not linux itself but the "programs" available, cuz they want to keep using bloated propietary stuff
11:35
and they refuse to learn the superior free as in freedom software
11:35
BASED
Avatar
Libreoffice is bloated too. Office suites are just ew
11:35
i just use latex
11:35
or md with pandox
11:35
pandoc
11:35
is awesome
Avatar
As I said, only problem I've had within these last 3 years with linux desktop is game anticheats and gimp being made by weirdos
Avatar
Avatar
Ryozuki
and they refuse to learn the superior free as in freedom software
who cares about freedom feelsbadman
Avatar
lot of people
11:36
americans
11:36
kek
11:36
me
Avatar
ukraines
11:36
😉
Avatar
kekw
Avatar
@Learath2 a good talk while emerging packages
11:38
[The Tale of Two Elitists] Carpenter Elitist: *walking in IKEA to buy some meatballs* Carpenter Elitist: (thinks to himself) Look at all these IKEA sheeples, a bunch of normies who don't have the skills to build their own furniture. Carpenter Elitist: (thinks to himself) These people neither have the curiosity nor the initiative to learn basic woodworking. Carpenter Elitist: (thinks to himself) I guess some people are simply like that, docile and apathetic. Later Carpenter Elitist: (to his son) Son, I have the IKEA meatballs you want. Were you able to fix the issue with my laptop? Son, Linux Elitist: Yes. That issue will keep coming back. I can install Linux in your laptop to permanently resolve that issue. Dad, Carpenter Elitist: I don't have time for that Linux you keep talking about. Windows works for me. Just fix it again later if the issue returns. Son, Linux Elitist: (thinks to himself) I guess some people are simply like that, docile and apathetic. Son, Linux Elitist: (thinks to himself) Some people neither have the curiosity nor initiative to learn basic information about operating systems. Son, Linux Elitist: (thinks to himself) I hate to admit it but my dad is a normie and a Windows sheeple.
11:38
lmao
Avatar
Avatar
Learath2
As I said, only problem I've had within these last 3 years with linux desktop is game anticheats and gimp being made by weirdos
Add weird tax software running in Wine for me (it's even written in Qt, wouldn't be that hard to port to Linux)
Avatar
do u use wine staging?
Avatar
I just use whatever wine my distro or homebrew give me
Avatar
well its very important to use wine-staging
11:49
normal wine is really far behind
Avatar
That's ok, the tax software has not changed in 10 years
Avatar
wine-7.20 (Staging)
11:50
so it actually does run?
Avatar
same version
Avatar
i thought u had a typo
11:51
since learath talked about stuff that didnt work
Avatar
yes, it runs, with some minor problems
Avatar
running windows apps on linux is a good way to find UB xd
11:55
11:55
xd
Avatar
why does smth else than aligned_alloc exists
12:08
why even allocating, just use the RAM directly
Avatar
Why use ram, just use L3 cache
Avatar
any program that doesnt work with registers only is slow af
Avatar
@Jupstar ✪ java?
12:30
can a java app be memory efficient
12:30
xd
Avatar
yes it can, by using JNI
Avatar
Well whenever a GC is involved there will be some inefficiency, but I heard java got some new gc that is pretty acceptable
Avatar
there are big GC defenders out there
12:35
they would even make a kernel with gc
Avatar
Avatar
Learath2
Well whenever a GC is involved there will be some inefficiency, but I heard java got some new gc that is pretty acceptable
yeah
12:35
Zgc
Avatar
After reading that I checked and probably not so easy to use calloc for the map layers in memory on server
12:36
because that would be a nice way to save memory on largely empty parts of maps
12:37
because we don't actually mem_zero them, but malloc and then io_read
Avatar
Is that bad?
12:38
I didn't read the article yet, just wondering
Avatar
i think calloc can be faster sometimes
12:38
cuz it knows if it needs to zero the memory
12:38
but malloc sometimes double zeroes
12:38
i only read it over fast
Avatar
So if we'll mem_zero after anyway, we should calloc instead is the takeaway?
Avatar
if you malloc + mem_zero all the memory needs to be there. With calloc you get a single COW page and it will be expanded on write access
12:39
yes
12:39
but the COW might make performance a bit less predictable
Avatar
Ok, that fits with the mental model I've had already 😄
12:40
If after reading the map we don't touch it, I guess mmaping it could be an optimization there but honestly that part of the code is very much fine
Avatar
Yeah, after looking at it my conclusion was also to change nothing 😄
Avatar
@Jupstar ✪ for the last couple months I've been getting some very harsh stuttering. Do you have any idea how I could go about diagnosing the issue?
12:41
Since this is very subjective I don't think I can easily bisect for it, we don't really have tooling in the code to profile frametimes either
Avatar
Avatar
Learath2
@Jupstar ✪ for the last couple months I've been getting some very harsh stuttering. Do you have any idea how I could go about diagnosing the issue?
what have u tried yet, unplug everything and stuff?
Avatar
I tried an older version, I don't remember which and it didn't have the stuttering. Other than that nothing yet
12:42
I'm a little lost when it comes to debugging stuff that doesn't crash
Avatar
whats the first version that doesnt lag
Avatar
I profiled for a bit too but nothing really popped up as small spikes in frametime just get averaged out
Avatar
You could try printing out the frametimes with our benchmarking tools, maybe it's objective there and can then be bisected?
Avatar
Avatar
Jupstar ✪
whats the first version that doesnt lag
I can try to find it but it's really hard. I have to play for a bit on each version to see if I get them
Avatar
i c
Avatar
Yesterday I clicked on server info on the 64 player multeasymap server and DDNet hung for > 1 second, never seen that before
Avatar
Avatar
Learath2
@Jupstar ✪ for the last couple months I've been getting some very harsh stuttering. Do you have any idea how I could go about diagnosing the issue?
lot of skins?
Avatar
Avatar
deen
You could try printing out the frametimes with our benchmarking tools, maybe it's objective there and can then be bisected?
Ah, this is a good idea. I could set up some frametime metrics and just bisect and apply the patch to see if my worst frametimes get worse
Avatar
4k skins are a problem that could occur after time
12:44
if u use skins.tw
12:44
they make ur game lag if u dont have 8k ready GPU xd
Avatar
No 4k skins, no local skins
Avatar
skins.tw?
Avatar
Nope, skins.ddnet.tw
Avatar
ok
Avatar
Avatar
Learath2
Ah, this is a good idea. I could set up some frametime metrics and just bisect and apply the patch to see if my worst frametimes get worse
benchmark_quit
Avatar
Maybe I'll try turning off download skins entirely. Though I didn't see the spikes correlate to any skin loads
Avatar
Avatar
deen
benchmark_quit
Does this actually exist? What does it benchmark?
Avatar
It exists, we use it for phoronix
12:46
it prints out the frametimes to a file and then quits after a specified number of seconds
Avatar
Avatar
Learath2
Maybe I'll try turning off download skins entirely. Though I didn't see the spikes correlate to any skin loads
if its just ddnet skins it should be fine
Avatar
Avatar
deen
it prints out the frametimes to a file and then quits after a specified number of seconds
Does it join any server or sth?
Avatar
./DDNet "connect ger2.ddnet.org; benchmark_quit 3 foo.txt"
Avatar
Oh that should make this much easier
12:48
Is it just a list of frametimes?
Avatar
I'll just build a small tool to gather some easier to use metrics. Some percentiles, maybe worst/best, variance and make a graph of the distribution
12:50
See if anything pops out at me just by staring at data
Avatar
I seem to have some jumps in there too, but not noticable since it's just to 11-13 ms
Avatar
Avatar
Learath2
I'll just build a small tool to gather some easier to use metrics. Some percentiles, maybe worst/best, variance and make a graph of the distribution
Avatar
I get like insane stutters. Makes playing very hard
12:51
Easily noticeable to the eye
12:51
linux?
12:51
maybe ur gpu is dying
12:51
temps?
12:51
throttling
Avatar
Windows, on linux it is much better though I still get more stutters then I used to even on there
Avatar
Avatar
Ryozuki
maybe ur gpu is dying
I'd probably see this on much more demanding games way before ddnet, no?
12:52
Temps seemed fine to me but I'll keep an eye on them just incase
Avatar
Just a couple lines of python that I don't really intend to maintain 😛
Avatar
generally:
  • your GPU could be in a state where it down and upclocks all the time bcs its not used enough
  • temps of CPU or GPU make the hardware downclock
  • other software e.g. firewall or anti virus
  • drivers are broken etc.
Avatar
Difference between versions smells more like something we changed to me, but I'll keep an eye on those too incase
12:56
Maybe we accidentally made something block on the main loop accidentally and it blocks longer on my old cpu making it noticeable
Avatar
question is how long did u test the other version
12:57
and also which version
Avatar
I'll take a look tonight 👍
Avatar
Hey, I'd like to contribute to DDNet, but I am completely new to programming..I mean, I have some projects but I never tried programming at larger scale or contributing. Also I never made a single pull request or issue on github. Could you give me some tips, to get started? Solving an issue is probably long way to go for me, so I need a way to get started.
Avatar
depends on ur level
Avatar
If you can build client and server locally following the github readme that already helps
Avatar
This article aims to introduce you into DDNet development, since it's an open-source game, it relies on random people kind enough to contribute to it on their free time.
13:23
ah yes if you use windows check the github readme
Avatar
I've read this all, and already made this changes: https://edgarluque.com/blog/chat-command-ddracenetwork/
A chat command that shows info about our player
13:24
And yeah it works
Avatar
oh poggers
13:24
i wonder who made that
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:24:12Z
fellow ryo enjoyer
Avatar
Avatar
Ryozuki
i wonder who made that
This edgar dude seems really knowledgeable
Avatar
And yeah, by now I want to somehow help you in solving issues, but I actually don't know how
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:25:01Z
I also made a video series for beginners https://www.youtube.com/watch?v=HB_aSIOmdu4&list=PLhJkqAQmOh5LyYOfnMy4PJB6CSZltQyTc @Aniak did you manage to compile and test out some code yet?
Avatar
Avatar
Aniak
Hey, I'd like to contribute to DDNet, but I am completely new to programming..I mean, I have some projects but I never tried programming at larger scale or contributing. Also I never made a single pull request or issue on github. Could you give me some tips, to get started? Solving an issue is probably long way to go for me, so I need a way to get started.
I started out exactly like this. I picked something that annoyed me and started there. However small it is
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:25:49Z
im pretty annoyed by missing 0.7 support
13:25
xd
Avatar
I'll admit though back when I started out ddrace was in a much worse state than ddnet is in right now. Our bugs and problems aren't exactly too too easy to solve
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:26:32Z
there are always low hanging fruits even now
Avatar
i should continue that ddnet blog series
Avatar
There are some very low hanging fruits in the editor where we don't maintain a code quality as high as the rest of the client
Avatar
Maybe I can start by looking at code, and make issues?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:27:21Z
yikes pls not more issues
Avatar
For example I see a lot of magic numbers in code, and idk if its intended to be like that, or no
Avatar
maybe something in #bugs is easy
13:27
or in github issues
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:27:37Z
pls close issues instead of opening them :p
Avatar
identifiying whats hard or not is also a skill though
Avatar
Avatar
Aniak
Maybe I can start by looking at code, and make issues?
Or browse through issues and see if you find something that catches your eye, maybe annoys you aswell
Avatar
Avatar
[quakenet] ChillerDragon
I also made a video series for beginners https://www.youtube.com/watch?v=HB_aSIOmdu4&list=PLhJkqAQmOh5LyYOfnMy4PJB6CSZltQyTc @Aniak did you manage to compile and test out some code yet?
Like this magic -1 in your videos, which means message to all
Avatar
Avatar
[quakenet] ChillerDragon
pls close issues instead of opening them :p
open issues if they are valid
Avatar
Avatar
Aniak
Like this magic -1 in your videos, which means message to all
its fine if u want to replace those
13:28
just make sure if its network related that it has the same value
Avatar
That -1 for all would be a massive amount of manual work that won't teach you much coding imo. It's more labour 😄
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:29:57Z
If you are really really new to coding recommend having fun first build some feature that you would like in your client or server before you try to contribute something
Avatar
Or that, it's also fun to mess around. One of the first things I built was a level system. You'd get xp as you killed tees and you'd level up 😄
Avatar
Hm, maybe that's the way
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:31:21Z
yes that should give you dopamine while learning how the code works
13:31
Is there some feature you always wished for?
Avatar
Actully, some would be cool to see
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:32:17Z
yes what
Avatar
for example skin changing color dynamically (edited)
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:32:32Z
?
13:32
could you ellaborate what that means
13:33
you mean automatic color changes on tees?
13:33
like a fading effect or something?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:33:25Z
yes thats a fun first task
Avatar
Or its already there xd
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:33:33Z
there is
Avatar
Rainbow tees are fun to code indeed
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:33:36Z
but it doesnt matter
Avatar
Avatar
Learath2
Rainbow tees are fun to code indeed
Thats what i meant
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:33:46Z
only makes it easier if you get stuck
👍 1
Avatar
but i couldnt find a word
13:33
rainbow tee
Avatar
hi i want to set motd of my server to map info how can i do that just like ddnet in motd
Avatar
a good code QOL is replacing int flags with named enums
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:34:20Z
put sv_motd in server server settings
13:34
ah wait
13:34
i red wrong
Avatar
Avatar
[quakenet] ChillerDragon
put sv_motd in server server settings
no i want to put there server info
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:34:46Z
yes sori xd
13:34
i think ddnet generates those with a script
Avatar
i have vote list
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:35:22Z
what maps are you using?
13:35
official ddnet maps?
Avatar
Avatar
[quakenet] ChillerDragon
official ddnet maps?
yup
13:35
13:37
@deen
Avatar
If anyone wants to summarize the discussion, feel free to. I just wanted to create the issue now.
poggers 1
❤️ 4
f4 1
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:39:18Z
wow
13:39
casually dropping that xd
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:39:33Z
@pinkrat
Avatar
Grabs popcorn
Avatar
Avatar
-iᴅiɴ
@deen
We're shipping the cfg files too, I think they should auto load
13:40
you can remove all .cfg files if you don't want them
Avatar
Avatar
deen
We're shipping the cfg files too, I think they should auto load
For motd what can i do ?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:40:12Z
i do not see them shipped
Avatar
Then you can set sv_motd in your autoexec_server.cfg
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:40:26Z
Avatar
Avatar
deen
Then you can set sv_motd in your autoexec_server.cfg
bro i want to put map info in server motd
13:40
like ddnet
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:40:40Z
or how are they named?
Avatar
everytime u change map (edited)
13:41
motd changes to map info
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:41:20Z
The magic scripts that make DDNet run. Contribute to ddnet/ddnet-scripts development by creating an account on GitHub.
Avatar
how can i do that ?
Avatar
Like you personally? 😄
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:42:05Z
seems like those .map.cfg files are not published tho
Avatar
Avatar
Learath2
Like you personally? 😄
Yeah, doesn't seem like that much work.
13:42
if people agree with the proposal. Don't want to roll it back again
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:43:08Z
thats crazy
13:43
history moment
13:43
will there be a feedback round or is that final?
Avatar
if someone recording or screenshoting, hi mom, i was here!
13:44
🥹
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:44:08Z
ikr
Avatar
feedback round. I came up with this in 2 minutes just now, it's probably not perfect 😄
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:44:31Z
u made graphics?
13:44
deen artist confirmed?
13:44
wait those are not tw related ? xd
13:44
scam
13:45
ah i didnt read it says duolingo xd
Avatar
Oh you made a proposal, I'll check it out tonight. Finally maybe some progress on accounts. It was time
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:45:15Z
@deen wat lang are you learning?
13:45
wow so basically 2 point systems?!
13:46
so we have to finish all those annoying novice maps from aoe again?! -.-
Avatar
No, you don't have to. Only if you want the achievement
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:46:49Z
or the points
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:47:19Z
crazy
Avatar
Would be crazier to manually assign each of the thousands of active players to their new accounts
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:47:48Z
yes for sure
Avatar
Avatar
deen
Would be crazier to manually assign each of the thousands of active players to their new accounts
feelsbadman
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:48:15Z
what about ppl who loose their private key? or leak it?
Avatar
Avatar
[quakenet] ChillerDragon
what about ppl who loose their private key? or leak it?
get doxxed
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:48:46Z
or wait are there passwords the users type in?
Avatar
Avatar
[quakenet] ChillerDragon
what about ppl who loose their private key? or leak it?
For leaks a central server can invalidate the old key. For losing they can get a new one from a central server
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:49:28Z
can ddnet accounts be used by non ddnet servers to avoid having to reimplement a account system?
13:49
basically oauth xd
Avatar
the private key would be a temporary token
13:49
so your password can be used to log in again and get a new token on each device
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:49:54Z
if i lose my password?
Avatar
interesting
Avatar
email address during signup
13:50
so you can restore it
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:50:10Z
has to be verified?
13:50
if you want to rstore pw
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:50:23Z
if i forgot my email password?
Avatar
otherwise don't care
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:50:28Z
or what email i used
Avatar
Avatar
[quakenet] ChillerDragon
can ddnet accounts be used by non ddnet servers to avoid having to reimplement a account system?
yes, that's the idea
Avatar
@deen one question
13:50
u have kog maps ?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:50:57Z
wait but what happens if i lose access to my email account?
Avatar
You can try asking @Avolicious if they have a ll maps to download
Avatar
@Avolicious hey bro
Avatar
I hope you'll provide something for other mods/servers. As a mod dev/hoster I'd love to either use DDNet account server, or be able to run own server and let the players add it to their clients.
Avatar
@deen this opens another attack tho, i come with thousands of ips and start registering like crazy
Avatar
Avatar
[quakenet] ChillerDragon
wait but what happens if i lose access to my email account?
Same as with every account in the world, start begging them to switch to a different email and provide some proof of who you are, or bad luck and make a new account
Avatar
can i get cash back in points by purchasing stuff in partner shops? troll
Avatar
Avatar
Ryozuki
@deen this opens another attack tho, i come with thousands of ips and start registering like crazy
what good is that?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:51:52Z
so there will be manual management of accounts?
Avatar
Avatar
Kaffeine
I hope you'll provide something for other mods/servers. As a mod dev/hoster I'd love to either use DDNet account server, or be able to run own server and let the players add it to their clients.
yes, the idea would be that every game server can use the accounts
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:52:00Z
hm
Avatar
Avatar
[quakenet] ChillerDragon
can ddnet accounts be used by non ddnet servers to avoid having to reimplement a account system?
Oh, this. I've composed my messages for a while 😄
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:52:08Z
xd
13:52
what about dummys?
13:52
how many tees per account?
13:52
how many accounts per ip?
Avatar
Today the accounts, and tomorrow what, a skinshop?)
13:52
brownbear
Avatar
Avatar
[quakenet] ChillerDragon
so there will be manual management of accounts?
Well with such an extreme circumstance there will definitely need to be manual intervention. You lost your password, you lost your email, you lost your emails password
Avatar
Avatar
Matodor
Today the accounts, and tomorrow what, a skinshop?)
twerking twinbop for 40$
Avatar
And the accounts+season 2 would be a good fit for the year 2023. You can say DDNet is 10 years old, first season is over
Avatar
Avatar
Matodor
Today the accounts, and tomorrow what, a skinshop?)
never
Avatar
Avatar
Ryozuki
never
How will I buy my mansion then???
Avatar
Avatar
Ryozuki
never
google in discord phrase: "accounts" and see how many times was answering "never"
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:54:26Z
So I can send a email from real.milk@gmail.com to support@ddnet.org and say i lost access to my old account "milk+81289" and get in? xd
Avatar
s/my mansion/more servers for ddnet/ ofc
Avatar
Avatar
[quakenet] ChillerDragon
So I can send a email from real.milk@gmail.com to support@ddnet.org and say i lost access to my old account "milk+81289" and get in? xd
You will try to prove it. If you can't then no
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:55:00Z
yikes this will be drama
Avatar
No it'll be fine
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:55:13Z
who is responding to those requests?
Avatar
It's how accounts work everywhere
Avatar
u must be responsible for ur own things
Avatar
Are you going to spam it? I don't expect it to happen a lot
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:55:41Z
@Ryozuki learath and deen just confirmed there will be support if you mess up
Avatar
nobody is entitled to give your account back if u lost credentials
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:55:55Z
@Learath2 not me but such things happen
Avatar
How often do you lose your password and your email password?
Avatar
Avatar
[quakenet] ChillerDragon
@Ryozuki learath and deen just confirmed there will be support if you mess up
That's probably less effort than the manual renames we do 3 times a week now
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:56:22Z
i dont mean neccessarly bad actors but also a bunch of youngsters who lost their mail
13:56
@Learath2 more often than i would like to admit
13:56
oh i see i wasnt aware of the renames
Avatar
Avatar
Learath2
How often do you lose your password and your email password?
i saw guy on kog discord, he had like 7 accounts just cuz he forgot pass and email xd
Avatar
We have a couple ways of verifying people are who they say they are, I think we'll be fine
Avatar
ChillerDragon: use a password manager
13:57
ChillerDragon: start today. I use bitwarden
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:57:12Z
tell that to me 14y ago
13:57
i use "pass"
13:57
nowerdays
Avatar
sounds good
Avatar
bitwarden has a cool cli client
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:57:43Z
but also email providers might die etc
Avatar
you can add multiple emails to your account, maybe discord, idk
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:58:12Z
ah yea
13:58
that sounds cool!
Avatar
login/password registration OR discord/google/github etc oauth 2FA
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:58:39Z
can i also provide the name of my first pet? xd
Avatar
chiller go the unix way
13:58
use pass
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:58:46Z
i do use "pass"
Avatar
ChillerDragon: no
Avatar
Pass is the standard unix password manager, a lightweight password manager that uses GPG and Git for Linux, BSD, and Mac OS X.
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:58:56Z
sad
13:58
i do use it!
Avatar
email, discord, matrix, telegram, github, goodle, facebook, and real adress
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:59:02Z
omg
13:59
xd
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 13:59:12Z
with pass-otp extension
13:59
for 2fa
13:59
its very poggers
13:59
and i cant login shit on my phone xd
13:59
phone bad anyways
Avatar
Avatar
[quakenet] ChillerDragon
can i also provide the name of my first pet? xd
So you can get owned by the Facebook quiz asking you to post your pet's name, mother's maiden name and birthday in some slightly encoded form? 😄
Avatar
I hope you saved your 2fa codes somewhere not on your only machine
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 14:00:37Z
no
14:00
xd
Avatar
do it, now
Avatar
One serious question I have is whether we can integrate this with steam
Avatar
or print them
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 14:00:50Z
print xd
Avatar
Avatar
Learath2
One serious question I have is whether we can integrate this with steam
we can, I thinkk
Avatar
@Learath2 oauth2
Avatar
It'd be nice if steam players got an account automatically somehow
Avatar
ChillerDragon: yes, print
Avatar
Avatar
Learath2
One serious question I have is whether we can integrate this with steam
Yeah, every Steam user having an automatic account would be sweet and make this much easier
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 14:01:35Z
For example all emails I owned when i started to play tw which i would have used to signup for ddnet do not exists anymore
Avatar
Maybe at steam startup we can ask if they have an account they want to link to their steamid and if they click no we create a new one for them
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 14:01:47Z
add in a 5yr tw break and account is gone
14:02
also please do add support for 2rd party servers making use of the accounts!
14:02
3rd
14:02
omg
14:02
xd
Avatar
3nd
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 14:03:50Z
bra
Avatar
Ah yes. Secord and Thind
Avatar
if the id is 4 digits long i can see trolls registering 9999 accounts under deen nick
Avatar
Avatar
deen
And the accounts+season 2 would be a good fit for the year 2023. You can say DDNet is 10 years old, first season is over
Avatar
Are we actually making accounts?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 14:17:07Z
seems like
Avatar
How do you solve linking existing names to accounts safely? Was that already talked about?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 14:18:56Z
yes
Avatar
As I understood season 2 will reset points
Avatar
Really???
14:21
Surely you don't mean the points reset I wouldn't believe that
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 14:21:13Z
keep both
14:21
u dont have to believe anything just read the proposal deen just sent
Avatar
Ok I will sorry
Avatar
Ah yes I worded wrong season 2 will not have the points from season 1 but I think season 1 will kinda continue or smt
Avatar
I have a lot of ideas for ways this could be implemented but I think everyone does
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:35:48Z
@heinrich5991 how does "size": "specified_before" work?
15:36
Some Teeworlds stuff in Rust. Contribute to heinrich5991/libtw2 development by creating an account on GitHub.
15:37
A retro multiplayer shooter. Contribute to teeworlds/teeworlds development by creating an account on GitHub.
15:37
and the dissector just reads it as the raw data saying that the first int is the size?
15:37
if so its a bit sad that "chunk" is not displayed in the dissector view :c
Avatar
but actual name+id are also shown
so to play anonymously i assume youd just have to log out of an account for the time being?
15:40
and yes accounts plz f3
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:41:49Z
wait map data also uses displays the chunk before
15:41
makes no sense to me
Avatar
not 100% how deen planed it yet i guess the easiest would simply to add a unique ID column and respect it in all SQLs and dont fill if not logged in but it sounded like deen generally prefers to have accounts, and split the ranks
Avatar
how would the season work?
Avatar
in the issue he mentioned smth about season 2 for ddnet so accounts start at 0 points, but he also disclaimed that he isnt sure yet
Avatar
would the map pool be the same
Avatar
yes
15:44
i think its just so it motivates ppl to use accounts
15:44
and not feel bad
Avatar
i would support a different map pool 😅
Avatar
but tbh, the ppl with 10k+ points needs to be transferred i simply dont see it comming else
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:44:53Z
@heinrich5991 nvm i think i actually understood ur dissector xd pr incomning
Avatar
Avatar
Jupstar ✪
but tbh, the ppl with 10k+ points needs to be transferred i simply dont see it comming else
well if u do for one, u have to do for all
15:45
idk
Avatar
if ~100 people help out to identify the ppl's current name for the accounts it shouldnt be too much works
Avatar
Avatar
louis
well if u do for one, u have to do for all
yes, well i'd say not for all
15:45
but maybe a certain amount of points
Avatar
i think the only way to do the no point transfer is to change the map pool and the point system/rank point system
Avatar
500 points are nothing xd
Avatar
so people dont feel as theyre just playing the game twice
Avatar
I think it'd be good for the game if the move included fixes to game mechanics, such as a toggle for strong / weak. (or removing weak in general), not allowing dummies being killed in team ranks, etc.
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:46:11Z
yo why is my vscode rust intellij so bad?
15:46
i cant click shit
Avatar
what extension did u use
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:46:33Z
rust
Avatar
yeah it sucks
15:46
better use rust analyzer (edited)
15:46
i still have to update the workspace
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:47:03Z
yea i saw xd
15:47
15:47
okeoke
Avatar
Avatar
Skeith
I think it'd be good for the game if the move included fixes to game mechanics, such as a toggle for strong / weak. (or removing weak in general), not allowing dummies being killed in team ranks, etc.
as much as i hate strong/ weak there were some arguments as why its fundamentally hard to fix
15:47
but there can def be some improvements
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:47:13Z
scam
Avatar
If we were to restart points for a new "season", it'd be a massive waste to not make such changes alongside it
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:47:44Z
do i need to configure da rust shiet
15:47
or can it just werk like c++
Avatar
As discussed with @edg-l rust-analyzer is the extension to use

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 (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or val...
Avatar
chillerdragon it should just work™️
15:54
i also made a pr rn
Avatar
Avatar
Skeith
If we were to restart points for a new "season", it'd be a massive waste to not make such changes alongside it
mh yeah seasons are a way for physic changes indeed. every fix will probs introduce a new "broken" physics anyway ^^
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:55:51Z
wot u prn?
Avatar
so that rust is auto formated
15:56
rust code
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:56:15Z
rost dev
15:56
pog
15:56
ctrl+shift+f it is
15:56
Avatar
is ur repo up to date?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:56:58Z
lang server for nobs anyways
Avatar
ryo fixed stuff
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:57:00Z
i rust pro
15:57
im not working on cringe ddnet
Avatar
yes
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:57:17Z
i work on libtw2 rust masterrace proj
Avatar
thats why i asked
15:57
lel
15:57
well heinrich probs doesnt care about rust analyzer working correctly xd
Avatar
After generating compile_commands.json with cmake, I ran cppcheck like this: cppcheck --project=compile_commands.json -DWIN64 --suppressions-list=cppcheck.supp --enable=all 2>cppcheck.log With these suppressions in cppcheck.supp: ``` cstyleCast useStlAlgorithm unusedFunction variableScope noExplicitConstructor useInitializationList noConstructor uninitMemberVar uninitMemberVarPrivate uninitDerivedMemberVar uninitStructMembe...
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 15:58:05Z
i didnt touch ddnet code since i rq playing tw basically
15:58
heinrich gigachad doesnt need it
15:59
OMG nvm i suck xd
15:59
i wrote all generated code by hand and the generate script deleted it xd
15:59
xxxxxxxxxxxxxxxxxxxxD
Avatar
nais
Avatar
Avatar
Jupstar ✪
mh yeah seasons are a way for physic changes indeed. every fix will probs introduce a new "broken" physics anyway ^^
maybe rewrite physics so they're faster/more efficient as a target?
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 16:01:06Z
yikes change physics
16:01
we need better test coverage for physic changes first
Avatar
[quakenet] ChillerDragon BOT 2022-11-13 16:22:01Z
ok nvm i dont get it
16:22
heinrich sos
Avatar
took long enough to make an acc system ready
16:34
justatest
16:34
imma stick to discord auth for tourneys
Avatar
so many const in that pr
17:01
this is way immutable by default helps
17:01
ccuz u wont miss any
Avatar
have u ever encountered a logical bug with non const stuff?
17:08
i feel like i havent tbh
17:08
i mean e.g. in rust its nice bcs its default
17:08
but in cpp u have to manually write const xD
17:09
also this only adds it to places where its sure it can be const
17:09
so at least for current bugs it wont help
Avatar
yo wanna buy some free raycast collision detection code?
Avatar
150% more fps in some cases :D
Avatar
sounds costly
Avatar
should I diff it or should make a pr?
Avatar
i'd like to know if u claim 150% how much fps more do i get if i just replace sqrted checks with squared checks
17:21
sqrt is probs most expensive in the loop
Avatar
I mean from 2000 fps down to 1200 on unpatched and to 1800 to patched
Avatar
the main difference is that it checks only key points, not 32 per tile
Avatar
i mean if u can garantuee its not changing physics that sounds good to me ^^
Avatar
sadly not changing physics sounds bad to me 😦
17:22
i mean changing physics would(or might) worth it (edited)
Avatar
even changing roundings of floatingpoints might already break maps sadly
17:23
sometimes u stand against a wall and hold jump + d
17:24
or stuff like that
Avatar
Season 2 :D if it breaks stuff.
17:24
I'll send diff real quick
Avatar
^^
Avatar
Well, I'm not sure for that
17:25
the algorithm does not depend on rounding of a specific way
Avatar
Avatar
Jupstar ✪
but in cpp u have to manually write const xD
this is my argument
17:29
u have to opt in
17:30
it should be opt out
17:31
we should use this season 2 to make ddnet 2.0
17:31
break the protocol
17:31
optimize it
Avatar
but still i think const correctness is much less helpful then you probably would agree xd
Avatar
map format
17:31
kek
Avatar
Avatar
Jupstar ✪
but still i think const correctness is much less helpful then you probably would agree xd
in c++ const is useless cuz u can get rid of it
17:32
in rust u cant
Avatar
i'd really like a language that actually tries to prevent common logic bugs
Avatar
also the const (non mut) is paired with the borrow checker (edited)
Avatar
i have a server dedicated to ddnet idea spitballing if 2.0 ever happens
Avatar
making it way more powerful
Avatar
well also depends on what u write
17:33
for APIs its probs better
17:33
than for a small module
Avatar
its better for everything
Avatar
Avatar
Mr.Gh0s7
150% more fps in some cases :D
When I runned it with valgrind smth it had 16x less calls. It's been a while since then though
Avatar
Avatar
Ryozuki
its better for everything
its same discussion as using private vs getters etc
Avatar
you know u pass smth to a function by reference e.g
17:34
and it wont be modified
17:34
unless its mut
17:34
for example
Avatar
Avatar
Jupstar ✪
its same discussion as using private vs getters etc
no
Avatar
yes
17:34
until u suddenly need mutation and need to change 10000 functrions xD
Avatar
not rly
Avatar
give me stats how many bugs have been prevent for const correctness
17:36
i wont try to convince u
Avatar
i feel like in most situation its smth like if(a = 1) or stuff like that xd
Avatar
u can keep ur cpp
17:36
idc
Avatar
but i dislike coding like this anyway xD
Avatar
Avatar
Ryozuki
u can keep ur cpp
lel
17:37
u can also accidentially use mut in rust where it makes no sense
17:37
or depends what the fuck u design
17:37
fn HiIMutateOneAttributeButPlsNeverChangeAnythingElse
17:37
oh nice i have mutation rights, lets change stuff
Avatar
Avatar
Jupstar ✪
u can also accidentially use mut in rust where it makes no sense
not rly
17:37
cuz the compiler has a check
17:38
it tells u if the mutability is used
Avatar
ok
Avatar
this works cuz the whole type system works with the mut keyword
Avatar
maybe u are right if the function is max 10 lines of code
Avatar
e.g a function that modifies a struct takes a &mut self
Avatar
but if u have a beast of a function
17:38
then rip
Avatar
idc what u talking about here
17:38
idk
17:38
*
17:39
idk the mut and non mut falls in place rly ez in rust
17:39
it just makes sense
Avatar
int i = 0 if(i == 0) dostuff // 5000 lines of code oh i need i now, i hope its never changed again
17:39
it was*
17:40
anyway i can only tell from my experience
17:40
and have to say i cannot really think of any case
Avatar
a immutable value can be initialized at runtime
17:40
but a const has to he const evaluated
17:41
so its not exactly the same as cpp const i guess
17:41
let x = 2;
17:41
is called a binding
17:41
const X: i32 = 2; (edited)
17:41
a constant
Avatar
yea
17:41
cpp thus create constexpr
17:41
so its clear the expression it self is constant
Avatar
rust const is like constexpr
Avatar
yes
Avatar
u only use const in rust where u would do a constexpr
Avatar
ok if i say const i meant immutability
17:42
not a constant expression
Avatar
the mutability is rly closely tied to the borrow checker
17:43
so i think it makes a lot of of sense, or even is required to be the way it is in rust
17:43
As mentioned in the “Storing Values with Variables” section, by default variables are immutable. This is one of many nudges Rust gives you to write your code in a way that takes advantage of the safety and easy concurrency that Rust offers. However, you still have the option to make your variables mutable. Let’s explore how and why Rust encourages you to favor immutability and why sometimes you might want to opt out.
17:44
note that you can do this too btw
17:44
let x; if a == 2 { x = 3; } else { x = 4; }
17:44
and x here is immutable
17:44
and rust checks that its init in all code paths
Avatar
i just wonder is it like this for mut for parameters why isnt everything a immutable reference (or simple type) and then if u add & its automatically mut if u want a copy of the object as parameter it should be explicity mut
Avatar
function parameters can be mut too
Avatar
yes
17:45
but with mut as keyword?
Avatar
but mut changes meaning on whether its a reference or not
17:45
ye
Avatar
and why not simply have & which is mut, or mut which is a copy. rest is const anyway and the compiler should decide (edited)
17:46
can u even change parameters itself?
17:47
like fn (i mut: i32) i = 2
Avatar
// pass by value fn func(x: i32) { // cant change x, its immutable let y = x + 1; } // pass by value fn func(mut x: i32) { // can change, but its value is only changed locally (for the copy passed) x = x + 1 } fn func(x: &i32) { // cant change x, its immutable } fn func(x: &mut i32) { *x = *x + 1 }
Avatar
yes
17:47
exactly
17:47
this is what i dont get
Avatar
what does this help to make it so complicated
Avatar
it helps
Avatar
why does x:&i32 and x:i32 exists?
Avatar
i dont think its complicated
17:47
u are just explicit
Avatar
why doesnt the compiler decide?
Avatar
Avatar
Jupstar ✪
why does x:&i32 and x:i32 exists?
here
Avatar
with &i32 u pass by reference
Avatar
yes
17:48
but why does it matter?
Avatar
with i32 you pass by value
Avatar
its const
Avatar
in fact
17:48
??
17:48
but if you pass without a reference, then you give up the ownership of the object (if its not copy, e.g a complex object, not a integer)
Avatar
see whatever i passed to the function its immutable
17:48
so its 100% whatever i holds
Avatar
ownership is the answer
17:49
to ur question
Avatar
yes but why isnt rust always using a const ref
17:49
how does the ownership help for the function call as is
Avatar
do u always pass by const ref in cpp?
Avatar
it help before and after
Avatar
sometimes a function simply has to take ownership of the value you are passing
Avatar
Avatar
Ryozuki
do u always pass by const ref in cpp?
no but i'd love to not have to decide. When i say const it should automatically decide
Avatar
i say its good y ou have to decide
Avatar
Avatar
Ryozuki
sometimes a function simply has to take ownership of the value you are passing
and why not always enforce it for immutable objects?
17:50
i mean does this help for multi threading?
Avatar
mh ok
Avatar
when a function takes for example a &mut i32
17:50
it knows it has full exclusive access to it
17:51
and no other place has it
17:51
its thread safe
Avatar
then my next question
17:51
what are u doing more often? pass an object by const ref or create a copy
Avatar
hard to say
Avatar
bcs i feel like i defs do more const ref
Avatar
for example if i take a cheap object that implements Copy i take a copy
17:52
otherwise it depends on the logic
Avatar
and thus this should be the "easiest" way of passing, same for references
Avatar
sometimes it makes sense to take full ownership
17:52
and not let the called hold the passed value
Avatar
after that comes a "real" copy
Avatar
for example the builder pattern
17:52
u should learn rust
Avatar
yes
Avatar
then its better to argue
17:52
but dont half ass it
17:52
im also bad explaining xd
Avatar
but from my current experience in c++ i'd say mut for reference is too verbose, as its more likely than a "real" copy
Avatar
i dont think so
Avatar
and for simple types like int it rarely useful anyway (edited)
17:53
(const ref is rarely useful i mean)
Avatar
Avatar
Ryozuki
i dont think so
mhh well u dont need to argree
17:54
to me this is a flaw in rusts thinking really
Avatar
the borrow checker allows amazing things like safe array slices
17:54
slices in rust are amazing
Avatar
yes
17:54
i know
Avatar
A dynamically-sized view into a contiguous sequence, [T]. Contiguous here means that elements are laid out so that every element is the same distance from its neighbors.
Avatar
slices even allow to split the borrowing for threading
Avatar
most stuff i know about rust is, when i encounter threading stuff and want to know how easy it is in rust xD
Avatar
Avatar
Jupstar ✪
most stuff i know about rust is, when i encounter threading stuff and want to know how easy it is in rust xD
idk u wont know if u dont try urself
17:55
but threading touches the hard part of rust
Avatar
yeah but IMHO this is actually the most intersting
Avatar
like in any language i would say
17:56
yeah
17:56
it is the most interesting
Avatar
bcs more threading is cool
Avatar
and what makes rust so amazing
Avatar
but also destroys performance easily if u do it wrong
17:56
or overdo it
17:56
most often u need to profile
17:56
cuz u dont have definitive answers
17:56
when doing threaded stuff
17:58
yesterday i found out this is the way to make a slice without copying https://doc.rust-lang.org/stable/std/slice/fn.from_ref.html
Converts a reference to T into a slice of length 1 (without copying).
17:58
a slice of len 1
17:58
didnt know before xd
Avatar
u never learn out ^^
18:00
i mean the projects i did when i was like 16 completly suck from my point of view.. but they still work xDD
18:01
and the best moments are when u are impressed about what your past you already did xD
18:01
"wow this is actually clever" XD
18:02
its probs like in sports.. sometimes you onfire and do epic stuff, and sometimes u do the worst solution possible xd
18:08
@Ryozuki i've one more question do u use mut for anything else than parameter/var declaration?
18:09
e.g. why let mut i = 1 and not mut i = 1 where mut and let mut is basically the same... the let seems verbose
Avatar
well idk bro
18:15
ur just nitpicking now
18:15
xd
Avatar
no
18:15
i am actually serious
Avatar
my argument would be that if i see a let i know its a variable binding/declaration
18:15
otherwise i dont know, and i dont rly care
Avatar
mhh but if u wouldnt know let mut, it would be same for mut
18:16
ok anyway thanks
Avatar
probs some syntax parsing limitation
18:16
or idk
18:16
design decisions
Avatar
as soon as heinrich reads it i get some 50000000000 lines text anway
18:16
to explain all in detail
Avatar
or not
18:16
he will skip this maybe
18:16
xd
Avatar
xD
18:17
i bet he has "rust" highlighted like u
18:17
u can do this
18:17
let (a, mut b) = (1, 2);
Avatar
yeah ok, dunno but still interesting xD
Avatar
u are unpacking
18:17
a declaring a and b
18:17
where b is mutable
Avatar
yes
18:18
its like int a,*b
18:18
i dunno if i like such delcartions
Avatar
well i like em
18:18
cuz they fit rust "everything is an expression" pattern
Avatar
it feels like its less readable 😄
Avatar
let (a, b) = if x == 2 { (3, 4)} else { (4, 5) };
Avatar
xd
18:19
imagine not having ternary operators
Avatar
"mut is not paired with let in syntax, it's paired with each variable declaration"
Avatar
ah
Avatar
let (a, mut b) = get_pair();
Avatar
its the new let else sxntax?
Avatar
wasnt there a recent addition
18:20
let else
18:20
if let else
Avatar
but in this case its simply a tenary operator?
Avatar
what i sent is just a one line if
18:20
to show u that its a expression
18:20
the "everything is an expression"
Avatar
yeah
18:21
i see
Avatar
also rust match is amazing
Avatar
ok but thats also the way to write any tenary operator right?
Avatar
pattern matching is rly powerful
Avatar
i mean there is no alternative
18:21
there is not
Avatar
ok
Avatar
well u can make a macro
Avatar
yeah i see it really just a question bcs i actually use them quite often
18:22
and putting a full if expression is ofc verbose xd
18:23
but with macros might be smaller
Avatar
nah ppl dont write macros for this
18:23
you have to know the context
18:23
if you write code in a rusty way
18:23
it falls pretty nice i would say
18:23
rust mixes functional and imperative
18:23
i think it gets best of both
Avatar
mh yeah, maybe i just need more ryozuki propaganda to like it more xd
Avatar
this is how i decide to create a random seed or use the provided one from cli
18:26
on my ddnet map gen
Avatar
yeah looks like classic script languages, which i do not dislike makes it small and readable once u in it
Avatar
Avatar
Jupstar ✪
mh yeah, maybe i just need more ryozuki propaganda to like it more xd
thing is im bad at arguing and sometimes it feels like a race to nowhere
18:27
like the effort is futile
18:27
ppl will just believe their own opinion
18:27
so why bother
Avatar
yeah but sometimes its better to ask such ppl, bcs they find a easy way to overcome problems, so they dont have to argue xD
Avatar
Does anyone know how semaphores can work when you have multiple child process executing the same code, and the main process waits that all child process has finished to execute the code in the function? (lets say the func is called child()) in C (edited)
Avatar
oh in C
18:28
f
18:28
yeah
18:28
that's for school lmao
18:29
when u say rust to my teacher he's like "nothing is better than C"
18:29
is learath2 ur teacher
18:29
imagine a teacher saying bullshit for 1 hour
Avatar
Avatar
ReiTW
Does anyone know how semaphores can work when you have multiple child process executing the same code, and the main process waits that all child process has finished to execute the code in the function? (lets say the func is called child()) in C (edited)
what exactly is your problem
Avatar
just to explain smth that could be simplified in 2min
18:29
@Jupstar ✪ wait I was starting my VM for some code
Avatar
A semaphore is an integer whose value is never allowed to fall below zero. Two operations can be performed on semaphores: increment the semaphore value by one (sem_post(3)); and decrement the semaphore value by one (sem_wait(3)). If the value of a semaphore is currently zero, then a sem_wait(3) operation will block until the value becomes greater than zero.
18:30
increment for each child created and decrement when the child finishes?
18:30
idk whats the problem there
Avatar
#include <stdio.h> #include <sys/mman.h> #include <sys/types.h> #include <unistd.h> #include <semaphore.h> #define NUM_CHILDS 4 struct mmap_data { sem_t semaphore; int pid; }; void child(void *shared) { struct mmap_data *data = (struct mmap_data*)shared; sem_wait(&data->semaphore); data->pid = getpid(); sem_post(&data->semaphore); } int main(void) { void *shared = mmap(NULL, sizeof(struct mmap_data), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); struct mmap_data *data = (struct mmap_data*)shared; int err = sem_init(&data->semaphore, 1, 0); printf("Parent pid is %d\n", getpid()); for(int i = 0; i < NUM_CHILDS; i++) { if(fork() == 0) { child(shared); break; } } sem_wait(&data->semaphore); printf("pid:%d shared:%d\n", getpid(), *(int*)(shared + sizeof(sem_t))); sem_destroy(&data->semaphore); } I was trying to see that all processes will edit the same addr value
18:31
what I need to do is to wait that all the code in child() is finished
18:31
and only after printf in main
Avatar
unprotected shard memory
18:32
i actually very rarely ever used fork xd
18:32
not like i do c anymore
Avatar
the printf at the end is cursed but it was 5am when I did it
Avatar
@ReiTW u dont sem_post?
18:34
i think u have to sem_post on the for loop
18:34
before fork
18:34
or after
18:34
idk
18:34
ah wait
18:34
im
18:34
blind
18:35
fuckyousnail
Avatar
Idk i'm kinda lost with that
Avatar
dont mind me
18:35
i should reread stuff
Avatar
Thing is there's 4 childs + parent so it's even more confusing about how to use it
Avatar
so does it not work
18:36
i still dunno what ur problem is xD
18:36
i mean u basically use a mutex here
18:36
since counter is only 1 isnt it
Avatar
does unsigned int value need to be 1 when u init it?
Avatar
ok value is second parameter lel
Avatar
otherwise nobody will unblock on wait
Avatar
Imagine you don't use semaphore but instead you do sleep(1); in the main func before the printf at the end
18:37
I want the same result
Avatar
what does the program do rn
18:38
does it work?
Avatar
l@debian:~/c$ ./mmap_ex Parent pid is 4726
18:38
it's stuck
Avatar
int err = sem_init(&data->semaphore, 1, 0);
18:38
to
18:38
int err = sem_init(&data->semaphore, 1, 1);
18:38
u need 1 in the value
18:38
of the semaphore
18:39
wait only gets unlocked if value is greater than 0
18:39
and post increases it by one
18:39
thing is, it is always 0
18:39
so they all wait
18:39
u need to init it to 1
Avatar
l@debian:~/c$ ./mmap_ex Parent pid is 4815 pid:4815 shared:0 l@debian:~/c$ ./mmap_ex Parent pid is 4844 pid:4845 shared:4845
Avatar
did it work?
Avatar
not as expected, wait let me explain what print should be: Each child (4) and the parent should print pid:{self} shared:{the same value for all of them}
Avatar
so fork() == 0 fails basically
18:40
thats ur problem
Avatar
no fork() doesn't
18:41
just semaphores aren't used properly
Avatar
if(fork() == 0) { child(shared); break; }
Avatar
it either enters child or doesnt at all
Avatar
#include <stdio.h> #include <sys/mman.h> #include <sys/types.h> #include <unistd.h> #define NUM_CHILDS 2 int main(void) { void *shared = mmap(NULL, sizeof(int), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); int not_shared = getpid(); *(int*)shared = getpid(); for(int i = 0; i < NUM_CHILDS; i++) { if(fork() > 0) break; not_shared = getpid(); *(int*)shared = getpid(); } sleep(1); printf("pid:%d not_shared:%d shared:%d\n", getpid(), not_shared, *(int*)shared); }
18:41
take that as another example
Avatar
i mean every child would call sem_destroy(&data->semaphore);
18:41
in ur first
Avatar
(int)shared = getpid(); doesnt that override semaphore
Avatar
right? xd
Avatar
ah u changed it
Avatar
but instead of sleep(1); noby told me I could prob use semaphores to sync all process
18:42
xdd
Avatar
sleep 1 is wrong anyway
Avatar
and wait to print
Avatar
its not the way sleep
18:42
its a hack
Avatar
xD well it's the ugly way to do, this works & print the same value for all processes (shared)
Avatar
can u print all fork()?
18:43
and all getpid()
18:43
then u must see whatever problem u have xD
Avatar
l@debian:~/c$ ./mmap_ex pid 4989 pid 4990 pid 0 pid:4989 shared:4989 pid 4991 pid 0 pid 4992 pid 0 pid 0
18:44
just that childs are waiting, and parent too
18:44
(I did that:) sem_init(&data->semaphore, 1, 1); for(int i = 0; i < NUM_CHILDS; i++) { pid_t pid = fork(); printf("pid %d\n", pid); if(pid == 0) { child(shared); break; } } (edited)
18:47
fork() isn't the issue at all
Avatar
i still dunno exactly what u want to archive
18:49
but do u know what fork does?
18:49
its not a thread if u think that
18:50
what u want fits threads
Avatar
Avatar
ReiTW
#include <stdio.h> #include <sys/mman.h> #include <sys/types.h> #include <unistd.h> #include <semaphore.h> #define NUM_CHILDS 4 struct mmap_data { sem_t semaphore; int pid; }; void child(void *shared) { struct mmap_data *data = (struct mmap_data*)shared; sem_wait(&data->semaphore); data->pid = getpid(); sem_post(&data->semaphore); } int main(void) { void *shared = mmap(NULL, sizeof(struct mmap_data), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); struct mmap_data *data = (struct mmap_data*)shared; int err = sem_init(&data->semaphore, 1, 0); printf("Parent pid is %d\n", getpid()); for(int i = 0; i < NUM_CHILDS; i++) { if(fork() == 0) { child(shared); break; } } sem_wait(&data->semaphore); printf("pid:%d shared:%d\n", getpid(), *(int*)(shared + sizeof(sem_t))); sem_destroy(&data->semaphore); } I was trying to see that all processes will edit the same addr value
here every child will cale sem_destroy
18:50
Destroying a semaphore that other processes or threads are currently blocked on (in sem_wait(3)) produces undefined behavior.
>
Using a semaphore that has been destroyed produces undefined results, until the semaphore has been reinitialized using sem_init(3).
Avatar
@ReiTW why not threads
Avatar
its a wonder whatever u did does not crash xD
Avatar
Avatar
Ryozuki
@ReiTW why not threads
cuz I've already did smth about threads
Avatar
anyway
Avatar
we're learning interprocess communication
Avatar
add sem_post(&data->semaphore);
18:52
before the printf
18:52
@ReiTW
Avatar
I keep the wait?
Avatar
u cannot destroy a locked semaphore
18:52
no wait required
18:52
u use the semaphore like a mutex here anyway
18:52
after the for loop acquire it and release it again
18:53
but i hope u understand that u are simply cloning the processes
18:53
xD
18:53
it has nothing todo with threading
Avatar
yes I know I have another file using pthread
18:56
teacher talked about:
  • threads
  • semaphores
  • processes
  • mem shared communication between processes (mmap/shm idk) etc..
I kinda have to do most of the job for everyone, everyone in the classroom doesn't understand a shit Doing some small code example is good to help them, but ig doing mmap + processes + semaphores at the same time isn't the best way to learn
Avatar
Avatar
Jupstar ✪
add sem_post(&data->semaphore);
anyway do this ^
18:56
for the rest i dunno what ur goal is xd
Avatar
Avatar
Jupstar ✪
add sem_post(&data->semaphore);
I did and all processes exits successfully just as expected:
18:57
pid:5403 shared:5403 pid:5404 shared:5404 pid:5402 shared:5404 pid:5405 shared:5405 pid:5406 shared:5406
18:57
shared isn't the same value, but ig i'll do it differently xD (edited)
Avatar
Avatar
Ravie
it's already fixed but c0d3d3v went missing in action justatest
Yes I'm so sorry 😦 -.- It's really crazy how time flies. I'll start rebasing my changes right away.
Avatar
Avatar
ReiTW
shared isn't the same value, but ig i'll do it differently xD (edited)
but that makes sense
Avatar
a better way to use semaphores cuz rn that sucks
Avatar
u cloning the process
18:58
the old value still has old value
18:58
because this is a memory region shared between 5 processes
18:58
4 childs & 1 parent
18:58
using mmap
Avatar
(int)shared = getpid();
18:58
why this tho
18:59
*(int*)shared = getpid();
Avatar
was just to set a default value from the parent xd
18:59
ah well this is the thread example
Avatar
ah lol
19:00
know i understand what u want to do xD
19:01
but ur semaphore isnt shared
19:01
xd
Avatar
yes I just want that the last child to run data->pid = getpid(); sets his pid. at the end all processes shows this exact PID as it is "shared" memory
Avatar
Avatar
Jupstar ✪
but ur semaphore isnt shared
well technically it is lol it is
Avatar
why
Avatar
struct mmap_data { sem_t semaphore; int pid; };
19:02
void *shared = mmap(NULL, sizeof(struct mmap_data), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); struct mmap_data *data = (struct mmap_data*)shared; int err = sem_init(&data->semaphore, 1, 0); printf("Parent pid is %d\n", getpid());
Avatar
u only share the class that represents the semaphore
19:02
i dunno if it works like this
Avatar
semaphore is set in the shared region
Avatar
let me read docs
19:02
i never used it this way xd
Avatar
Avatar
ReiTW
#include <stdio.h> #include <sys/mman.h> #include <sys/types.h> #include <unistd.h> #define NUM_CHILDS 2 int main(void) { void *shared = mmap(NULL, sizeof(int), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); int not_shared = getpid(); *(int*)shared = getpid(); for(int i = 0; i < NUM_CHILDS; i++) { if(fork() > 0) break; not_shared = getpid(); *(int*)shared = getpid(); } sleep(1); printf("pid:%d not_shared:%d shared:%d\n", getpid(), not_shared, *(int*)shared); }
u need to sem_open right
19:03
i dont think u can just share the ptr
Avatar
sem_open and sem_init are technically similar
Avatar
" If pshared has the value 0, then the semaphore is shared between the threads of a process, and should be located at some address that is visible to all threads (e.g., a global variable, or a variable allocated dynamically on the heap)." it doesnt mention sharing process sharing
Avatar
just one is "named"
Avatar
isnt the name what gives both processes the ability to point to the same semaphore
Avatar
ah yeah
19:03
u right lel
19:03
u set it to 1
19:04
im blind soz
Avatar
sem_init is the equivalent of sem_open for unnamed semaphores.
Avatar
Avatar
noby
isnt the name what gives both processes the ability to point to the same semaphore
i'd use sem_open if I had to use that between siblings
19:04
like
19:04
not child process but 2 completly different processes
Avatar
ah then the semaphore has to exist within the shared memory right
Avatar
anyway
Avatar
it does rn
19:04
xD
Avatar
anyway if u want it equal put the print inside the child function
19:06
do you need your exact behavior?
19:07
dw i'll just find another way to do
19:08
idk it's like if semaphores are only binary
19:08
like can be only 1 or 0
19:08
so in my case it'd be too hard to use them for 4 childs (edited)
Avatar
you can initialize it with initial value 1
19:11
also values of it range from 0 to SEM_VALUE_MAX (according to man page)
Avatar
i think the output makes sense
19:17
@ReiTW
19:17
#include <stdio.h> #include <sys/mman.h> #include <sys/types.h> #include <unistd.h> #include <semaphore.h> #define NUM_CHILDS 4 struct mmap_data { sem_t semaphore; int pid; int calls; }; void child(void *shared) { struct mmap_data *data = (struct mmap_data*)shared; sem_wait(&data->semaphore); data->calls++; data->pid = getpid(); sem_post(&data->semaphore); } int main(void) { void *shared = mmap(NULL, sizeof(struct mmap_data), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); struct mmap_data *data = (struct mmap_data*)shared; int err = sem_init(&data->semaphore, 1, 1); printf("Parent pid is %d\n", getpid()); int forked = -1; for(int i = 0; i < NUM_CHILDS; i++) { forked = fork(); if(forked == 0) { child(shared); break; } } if(forked == 0) { printf("pid:%d shared:%d\n", getpid(), data->pid); } else { int chd = 0; while(chd < NUM_CHILDS) { sem_wait(&data->semaphore); chd = data->calls; sem_post(&data->semaphore); } sem_destroy(&data->semaphore); printf("i am the parent pid:%d\n", getpid(), data->pid); } return 0; }
19:17
the output never fits for the parent
19:17
bcs parent does not call child()
19:17
i hope this visualized the problem better to u
19:19
note that printf doesnt garantuee any order
19:19
thats also important to know xd
19:19
if that was your problem all along
Avatar
your last printf has an extra argument (edited)
Avatar
#include <stdio.h> #include <sys/mman.h> #include <sys/types.h> #include <unistd.h> #include <semaphore.h> #define NUM_CHILDS 4 struct mmap_data { sem_t semaphore; int pid; int calls; }; void child(void *shared) { struct mmap_data *data = (struct mmap_data*)shared; sem_wait(&data->semaphore); data->calls++; data->pid = getpid(); } int main(void) { void *shared = mmap(NULL, sizeof(struct mmap_data), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); struct mmap_data *data = (struct mmap_data*)shared; int err = sem_init(&data->semaphore, 1, 1); printf("Parent pid is %d\n", getpid()); int forked = -1; for(int i = 0; i < NUM_CHILDS; i++) { forked = fork(); if(forked == 0) { child(shared); break; } } if(forked == 0) { printf("pid:%d shared:%d\n", getpid(), data->pid); sem_post(&data->semaphore); } else { int chd = 0; while(chd < NUM_CHILDS) { sem_wait(&data->semaphore); chd = data->calls; sem_post(&data->semaphore); } sem_destroy(&data->semaphore); printf("i am the parent pid:%d\n", getpid()); } return 0; } here with forced order
Avatar
@Jupstar ✪
Avatar
but only by luck
Avatar
Avatar
zogtib
your last printf has an extra argument (edited)
true i removed it
Avatar
but shouldnt matter
Avatar
Avatar
Ryozuki
.
yeah nice
19:21
read it fully
Avatar
i know
19:21
it was ironic
Avatar
mold linker 1.7.0 released and author seriously considering changing license to be free for non-commercial use only
Avatar
nice
Avatar
I'd like to inform users that I'm seriously considering changing the mold's license from AGPL to a source-available license unless I secure big funding. The new license would be something like individuals can use it for free but corporate users have to pay. mold started as my personal project, and I've been working on this full time for two years so far. I thought that I could earn a comfortable income if mold become popular, but unfortunately, I'm still losing my money. I think I need to take an action to make the project sustainable long term. For the details, please read my post.
Avatar
i simply dont understand the mindset
Avatar
me neither
Avatar
but
19:22
the problem is somewhere else
19:22
the open source community is too focused about source coding
19:22
we'd need a open world
19:23
its sad that mostly software devs live this dream
Avatar
shared knowledge
19:23
remove patents
Avatar
maybe it would help if we wouldnt see politics as a way to represent us but see politics as a way to set goals that the community(basically all humans) want to "at least" archive
19:26
its same with climate change we talk every day... but we have no real plan maybe it works, if companies do it by their own, maybe not, bcs companies say "if other company doesnt do it, i wont either" XD
19:26
it often feels like the only communication layer is money xD
19:27
but maybe its simply bcs thats what everyone understands in long and short run
19:29
i just wonder how u always find the interesting stuff xD
Avatar
i check rust reddit dailly
19:29
hourly maybe
19:29
and hackernews
Avatar
i only read phoronix once per day, but indeed he already wrote an article about it 😄
Avatar
this one has the most interesting
19:30
for general stuff
Avatar
well i often only read headlines anyway xD
Avatar
if u read comments
19:31
often people from all the world comment
19:31
authors too
19:31
like people from facebook
19:31
engineers
19:31
and the fbi or smth
19:31
idk
Avatar
what is minimum for sponsoring?
19:32
he currently has around 85 supporters
Avatar
sponsoring what
Avatar
github
19:32
depends what he got setup
19:33
i got 2 ppl paying me 5$
Avatar
Avatar
Jupstar ✪
github
1€ I guess at least I donate 1€/month to someone
Avatar
lol wb codedev
♥️ 1
Avatar
But you can configure it
Avatar
long time no see
19:33
yes
Avatar
I try to actively contribute to free software projects.
Avatar
Avatar
c0d3d3v
1€ I guess at least I donate 1€/month to someone
ok 1€ is ofc not a lot, if everyone does that 😄
Avatar
if u would like to donate
Avatar
@Ryozuki how much money u make
Avatar
Avatar
Jupstar ✪
@Ryozuki how much money u make
10$ month
Avatar
nice
Avatar
Avatar
Jupstar ✪
nice
i guess i can buy a meal
19:35
xd
Avatar
still cool xd
Avatar
At bc4a5ee6f5dbfd1e144071dd7ef63c23f91f0480. The crash doesn't happen consistently. Haven't tried with ASAN. 1. Load ctf1 2. Select the last two tile layers in the game group 3. Shift both layers by 1 in Y direction ``` Error occurred on Sunday, November 13, 2022 at 20:43:56. DDNet.exe caused an Access Violation at location 00007FF62CCF0A35 in module DDNet.exe Reading from location 0000000000555CA0. AddrPC Params 00007FF62CCF0A35 000000003AE014A8 0000000000000000 000...
Avatar
Avatar
Patiga
I released a new version of twmap, twmap-tools, twmap-py and twmap-blender ( @Ryozuki, @gerdoe, @k2d222, ChillerDragon ) twmap: 0.9.0 contained a rather big bug where the Layer::shape function had x and y mixed up. that is fixed, alongside its uses (somehow I managed to use it the correct wrong way multiple times). apart from the fixes there should not be any breaking changes with 0.9.1, but some nice additions from @Ryozuki twmap-tools: twmap-edit wasn't working properly because of the mentioned bug, everything should work again twmap-py: the to_mesh method on tiles layers now works again, it was broken for a while (also the release was necessary to fix the mentioned bug) twmap-blender: the add-on now automatically downloads the twmap python module with pip, if it isn't installed (release: https://gitlab.com/Patiga/twmap-blender/-/releases/v0.3.0)
uhuhuh time to try it out again ahah
20:04
im finally home
20:04
hi
Avatar
4. Game server sends challenge to client, client uses its private key token to solve it. Thus evil server hosters can't steal tokens and impersonate players.
>
Evil server hosters can still impersonate players: If someone joins the evil server, it can join a real server and forward the challenge from the real server to the player. The player solves it and now the evil server impersonates the player.
21:31
can't you keep challenge only between the account server and client?
Avatar
and how does the game server know if the user is the real one then?
Avatar
client sends game server info to account server and account server sends verification to that ip
Avatar
and game server? xd
21:36
i mean what does it send
21:36
lets say u connected to a evil server, does the client then send the ip of the evil server?
21:36
or the server info of the evil server?
Avatar
ok and now the evil server checks if the client is real or not
21:37
but how does that help with the real server?
Avatar
ok now im confused 😅 im probably wrong anyways
Avatar
tbh the easiest is if the server registers with a public key that will make the client -> server connection secure and even if you connect to a evil server the evil server can still not pretent its you, bcs you also send a public key with information that only the server you connected to should know
21:42
i mean you just have to guarantuee: evil server can either not decrypt the one way or the other
Avatar
Would it be possible to outsource the challenge to an dedicated server?
21:43
Or is every server in charge of handling challenges
Avatar
i dont think we have decided yet
21:44
do you fear dos?
21:47
but i guess generally it could also register with a additional address just for challenges
21:47
maybe you could add your reason here #3411
Avatar
If anyone wants to summarize the discussion, feel free to. I just wanted to create the issue now.
Avatar
Avatar
Jupstar ✪
do you fear dos?
Well I guess its more or less to offload this "authentication" to a dedicated service
Avatar
yes, a rust backed auth server sounds the best 🥹
Avatar
long time ago
21:55
i did this
21:55
WIP/RFC ddnet auth service using ed25519 pub key auth. - GitHub - edg-l/ddnet-authservice: WIP/RFC ddnet auth service using ed25519 pub key auth.
Avatar
I prefer to go for keycloak 👀 (edited)
21:56
So building in full OAuth2/SAML support
Avatar
its nothing serious tho dont lookat it
Avatar
Technically you could use Keycloak for other services too & you're able to federate ^^
Avatar
is keycloak written in java?
21:59
OpenID Certified™ OpenID Connect and OAuth Provider written in Go - cloud native, security-first, open source API security for your infrastructure. SDKs for any language. Works with Hardware Securi...
21:59
which is pretty famous
22:00
Next-gen identity server (think Auth0, Okta, Firebase) with Ory-hardened authentication, MFA, FIDO2, TOTP, WebAuthn, profile management, identity schemas, social sign in, registration, account reco...
Avatar
Yes, Keycloak is written in Java EE
22:03
i cant find anything in rust so
Avatar
Its not that bad for Java EE 🙂
Avatar
If it's optional ok. I just would prefer if my game server didn't need to connect to other servers
Avatar
An extensible, strongly-typed implementation of OAuth2 (RFC 6749) including token introspection (RFC 7662) and token revocation (RFC 7009).
Avatar
That can always lead to being abused
Avatar
Avatar
Jupstar ✪
That can always lead to being abused
Thats why you should use OAuth2
Avatar
i also prefer a fully federated option
Avatar
Share the public key with your gameservers from the keycloak instance
22:05
Keycloak signs a JWT after successful login & you can verify it on the server
Avatar
@heinrich5991 you have to read all this xd
Avatar
i think he is on a trip
22:06
mentioned a flight yesterday
22:06
or before idk
Avatar
Just so he doesn't forget
Avatar
but he does read everything yeah
22:06
hi heinrich from the future
👋 5
22:06
PES3_WeirdSip
Avatar
Avatar
Jupstar ✪
@ReiTW
well ty for that, I think I got it
Avatar
Too much crust on the old ones. Decided to leave ohno.png alone, just because it felt right to keep it vintage.
23:23
0945760 Higher Quality (tm) memes - VoxelDoesCode 7fb8014 Merge pull request #35 from VoxelDoesCode/quality - def-
Avatar
Much like how font awesome works, you can supplement some words for symbols I don't think it fits for this case !image
Exported 1,290 message(s)