Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2021-05-18 00:00:00Z and 2021-05-19 00:00:00Z
Avatar
Avatar
Astramast
Bcd new ddnet steam comers dont know that they exist
i know that they exist
Avatar
Avatar
Iza
i know that they exist
no u dont
Avatar
ok, I know why my macos is compiling external/pnglite/VERSION now
09:10
i'm using a case-insensitive apfs, macossdk tries to include <version> then it just found external/pnglite/version
Avatar
adding a BEFORE in target_include_directories when using bundled libs fixed it.
09:22
not sure if it is right way tho
Avatar
Hey Devs, i bought a raspberry pi 3b yesterday and wanted to install a nas-sys and run tw beside. Do you think that the raspi 3b is good enough to run both task at the same time ?
09:47
i wanna run surely the native ver of ddnet client
Avatar
just test it out, it should run, but maybe not good
Avatar
Don't like it much, I'm not a big fan of pvp mods and think they are not so fun long-term. Also a tab makes no sense, since pvp is not a project
11:03
like DDNet or KoG
Avatar
add community, put noby fng and kog there
11:05
but everything thats hosted by ddnet can stay in ddnet
Avatar
Internet tab is plenty enough tbh
Avatar
not untrue, official server are highlighted anyway 😄
11:21
with https master servers especially 😄
Avatar
but I should change my repo name I guess
11:22
kek
Avatar
lets create PVPNet.tw
Avatar
why this shit tell me player.h does not exist when he exist :c
11:38
i tried on local and that work, i have this shit only in my vps (edited)
Avatar
player entity. interesting
Avatar
did u clone with submodules
Avatar
Avatar
TsFreddie
player entity. interesting
yeah i tried to move it but that doesn't work
Avatar
Do random things until it works is my favourite approach to debugging aswell
Avatar
dont buy ur compiler on wish
Avatar
did you or why?
Avatar
no bcs he cant compile with his vps XD
12:30
the joke behind it is, that things from wish are always low quality xD
Avatar
when i was moving in US, i hired some helpers, and one of them asked me if i can get them something on wish.
13:53
didn't know what wish was at the time tho.
Avatar
@Deleted User is there a player.h in src/game/server/entities/?
15:01
by default there's only one in src/game/server/
Avatar
ye i know
15:02
I just did shit because I hadn't slept
Avatar
someone can explain this shit? same code but on local and vps not the same result
Avatar
smells like undefined behaviour
Avatar
compiled with signed char?
15:35
on arm char isnt signed
15:36
-fsigned-char
Avatar
has anyone run ddnet server on arm yet?
15:37
might find some bugs with it
Avatar
i ran it on android
15:38
but worked fine and the toolchain also uses signed char there
15:38
ah but only client
15:38
thought he uses client anyway 😄
Avatar
304d9f3 Fix UB with super (fixes #3830) - def- c6c0c1d Merge #3832 - bors[bot]
Avatar
but we still have alignment issues anyway, but i think they are mostly deadly for floats, and they were only in vote options
15:43
so might not be too critical
15:43
atleast on arm32 its deadly
Avatar
Avatar
Deleted User
but we still have alignment issues anyway, but i think they are mostly deadly for floats, and they were only in vote options
do we really have alignment issues left? thought we cleaned up ubsan
Avatar
Avatar
Learath2
do we really have alignment issues left? thought we cleaned up ubsan
in server i think so
15:44
client should be fine
15:44
there is still issues with destructors tho
15:45
soon in 20 years when tsfreddie rewrote all prediction code it might be solved xd
15:47
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/game/server/gamecontext.cpp:2785:12 in ../src/game/server/gamecontext.cpp:2785:12: runtime error: load of misaligned address 0x63100001488f for type 'CVoteOptionServer *', which requires 8 byte alignment 0x63100001488f: note: pointer points here @Learath2
Avatar
I bet that's the weird memheap implementation we use to keep these allocations in a block
15:52
I'll add alignment support to it tonight
15:52
Hopefully, idk, I woke up way too late today
Avatar
alternatively just align it to 8 bytes
15:52
instead of passing alignment everywhere
15:52
to pointer size
Avatar
Avatar
heinrich5991
alternatively just align it to 8 bytes
Could do that too, but why waste space?
15:53
I guess byte lifes don't matter to you young folk
Avatar
I feel like this is applying the optimization at the wrong place
Avatar
just remove these heaps xD
15:55
just use normal allocations
Avatar
Avatar
Deleted User
just remove these heaps xD
Tbf with modern arena allocators this would work fairly well
15:56
Actually no, it might end up in different bins. So we should probably put it in a vector instead
15:56
We iterate thru it a lot
Avatar
Avatar
heinrich5991
I feel like this is applying the optimization at the wrong place
Point was that not every type requires max alignment
Avatar
yes. malloc also always returns maximum alignment
Avatar
Because malloc needs to stay generic and support decades of C cruft.
15:59
Modern allocators with an std::allocator interface correctly take and utilize alignment
Avatar
use whatever fits
16:00
still better than own implementations that always make trouble xD
Avatar
@Learath2 I guess you could make it a template argument, then it's not harder to pass
16:00
ah no, the usage doesn't line up with that
Avatar
That is what I was planning, but I didnt look at the code yet. Putting it in a vector might be much easier
Avatar
the usage is for structs that are larger than they actually are
16:01
i.e. ones that have dynamic data at the end, usually strings
16:01
I think consumers expect the pointers to remain stable
Avatar
We have flexible array members??
Avatar
yes
Avatar
I love how matricks coded these
16:03
we've only messed his nice memory layout out since we all started messing around with it
16:03
s/out/up
16:04
anyway, I'll do it however you prefer I do it, I honestly don't have the energy to argue anything
16:05
If you prefer I get rid of the flexible array member and shove it in a vector I'll do that
16:05
If you prefer I align everything to max alignment I'm also fine with that
Avatar
do it how you like it, I don't htink there's much new usage of these classes
16:49
f48cba5 Check length of reason (#17) - Learath2
Avatar
@heinrich5991 sadly on windows dbg_curl doesnt seem to show the verbosity it does on linux
16:56
person checked dbg_curl was 1
Avatar
@Learath2 i found something interesitng
21:14
I just saw a picture today and think I'd appreciate explanations. So here is the picture: I found this confusing and wondered if such codes are ever practical. I googled the picture and found an...
Avatar
this is not flexible array member class CNetChunkResend { public: int m_Flags; int m_DataSize; unsigned char *m_pData; int m_Sequence; int64 m_LastSendTime; int64 m_FirstSendTime; };
21:16
this is flexible array member, but it's not supported in C++ class CNetChunkResend { public: int m_Flags; int m_DataSize; int m_Sequence; int64 m_LastSendTime; int64 m_FirstSendTime; unsigned char m_data[]; };
21:17
🙂
Avatar
u can just malloc any type and run new over it tho so unsigned char* m_data;
21:19
any size*
21:19
and for simple structs ofc without constructing
Avatar
yes, but that fake flexible array member wastes 4/8 bytes on that unnecessary pointer
Avatar
well u can just use uint8_t
21:20
i mean in the end its just binary work
Avatar
single byte pointer?
Avatar
you just want an address of the starting pointer
21:21
rest doesnt really matter as you define how tall your struct is
21:22
so &m_data
Avatar
what about class CNetChunkResend { public: int m_Flags; int m_DataSize; int m_Sequence; int64 m_LastSendTime; int64 m_FirstSendTime; unsigned char m_data[1]; };
21:22
emulating flexible array member in C++
Avatar
yeah
Avatar
ah so you meant this
Avatar
pointers of arrays are still the beginning of pointers i c++
21:22
so yeah
21:23
doesnt really matter how it looks like, u just need the start address 😄
Avatar
*beginning of array
Avatar
With heinrich5991's upcoming HTTP master server (https://github.com/ddnet/ddnet/pull/3772, https://master1.ddnet.tw/ddnet/15/servers.json) we now also archive the player statistics: https://ddnet.tw/stats/master/ Maybe someone has a good use for that data already.
Avatar
Avatar
Ryozuki
this is not the best way to read C declarations btw, there is only one rule and it's "declaration follows use"
Avatar
i.e. try to imagine that the declaration tells you how to use it
22:51
(*abc)[10] pointer to array
22:52
*abc[10] == *(abc[10]) array of pointers
22:57
if I asked you what you'd prefer to write the HTTP masterserver API for servers in, you'd probably say go out of python, go, rust? @Learath2
22:57
go has the disadvantage (for me) that I don't know it well
Avatar
@heinrich5991 I don't know go well enough to suggest it for anything tbf
23:30
I know this would be a decent usecase for it tho
23:31
I think rust is our best bet here
Exported 135 message(s)