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 2023-05-22 00:00:00Z and 2023-05-23 00:00:00Z
Avatar
war is no more, we landed fixes for russia and ukraine
06:10
justatest
Avatar
@Ryozuki could you change the representation in the server to std::optional everywhere?
09:45
so we don't have the magic value -9999 there
Avatar
isnt more -9999 a magic value that has to be sent due to the client interpreting it specially
Avatar
i see it in the server info in the browser sometimes
09:46
but yeah you canโ€™t send a std optional over net lol
Avatar
I'm guessing heinrich is saying it should be optional everywhere within the server and only get serialized as -9999
09:47
which is half that way already
09:50
ah i see
Avatar
Avatar
Ryozuki
which is half that way already
yup, but the score is somehow -9999 and that has to be interpreted by the 0.7 code to be changed to -1, I think
Avatar
why is any negative score value possible
09:52
time or real score
09:52
just de/serialize as unsigned
Avatar
i think the cclient in serverbrowser.h needs to stay non optional
Avatar
Avatar
Ryozuki
i think the cclient in serverbrowser.h needs to stay non optional
I only meant in the server; but theoretically, even the serverbrowser.h could be made std::optional
10:23
fixed it, but sometimes there is 1 player showing without time at the top
10:23
rly weird
10:24
his time is 6:43
10:24
in game
10:32
why does this guy report a negative score
10:33
is this some kind of bug?
Avatar
idk i see them too
10:33
the current client displays them as having no time
10:33
but he has 53 mins
10:33
in game
Avatar
well the score is either full negative to 0 being time 0
10:39
or positive to 0
10:39
so abs fixes it
Avatar
Avatar
Ryozuki
so abs fixes it
client-side? could you only do the abs if the server doesn't specify that it's doing time scores?
Avatar
the thing is
10:42
ddnet is reporting time score
10:42
and some clients send a negative score for some reason
10:42
1-3 usually
10:42
idk why
Avatar
clients?
10:42
game servers?
Avatar
im looking at where ddnet sends the server info
10:42
the ddnet client, reports a player having a negative score
10:42
like -3305
10:42
whne it should be positive
10:43
because ddnet reports time score
10:43
(oficial server)
Avatar
hmmm
10:43
that's weird
Avatar
the current client 16.9 doesnt even show them having time
10:43
due to this
10:43
but u see them with time when u join
10:43
and look tab
10:44
10:44
i have this on the sort rn
10:44
and it displays all good
Avatar
ChillerDragon BOT 2023-05-22 10:44:20Z
ircd u heinrich
Avatar
i had to change the render of the score too in the browser
10:44
Avatar
(but we shouldn't add compatibility with buggy servers if we can just fix the buggy servers)
Avatar
this is to render the negative score players on time too
10:44
true
10:44
altho this fix is harmless
10:44
im trying to find where ddnet sends the info
Avatar
src/engine/server/server.cpp
10:45
CServer::UpdateRegisterServerInfo
Avatar
m_aClients[i].m_Score == -1 ? -9999 : m_aClients[i].m_Score
10:45
its this currently
10:46
added by u
10:46
i guess here its a good place
10:46
to use the optional
10:46
i guess i forgot to chang eit
Avatar
yea
10:47
note that this supports setting the time to 9999, even
10:47
but its not backcompat
10:47
to old clients
10:47
or is it
10:48
i dont care but i know u care
Avatar
I think for this particular thing, I don't care so much
10:48
but let me check anyway
10:48
(because it's not a problem when trying to play the game)
Avatar
what score do we send to sixup
10:49
when no score is there
Avatar
I checked it when doing my PR, you can look there
10:49
-1, I think
Avatar
Issue: When you visit a player profile, it would be nice to have all the tabs for the finished maps hidden by default. Maybe make it the same way that "Unfinished maps (show/hide)" works. My experience: I needed to find an unfinished map for both me and my friend, so I went to my profile and added my friend's nick in the "compare" section. When you have a long list of finished maps (especially combined finishes), you have to scroll all the way down to find the category you are looking...
Avatar
fixes #6638

Checklist

  • [x] 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 valgrind's memcheck](https://github.com/ddnet/ddnet/#...
Avatar
The absolute(CurrentClient.m_Score) >= 0 seems pointless. If it's supposed to check for MIN_INT, then the call to absolute is already UB.
11:11
no
11:11
it is meant to check for the negative values ddnet sends sometimes
11:13
the int min is used on a temp var to stort
11:13
sort, its never there
Avatar
absolute converts a number into a non-negative number
Avatar
so checking whether the absolute is greater or equal to zero sounds pointless
Avatar
ah true
11:14
xd
11:17
well i dont have the will to figure out why the sv sends negative sometimes
Avatar
!screen

Checklist

  • [x] Tested the change ingame
  • [x] 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
  • [x] Considered possible null pointers and out of bounds array indexing
  • [x] Changed no physics that affect existing maps
  • [ ] T...
Avatar
so u can accept the fix or wait a undetermined amount of time
Avatar
Avatar
Ryozuki
well i dont have the will to figure out why the sv sends negative sometimes
Isnโ€™t it supposed to be negative for times?
Avatar
it doesnt matter
11:35
the client always did abs on the score
11:35
time and score handling sucks
11:36
cuz back compat
11:36
i hate back compat
11:36
and i shouldnt have gotten into this
11:36
i regret itn ow xd
11:39
idk why ddnet-libs got updated
11:39
and how to revert it
11:39
today is not my day oof
Avatar
Avatar
Ryozuki
and how to revert it
Reset mixed, cd into submodule, reset hard, cd back out, commit, force push
Avatar
reset mixed?
11:43
how
Avatar
Well first, is it the last commit or another commit you updated submodule in?
11:44
warning: --mixed with paths is deprecated; use 'git reset -- <paths>' instead.
11:45
โฏ git reset --mixed upstream/master -- ddnet-libs/ warning: --mixed with paths is deprecated; use 'git reset -- <paths>' instead. Unstaged changes after reset: M ddnet-libs
Avatar
It seems to be the very first commit
Avatar
i did this
Avatar
Do you want to squash your commits?
Avatar
my inner self doesnt want to, cuz commit points xd
11:45
but i dont mind
11:46
ฮ” ddnet-libs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 328fd20..625457e
Avatar
Ok, git reset โ€”hard origin/pr_fix_info; git rebase -i upstream/master
11:46
In the interactive rebase mark the very first commit with e instead of pick
11:47
i fixup'ed the others
11:47
felt guilty
Avatar
Rebase will check out your first commit, when there cd into the submodule, git reset โ€”hard HEAD, get out, git commit โ€”amend, git rebase โ€”continue and a force push to finish it up
Avatar
โฏ git reset --hard HEAD HEAD is now at 625457e Update libraries
11:48
i think thats the wrong commit
11:49
oh
11:49
i just needed to git pull
11:49
XD
11:49
โฏ git pull Updating 625457e..328fd20 Fast-forward
11:50
got it
11:50
Still managed to update ddnet-libs ๐Ÿ˜„
11:51
refresh
11:52
ill remove the useles math header too
Avatar
You made 2 commits, one changing ddnet-libs, the next reverting it
Avatar
lol true
11:52
xd
Avatar
With the exact same name
11:53
Git struggles
11:54
i tested it a bit, and it works nice
Avatar
Congrats
Avatar
points are shown in order, time in ordere
11:54
idk if i did test any backcompat time server
11:54
cuz idk which one is
11:54
well
11:55
fokko one is
11:55
maybe
Avatar
Unique probably isnโ€™t all the way up to date
Avatar
@Learath2 do u know
11:56
if gores reports some time
11:56
Avatar
Hm, KoG has been trying to follow closer to master, but idk if they got the time flag yet
11:57
But judging by your screenshot backcompat does look broken
Avatar
@Avolicious update kog, make it send "score_kind": "time" to masters ty bye
Avatar
Avatar
Learath2
But judging by your screenshot backcompat does look broken
idk if its set to backcompat
11:57
or points here
Avatar
Always the easy way out with you people ๐Ÿ˜„
Avatar
I have electromagnetism to go study. This isnโ€™t in the RC yet is it?
11:58
If it is the RC is not shippable imo
12:00
@Learath2 im making him a favour
12:00
btw
12:00
16.9
12:00
shows same
12:00
12:00
so its not that its not backcompat
12:00
its thatis interpreted as points
Avatar
Mh, then 16.9 shouldnโ€™t have been shipped, meh
Avatar
u mean all versions?
12:00
since kog changed ddnet to kog
12:01
has been like this iirc
12:01
when u join it shows time tho
12:01
the proper fix here is for them to send a score_kind
12:01
and not us to add a special gores check
Avatar
A negative score and a raceish~ gametype should always result in time score displayed
Avatar
Avatar
Ryozuki
@Avolicious update kog, make it send "score_kind": "time" to masters ty bye
KoG is latest ddnet lol
Avatar
Avatar
Avolicious
KoG is latest ddnet lol
not latest enough
Avatar
Its latest latest
Avatar
update to current master
Avatar
its current master
Avatar
is that server updated
Avatar
or have you pushed in the last 10 minutes?
Avatar
do u send score_kind
12:02
7 months ago
Avatar
Then itโ€™s worse than the backcompat being broken
Avatar
@Avolicious ah
12:03
its "client_score_kind"
Avatar
first KoG server that I check doesn't send it
Avatar
"client_score_kind": "time"
Avatar
"tw-0.6+udp://5.181.124.84:8303"
Avatar
Avatar
Learath2
Then itโ€™s worse than the backcompat being broken
u assume the worst of us
12:03
and not others
12:03
smth
Avatar
in: https://master1.ddnet.org/ddnet/15/servers.json
Avatar
backcompat is only set on these
12:04
race and fastcap
12:04
so we not forcefully setting gores to backcompat
12:04
they should send the proper flag
Avatar
Avatar
Ryozuki
backcompat is only set on these
Ah I remember they changed gametypes, itโ€™s Gores now
Avatar
Avatar
Avolicious
Click to see attachment ๐Ÿ–ผ๏ธ
Maybe for some reason that codepath isnโ€™t being taken? Or the server just hasnโ€™t been updated due to a silent deployment issue?
12:06
Though looks pretty hardcoded to me
Avatar
can you confirm that "tw-0.6+udp://5.181.124.84:8303" is on your latest master? @Avolicious
12:06
u not sending it
Avatar
Avatar
heinrich5991
can you confirm that "tw-0.6+udp://5.181.124.84:8303" is on your latest master? @Avolicious
Yes, are the latest stable ones
Avatar
@heinrich5991 could the master filter it out?
12:07
it should reflect all u send right
12:07
odd
Avatar
the master doesn't look at the JSON
12:07
why is it not there
Avatar
to me, it looks like that particular server doesn't send it
12:08
which would mean that the server is likely not runnign the code that Avo thinks it's running
Avatar
none do
Avatar
havne't checked the others
12:08
but Ryo did, probably ๐Ÿ™‚
Avatar
UpdateRegisterServerInfo is where the flag gets set
12:08
I've not changed anything on HTTPs Register stuff
Avatar
but are u sure the deployed servers are using the version u expect
Avatar
If you didnโ€™t change anything there then Iโ€™m also voting some deployment issue
Avatar
Servers do have this version
12:10
We verify it by comparing the SHA256 File hash
12:10
And Git commit hash is also deployed in the container image
Avatar
Okay, then itโ€™s divine intervention
Avatar
not having the source, we can't trace it as easily
12:11
actually, unlikely to be a source issue
12:11
but likely deployment
Avatar
oh i forgot its closed source
12:12
can't help a lost cause
12:12
(im joking pls no ban)
12:16
@Learath2 i ruined my kimetsu episode watch
12:17
smh
Avatar
Because of timescores?
12:17
stopped mid ep
12:17
and now i have a meeting
12:17
xdxd
Avatar
i like to watch anime while i eat
Avatar
@Avolicious and I figured it out, the client_score_kind change was merged just after the last KoG release
troll 2
Avatar
@heinrich5991 i think the abs should stay imho, we dont have a set standard on how to report the time, so maybe some server says kind: time and sends it negative
12:42
the absolute works always
12:43
i dont say we shouldnt fix the bug
12:43
do u know if the http server info the server sends uses the info from the packer?
12:43
ADD_INT(q, !m_aClients[i].m_Score.has_value() ? -9999 : m_aClients[i].m_Score.value() == 9999 ? -10000 : -m_aClients[i].m_Score.value()); // client score
12:43
this is what we have on the packer
12:43
well on the ptr i changed it to use a optional
12:45
on the http i changed it to
12:45
m_aClients[i].m_Score.value_or(-9999)
12:45
but maybe i can abs the value there? but we wouldnt be getting to the root of the problem
12:45
where the score is set to negative somwhere
Avatar
Avatar
Ryozuki
@heinrich5991 i think the abs should stay imho, we dont have a set standard on how to report the time, so maybe some server says kind: time and sends it negative
I think we should not do the abs in order to establish a standard
12:46
there is this
Avatar
Avatar
Ryozuki
do u know if the http server info the server sends uses the info from the packer?
it does not
12:48
we could probably just pass on the option in that code snippet
Avatar
Avatar
Ryozuki
Click to see attachment ๐Ÿ–ผ๏ธ
in this one
12:49
@heinrich5991 can i compare a std::optional<int>
12:49
12:49
for the expire
12:49
can i simply so m_Score != Score
12:49
xd
12:49
do*
12:50
in rust u can
12:50
seems so
Avatar
ok seems like its a sane optional
12:50
the only thing it lacks is map
Avatar
transform
12:51
C++23 though
12:51
C++ finally catching up on basic functionality
Avatar
Jupstar โœช 2023-05-22 12:52:12Z
๐Ÿ˜‚๐Ÿ˜‚
12:52
Let's skip cpp20
Avatar
@heinrich5991 do u wanna break the compat then
12:54
and allow 9999 time
12:54
  • we fix the bug
  • negative numbers mean no time
  • 0 and 9999 are valid times
12:55
u know
12:55
actuall
12:55
ywe should drop score altogether for ddnet
12:55
and show a proper time
12:55
with more resolution even
12:56
so instead of seconds
12:56
we send miliseconds
Avatar
Avatar
Ryozuki
@heinrich5991 do u wanna break the compat then
I'd rather not, probably
Avatar
Avatar
Ryozuki
  • we fix the bug
  • negative numbers mean no time
  • 0 and 9999 are valid times
we can already do this for the serverbrowser, just not ingame, I think
Avatar
ill just leave this comment
13:00
in the in game time reporting
13:01
this code is like this already btw
13:01
im trying to find where its negative xd
Avatar
the absolute should probably be removed there
13:02
maybe its set to negative if someone finished a map
13:02
13:02
due to this
13:03
this is on the onfinish
Avatar
I'd say: remove all the absolutes and think about whether we want negative or positive numbers, probably positive ones
Avatar
Avatar
heinrich5991
the absolute should probably be removed there
but that abs is on the ingame code
13:03
not serverbrowser
13:03
but yeah
13:03
ill remove it
Avatar
it's inside the server, right?
13:04
(the server is the creator of that value, it knows whether it's positive or negative)
13:04
im gonna remove it all and make sure its positive
13:04
i think the source of the negative is the onfinish thing
13:05
btw
Avatar
ah
13:05
that makes sense
Avatar
@heinrich5991 whats better -1 * m_Score.value() or -m_Score.value()
Avatar
the latter IMO
Avatar
@heinrich5991 is it safe
13:07
m_Score = Result.m_Data.m_Info.m_Time;
13:07
where
13:07
m_score is option<int>
13:07
m_time is option<float>
13:07
?
13:07
public: template<> enable_if_t<__and_v<__not_<is_same<int, float>>, is_constructible<int, const float &>, is_assignable<int &, const float &>, __not_<__converts_from_optional<int, float>>, __not_<__assigns_from_optional<int, float>>>, std::optional<int> &> operator=<float>(const optional<float> &__u) noexcept(__and_v<is_nothrow_constructible<int, const float &>, is_nothrow_assignable<int &, const float &>>)
13:08
i guess yes? xd
Avatar
oof
13:08
let me check ๐Ÿ˜„
13:08
(I'm not actually a C++ wizard)
13:09
4
13:09
seems like that's the map you've been looking for ๐Ÿ˜„
Avatar
although very constrained
13:10
(conditionally explicit)
13:10
not sure if I want to find out what that means
Avatar
well then
13:10
ill fix this to be positive
13:10
maybe i need to change again the sort on the info
13:10
and this may mean partially broken until servers update
13:10
and clients
13:10
or idk
Avatar
Avatar
Ryozuki
ill fix this to be positive
sounds good ๐Ÿ™‚
Avatar
@heinrich5991 how to make my sv register to a local master
13:11
ill need this to test later
Avatar
sv_register_url
13:12
set it to sv_register_url http://[::1]:8080/ddnet/15/register (edited)
13:12
and http_allow_insecure 1
Avatar
i forgot
13:59
where do i add a master to the client xd
Avatar
~/.ddnet/ddnet-master-urls.cfg
Avatar
i dont have .ddnet
14:01
i have .local/share/ddnet
14:01
i dont see that file
Avatar
ddnet-serverlist-urls.cfg
14:02
probably doesn't exist by default
Avatar
whats the format?
Avatar
put an URL into that file
14:02
?
Avatar
yes
14:02
it chooses the fastest responding server from that list
14:02
ah, no
14:03
the httpmaster doesn't serve that file though
14:03
so perhaps a python -m http.server would work
14:04
it needs to be a URL that you could also open in a web browser that serves this file
14:04
file:// doesn't work IIRC
14:05
2023-05-22 16:05:23 I http: http://[::]:8080 failed. libcurl error (22): The requested URL returned error: 404 2023-05-22 16:05:23 E register/6/ipv6: error response from master
14:07
hm
14:07
14:07
ah gforgot
Avatar
http_allow_insecure 1 ^^
Avatar
but my server doesnt register
14:08
it says the error i sent
14:08
hmm
Avatar
Avatar
heinrich5991
set it to sv_register_url http://[::1]:8080/ddnet/15/register (edited)
use this value for sv_register_url
14:09
it needs to be the full url
Avatar
yes
14:10
yay
14:10
it even shows 00 times
Avatar
nice ๐Ÿ™‚
14:10
@Jupstar โœช have you had a look at io_uring yet btw? ^^
Avatar
gotta fix the sorting when unfinished tho
Avatar
Avatar
heinrich5991
so perhaps a python -m http.server would work
miniserve ftw
Avatar
isn't it amazing that we have standards like http? ^^
14:13
with thousands of possible impls
14:13
ones faster than others
Avatar
sure, and the python impl probably being very slow
14:13
but I like interoperable software ^^
Avatar
but idk if the python module is made with many utilities
14:14
for the cli
Avatar
Avatar
heinrich5991
@Jupstar โœช have you had a look at io_uring yet btw? ^^
Jupstar โœช 2023-05-22 14:14:18Z
Wrong ping or did u actually mean me?
Avatar
miniserve has lot of stuff
Avatar
Avatar
Jupstar โœช
Wrong ping or did u actually mean me?
I actually meant you ^^
14:14
sounded like performance ^^
Avatar
Jupstar โœช 2023-05-22 14:14:41Z
What issue did we have? ^^
Avatar
you wanted to make the network faster
14:15
anyway, I just stumbled upon io_uring once more and wondered whether you had looked at it already
Avatar
Jupstar โœช 2023-05-22 14:15:38Z
I've written a complete new network impl for the playground but I'm also pretty slow currently lmao
Avatar
Avatar
Ryozuki
miniserve ftw
oh, it's even in the arch repos ^^
Avatar
Jupstar โœช 2023-05-22 14:16:37Z
But dunno, will iouring help for windows BCS it's not a kernel call or how can I imagine the performance increase here ?
14:16
It's Linux apparently
14:17
We have perf problems on windows for sure xd
14:18
So how much faster is it? ๐Ÿ˜„ never seen it in action
Avatar
Avatar
Jupstar โœช
But dunno, will iouring help for windows BCS it's not a kernel call or how can I imagine the performance increase here ?
I think there's something like io_uring on windows as well
14:18
it's called IO completion ports IIRC
Avatar
Avatar
Jupstar โœช
So how much faster is it? ๐Ÿ˜„ never seen it in action
it skips the syscall, basically
14:19
we put our recv request into a ringbuffer, and the kernel reads it from that ringbuffer
Avatar
Jupstar โœช 2023-05-22 14:19:50Z
I see, so the overhead is in the kernel instead?
14:19
Or is it a raw memory address
Avatar
hmm, it's a raw memory address. not sure I understand your question
14:20
instead of doing recv(buffer), we write (op_recv, buffer) into a ringbuffer
Avatar
Jupstar โœช 2023-05-22 14:20:47Z
I mean a non ringed memory address
Avatar
yes, I think
Avatar
Jupstar โœช 2023-05-22 14:21:08Z
Oh ok
14:21
And the kernel checks periodically?
Avatar
yes, basically
Avatar
Jupstar โœช 2023-05-22 14:22:07Z
Would probably help us indeed
Avatar
ok i got this sorted
14:30
all positivity
14:30
no negativity
Avatar
nice!
Avatar
and the current servers also look sorted correctly
14:31
@heinrich5991 i found that my client lingers before fully closing
14:31
its due to this
14:31
2023-05-22 16:31:24 I http: https://master2.ddnet.org/ddnet/15/servers.json failed. libcurl error (28): SSL connection timeout 2023-05-22 16:31:24 I serverbrowse_http: found master, url='https://master1.ddnet.org/ddnet/15/servers.json' time=204ms 2023-05-22 16:31:24 I http: https://master4.ddnet.org/ddnet/15/servers.json failed. libcurl error (6): Could not resolve host: master4.ddnet.org 2023-05-22 16:31:24 I serverbrowse_http: determined best master, url='https://master1.ddnet.org/ddnet/15/servers.json' time=204ms
14:32
it doesnt exist until the task is done
Avatar
yea, I think that's a currently existing problem
14:33
we don't have a good way of aborting jobs currently
14:33
I think @Learath2's PR would fix this particular problem
Avatar
fixes #6638 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 b...
14:33
check it out again if ucan
14:33
its rdy
14:33
^tm
14:33
i think optional has == for opt == value but i dont know it exactly, it said also it does < with the inner so i didnt use that
14:33
and just used a if
14:34
somewhere
Avatar
@heinrich5991 idk if i can get SelectedServer->m_aGameType there
14:45
hmm and shouldnt the ClientScoreKind be normalized just once, somewhere?=
Avatar
I guess that could be done
14:46
I don't see why not, at least
Avatar
sk Airbase BOT 2023-05-22 14:46:06Z
hey
14:46
Noob here
Avatar
hi noob im dad
Avatar
sk Airbase BOT 2023-05-22 14:47:15Z
can anyone suggest me any guide for to get this to understand thia
Avatar
understand what?
Avatar
sk Airbase BOT 2023-05-22 14:47:54Z
i mean
14:48
whats is going on here
14:48
i see you all make websites
Avatar
we're building a game: https://ddnet.org/
Avatar
im on the edge wondering if this is a troll or a confused person
14:53
xd
14:53
or a wannabe bot dev
14:53
u never know these days
Avatar
sk Airbase BOT 2023-05-22 14:53:27Z
ahhhhhhh
14:53
just new here
14:53
now i understood the gane ;)
Avatar
Jupstar โœช 2023-05-22 14:54:27Z
To be precise, the best game
Avatar
sk Airbase BOT 2023-05-22 14:54:49Z
game
14:55
i wish i was a dev :D
Avatar
become one
14:57
the internet is ur door to knowledge
Avatar
sk Airbase BOT 2023-05-22 14:57:48Z
yes thanks for the support
14:58
where shall i start ? i only have very little exprience in coding and all this
14:58
whats the first thing i should start
Avatar
first you should learn to google
14:59
and ask this very question to google
14:59
or ur search engine of preference
Avatar
sk Airbase BOT 2023-05-22 14:59:17Z
rest im sitting here and reading to gain knowledege'
Avatar
i recommennd reading this
Avatar
sk Airbase BOT 2023-05-22 14:59:44Z
thankss nate
Avatar
but its more aligned to my values
14:59
idk about urs
Avatar
Jupstar โœช 2023-05-22 15:00:16Z
๐Ÿ˜‚
Avatar
To follow the path: look to the master, follow the master, walk with the master, see through the master, become the master.
Avatar
Jupstar โœช 2023-05-22 15:00:27Z
Fuck Google ask me
Avatar
To be a hacker, you have to develop some of these attitudes. But copping an attitude alone won't make you a hacker, any more than it will make you a champion athlete or a rock star. Becoming a hacker will take intelligence, practice, dedication, and hard work.
>
Therefore, you have to learn to distrust attitude and respect competence of every kind. Hackers won't let posers waste their time, but they worship competence โ€” especially competence at hacking, but competence at anything is valued. Competence at demanding skills that few can master is especially good, and competence at demanding skills that involve mental acuteness, craft, and concentration is best.
>
If you revere competence, you'll enjoy developing it in yourself โ€” the hard work and dedication will become a kind of intense play rather than drudgery. That attitude is vital to becoming a hacker.
15:01
i love this quote
15:01
(hacker not being the word used to refer to crackers)
Avatar
Jupstar โœช 2023-05-22 15:02:51Z
I love this quote
Learn everything u need to make your game fast. Nobody can teach u that, and it's never perfect
It's from me
15:04
troll
15:05
is this same kinda thing ?
Avatar
ok i think this guy is trolling
15:06
and here i spent time to convert someone into a hacker
15:06
smh
Avatar
sk Airbase BOT 2023-05-22 15:06:40Z
brother
15:07
im not trolling brother
15:07
im going throught open source for now to gain knowledge
Avatar
"Any fool can write code that computers understand. A good programmer writes code that humans can understand" - Martin Fowler
Avatar
sk Airbase BOT 2023-05-22 15:08:16Z
BTW it was good to Meet you all
15:08
last question pleas
15:09
light and good os for coding ?
15:09
hence im not having a high end laptop
15:09
how do they make money fron this ??
Avatar
all the wrong questions
Avatar
if you are aiming to make money, this isn't the best developer channel for you. none of the developers here make money by contributing to the game ddnet the developers here do it because they like the game and enjoy coding :)
Avatar
sk Airbase BOT 2023-05-22 15:12:59Z
yes i got it its passion .....!!!
15:13
will stick to you guys ;)
Avatar
if you want a light and good os, you can probably use any popular linux distribution. ubuntu is probably the most popular one, though there are plenty others which offer different experiences
Avatar
sk Airbase BOT 2023-05-22 15:13:53Z
atleast i will learn sone thing
Avatar
@heinrich5991 factored it out
15:23
this should even bring more perf
15:23
since its not done every time now
15:23
or smth idk
15:23
probs str_find_nocase is not that expensive xd
15:23
(i tested it and works, race server shows time)
15:26
str_find_nocase(pEntry->m_Info.m_aGameType, "race")
15:26
this doesnt match ddrace right? xd
15:26
ah well but its no problem cuz ddnet doesnt send unspecified
Avatar
Avatar
sk Airbase
hence im not having a high end laptop
Linux ๐Ÿ™ƒ
Avatar
Avatar
Ryozuki
str_find_nocase(pEntry->m_Info.m_aGameType, "race")
that should match "ddrace" and "ddracenetwork"
Avatar
Avatar
heinrich5991
that should match "ddrace" and "ddracenetwork"
yeah, but ddnet sends time kind, not unspecified
15:32
so its ok
Avatar
yup
Avatar
Avatar
sk Airbase
light and good os for coding ?
Windows is going to eat ur resources for itโ€™s shitty services. Ubuntu is right thing for you
Avatar
ah, now I understand your question
Avatar
Jupstar โœช 2023-05-22 15:33:22Z
KUbuntu
15:33
Ubuntu with gnome sucks for ppl comming from windows
Avatar
ubuntu is only good because it has a manga
15:33
โ€œUbunchu!โ€ is a Japanese manga series featuring Ubuntu Linux. Three school students in a system-admin club are getting into Ubuntu!
15:34
there is a chapter where they fight a pro-windows school user
15:34
xdd
Avatar
Jupstar โœช 2023-05-22 15:34:19Z
๐Ÿ˜ฌ
15:34
there is 3 episodes more!
15:34
15:34
xD
15:34
mint-chan
15:41
@heinrich5991 fixed ur comments btw
Avatar
thanks
15:46
does anyone know python stdlib functions taking bools?
15:46
what do they do if a non-bool is passed?
15:46
error? call bool() on it?
15:48
preferably a function implemented in C
15:50
os.walk() gets a topdown boolean argument
15:50
but it just gets put into an if, so it's interpreted as if bool was called on it (edited)
Avatar
Jupstar โœช 2023-05-22 15:54:25Z
gpt-4 says: "Generally, Python's standard library functions are designed to be flexible and work with multiple data types. " and it names examples such as: open json.dump
15:54
i also let it search the internet to verify what it said, take at your own risk ๐Ÿ˜‚
15:55
dont even know if they are part of stdlib as u mean it
15:58
os.dup2
15:58
xd
Avatar
open does indeed take a boolean, but it seems to be implemented in _pyio.py
15:58
json.dump is kinda useless
15:59
ah no, it also has boolean arguments
15:59
but I bet it's implemented in python as well
Avatar
Jupstar โœช 2023-05-22 16:02:18Z
it also claims array sort but i doubt the reverse parameter ever reaches c
Avatar
8a3d8fc fix time score info on server detail - edg-l 1d30462 clean time score handling, with positive time values - edg-l a4abc1f factor out scorekind backwards compat gametype check - edg-l 43c1b48 Merge #6646 - bors[bot]
Avatar
we reached the milestone
16:04
now 17.0 should be ready
Avatar
which milestone?
Avatar
big ^tm
Avatar
ah
Avatar
here: โ„ข :p
16:04
compose key ftw
Avatar
Closes #5464.

Checklist

  • [X] 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 valgrind's memcheck](https://github.com/ddnet/ddnet/...
16:05
@Robyt3 nice work working with confusing code
16:06
justatest
Avatar
Avatar
Ryozuki
@Robyt3 nice work working with confusing code
Jupstar โœช 2023-05-22 16:09:14Z
i dunno what u mean... Meanwhile DDNet code: c++ float not_confusing_at_all (float x){ float xhalf = 0.5f*x; int i = *(int*)&x; i = 0x5f3759df - (i>>1); x = *(float*)&i; x = x*(1.5f - xhalf*x*x); return x; }
Avatar
Jupstar โœช 2023-05-22 16:09:39Z
its "The inverse square root implementation in Quake 3"
16:09
btw
Avatar
why does it take reference casts and dereferences
Avatar
Jupstar โœช 2023-05-22 16:10:33Z
i dunno, maybe it saves one CPU cycle
Avatar
int i = *(int*)&x; int i = (int)x;
16:10
is this not the same
16:10
should be a noop right
16:10
idk
Avatar
no it's no noop (edited)
Avatar
Jupstar โœช 2023-05-22 16:11:03Z
well x is float
Avatar
Jupstar โœช 2023-05-22 16:11:24Z
its a reinterpret to me
Avatar
yeah, it converts float to int by preserving the bits
Avatar
the fast inverse square root trick came from treating the 32-bit floating-point word[note 2] as an integer, then subtracting it from a "magic" constant, 0x5F3759DF
16:12
ah
16:12
the trick is to do the cast as a noop
16:12
actually
16:12
right? xd
Avatar
Avatar
Jupstar โœช
it also claims array sort but i doubt the reverse parameter ever reaches c
thanks, it actually reaches C
Avatar
Avatar
Ryozuki
int i = *(int*)&x; int i = (int)x;
I mean those two lines are not the same
Avatar
true true
16:15
i missed it
16:16
reminds me of implementing tagged unions
Avatar
Avatar
Ryozuki
the fast inverse square root trick came from treating the 32-bit floating-point word[note 2] as an integer, then subtracting it from a "magic" constant, 0x5F3759DF
Did you figure out how it works? There is a decent video on it if not
Avatar
ill look at it someday xD
Avatar
Jupstar โœช 2023-05-22 17:00:29Z
how did they find it
Avatar
chatgpt
Avatar
Jupstar โœช 2023-05-22 17:03:27Z
soonโ„ข๏ธ
Avatar
Who knows what was going through their minds
17:04
It relies on the fact that the ieee754 representation of a float has it's exponent easily accessible and that square root of a multiplication can be split in two
17:05
If you mean the magic number only god knows
Avatar
Oh and the cool property of logs that make exponentiation multiplication
Avatar
Avatar
Ryozuki
now 17.0 should be ready
That's not how it works. I try to wait at least a week before release to give bugs a chance to be found
Avatar
Avatar
deen
That's not how it works. I try to wait at least a week before release to give bugs a chance to be found
oh yeah, i meant ready as in known bugs fixed
17:24
xD
17:25
rust for C/C++ developers
Avatar
But I'm pretty happy with the RC process. Far fewer point releases since we started doing that
Avatar
god i want to jump all in and start making something stupid like rewriting the entirety of ddnet in rust because then we could compare the code and remove every and all crashes
Avatar
rewriting it in rust is probably gonna add more crashes
Avatar
wait wtf why isnt rust code built to prevent crashes
Avatar
Avatar
Voxel
wait wtf why isnt rust code built to prevent crashes
because rewriting things introduces bugs
17:36
and the current code has been tested in the real world for quite some time
Avatar
Less SIGSEGV, more Unhandled Error bubbling to main ๐Ÿ˜›
Avatar
*panics are easier to debug
17:38
but yeah
17:38
and rewriting is work
17:38
u say this cuz ur new
17:38
u dont know what ur saying
17:38
no offsense
Avatar
i wanna do work that isnt boring !
Avatar
unhandled error bubbling to main is harder to debug
17:39
than an easy segfault
17:39
panics have stacktraces too
Avatar
Jupstar โœช 2023-05-22 17:39:30Z
its 50:50
17:39
segsegvs can be impossible to reproduce and give no debug info (edited)
Avatar
Avatar
Ryozuki
idk
having dealt with this in complex code bases, yes
17:39
you don't know where the damn error comes from
Avatar
define complex
Avatar
Jupstar โœช 2023-05-22 17:40:20Z
10 lines of code
Avatar
e.g. try to figure out why rustls rejects a certificate
Avatar
Avatar
Jupstar โœช
10 lines of code
10 lines of cpp code
Avatar
Avatar
Jupstar โœช
i dunno what u mean... Meanwhile DDNet code: c++ float not_confusing_at_all (float x){ float xhalf = 0.5f*x; int i = *(int*)&x; i = 0x5f3759df - (i>>1); x = *(float*)&i; x = x*(1.5f - xhalf*x*x); return x; }
.
Avatar
Jupstar โœช 2023-05-22 17:41:02Z
1 line of code, bcs no newline was used
Avatar
0 lines, because all the code is in json files troll
Avatar
now that i think about it god yea i dont even know how to properly cpp so i grew up doing basic coding logic so i pretty much only know loops and how to format functions that dont look ugly
17:45
mainly just basic coding logic
Avatar
coding is just basic coding repeated a lot of times :p
17:46
hm, maybe not. maybe sometimes you need to design stuff
17:46
but for small things, it works
Avatar
but like.. pointers and ..
Avatar
a068034 Extract duplicate expressions into variables - Robyt3 d5e4597 Fix filling switch layer not setting switch number 0 - Robyt3 6ca74ec Clear unused switch/tele properties when filling selection - Robyt3 b2eacf7 Merge #6648 - bors[bot]
Avatar
Jupstar โœช 2023-05-22 17:49:34Z
well voxel, rust is easier than cpp in this case if u dont aim for performance, but idiomacity, i'd generally say rust is easier e.g. if u use lots of Rc or Arc u can basically create code like in javascript in js u often copy objects, in rust u can do this too bcs of Copy macro
17:50
yeah i had this plan for how i could use rust to my advantage
17:50
exploiting an adobe product troll
17:51
if i could somehow copy adobe animate frames outside the program i could apply advanced animation tactics without having adobe animate throttle the cpu
17:52
because fun fact, adobe animatr limits to only a small percentage of your cpu, meaning its super fucking slow
17:52
so if you were to run a javascript file in it, itd take ages and maybe freeze up
17:53
so i want to somehow run all of this outside the program in something fast
Avatar
Avatar
Voxel
because fun fact, adobe animatr limits to only a small percentage of your cpu, meaning its super fucking slow
I can confirm, that is why no one used flash
Avatar
everyone used flash?!
Avatar
theres a whole community online who still relies on flash LOL
17:55
and im in it
Avatar
Didn't they kill flash years ago?
Avatar
no i mean adobe animate
Avatar
Avatar
Salanto
Didn't they kill flash years ago?
there's tons of material in flash, people are working on preserving it
Avatar
the program to make flash files
17:58
anyways there is nothing that comes close to adobe animate
17:58
that is free and doesnt look ugly and is usable
Avatar
I used flash too, and made a long and cool animated stick fight video with it, but lost the files unfortunately ๐Ÿ˜ฆ
18:08
In the spirit of https://en.wikipedia.org/wiki/Xiao_Xiao, so must have been > 20 years ago ๐Ÿ˜„
Avatar
oh damn :(((
Avatar
Fixed typos and uncapitalized words for DDNet's Explain Page. The changes don't alter the meaning of each description, but instead tries to be more accurate.
Avatar
Jupstar โœช 2023-05-22 19:02:40Z
ez, robyte makes new UI with tw UI code xd
Avatar
Avatar
Voxel
but like.. pointers and ..
do u truly understand pointers
19:09
they are hard to grasp
19:09
one of the most abstract things
19:10
flash animation was
19:10
the biggest scene
19:11
im a fan of krinkels
19:11
A community of artists, game developers, musicians, voice actors and writers who create and share some of the best stuff on the web!
19:11
good old times
19:11
krinkels made madness combat
19:13
yutube url sucks
Avatar
i sent a meme in offtopic that relates to this whole adobe animate ordeal
19:14
i was so into this
19:14
and another one about a bunny killing
Avatar
Avatar
Ryozuki
int i = *(int*)&x; int i = (int)x;
DANGER
19:15
you are not casting the value of x into an int, youโ€™re casting a float pointer to an int pointer & dereferencing
19:15
getting float data as an integer
Avatar
ur late to the paty
Avatar
i wake up
Avatar
Avatar
Ryozuki
they are hard to grasp
When helping people I've found that the image of literal people pointing at stuff kinda helps
19:19
Also talking about addresses as if they are regular home addresses
Avatar
i kinda know how pointers work? since i needed them for packet decompiling and stuff
19:19
with classes and all
Avatar
youโ€™re word souping
Avatar
@Voxel u havent struggled right
19:22
i think u dont know em
Avatar
you can grasp the concept of pointers and still be completely in the dark on heap memory & how to manage your pointers
Avatar
@Voxel i recommend u make a linked list in C
19:23
good way to learn
Avatar
Avatar
Ryozuki
@Voxel u havent struggled right
i just copied another code segment in the same file lololol
Avatar
fabulous idea
Avatar
Avatar
Ryozuki
they are hard to grasp
I don't remember why they're hard
Avatar
idk either
Avatar
if you model your memory as cells for bytes with positions
Avatar
they seem ez to me
19:27
but i struggled
Avatar
can't you just say that a pointer is an integer saying which of these cells is meant?
Avatar
@Chairn what do u say
19:28
or u havent teached c to completly new ppl
Avatar
(note that this doesn't represent correctly how pointers work in C, but kinda in x86 assembly)
19:28
(but it was still the mental model with which I started, I think)
Avatar
they work the same in C they just have a type specifier attached for clarity's sake
19:29
they can be trivially cast away
Avatar
no, unfortunately not
Avatar
pointers dont have a type, but in c they refer to the pointee type
Avatar
e.g. float x; int *y = (int *)x; *y = 0; is UB in C (edited)
Avatar
Avatar
Ryozuki
pointers dont have a type, but in c they refer to the pointee type
I don't understand "pointers don't have a type". in C, they do, no?
Avatar
they are still just an int
Avatar
Avatar
Ewan
they are still just an int
no, as I demonstrated above
Avatar
@heinrich5991 i just come from llvm
19:31
llvm has opaque pointers
19:31
they dont care what they point to
19:31
a pointer is only a pointer
Avatar
I see
Avatar
Avatar
heinrich5991
I don't remember why they're hard
The pointer arithmetic is what is confusing to teach in my experience. It's not exactly intuitive what adding 1 to a traditional address means
Avatar
llvm used to have ptr with a type
19:31
but that was just to satisfy C
19:31
well
19:31
it was to find errors in clang
19:31
but llvm now is more generic
19:32
clang is the one who needs to save the pointee type info
Avatar
Avatar
heinrich5991
e.g. float x; int *y = (int *)x; *y = 0; is UB in C (edited)
this demonstrates pointer-specific operations but it doesn't say a pointer is anything but an integer ๐Ÿ˜ƒ
19:32
without such potentially dangerous operations pointers would be useless in C
Avatar
A pointer is most definitely not an integer. Atleast as far as the standard is concerned
Avatar
also not compilers
19:32
this
Avatar
they miscompile your stuff if you treat them like integers
Avatar
Avatar
Ewan
this demonstrates pointer-specific operations but it doesn't say a pointer is anything but an integer ๐Ÿ˜ƒ
float x; &x + 3; is UB
Avatar
oh yeah for sure
Avatar
x + 3 isn't UB for most values of an integer
Avatar
It guarantees that there is a way to cast OBJECT pointers to an integer and back through an intptr_t or uintptr_t. But not much else
19:34
i dont wanna spam the content xd
19:34
Pointee types provide some value to frontends because the IR verifier uses types to detect straightforward type confusion bugs. However, frontends also have to deal with the complexity of inserting bitcasts everywhere that they might be required. The community consensus is that the costs of pointee types outweight the benefits, and that they should be removed.
Avatar
that is awesome
Avatar
in rust its even more difficult
19:35
to handle pointers
Avatar
i thought you couldn't without an unsafe block
19:35
outright
Avatar
u can only deref in a unsafe
Avatar
you have & and &mut pointers which work without unsafe blocks
Avatar
but u can deal with em
Avatar
but there are subtle things
19:36
this exists
19:36
s
19:36
Create a const raw pointer to a place, without creating an intermediate reference.
Avatar
how do i live in this world knowing s exists
Avatar
Create a const raw pointer to a place, without creating an intermediate reference.
>
Creating a reference with &/&mut is only allowed if the pointer is properly aligned and points to initialized data. For cases where those requirements do not hold, raw pointers should be used instead. However, &expr as *const _ creates a reference before casting it to a raw pointer, and that reference is subject to the same rules as all other references. This macro can create a raw pointer without creating a reference first.
>
Note, however, that the expr in addr_of!(expr) is still subject to all the usual rules. In particular, addr_of!(*ptr::null()) is Undefined Behavior because it dereferences a null pointer.
(edited)
Avatar
Avatar
Ryozuki
i boldly asked 33k
well, time to ask for 40k ๐Ÿ™‚
Avatar
thats old xd
Avatar
Avatar
Ryozuki
s / teach /tech
remove space and it works ๐Ÿ˜‰
Avatar
i did it without it intentionally
Avatar
He is slowly making his way
Avatar
you can use \ to make it not work (edited)
19:38
s/not// (edited)
Avatar
Avatar
heinrich5991
you have & and &mut pointers which work without unsafe blocks
is this a pointer or a reference? there is a difference
Avatar
what's the difference?
Avatar
they cant be nullable, but same
Avatar
Avatar
Ryozuki
Native GUI with GPU acceleration in Rust, no more waiting on launching the editor, and any lag on your keystroke will be treated as a bug and get fixed.
what's the point of gpu acceleration just to print text to screen?
19:40
why does he only answer what i say
19:40
what about others
19:40
xd
Avatar
you're having a 1 on 1 convo ๐Ÿ˜ƒ
Avatar
Avatar
Ryozuki
they cant be nullable, but same
hmm, that seems like a c++-specific difference
19:43
e.g. function pointers in rust aren't nullable
Avatar
There are lots of c++ specific small subtleties for ref vs ptr
Avatar
but then it's kind of moot to ask whether it's a pointer or a reference for other languages
19:44
e.g. I don't know what java calls its references
Avatar
we can't talk about ref vs ptr globally
Avatar
but they're nullable
Avatar
i know for a fact C# has a very convoluted reference system
19:44
we are not talking about that
Avatar
Avatar
Ewan
is this a pointer or a reference? there is a difference
I was wondering how to answer this question
Avatar
well we were talking about rust
Avatar
well, in rust &mut/& is called "reference"
Avatar
i'm sure you can 'dereference' a reference outside of an unsafe block yea?
Avatar
yes
Avatar
but a real pointer which could fathomably point to anything, you can't
19:45
there's one difference (edited)
Avatar
Avatar
Mr.Gh0s7
Click to see attachment ๐Ÿ–ผ๏ธ
damn, tiles looks like giant compared to 2D
๐Ÿ‘‹ 1
๐Ÿ‘ป 2
๐ŸŽฉ 1
Avatar
i didn't see that video until now
19:46
it's awesome
19:46
third person 3d client would be insane
Avatar
Avatar
heinrich5991
well, in rust &mut/& is called "reference"
*mut T would be called a pointer though, no? There must be a reason they differentiate between the two
Avatar
well i know that in cpp references vs pointers are more strictly enforced
Avatar
yea, they're called (raw) pointers in rust
Avatar
A null ptr can exist in rust, but I don't think a null ref can exist there either
Avatar
a null object pointer can exist
19:48
a null function pointer cannot
Avatar
Avatar
Chairn
damn, tiles looks like giant compared to 2D
there's a more up todate version here https://streamable.com/67bvjs
Avatar
Avatar
heinrich5991
well, in rust &mut/& is called "reference"
or borrow
Avatar
ohhhhhhhhhhhhhh
19:48
borrow
Avatar
i think borrow is more used
Avatar
huh? never heard that tbh
Avatar
Avatar
Mr.Gh0s7
there's a more up todate version here https://streamable.com/67bvjs
this poor tee ๐Ÿ˜ญ
Avatar
apparently pointer is used to refer to all these types: raw pointers, references, smart pointers
Avatar
a little misleading but it works i guess
Avatar
hmm i guess
Avatar
why is it misleading?
Avatar
Avatar
Learath2
My brain is malfunctioning a little, are these two equivalent? n & 0xB4 == 0xB4 and n >= 0xB4?
looks like if first is true, then second is true as well
Avatar
about the borrow thing
Avatar
They should make a rust standard so I can become a rust standards lawyer too
Avatar
Avatar
Ewan
a little misleading but it works i guess
we just established that terminology is language-specific
Avatar
I can nitpick terminology
Avatar
if anything i'd have chosen the word 'reference' to encapsulate all 3. regardless of what form a pointer takes it's still just a tool for referencing, "references" can be borrow checked (?), smart pointers... yea
Avatar
so it cannot really be misleading unless you tell me what sets pointers apart from references cross-language
Avatar
philosophically speaking i think the term pointer is bound to its specific address implementation, where it's just a number that holds the address of a value it's referencing. a reference could be anything else
Avatar
Avatar
Ewan
philosophically speaking i think the term pointer is bound to its specific address implementation, where it's just a number that holds the address of a value it's referencing. a reference could be anything else
that's what all three pointer types in rust are
19:52
just a number in memory
Avatar
Avatar
Ewan
philosophically speaking i think the term pointer is bound to its specific address implementation, where it's just a number that holds the address of a value it's referencing. a reference could be anything else
if there were some theoretical language-specific entity tasked with keeping track of references by any means, with the underlying method being entirely irrelevant/possibly changing across implementations, it would be reasonable to call its objects 'references'
Avatar
Avatar
Ryozuki
i got this mail lol
the git does exist and is public though
Avatar
Avatar
Ewan
if there were some theoretical language-specific entity tasked with keeping track of references by any means, with the underlying method being entirely irrelevant/possibly changing across implementations, it would be reasonable to call its objects 'references'
e.g. references there could be implemented with pointers, but that is not a requirement for it to still be a reference
19:53
if you catch my drift
19:53
this is all theoretical anyway i can't imagine a very good use case differentiating between the two
Avatar
Avatar
Chairn
the git does exist and is public though
yeahh i think they were just like, don't share this with your buddies
Avatar
Avatar
Robyt3
very soon
damn it, 1040 friends?
Avatar
i'm more fascinated by robyt being in the kog clan
19:56
don't you have to be top 100?
19:56
this man gores
Avatar
oh so he does play
Avatar
Avatar
ChillerDragon
!:justatest:
can you reduce the image size a bit?
Avatar
reading the backlog
20:01
its dedication
20:01
i dont need to do that
20:01
since im always here
20:01
justatest
Avatar
Avatar
Chairn
can you reduce the image size a bit?
ChillerDragon doesn't see replies. @Chairn's message was a reply to yours, ChillerDragon
Avatar
Avatar
Learath2
I want to find all paths that visits each node at most once from A to B in a directed graph, DFS is the best I can do, right?
Dijkstra seems fine because you want ALL paths
Avatar
Avatar
Chairn
Dijkstra seems fine because you want ALL paths
I ended up doing BFS. Why do you think djikstra would work? Isn't the entire idea of djisktra discarding paths that can't possibly be the shortest?
Avatar
Avatar
Ravie
guys do you like my concept for the settings page?
ah, actually a good idea, we could play the associated animation on the side ๐Ÿ˜‰
Avatar
Avatar
Jupstar โœช
Click to see attachment ๐Ÿ–ผ๏ธ
this looks fine imo
Avatar
Jupstar โœช 2023-05-22 20:08:03Z
Avatar
Original message was deleted or could not be loaded.
also in France
Avatar
Original message was deleted or could not be loaded.
do you speak baguette at least?
20:16
i speak catalan
Avatar
Original message was deleted or could not be loaded.
you gotta split on < and > and then split according to what's in between, because there are multiple garbages prepended
Avatar
ChillerDragon: ^
Avatar
Original message was deleted or could not be loaded.
meh, didn't got time to review it (and there are some mistakes ๐Ÿ˜ฆ )
Avatar
Original message was deleted or could not be loaded.
gl & hf ๐Ÿ˜›
Avatar
Original message was deleted or could not be loaded.
because floating point operations are fairly expensive, especially in 1999
20:45
it's just an approximation of the inverse square root function, which surprisingly works pretty well
20:46
i believe the factor they use is kinda experimental, but someone used Newton's method and shown that it was actually the optimal number
Avatar
Original message was deleted or could not be loaded.
technically, on x86/x87, it's not really a nop because it induces a transfer from the FPU to the CPU
Avatar
Original message was deleted or could not be loaded.
experimental
Avatar
wtf is x87
Avatar
Jupstar โœช 2023-05-22 20:47:55Z
Fpu
Avatar
Avatar
Chairn
experimental
Jupstar โœช 2023-05-22 20:48:33Z
Well but how. By hand? Xd
Avatar
Original message was deleted or could not be loaded.
technically, pointers are integers
20:50
but if you go this path, everything is just a soup of bits and bytes
20:50
and you interpret them as you wish ๐Ÿ™‚
Avatar
Avatar
heinrich5991
float x; &x + 3; is UB
hmm, this is not UB? it just takes the address of x and adds 3*sizeof(x) ?
Avatar
Avatar
Ryozuki
thats old xd
you're old !!
Avatar
Avatar
Ryozuki
what about others
sorry, you were the most interesting guy in the last 5 days ๐Ÿ™‚
Avatar
Avatar
Learath2
A null ptr can exist in rust, but I don't think a null ref can exist there either
a null ref can exist in c++, your phrasing suggests otherwise
Avatar
The standard does not allow for a null reference
Avatar
can u do &nullptr
20:54
xd
Avatar
It'd give you a pointer
Avatar
Avatar
Learath2
I ended up doing BFS. Why do you think djikstra would work? Isn't the entire idea of djisktra discarding paths that can't possibly be the shortest?
it only discards at the end if you don't optimize it
Avatar
to the nullptr
20:54
hmm
20:54
idk how to make one
Avatar
(Depends on the context)
Avatar
Avatar
Learath2
The standard does not allow for a null reference
but it can be crafted though
20:55
soon #6666 also
Avatar
Avatar
Chairn
but it can be crafted though
Not without invoking UB
Avatar
surely, but it's not impossible to break compiler assumption
Avatar
C++20: 9.3.3.2p5 ...
[Note: In particular, a null reference cannot exist in a well-defined program, because the only way to create such a reference would be to bind it to the โ€œobjectโ€ obtained by indirection through a null pointer, which causes undefined behavior...]
Avatar
probably possible to create an invalid but non null reference too
Avatar
Avatar
Chairn
it only discards at the end if you don't optimize it
Are we talking about the same Djikstra's Algorithm? Doesn't it just devolve into breadth-first search if you remove the comparison with the shortest known route at any step?
Avatar
i don't know breadth-first search ๐Ÿ˜ฆ
21:01
iirc, Dijkstra discard when it reuses a node
21:02
I realize there are a lot of UB in C/C++ that are actually quite well defined at assembly level...
Avatar
Avatar
heinrich5991
float x; &x + 3; is UB
I misread
21:13
nothing is even happening here
21:14
for some reason i thought you were trying to do like this, assuming x is magically pointing to a valid float value (bare with me) void *x; *x += 3; (edited)
21:14
that would be UB
Avatar
&x + 3 gets you outside the 1 float you declared, even creating such a pointer is deemed UB
Avatar
since anything beyond &x + 1 is unknown yea
21:17
thing is he would have to do something with &x + 3 for problems to arise
21:17
atm itโ€™s just a random expression
Avatar
C99: 6.5.6p8 even doing that + immediately invokes UB
21:18
In practice indeed nothing will happen, but the compiler is allowed to shoot your parents for it
Avatar
Avatar
Ryozuki
can u do &nullptr
Now that I think about it you can't do this. Something was bugging me but I couldn't put my hand on it. nullptr isn't even an lvalue
Avatar
``` /home/teeworlds/src/master/src/engine/shared/snapshot.cpp:206:21: runtime error: signed integer overflow: 1645289600 - -2139062144 cannot be represented in type 'int' #0 0x7650b7 in CSnapshotDelta::DiffItem(int const, int const, int, int) /home/teeworlds/src/master/src/engine/shared/snapshot.cpp:206:21 #1 0x765cea in CSnapshotDelta::CreateDelta(CSnapshot, CSnapshot, void) /home/teeworlds/src/master/src/engine/shared/snapshot.cpp:323:7 #2 0x51a0e2 in CServer::DoSnapsh...
Avatar
Avatar
Learath2
C99: 6.5.6p8 even doing that + immediately invokes UB
Funfact: x + 1 is completely fine, even x++
Avatar
yea cuz float is 2 bytes
Avatar
(Dereferencing it is still not ok, but you can hold and use that pointer)
Avatar
i think x++ would error in cpp
Avatar
Avatar
Ewan
yea cuz float is 2 bytes
Nope, that +1 takes you sizeof *x bytes out. So you are indeed outside
21:50
For additions in C, if one operand is a pointer that doesnt point to an array object but another object, it's treated as an array of length 1. Holding/creating a pointer one past an array is allowed
Avatar
808d604 Propagate list box active state to underlying scroll region - Robyt3 e175c0a Remove duplicate enter hotkey used for connecting to server - Robyt3 59fafdb Only activate server browser list box when no popup is open - Robyt3 0d0f9ed Remove dead code - Robyt3 9be72db Remove unnecessary margin on left side of server filter - Robyt3 f16f77c Slightly decrease size of country flag in server filter - Robyt3 4dcb80e Enable country button also when filter not enabled - Robyt3 83c19a1 Add highlight color when hovering country button of server filter - Robyt3 23d8acd Replace country server filter fullscreen popup with smaller popup - Robyt3 bf7469f Merge #6649 - bors[bot]
Avatar
The more completely useless information you know the better
Avatar
Avatar
Ewan
yea cuz float is 2 bytes
This one is another reason why thinking about pointers as integers can lead you astray. Adding 1 doesn't add 1 to the number you are thinking of
Avatar
Interesting
Avatar

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 valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssan...
Avatar

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 valgrind's memcheck](https://github.com/ddnet/ddnet/#using-ad...
Exported 951 message(s)