00:44 <+bridge> [ddnet] @Jupstar ✪ 00:44 <+bridge> [ddnet] ``` 00:44 <+bridge> [ddnet] QuadroMask(long long mask) { 00:44 <+bridge> [ddnet] memset(m_Mask, mask, sizeof(m_Mask)); 00:44 <+bridge> [ddnet] }``` 00:44 <+bridge> [ddnet] i do have `int64_t m_Mask[2];` now, so what to pass here? 00:44 <+bridge> [ddnet] why does this take a long long mask, and not a QuadroMask 00:45 <+bridge> [ddnet] nothing, i just did that constructor to set all bits to 1, if required 00:45 <+bridge> [ddnet] u can overload the constructor 00:45 <+bridge> [ddnet] and have multiple 00:46 <+bridge> [ddnet] what do you mean 00:46 <+bridge> [ddnet] just change the source to your purpose 00:46 <+bridge> [ddnet] but i dont really know what all is needed 00:46 <+bridge> [ddnet] QuadroMask(const QuadroMask& OtherMask) { *this = OtherMask } 00:46 <+bridge> [ddnet] sry 00:46 <+bridge> [ddnet] memcopy 00:46 <+bridge> [ddnet] it 00:47 <+bridge> [ddnet] QuadroMask(const QuadroMask& OtherMask) { memcpy(this, &OtherMask, sizeof(OtherMask); } 00:47 <+bridge> [ddnet] i dunno what u need xD 00:47 <+bridge> [ddnet] i am not sure either, because i dont completely understand ur system 00:47 <+bridge> [ddnet] i need to adapt this to fit in the ddnet like teammasking 00:48 <+bridge> [ddnet] it just overloads common operators u use with bitflags 00:48 <+bridge> [ddnet] like if((Mask | OtherMask)) { //mask is set } 00:49 <+bridge> [ddnet] if you really want it as mighty as a datatype, you should use templates and/or overload the operators with specific datatypes 00:50 <+bridge> [ddnet] i cannot explain what operator overloading does in 2 setences xD 00:50 <+bridge> [ddnet] xD 00:50 <+bridge> [ddnet] just imagine it like that, you can build your datatype u want 00:50 <+bridge> [ddnet] e.g. a int is nothing else than a datatype that overloads the operators 00:51 <+bridge> [ddnet] int operator==(const int& otherint) { SOME ASSEMBLER } 00:51 <+bridge> [ddnet] u can imagine it like that 00:51 <+bridge> [ddnet] and you can do the same in c++ 00:51 <+bridge> [ddnet] bool operator==(const int& otherint) { SOME ASSEMBLER } 00:52 <+bridge> [ddnet] for teeworlds you most probably just need & don't u? 00:53 <+bridge> [ddnet] if Flag & (1 << 63) is set, then id 63 exists 00:53 <+bridge> [ddnet] yea 00:53 <+bridge> [ddnet] i think 00:53 <+bridge> [ddnet] ok 00:54 <+bridge> [ddnet] ` 00:54 <+bridge> [ddnet] bool IsSet(size_t BitIndex) const { 00:54 <+bridge> [ddnet] size_t IndexOfBit = BitIndex / (sizeof(int64_t) * 8); 00:54 <+bridge> [ddnet] size_t BitInIndex = BitIndex % (sizeof(int64_t) * 8); 00:54 <+bridge> [ddnet] return (operator[](IndexOfBit) & (((int64_t)1) << BitInIndex)) != 0; 00:54 <+bridge> [ddnet] }` 00:54 <+bridge> [ddnet] so that function would replace what u want todo 00:55 <+bridge> [ddnet] instead of & u just call the function on the bitflag 00:55 <+bridge> [ddnet] if you prefer a & operator you need to overload & operator 00:55 <+bridge> [ddnet] ``` 00:55 <+bridge> [ddnet] int64_t operator & (const Mask128& Mask) 00:55 <+bridge> [ddnet] { 00:55 <+bridge> [ddnet] return (m_Mask[0] & Mask[0]) | (m_Mask[1] & Mask[1]); 00:55 <+bridge> [ddnet] } ``` 00:55 <+bridge> [ddnet] (you can avoid the expensive div and mod) 00:55 <+bridge> [ddnet] you mean this? 00:55 <+bridge> [ddnet] for that u need to create an own flag 00:56 <+bridge> [ddnet] also possible to use 00:56 <+bridge> [ddnet] uhm 00:56 <+bridge> [ddnet] i am lost i think 00:56 <+bridge> [ddnet] too high level for me 00:56 <+bridge> [ddnet] you need to understand what datatypes are about i think 00:56 <+bridge> [ddnet] yes, that is what happens if you don't plan things 😄 00:56 <+bridge> [ddnet] its just some bytes in memory 00:57 <+bridge> [ddnet] @Learath2 how can i avoid it btw 😄 00:57 <+bridge> [ddnet] bit shifting? 00:58 <+bridge> [ddnet] Well a branch is cheaper 00:59 <+bridge> [ddnet] puhh yeah probably xD 00:59 <+bridge> [ddnet] @Jupstar ✪ so how would this work with the larger mask? Mask |= 1LL << i; 00:59 <+bridge> [ddnet] i dunno what the compiler is able todo 00:59 <+bridge> [ddnet] to optimize* 00:59 <+bridge> [ddnet] I think a smart enough compiler would optimize that 01:02 <+bridge> [ddnet] @fokkonaut you can e.g. overload a global operator << and add a datatype that reresents another datatype for i 01:02 <+bridge> [ddnet] 01:02 <+bridge> [ddnet] e.g. 01:02 <+bridge> [ddnet] struct SShiftOffset { 01:02 <+bridge> [ddnet] size_t i; 01:02 <+bridge> [ddnet] }; 01:02 <+bridge> [ddnet] 01:02 <+bridge> [ddnet] then 01:02 <+bridge> [ddnet] QuadroMask& operator<<(const int& ValueToShift, const SShiftOffset& B) { 01:02 <+bridge> [ddnet] //if you just accept 1 as valuetoshift anyway 01:02 <+bridge> [ddnet] QuadroMask m; 01:02 <+bridge> [ddnet] m.SetBit(B.i); 01:02 <+bridge> [ddnet] } 01:02 <+bridge> [ddnet] 01:02 <+bridge> [ddnet] and call it by 1 << SShiftOffset(Offset) 01:02 <+bridge> [ddnet] something like that 01:02 <+bridge> [ddnet] or just create a mask and call SetBit 01:02 <+bridge> [ddnet] there are infinite ways todo it 01:02 <+bridge> [ddnet] yep optimizes to a branch 01:02 <+bridge> [ddnet] interesting 😄 01:03 <+bridge> [ddnet] @Jupstar ✪ uhm, yea so the masking needs to wait :( xd 01:03 <+bridge> [ddnet] im too dumb for this 01:03 <+bridge> [ddnet] yeah sry 01:03 <+bridge> [ddnet] np 01:03 <+bridge> [ddnet] make tutorials on assembler to understand that anything is just memory 01:04 <+bridge> [ddnet] its really noit easy to get away from the feeling from datatypes to hardware close things 01:04 <+bridge> [ddnet] oh even better no branch no nothing 01:05 <+bridge> [ddnet] have you tried to search for an bitfield implentation in c++? 01:05 <+bridge> [ddnet] `std::bitset` 01:05 <+bridge> [ddnet] maybe someone did it with good implementation already 01:05 <+bridge> [ddnet] ah nice 01:05 <+bridge> [ddnet] that makes it ez xD 01:06 <+bridge> [ddnet] Oh duh `sizeof(int64_t) * 8` is a power of 2 01:06 <+bridge> [ddnet] You can use a shift to do the division 01:06 <+bridge> [ddnet] yeah 😄 01:06 <+bridge> [ddnet] power of modern optimizing compilers 01:07 <+bridge> [ddnet] but yeah fokko, std::bitset is what u want 01:07 <+bridge> [ddnet] even in c++ std what do u want more 01:13 <+bridge> [ddnet] @Jupstar ✪ how the hell did you managed to do single-line-code syntax for multiline code using ` 01:13 <+bridge> [ddnet] ` 01:13 <+bridge> [ddnet] ` 01:13 <+bridge> [ddnet] u mean this? 01:13 <+bridge> [ddnet] shift + enter 01:14 <+bridge> [ddnet] ` 01:14 <+bridge> [ddnet] ` 01:14 <+bridge> [ddnet] ...though 01:14 <+bridge> [ddnet] u need to do 3 times ` at end and beginning 01:14 <+bridge> [ddnet] @fokkonaut ye, normally, but he's cheating 01:14 <+bridge> [ddnet] seems Discord trolls itself with it, because it doesn't show that as a code while typing, but does convert after sending 01:15 <+bridge> [ddnet] i dunno the chat code styles for discord xD 01:15 <+bridge> [ddnet] easiest would be /code xD 01:15 <+bridge> [ddnet] (╯°□°)╯︵ ┻━┻ 01:15 <+bridge> [ddnet] lol 01:16 <+bridge> [ddnet] ¯\_(ツ)_/¯ 01:16 <+bridge> [ddnet] |||| 01:16 <+bridge> [ddnet] sorry 01:16 <+bridge> [ddnet] \` for single line -- `code` 01:16 <+bridge> [ddnet] \`\`\` for 01:16 <+bridge> [ddnet] ``` 01:16 <+bridge> [ddnet] multi 01:16 <+bridge> [ddnet] line 01:16 <+bridge> [ddnet] ``` 01:16 <+bridge> [ddnet] ah 01:16 <+bridge> [ddnet] i am missing color 01:16 <+bridge> [ddnet] also, with the multiline you can set language syntax, for colors 01:16 <+bridge> [ddnet] even steam supports it better xD 01:16 <+bridge> [ddnet] steam chat 01:16 <+bridge> [ddnet] @Jupstar ✪ on pc there is color sometimes 01:17 <+bridge> [ddnet] only for some languages tho 01:17 <+bridge> [ddnet] ```css 01:17 <+bridge> [ddnet] body { 01:17 <+bridge> [ddnet] background-color: #0080FF; 01:17 <+bridge> [ddnet] } 01:17 <+bridge> [ddnet] ``` 01:17 <+bridge> [ddnet] ui 01:17 <+bridge> [ddnet] yea 01:17 <+bridge> [ddnet] nice 01:17 <+bridge> [ddnet] not for c++ tho 01:17 <+bridge> [ddnet] @Jupstar ✪ 01:17 <+bridge> [ddnet] \`\`\` 01:17 <+bridge> [ddnet] some code 01:17 <+bridge> [ddnet] \`\`\` 01:18 <+bridge> [ddnet] ``` 01:18 <+bridge> [ddnet] int i(void); 01:18 <+bridge> [ddnet] ``` 01:18 <+bridge> [ddnet] don't put it in <> 01:18 <+bridge> [ddnet] oh xd 01:18 <+bridge> [ddnet] ```c++ 01:18 <+bridge> [ddnet] int i(void); 01:18 <+bridge> [ddnet] ``` 01:19 <+bridge> [ddnet] ```c++ 01:19 <+bridge> [ddnet] void test(int a, int b) 01:19 <+bridge> [ddnet] { 01:19 <+bridge> [ddnet] return; 01:19 <+bridge> [ddnet] } 01:19 <+bridge> [ddnet] ``` 01:19 <+bridge> [ddnet] ez 01:25 <+bridge> [ddnet] but typing ` on a german keyboard sucks anyway xD 01:25 <+bridge> [ddnet] ./code would be best xd 01:39 <+bridge> [ddnet] hm I couldn't find a variant of isset that's optimized well on all major compilers 01:42 <+bridge> [ddnet] `return __shiftright128(m_Data[0], m_Data[1], idx) & 1;` works great for msvc 01:45 <+bridge> [ddnet] (even better then gcc and clangs emulated 128 bit ints) 01:55 <+bridge> [ddnet] okay not perfect but `std::bitset<128>` is mediocre across all relevant compilers 02:03 <+bridge> [ddnet] weird that such a simple thing is optimized so inconsistently accross compilers 02:28 <+bridge> [ddnet] so when using bitset<128> it is basically the same as if __int128 was available? 02:29 <+bridge> [ddnet] I can just typedef the bitset<128> as int128_t and replace it all over the place? 02:51 <+bridge> [ddnet] bitset is an array of bools 02:52 <+bridge> [ddnet] and it has functions 02:52 <+bridge> [ddnet] its not the same 02:58 <+bridge> [ddnet] but it could do the same job? 03:24 <+bridge> [ddnet] bitwise some kind of yes 03:25 <+bridge> [ddnet] is it so horrible to replace it with std::bitset<128>? or just typedef it not int128_t so it doesnt collide with the gcc datatype 09:33 <+bridge> [ddnet] Dont bother with gcc and clangs int128 anyway 09:33 <+bridge> [ddnet] For this purpose their emulated 128bit integers optimize to shit 10:12 <+bridge> [ddnet] Was reading papers for work and stumbled over this: 10:12 <+bridge> [ddnet] > All our bug reports for MariaDB were verified quickly. However, only one of them was fixed, which is why we have stopped testing this DBMS. 10:12 <+bridge> [ddnet] https://www.manuelrigger.at/dbms-bugs/ Oh well... 10:22 <+bridge> [ddnet] Huh 16:19 <+bridge> [ddnet] i set my map parse repository to public, if anyone wants to take a look: https://gitlab.com/Patiga/twmap 16:57 <@deen> Nice @Patiga 18:36 <+bridge> [ddnet] Does anyone remember how `CNetMsg_Sv_PlayerTime` is supposed to work? 18:39 <+bridge> [ddnet] It seems to modify the score, but isn't score part of `CNetObj_PlayerInfo`? 19:02 <+bridge> [ddnet] `CNetMsg_Sv_PlayerTime` is a relic from the first race client. I doubt any client still relies on it. The ddnet implementation even seems to be incompatible with itself. Server uses hundredths of a second while the client uses seconds. 19:49 <+bridge> [ddnet] we hit 10'000 commits! 🙂 20:04 <+bridge> [ddnet] @deen PRs got merged 22:03 <+bridge> [ddnet] https://www.youtube.com/watch?v=Aymrnzianf0 22:03 <+bridge> [ddnet] 2 astronauts launching in 30 mins 22:03 <+bridge> [ddnet] :justatest: 22:03 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/715294222076346449/unknown.png 22:20 <+bridge> [ddnet] ^ cancelled 22:22 <+bridge> [ddnet] y 22:22 <+bridge> [ddnet] may 30 23:20 <+bridge> [ddnet] killing practice team leaves the team in practice 23:20 <+bridge> [ddnet] is it normal? 23:20 <+bridge> [ddnet] some people will get fucked because of that, they practice, restart the map with locked team 23:20 <+bridge> [ddnet] they end the map normal, and realize practice is still on 23:24 <+bridge> [ddnet] @deen `m_SetSavePos && !m_Super && !m_DeepFreeze` 23:24 <+bridge> [ddnet] I doubt this will work 23:30 <+bridge> [ddnet] I wanted to say the same issue as @Chairn. There is no command to leave practice mod or no server command after crossing start (after killing) that you are still in practice mod to pay attention 23:37 <+bridge> [ddnet] @Chairn thanks, fixed in here: https://github.com/ddnet/ddnet/pull/2218 23:38 <+bridge> [ddnet] @heinrich5991 i noticed when testing locally 🙂