01:23 < bridge> Cursed. By the way ruby has the „unless“ keyword for that 05:37 < bridge> I NEED 05:45 < bridge> I saw this on twitter and be like: yep, completely reasonable people posting masterwork 05:46 < bridge> oh sorry my boomer brain said the t word 05:46 < bridge> I meant "x" 05:47 < bridge> :owo: 09:01 < bridge> why i can't do this somewhere in the code base? 09:01 < bridge> ```cpp 09:01 < bridge> str_format(CSkyb::UserDirPath, sizeof(CSkyb::UserDirPath), "%s", m_aUserdir); 09:01 < bridge> ``` 09:01 < bridge> and this is the definition: 09:01 < bridge> 09:01 < bridge> ```cpp 09:01 < bridge> class CSkyb 09:01 < bridge> { 09:01 < bridge> public: 09:01 < bridge> 09:01 < bridge> static char UserDirPath[512]; 09:01 < bridge> 09:01 < bridge> bool IsStandardString(const char *pStr); 09:01 < bridge> char *GetUserDirPath(); 09:01 < bridge> 09:01 < bridge> }; 09:01 < bridge> ``` 09:02 < bridge> i used str_format() instead of str_copy() 09:04 < bridge> when i compile this cmake gives me 1000 line of error 09:10 < bridge> i also tried with 09:10 < bridge> ```cpp 09:10 < bridge> namespace NSkyb 09:10 < bridge> { 09:10 < bridge> static char UserDirDirectory[512]; 09:10 < bridge> } 09:10 < bridge> ``` 09:10 < bridge> and assigned the value somewhere: 09:10 < bridge> ```cpp 09:10 < bridge> str_copy(NSkyb::UserDirDirectroy,m_aUserDir) 09:10 < bridge> ``` 09:10 < bridge> but when i tries to read the value of NSkyb::UserDirectory somewhere else, the value is gone 09:12 < bridge> my general goal is to make a bank of variables and assign them around the src base, and read them anywhere i wanted 09:12 < bridge> like stealing the m_aUserDirPath from storage.cpp, and use the value of it in ddracechat.cpp 09:15 < bridge> like stealing the value of m_aUserDirPath from storage.cpp, and use the value of it in ddracechat.cpp 09:17 < bridge> any suggestion @mpft ? 09:18 < bridge> when i compile this cmake gives me 1000 lines of error 09:19 < bridge> i also tried with 09:19 < bridge> ```cpp 09:19 < bridge> namespace NSkyb 09:19 < bridge> { 09:19 < bridge> static char UserDirectory[512]; 09:19 < bridge> } 09:19 < bridge> ``` 09:19 < bridge> and assigned the value somewhere: 09:19 < bridge> ```cpp 09:19 < bridge> str_copy(NSkyb::UserDirectroy,m_aUserDir) 09:19 < bridge> ``` 09:19 < bridge> but when i try to read the value of NSkyb::UserDirectory somewhere else, the value is gone 09:28 < bridge> use extern instead of static 09:28 < bridge> cross-translation unit 09:28 < bridge> in this case 09:29 < bridge> what are the errrors anyway 09:36 < bridge> there is no error, the NSky::UserDirectory is just empty when i try to read it's value 09:37 < bridge> is namespace case, there is no error, the NSky::UserDirectory is just empty when i try to read it's value 09:41 < bridge> yep 09:41 < bridge> translation unit problem 09:43 < bridge> then i can't use it like CSkyb::UserDirPath, i need to make a member of the class , right ? 09:47 < bridge> i don't want to create a pointer to my a member in every .h file :justatest: 09:47 < bridge> i don't want to create a pointer to my member in every .h file :justatest: 09:50 < ChillerDragon> I see so many websites even big ones with outdated copyright years. That gives me the impressions most people bump the year manually instead of setting the current year as copyright programatically 09:50 < ChillerDragon> why? 09:50 < ChillerDragon> is there some law? is that some tooling limitation? 09:50 < ChillerDragon> is there any reason to not set it automatically? 09:50 < ChillerDragon> could even be done in the frontend with js 09:53 < bridge> well if u ask for my web 09:54 < bridge> its cuz i want it jsless 09:54 < bridge> but its just proba lazyness on web devs 09:54 < bridge> it doesnt even matter proba 10:12 < bridge> thats like creating a parking disc that automatically adjust the time 10:39 < ChillerDragon> @ryozuki but your html is generated by a backend right? Why not do it there? 10:39 < ChillerDragon> jopsti that sounds useful 10:42 < ChillerDragon> @mamad_melanin you do not need a pointer to every variable. Same as you do not need a pointer to the global variable ``g_Config`` you just need to include the header 10:43 < ChillerDragon> also if the value is a static string and does not change might as well define it with ``#define MYSTR "my string"`` and then put it in your globals.h that you include whereever you need it 10:47 < bridge> generated once 10:47 < bridge> getzola 10:52 < bridge> i have been wondering for 3 days why my code is not working, now i noticed i didn't include my library 11:00 < bridge> i seen a lot of g_config on the src base but i didn't understand it 11:01 < bridge> i just know it's from CConfig class 11:04 < bridge> is CConfig class automatically define values ? 11:07 < bridge> Yea it’s generated but it’s also just a regular external variable. You can do the same without generating stuff 11:08 < bridge> Just Google extern variables c++ 11:08 < bridge> Even once sounds like enough for once a year 11:09 < ChillerDragon> element crashed im tempted to ping heinrich but i already reported frequent crashes xd 11:10 < ChillerDragon> weechat did not crash once in years running it 24/7 11:10 < ChillerDragon> the faking element app crashes daily 11:26 < bridge> why class CStorage don't have it's own header file, instead the whole class is declared in a .cpp file 11:27 < bridge> ❯ fd storage 11:27 < bridge> src/engine/shared/storage.cpp 11:27 < bridge> src/engine/storage.h 11:27 < bridge> storage.cfg 11:27 < bridge> There are a couple of them like that. Probably only matricks remembers why he left them like that 11:27 < bridge> its just not where u think it is 11:27 < bridge> He means there is no src/engine/shared/storage.h 11:28 < bridge> why class CStorage don't have it's own header file, instead, the whole class is declared in a .cpp file 11:29 < bridge> ah xd 11:29 < bridge> he used extern fns to instantiate 11:29 < bridge> ```cpp 11:29 < bridge> extern IStorage *CreateStorage(int StorageType, int NumArgs, const char **ppArguments); 11:29 < bridge> extern IStorage *CreateLocalStorage(); 11:29 < bridge> extern IStorage *CreateTempStorage(const char *pDirectory); 11:29 < bridge> ``` 11:29 < bridge> i want to access the m_aUserdir from ddracechat.cpp but i couldn't find any way to do so 11:30 < bridge> get 11:30 < bridge> the gamecontext 11:30 < bridge> CGameContext *pSelf = (CGameContext *)pUserData; 11:30 < bridge> pSelf-> then what ? 11:30 < bridge> pSelf->Storage()-> ???? 11:30 < bridge> wait why u want userdir 11:31 < bridge> make a folder and file there 11:31 < bridge> just use OpenFile 11:31 < bridge> it's defferent on linux and windows 11:31 < bridge> u should not care about that 11:31 < bridge> i want to access the userdir 11:31 < bridge> storage handles it for you 11:31 < bridge> its called abstraction 11:31 < bridge> `virtual IOHANDLE OpenFile(const char *pFilename, int Flags, int Type, char *pBuffer = nullptr, int BufferSize = 0) = 0;` 11:31 < bridge> just use this 11:31 < bridge> and then i want to use std:: methods 11:32 < bridge> well good luck :salute: 11:33 < bridge> you looking mad 11:33 < bridge> not rly 11:33 < bridge> xD 11:33 < bridge> im just saying good luck on ur coding 12:03 < bridge> i think I'm gonna use system.h methods , they are rich 12:05 < bridge> :f4: 12:06 < bridge> i think it's good, but i'd also remove the browser icon on the right 12:07 < bridge> https://private-user-images.githubusercontent.com/6654924/273528118-12795536-2743-4c9c-bcf9-b168a5f7087b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDUxNDQzNDEsIm5iZiI6MTcwNTE0NDA0MSwicGF0aCI6Ii82NjU0OTI0LzI3MzUyODExOC0xMjc5NTUzNi0yNzQzLTRjOWMtYmNmOS1iMTY4YTVmNzA4N2IucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQV 12:07 < bridge> https://private-user-images.githubusercontent.com/6654924/273527819-8fa1c262-fbbb-4a4f-9364-a8be36e9ca09.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDUxNDQzNDEsIm5iZiI6MTcwNTE0NDA0MSwicGF0aCI6Ii82NjU0OTI0LzI3MzUyNzgxOS04ZmExYzI2Mi1mYmJiLTRhNGYtOTM2NC1hOGJlMzZlOWNhMDkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQV 12:08 < bridge> remove demo thing and add the server browser always visisble 12:08 < bridge> remove demo thing and add the server browser always visible 12:25 < bridge> you just coded this quick ? 12:28 < bridge> i did that a while ago 12:30 < bridge> What about the news page? 12:31 < bridge> I dunno, would it not work there? 12:32 < bridge> It uses the same space for the header 12:32 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1195691841853591672/screenshot_2024-01-13_12-32-11.png?ex=65b4e9cd&is=65a274cd&hm=a3219bec6ca86e71bee83adce6d31b8af0e50e0eaf0f191a53dc8dd45a2d64a6& 12:32 < bridge> Then it can be removed I guess 12:32 < bridge> Or do you find that useful 12:33 < bridge> It's the only explicit label that say "these are the news" 12:33 < bridge> We can't exactly move it down or the size of the news would change 12:33 < bridge> but you also explicitly clicked it, or not? 12:34 < bridge> yeah, it would look better in a popup 12:34 < bridge> or that 12:36 < bridge> I'll remove it for now, I also don't like the duplicate browser icon 12:39 < bridge> lol you cant view these images right? 12:39 < bridge> on my mobile & anonym tab it doesnt load 12:40 < bridge> yeah, preview loads but not the real image 12:40 < bridge> same as the image you commented on the PR 13:34 < bridge> nah just admit you code at 500 LoC per second :poggers2: 13:38 < bridge> what pBuffer used for ? 13:38 < bridge> ```cpp 13:38 < bridge> virtual bool FindFile(const char *pFilename, const char *pPath, int Type, char *pBuffer, int BufferSize) = 0; 13:38 < bridge> ``` 13:45 < bridge> https://github.com/ddnet/ddnet/actions/runs/7512436039/job/20453143093 I wonder if it's MSVC or clang that's wrong here 13:58 < bridge> Somehow a different `int` constant named `ERROR` is already in the scope in `http.cpp` 13:59 < bridge> If you add `int x = ERROR;` after `#include ` in `http.cpp` of current master than this compiles, so one of the includes must add this constant which clashes with the constant you added 14:12 < bridge> to store the path of the file i guess 14:21 < bridge> i used io_write() to write hello to a file, now the file have chinese words in it o__O 14:21 < bridge> 14:21 < bridge> the words: 敨汬o畳捣 14:22 < bridge> ha ? 14:22 < bridge> do i need to tell it it's a .text file or something ? 14:23 < bridge> and this is the code: 14:23 < bridge> ```cpp 14:23 < bridge> IOHANDLE file = io_open(abuff, IOFLAG_WRITE); 14:24 < bridge> io_write(file, "hello", 10); 14:24 < bridge> io_close(file); 14:24 < bridge> ``` 14:24 < bridge> You gave the function 5 bytes to write but said it should write 10 so it writes 5 bytes of garbage 14:26 < bridge> Use `str_length` to get the length of the string that you want to write 14:27 < bridge> why it didn't write it like this ? 14:27 < bridge> 14:27 < bridge> hello#@$#@ 14:27 < bridge> 14:27 < bridge> write my hello and then garbage ? 14:28 < bridge> Maybe your editor detected the wrong encoding because of the gargabe 14:30 < bridge> is there another way to use `m_SelectedSpectatorID` outside of `spectator.h` ? 14:31 < bridge> is there another way to get `m_SelectedSpectatorID` outside of `spectator.h` ? 14:33 < bridge> Make a getter for it or make it public? 14:33 < bridge> yeah but i figured it's private for a reason 14:35 < bridge> Anything should be as private as possible by default if it's not necessary to make it public 14:35 < bridge> If you have a reason to make it public or add a getter than do that 14:35 < bridge> If you have a reason to make it public or add a getter then do that 14:35 < bridge> sounds reasonable, thanks! 14:47 < bridge> how to clear my char buffer ? 14:52 < bridge> If it's for a string then it's usually enough to set the first character to 0: `aBuf[0] = '\0';` 14:53 < bridge> If you want to clear the whole buffer then use `mem_zero(aBuf, sizeof(aBuf));` 14:53 < bridge> ❤️ 14:53 < bridge> Ah, that makes more sense. I'm still curious which compiler is right 15:00 < bridge> programing is fun 15:06 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1195730568437047366/RDT_20240113_1505421263686838985258500.jpg?ex=65b50ddf&is=65a298df&hm=bba755fc0c72778bf5d608d0aac4629c9946da07bc28136c6a097ad67fd2cce0& 15:25 < bridge> this is so faking good, i can easily find the thing i want in it 15:25 < bridge> https://codedoc.ddnet.org/system_8h.html 15:33 < bridge> hosted by me :3 15:37 < bridge> Doesn't load for me 15:37 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1195738448385032222/RDT_20240113_1505421263686838985258500.jpg?ex=65b51535&is=65a2a035&hm=2ad29a2a7e544036daca1d0ef1029b8429a3a0277eabf6f9da4dffa1cc7ddc94& 15:37 < bridge> lol 15:37 < bridge> https://discordstatus.com/ 15:38 < bridge> discord mobile is borked 15:38 < bridge> Looks like it's Discord problem 15:38 < bridge> > We are currently investigating an issue that is preventing embedded media from loading. 15:41 < ws-client> rip everyone who depends on discord as cdn for important stuff 15:41 < ChillerDragon> probably 10 free image hosters went down 15:50 < bridge> str_comp() just compare the length of two strings ? how can i compare the content of the two strings ? 15:51 < bridge> now i using accounts as separate files for every account 🙂 15:52 < bridge> it's such a headache to put them in one single file 15:53 < bridge> `str_comp` compares the contents, read the comment in `system.h` 15:53 < bridge> It returns `0` when the strings match 15:54 < bridge> in just length, or it's compares every singe character ? 15:54 < bridge> Both 15:55 < bridge> thanks 15:57 < bridge> idk if they already did but discord doesnt support 3rd party cdn hosts anymore 15:57 < bridge> idk if its already in action but discord doesnt support 3rd party cdn hosts anymore 15:57 < bridge> cdn links expire after some time if its not on discord 16:03 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1195744961170251907/image.png?ex=65b51b46&is=65a2a646&hm=94a9f2f3d276bcd19a0fbbd4e17a60741bebeefe385ac3f9ed98e512db2ada4d& 16:09 < bridge> Oh rip they really went through with that 16:09 < bridge> Nice 16:47 < bridge> its time to spam generated accounts xd 16:50 < bridge> y xd 17:17 < ws-client> singapur servers pog 17:17 < ws-client> https://zillyhuhn.com/cs/.1705162550.png 17:17 < ws-client> easy rank 2 17:20 < ChillerDragon> @meeu when meet? 17:21 < bridge> images are starting to load again :) 17:22 < ChillerDragon> ye? from me only my image loads 17:23 < ChillerDragon> chat.zillyhuhn.com images > discord cdn 17:38 < bridge> ah that's why xD 18:46 < bridge> what am i doing wrong ? 18:46 < bridge> 18:46 < bridge> ```cpp 18:46 < bridge> struct CAccount 18:46 < bridge> { 18:46 < bridge> char m_aUsername[NSkyb::MAXIMUM_USERNAME_LENGTH]; 18:46 < bridge> char m_aPassword[NSkyb::MAXIMUM_PASSWORD_LENGTH]; 18:46 < bridge> }m_Account; 18:46 < bridge> bool ReadMoney(char *Username = m_Account.m_aUsername, char *Password = m_Account.m_aPassword); 18:46 < bridge> ``` 18:49 < bridge> dont use default parameters like that 18:51 < bridge> CAccount::m_aUsername ?? 18:53 < bridge> no 18:53 < bridge> dont use default parameters at all 18:53 < bridge> they bad 18:53 < bridge> pass the password when you call the function 18:54 < bridge> oh god 18:54 < bridge> why im trying to teach xD 18:54 < bridge> learn c++ :D 18:54 < bridge> im learning bro 18:54 < bridge> no u are hammering ur head against a wall 18:54 < bridge> https://cplusplus.com/doc/tutorial/classes/ 18:55 < bridge> read read read 18:55 < bridge> :feelsamazingman: 18:56 < bridge> the classes is my weakness 18:56 < bridge> and struct and namespaces 18:56 < bridge> also templates 18:57 < bridge> and some keywords like inline, static, extern, 19:13 < bridge> is there a method in ddnet code to convert long long unsigned int to str and vice versa or i use std:: methods ? 19:17 < bridge> std::stoull 😂 19:18 < bridge> google 19:18 < bridge> google the ddnet src ? 19:19 < bridge> https://en.cppreference.com/w/cpp/string/basic_string/to_string 19:19 < bridge> but for what? 19:27 < bridge> use gpt + google and 19:27 < bridge> https://edgarluque.com/blog/intro-to-ddnet/ 19:27 < bridge> https://edgarluque.com/blog/code-conventions-in-ddnet/ 19:27 < bridge> https://edgarluque.com/blog/chat-command-ddracenetwork/ 19:28 < bridge> What are you trying to do? 19:29 < bridge> kek thats my blog 19:31 < bridge> ddnet blogger :gigachad: 19:41 < bridge> nothing special, just converting a big ass unsigned int (players money) to string and vice versa 19:42 < bridge> are you trying to serialize? I think that can be done with reinterpret cast (or maybe it was some other cast) 19:45 < bridge> no, thanks tho 19:45 < bridge> terrible idea 19:46 < bridge> whoops, read it too fast. 19:46 < bridge> I just read uint to some data :p 19:58 < bridge> atoi itoa 19:58 < bridge> and whathever modern c++ has 19:58 < bridge> https://en.cppreference.com/w/cpp/string/byte/atoi 19:59 < bridge> https://en.cppreference.com/w/cpp/string/basic_string/stol 20:05 < bridge> does that even compile? 20:06 < bridge> no it didn't, i changed it 21:41 < bridge> is there a way to debug this error ? 21:41 < bridge> Illegal instruction 21:42 < bridge> from the server cmd 21:42 < bridge> i am so sleepy, gn ❤️ 22:27 < bridge> @chillerdragon did you use cowrie for the discord shell bot? 23:10 < bridge> bro it is the entire langage 23:51 < bridge> No not really 23:55 < bridge> y but, if you are coding on a big cpp project without using template, struct and class, it is very cringe 23:57 < bridge> y but, if you are coding on a big cpp project without using at least template, struct or class, it is very cringe