Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/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 2024-02-16 00:00:00Z and 2024-02-17 00:00:00Z
Avatar
A large collection of anime girls with programming books
00:49
@Ryozuki
00:50
😂😂😂
Avatar
Avatar
Teero
this me
Avatar
Avatar
Learath2
this me
gcc is forcing me to cast to (char*) ;(
Avatar
Not in superior C
Avatar
Today I wrote some templates so cursed I just deleted them, they truly are the source of all evil
01:14
A very task-specific reimplementation of std::bind
Avatar
I can't talk
01:20
Neither can I correctly explain anything I'm thinking with written language
01:21
Gn
Avatar
Avatar
Teero
gcc is forcing me to cast to (char*) ;(
It’s not GCC, it’s C++
Avatar
Avatar
Learath2
Today I wrote some templates so cursed I just deleted them, they truly are the source of all evil
interesting
Avatar
Hello guys, I'm really struggling trying to code a snap single chunk. Can someone help me decode it? "\x08\x0e\x0f\xae\x0b\xaf\x0b\xda\xf9\xfc\xd6\x0c\x82\x02\x00\x07" \ "\x00\x04\x0a\x90\x02\xb0\x0a\x02\x03\x04\x04\x90\x04\xb0\x06\x02" \ "\x02\x04\x02\xb0\x01\xb0\x04\x01\x00\x04\x01\xb0\x01\xb0\x03\x01" \ "\x00\x06\x00\x00\x00\x00\x00\x14\x00\x00\x01\x0b\x00\xcc\xcc\x80" \ "\xd1\x03\xcd\xf8\x88\x81\x02\xff\xfd\xfb\x87\x02\xff\xff\xfb\xf7" \ "\x0f\xff\xfd\xfb\xf7\x0f\xff\xfd\xfb\xf7\x0f\xff\xff\xfb\xf7\x0f" \ "\x8c\x01\xd2\xc8\xf0\xc1\x03\xff\xfd\xfb\x87\x02\xff\xfd\xfb\xf7" \ "\x0f\xff\xfd\xfb\xf7\x0f\xff\xfd\xfb\xf7\x0f\xff\xff\xfb\xf7\x0f" \ "\x00\x86\xe3\xd3\x0b\xa0\xfc\x80\x01\x0a\x00\x01\x00\x00\x00\x00"
03:55
This is the first snap after I enter a dm1 game. I already know how to decode: flags: 0 size: 142 bytes message: 7 (snap single) tick: 750 delta tick: 751 crc: -1701813851
03:56
but how do I decode the snap data XD?
Avatar
chillerdragon BOT 2024-02-16 03:59:31Z
WTF js
Replying to @MilkeeyCat image.png
Avatar
snap data starts at \x82\x02 (first line)
Avatar
chillerdragon BOT 2024-02-16 04:01:21Z
It’s all ints
04:01
Call getInt() until you consumed all
04:02
04:02
First three ints are removed num zero
04:02
Then the next int is the item type
04:02
Then it’s id
04:03
Then lookup its size in your table and consume as many ints as this type is big
04:03
Then another item starts
04:03
@Miguilim: what are you working on?
Avatar
Avatar
chillerdragon
Click to see attachment 🖼️
what decoder is this?
Avatar
chillerdragon BOT 2024-02-16 04:06:08Z
What are you working on dude?
04:06
You ignored my question since days I’m seriously curious
Avatar
Avatar
chillerdragon
What are you working on dude?
re-implementation of teeworlds server on a high level language as a framework for mods
04:07
TeeFrame
04:07
Frame from framework xd (edited)
04:07
tee from teeworlds xdddddddddd
Avatar
chillerdragon BOT 2024-02-16 04:07:28Z
Which language
Avatar
php + swoole
Avatar
chillerdragon BOT 2024-02-16 04:07:46Z
So you reimplement the server from scratch?
04:07
Woah php that’s new
Avatar
Avatar
chillerdragon
So you reimplement the server from scratch?
yes
Avatar
chillerdragon BOT 2024-02-16 04:08:25Z
04:08
The item types and sizes changed in 0.7 but the concept is the exact same
Avatar
respecting the protocol, but logic is completely different
Avatar
chillerdragon BOT 2024-02-16 04:09:32Z
What do you mean by different logic?
Avatar
Avatar
chillerdragon
The item types and sizes changed in 0.7 but the concept is the exact same
but it works for 0.6 xd?
Avatar
chillerdragon BOT 2024-02-16 04:11:02Z
?
04:11
Parse the stuff as I explained it and it will work yes
Avatar
Avatar
chillerdragon
What do you mean by different logic?
I will not copy how the things works and how they are structured
Avatar
chillerdragon BOT 2024-02-16 04:12:18Z
So it’s not 1:1 the c++ code in php yes that makes sense
Avatar
how do I run this XD I never messed with ruby
04:23
do the 0.6 protocol have unknown size snap items?
Avatar
Avatar
chillerdragon
https://chillerdragon.github.io/teeworlds-protocol/07/snap_items.html Ye so it’s my ruby lib it’s linked here
🤯
Avatar
its not working XD
04:38
not exactly
04:39
I'm trying to extract first snap item (it seems to be obj_pickup)
04:39
04:39
04:39
but what is this 10 XDDDDDDDDDDDDDDDDDD
04:40
ohhhhhhhhhhhh
04:40
its the ID
04:40
now everything makes sense
04:41
poggers2
04:43
if the snap single contains multiple obj items, what do snap do?
Avatar
chillerdragon BOT 2024-02-16 05:10:24Z
gem install huffman_tw
Replying to @Miguilim image.png
05:10
Idk I forgot. I think it’s just deltas and not full snaps or something like that.
Replying to @Miguilim if the snap single contains multiple obj items, what do snap do?
05:11
Don’t think so. But ddnet added their own snap items.
Replying to @Miguilim do the 0.6 protocol have unknown size snap items?
Avatar
hi chillah
Avatar
Avatar
Ewan
It’s not GCC, it’s C++
If I were to compile it by hand I wouldn't get that error so gcc fault
Avatar
Avatar
Ewan
It’s not GCC, it’s C++
In C++ it would be new and no casts. Here we have malloc() => it is C (or a fishy legacy C++).
06:55
in a perfect world sure
06:55
im just saying c++ requires explicit casting of void pointer types like returned from malloc
👍 1
Avatar
Avatar
chillerdragon
gem install huffman_tw
now getting this cammo
Avatar
using malloc is using a function not C (edited)
08:05
using new is using a c++ feature
08:05
that said, use rust
08:05
owo
08:06
ffr
Avatar
Epyc
Avatar
Avatar
Miguilim
php + swoole
php8+?
Avatar
Avatar
chillerdragon
gem install huffman_tw
how does msg.header.size work, it’s just that for some reason it doesn’t send messages at all when I enter the message length (edited)
Avatar
Avatar
VaLl
how does msg.header.size work, it’s just that for some reason it doesn’t send messages at all when I enter the message length (edited)
That usually doesn't happen unless you had some incorrect code
Avatar
Avatar
VaLl
how does msg.header.size work, it’s just that for some reason it doesn’t send messages at all when I enter the message length (edited)
And what is "when you enter the message length"?
Avatar
well the value to msg.header.size with the length of the message
Avatar
Avatar
Ryozuki
using malloc is using a function not C (edited)
It is technically part of libc, so kinda C 😄
Avatar
i dont think using a library means using a language xd
Avatar
I guess that's fair
Avatar
uv is an extremely fast Python package installer and resolver, designed as a drop-in alternative to pip and pip-tools.
09:44
made in rust
09:45
09:45
@Learath2 i need to do the same for portage
09:45
i always keep leaving it for later
09:45
i wonder how complex it is
09:45
portage is slow
Avatar
U share lot of pyson related stuff lately. Stay on our side, the dark side ( insert your cat emoji here )
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
Look at it, gorgus
Avatar
Avatar
Jupstar ✪
U share lot of pyson related stuff lately. Stay on our side, the dark side ( insert your cat emoji here )
idk its just news xd
09:47
i dont rly do python
09:47
i do edlang
Avatar
Avatar
Ryozuki
portage is slow
It's mostly graph operations
Avatar
Avatar
Ryozuki
idk its just news xd
Yeah at least it's written in rust 😏
Avatar
If you share a rust compiler written in pyson. Then I know the world is doomed
Avatar
Replacing portage/emerge with a rust application is probably unfeasible though. You'd need to start shipping a rust compiler in stage3, it would probably be unpopular
Avatar
Reference Stability is an important concept in C++ STL containers, and it is also one of the major sources of Undefined Behavior (UB). Will an iterator or a reference (pointer) keep valid when you do a modification? In C++ STL, the concept only exists on the document, we can find a table here: The table describes the reference invalidation behav...
Avatar
Useful day-to-day WebAssembly packages. Wapm Packages has 47 repositories available. Follow their code on GitHub.
10:04
Llvm compiled to wasm xD
11:31
the llvm optimizer makes my factorial recursive function into a non recursive
Avatar
Avatar
Ryozuki
the llvm optimizer makes my factorial recursive function into a non recursive
When use ai for optimizations xd
11:37
Could probably work to detect certain patterns. Just hard to make it reliable
11:38
look this wizardry
11:39
mod Main { pub fn main() -> i32 { let b: i32 = factorial(4); return b; } pub fn factorial(n: i32) -> i32 { if n == 1 { return n; } else { return n * factorial(n - 1); } } }
11:39
this is my code btw
11:40
define i32 @main() local_unnamed_addr #1 !dbg !19 { entry: call void @llvm.dbg.value(metadata i32 24, metadata !23, metadata !DIExpression()), !dbg !25 call void @llvm.dbg.value(metadata i32 24, metadata !23, metadata !DIExpression()), !dbg !26 ret i32 24, !dbg !27 }
11:40
main gets inlined tho xd
Avatar
chillerdragon BOT 2024-02-16 11:53:01Z
That’s odd I would have to take a look
Replying to @Miguilim image.png
11:54
You need the length of the entire message not the chat message. Just wait for me to fix it. I should get to it within the end of next week
Replying to @VaLl well the value to msg.header.size with the length of the message
Avatar
Avatar
Ryozuki
the llvm optimizer makes my factorial recursive function into a non recursive
Is that not a classic case of tail recursion optimization?
11:55
im just amazed cuz im seeing the ir
11:56
making my own lang
Avatar
Avatar
Learath2
Is that not a classic case of tail recursion optimization?
but i thought most is about removing the stack usage
11:56
not recursion (?)
Avatar
Avatar
Jupstar ✪
Could probably work to detect certain patterns. Just hard to make it reliable
Problem is probably to not change the behaviour of the code
Avatar
Avatar
Ryozuki
but i thought most is about removing the stack usage
Well "tail recursion optimization" is basically "tail call optimization" getting rid of the stack usage. But after that there is another pass (I don't remember the name) that optimizes further because the target is the same subroutine so it can be treated as a loop
Avatar
@Learath2 do u bet i can make edlang faster than c or not
Avatar
Avatar
Ryozuki
@Learath2 do u bet i can make edlang faster than c or not
No bet. You control IL generation directly. Ofc you can get it faster, especially for specific tasks
12:39
😂😂
Avatar
7ec182b Increase editor pan speed when holding down shift - ChillerDragon aae6748 Merge pull request #7975 from ChillerDragon/pr_ed_wasd_speed - archimede67
Avatar
considering im getting bullied by a check atm - is there any way to run a build test locally without having to push each of my attempts to the PR ? XD https://github.com/ddnet/ddnet/pull/7886 (edited)
closes #7881 edit: the ubuntu 20.04 check is failing - i cant exactly tell why, i assume its because of: CMake Error at CMakeLists.txt:642 (message): You must install MySQL to compile the DDNet ser...
Avatar
Avatar
meloƞ
considering im getting bullied by a check atm - is there any way to run a build test locally without having to push each of my attempts to the PR ? XD https://github.com/ddnet/ddnet/pull/7886 (edited)
no
Avatar
You could probably just run the command locally yeah
14:12
For the checks that fail
Avatar
the check is running on ubuntu 20.04 which would require me to downgrade my cmake version to test that accurately i assume?
Avatar
Maybe you can use docker to build with a specific environment
Avatar
@ReiTW time to teach me docker properly!
14:16
pepelaugh
Avatar
Or use something to run GitHub actions locally https://github.com/nektos/act
Run your GitHub Actions locally 🚀. Contribute to nektos/act development by creating an account on GitHub.
Avatar
Avatar
archimede67
Or use something to run GitHub actions locally https://github.com/nektos/act
cant seem to get it running on my system - sadge
Avatar
Why don't you just enable actions for your fork and push to a branch that isn't your PR?
Replying to @meloƞ considering im getting bullied by a check atm - is there any way to run …
f3 3
Avatar
Immediately cancel new HTTP requests instead of enqueuing them when already shutting down CHttp. Otherwise, CChooseMaster may wait forever for HTTP requests to be completed while the client is shutting down, if CHttp was shutdown while CChooseMaster is not waiting for an existing HTTP request. Not directly caused by #7962, but it made it more likely to happen. Closes #7980.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • ...
Avatar
Prompt: A litter of golden retriever puppies playing in the snow. Their heads pop out of the snow, covered in.
16:46
video
Avatar
If you change your player/tee info too quickly it will silently not be applied. Would be useful if a message was shown in the player/tee settings to inform when the info will (likely) be applied.
Avatar
c729cca Abort new HTTP requests immediately when shutting down CHttp - Robyt3 1bc11c5 Merge pull request #7981 from Robyt3/Http-Cancel-New-Jobs-On-Shutdown - def-
Avatar
I was going to delete this since it turned out so unwieldy but I think I'll show everyone before I do, https://paste.pr0.tips/CNp Observe this template abomination
wtf 1
19:59
It's a reimplementation of std::bind just for this usecase, it just to avoid typing the out type of the vulkan functions
Avatar
I just get obsessive about these kinds of things, so I had to get it working before moving on to something else
Avatar
Avatar
Learath2
I was going to delete this since it turned out so unwieldy but I think I'll show everyone before I do, https://paste.pr0.tips/CNp Observe this template abomination
may allah be with us in this night
20:13
i had some wine so im a drunk programmer
Avatar
C++ templates are proof that god is indeed dead
20:14
Bjarne killed him
Avatar
my worst template code is this recursive struct template<class Truth, class T, typename... Args> struct conditional_impl { using type = typename std::enable_if_t<(sizeof...(Args) == 0 && std::is_same_v<Truth, qpl::default_type>) || qpl::is_truth_type<Truth>(), std::conditional_t<(sizeof...(Args) >= 2), std::conditional_t<qpl::is_true<Truth>(), std::conditional_t<std::is_same_v<T, qpl::error_type>, T, qpl::identity<T>>, qpl::conditional_indirection<Args...>>, std::conditional_t<(sizeof...(Args) == 0), std::conditional_t<std::is_same_v<Truth, qpl::default_type>, std::conditional_t<std::is_same_v<T, qpl::error_type>, T, qpl::identity<T>>, std::enable_if<qpl::is_true<Truth>(), T>>, std::conditional_t<qpl::is_true<Truth>(), std::conditional_t<std::is_same_v<T, qpl::error_type>, T, qpl::identity<T>>, qpl::empty_indirection<Args...>>>>>::type; }; it basically unrolls nested std::conditional_t's so instead of writing template<std::size_t N> using unsigned_type = typename std::conditional_t < N == std::size_t{ 8 }, std::type_identity<std::uint8_t>, std::conditional_t < N == std::size_t{ 16 }, std::type_identity<std::uint16_t>, std::conditional_t < N == std::size_t{ 32 }, std::type_identity<std::uint32_t>, std::enable_if < N == std::size_t{ 64 }, std::uint64_t>>>>::type; I can write template<typename T> using unsigned_type = qpl::conditional< qpl::if_true<qpl::is_arithmetic<std::decay_t<T>>()>, qpl::conditional< qpl::if_true<qpl::bits_in_type<T>() == std::size_t{ 8 }>, qpl::u8, qpl::if_true<qpl::bits_in_type<T>() == std::size_t{ 16 }>, qpl::u16, qpl::if_true<qpl::bits_in_type<T>() == std::size_t{ 32 }>, qpl::u32, qpl::if_true<qpl::bits_in_type<T>() == std::size_t{ 64 }>, qpl::u64, qpl::default_error>, qpl::default_error>; (not the lack of >>>> closing templates) xD
20:27
I also found a nice way to iterate like a for loop but at constexpr time (made a post about it here https://stackoverflow.com/questions/73630843/achieving-constexpr-for-with-indexing) so basically achieving constexpr for (int i = 0; i < 5; ++i) with this function #include <utility> #include <type_traits> template<size_t Size, typename F> constexpr void constexpr_for(F&& function) { auto unfold = [&]<size_t... Ints>(std::index_sequence<Ints...>) { (std::forward<F>(function)(std::integral_constant<size_t, Ints>{}), ...); }; unfold(std::make_index_sequence<Size>()); } you can iterate over tuples very easily auto tuple = std::make_tuple(0ull, 1, 2.0, "3", '4'); constexpr size_t size = std::tuple_size_v<decltype(tuple)>; constexpr_for<size>([&](auto i) { std::cout << std::get<i>(tuple) << ' '; }); //prints 0 1 2 3 4 I use this for most of my constexpr template functions, it's a major life improvement for me
Avatar
That's cute actually
20:35
template<size_t Size, typename F> constexpr void constexpr_for(F&& function) { auto unfold = [&]<size_t... Ints>(std::index_sequence<Ints...>) { (std::forward<F>(function)(std::integral_constant<size_t, Ints>{}), ...); }; unfold(std::make_index_sequence<Size>()); } int main() { auto tuple = std::make_tuple(0ull, 1, 2.0,...
Avatar
Avatar
ReD
my worst template code is this recursive struct template<class Truth, class T, typename... Args> struct conditional_impl { using type = typename std::enable_if_t<(sizeof...(Args) == 0 && std::is_same_v<Truth, qpl::default_type>) || qpl::is_truth_type<Truth>(), std::conditional_t<(sizeof...(Args) >= 2), std::conditional_t<qpl::is_true<Truth>(), std::conditional_t<std::is_same_v<T, qpl::error_type>, T, qpl::identity<T>>, qpl::conditional_indirection<Args...>>, std::conditional_t<(sizeof...(Args) == 0), std::conditional_t<std::is_same_v<Truth, qpl::default_type>, std::conditional_t<std::is_same_v<T, qpl::error_type>, T, qpl::identity<T>>, std::enable_if<qpl::is_true<Truth>(), T>>, std::conditional_t<qpl::is_true<Truth>(), std::conditional_t<std::is_same_v<T, qpl::error_type>, T, qpl::identity<T>>, qpl::empty_indirection<Args...>>>>>::type; }; it basically unrolls nested std::conditional_t's so instead of writing template<std::size_t N> using unsigned_type = typename std::conditional_t < N == std::size_t{ 8 }, std::type_identity<std::uint8_t>, std::conditional_t < N == std::size_t{ 16 }, std::type_identity<std::uint16_t>, std::conditional_t < N == std::size_t{ 32 }, std::type_identity<std::uint32_t>, std::enable_if < N == std::size_t{ 64 }, std::uint64_t>>>>::type; I can write template<typename T> using unsigned_type = qpl::conditional< qpl::if_true<qpl::is_arithmetic<std::decay_t<T>>()>, qpl::conditional< qpl::if_true<qpl::bits_in_type<T>() == std::size_t{ 8 }>, qpl::u8, qpl::if_true<qpl::bits_in_type<T>() == std::size_t{ 16 }>, qpl::u16, qpl::if_true<qpl::bits_in_type<T>() == std::size_t{ 32 }>, qpl::u32, qpl::if_true<qpl::bits_in_type<T>() == std::size_t{ 64 }>, qpl::u64, qpl::default_error>, qpl::default_error>; (not the lack of >>>> closing templates) xD
looks the same though
Avatar
I don't have to write >>>> at the end though
Avatar
is this a problem xd
20:36
ide would do it instead of you anyway
Avatar
Avatar
ReD
I also found a nice way to iterate like a for loop but at constexpr time (made a post about it here https://stackoverflow.com/questions/73630843/achieving-constexpr-for-with-indexing) so basically achieving constexpr for (int i = 0; i < 5; ++i) with this function #include <utility> #include <type_traits> template<size_t Size, typename F> constexpr void constexpr_for(F&& function) { auto unfold = [&]<size_t... Ints>(std::index_sequence<Ints...>) { (std::forward<F>(function)(std::integral_constant<size_t, Ints>{}), ...); }; unfold(std::make_index_sequence<Size>()); } you can iterate over tuples very easily auto tuple = std::make_tuple(0ull, 1, 2.0, "3", '4'); constexpr size_t size = std::tuple_size_v<decltype(tuple)>; constexpr_for<size>([&](auto i) { std::cout << std::get<i>(tuple) << ' '; }); //prints 0 1 2 3 4 I use this for most of my constexpr template functions, it's a major life improvement for me
this one is great looking kekw
Avatar
the trick is std::integral_constant you usually can't use parameters in a constexpr context, but this struct implicitly has an constexpr operator that just returns the template value, which is all constexpr, so it works
20:40
usual craziness
Avatar
https://gitbutler.com/ rip not for winshit
A Git client for simultaneous branches on top of your existing workflow..
Avatar
gigachad
20:47
my software also doesnt have windows support
20:47
edlang has no windows binaries
Avatar
Avatar
ReD
the trick is std::integral_constant you usually can't use parameters in a constexpr context, but this struct implicitly has an constexpr operator that just returns the template value, which is all constexpr, so it works
did you try to express compile-time known map structs (like an usual db table for example)? i was always running into problem with string views afair
Avatar
Avatar
Ryozuki
edlang has no windows binaries
no binaries at all
20:48
force to use gentoo
Avatar
it has
Avatar
compile llvm
20:48
force em all
Avatar
Changelog All notable changes to this project will be documented in this file. [0.0.1-alpha.5] - 2024-02-14 Bug Fixes Fix linker on distros like ubuntu Ci improvements [0.0.1-alpha.4] - 2024-02-1...
Avatar
Avatar
zhn
did you try to express compile-time known map structs (like an usual db table for example)? i was always running into problem with string views afair
I am not sure I understand string_view can be tricky at constexpr context yeah, like string manipulations / concatination etc if you mean that. a db table could just be an std::tuple, no? (edited)
Avatar
a struct that has information both about type and name of the value
Avatar
Avatar
zhn
did you try to express compile-time known map structs (like an usual db table for example)? i was always running into problem with string views afair
They really should add a constexpr unordered_map constructor and getter
Avatar
yeah that would make sense to have
Avatar
I also want a new unordered map without constraints on complexity so we can have more modern hashmaps
Avatar
as people say: just use boost
21:03
pepeW
Avatar
you mean to have custom perfect hash functions? afaik unordered_map is a general catch all but can't you pass your own hash function anyway or is memory allocation also inefficient
Avatar
Avatar
ReD
you mean to have custom perfect hash functions? afaik unordered_map is a general catch all but can't you pass your own hash function anyway or is memory allocation also inefficient
It has to be structured in a certain way to provide the complexity guarantees in the standard. So unordered_map is stuck as a closed adressing hashmap
Avatar
interesting, I see closed causes overhead and performance degrades as load factor grows it says
Avatar
https://abseil.io/about/design/swisstables And the cppcon talk about it are very nice if you are interested
An open-source collection of core C++ library code
Avatar
cool thanks
Avatar
huh chinese mods are always out of view https://github.com/landmineHQ/ddnet-hidden
修改自DDraceNetWork的躲猫猫模式Hide&Seek mod from ddnet. Contribute to landmineHQ/ddnet-hidden development by creating an account on GitHub.
✅ 1
Avatar
How do I calculate the delta value of a snapshot. I though it was the amount of snap items on it. But its not working
22:39
My client stuck here
Avatar
There is no "delta value"
Avatar
Avatar
Learath2
There is no "delta value"
the second byte of a snap single chunk is the delta number I'm talking about
Avatar
Avatar
Miguilim
the second byte of a snap single chunk is the delta number I'm talking about
Although I dont know if this is the problem here
Exported 203 message(s)