07:20 < bridge> i think i am gonna face an issue 07:21 < bridge> i implemented this 07:21 < bridge> ```cpp 07:21 < bridge> void CGameContext::ConRegister(IConsole::IResult *pResult, void *pUserData) 07:21 < bridge> ``` 07:21 < bridge> and this function is static 07:22 < bridge> isn't it gonna broke if many tees try to register ? 07:26 < bridge> this function reads the whole .text file full of usernames and passwords and if that username or password is not existed, it adds the username and password to the file 07:26 < bridge> this function reads the whole .text file full of usernames and passwords and if that username or password is not existed, it appends the username and password to the file 07:27 < bridge> what happens if the file gets to big ? 07:27 < bridge> what if when reading the file, some tee tries to register ? 07:30 < bridge> See that's why copyright sucks. You waste so much time and still don't understand anything. 07:30 < bridge> 07:30 < bridge> Laws are still very subjective and it's interpretation can vary too much xd 07:30 < bridge> 07:30 < bridge> Your precious awesome short time 08:07 < bridge> morning 08:14 < bridge> GM 08:23 < bridge> Wednesday for opengl 08:48 < bridge> that might become a problem later 08:48 < bridge> the calls happen after each other, not at the same time 08:49 < bridge> i implement the time of the creation and want to add last time used on every user data, so that late i can delete the unused ones 08:49 < bridge> no, it's just static because it's a callback. You have the userdata and other shit as arguments 08:50 < bridge> i implement the time of the creation and want to add last time used on every user data, so then later I'll be able to delete the unused ones 08:56 < bridge> strings are such a pain in the ass 08:56 < bridge> in c++ strings are such a pain in the ass 08:56 < bridge> std::string is worth shit 09:05 < bridge> What exactly do you need 09:06 < bridge> use rust 09:07 < bridge> look at this shit, i no longer know what am i doing 09:07 < bridge> ```cpp 09:07 < bridge> std::string line; 09:07 < bridge> std::string username; 09:07 < bridge> std::string password; 09:07 < bridge> std::string money; 09:07 < bridge> 09:07 < bridge> std::ifstream ifile; 09:07 < bridge> ifile.open("build/BankAccounts.txt"); 09:07 < bridge> 09:07 < bridge> if(ifile.good()) 09:07 < bridge> { 09:07 < bridge> for(unsigned int LineNumber=0; std::getline(ifile, line); LineNumber++) 09:07 < bridge> { 09:07 < bridge> for(unsigned int CharNumber=0; CharNumber <= line.length(); CharNumber++) 09:08 < bridge> { 09:08 < bridge> if(Char == ' ') 09:08 < bridge> { 09:08 < bridge> char Char = line[CharNumber]; 09:08 < bridge> char buff[CharNumber]; 09:08 < bridge> line.copy(buff, CharNumber-1, 0); 09:08 < bridge> buff[CharNumber] = '\0'; 09:08 < bridge> username = buff; 09:08 < bridge> pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "chatresp", username.c_str()); 09:08 < bridge> } 09:08 < bridge> } 09:08 < bridge> // pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "chatresp", ); 09:08 < bridge> } 09:08 < bridge> } 09:08 < bridge> ``` 09:08 < bridge> and loot at this https://cplusplus.com/reference/ctime/strftime/ 09:08 < bridge> copy is a string method, but you can't copy to an string with it, you need to make a char array like in c 09:09 < bridge> what the fak is this ? 09:10 < bridge> is it fine ? 09:10 < bridge> ``` 09:10 < bridge> char buff[CharNumber]; 09:10 < bridge> ``` 09:10 < bridge> wrong link, let me fix it 09:11 < bridge> and loot at this https://cplusplus.com/reference/string/string/copy/ 09:11 < bridge> off course not 09:11 < bridge> of course not 09:12 < bridge> what you want exactly to do ? 09:14 < bridge> separate the username and password from a .text file 09:14 < bridge> i used space to separate them all 09:15 < bridge> your file is like this ? 09:15 < bridge> ``` 09:15 < bridge> mamad pass12345 09:15 < bridge> ``` 09:15 < bridge> mohammad mohammad455 0 2024-01-10 09:15 < bridge> edwardddd edward3232 0 2024-01-10 09:15 < bridge> someoneelse malekesh232 0 2024-01-10 09:15 < bridge> yes 09:15 < bridge> hmmm 09:16 < bridge> why you using file don't understand what's wrong with sql or sqlite ? 09:16 < bridge> i never used sql that's all 09:17 < bridge> You can start now it's better option than file 09:17 < bridge> DDNet already have it's base to use you just need add your table and some query for register, login and etc. 09:18 < bridge> yeh i come to a point that i realized c++ is not for these kind of things 09:19 < bridge> no you can use it in C++ and it's fine but in my experiences SQL is way better than file in account management purposes 09:19 < bridge> and look at this https://cplusplus.com/reference/string/string/copy/ 09:24 < bridge> By the way both onbgy fng and fokkonaut use self made file formats for accounts in production with lots of players 09:25 < bridge> @mamad_melanin 09:25 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1194557669474836530/image.png?ex=65b0c986&is=659e5486&hm=a3ff9e9c505b996630f5c99f8af58fd1fbc0b93f612c445fe9c36c6b854a5e2c& 09:26 < bridge> I would use one file per account not all in one file 09:27 < bridge> you made it look easy 😂 09:27 < bridge> in that case it's fine to use separate files and folder 09:28 < bridge> create a new folder for each account as it's id and inside folder put your databases as file like account that include username,password,level,register date and etc 09:28 < bridge> it was on back of my head too. 09:29 < bridge> i will do it later 09:29 < bridge> ``` 09:29 < bridge> #include 09:29 < bridge> #include 09:29 < bridge> #include 09:29 < bridge> #include 09:29 < bridge> 09:29 < bridge> int main() { 09:29 < bridge> std::string line; 09:29 < bridge> std::string username; 09:29 < bridge> std::string password; 09:30 < bridge> int level; 09:30 < bridge> std::string registerDate; 09:30 < bridge> std::ifstream ifile("BankAccounts.txt"); 09:30 < bridge> if (ifile.is_open()) 09:30 < bridge> { 09:30 < bridge> while (std::getline(ifile, line)) 09:30 < bridge> { 09:30 < bridge> std::istringstream iss(line); 09:30 < bridge> if (iss >> username >> password >> level >> registerDate) 09:30 < bridge> { 09:30 < bridge> std::cout << "Username: " << username << "\nPassword: " << password 09:30 < bridge> << "\nLevel: " << level << "\nRegister Date: " << registerDate << "\n=======================================" << std::endl; 09:30 < bridge> } 09:30 < bridge> else 09:30 < bridge> { 09:30 < bridge> std::cerr << "Error extracting values from the line." << std::endl; 09:30 < bridge> } 09:30 < bridge> } 09:30 < bridge> ifile.close(); 09:30 < bridge> } 09:30 < bridge> else 09:30 < bridge> I forgot to copy and paste codes 😄 09:30 < bridge> Yes, embrace the unix. Everything is a file 09:35 < bridge> So you are writing a custom serialization method. Yeah that's not the easiest 09:36 < bridge> Besides I'd not store accounts in a text file. 09:36 < bridge> Look at what u really want 09:36 < bridge> 09:36 < bridge> You want all lines 09:36 < bridge> And u want to split every line 09:36 < bridge> Do these two steps after each other 09:36 < ChillerDragon> on what does >> split? 09:37 < bridge> Wat 09:37 < ChillerDragon> wat dis do ``if (iss >> username >> password >> level >> registerDate)`` 09:37 < bridge> Xd 09:39 < bridge> i don't get this, i just tho my character by character method 09:39 < bridge> i don't get this, i just do my character by character method 10:06 < bridge> it's use `std::istringstream` to extract a space-separated string and store to variables 10:06 < bridge> as you wish 😉 10:16 < bridge> https://youtu.be/FUsMxUjk-zQ?si=HFGrMIN-fSiRQNJ4 10:30 < bridge> and some ppl say rust is uglu 10:30 < bridge> and some ppl say rust is ugly 10:31 < bridge> i did it finally 10:31 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1194574235360837702/screenshot_2024-01-10_12-58-00.png?ex=65b0d8f3&is=659e63f3&hm=4113c5eda5c5cf92a9037c7d5d9d9f16d0f1cf165bcc1d32e7a86598c398f84e& 10:31 < bridge> such a murican song 10:31 < bridge> I won't 😄 10:31 < bridge> y do u think that 10:32 < bridge> idk maybe im biased cuz ur american 10:32 < bridge> noice 10:32 < bridge> it’s british 10:32 < bridge> is smith a name more common in britain? 10:32 < bridge> aye innit 10:32 < bridge> was gonna say that 10:32 < bridge> probably as common 10:32 < bridge> i don’t think the smiths were ever very successful in the usa 10:32 < bridge> at least compared to in the uk 10:49 < bridge> my rust version 10:49 < bridge> ```rust 10:49 < bridge> use std::{ 10:49 < bridge> error::Error, 10:49 < bridge> io::{BufRead, BufReader}, 10:49 < bridge> }; 10:49 < bridge> 10:49 < bridge> fn main() -> Result<(), Box> { 10:49 < bridge> let file = std::fs::File::open("BankAccounts.txt")?; 10:49 < bridge> let buff = BufReader::new(file); 10:50 < bridge> 10:50 < bridge> for line in buff.lines() { 10:50 < bridge> let line = line?; 10:50 < bridge> let mut line = line.split_ascii_whitespace(); 10:50 < bridge> let username = line.next().expect("error getting username"); 10:50 < bridge> let password = line.next().expect("error getting password"); 10:50 < bridge> let level = line.next().expect("error getting level"); 10:50 < bridge> let register_date = line.next().expect("error getting register_date"); 10:50 < bridge> println!("Username: {username}, password: {password}, level: {level}, register_date: {register_date}"); 10:50 < bridge> } 10:50 < bridge> 10:50 < bridge> Ok(()) 10:50 < bridge> } 10:50 < bridge> ``` 10:50 < bridge> it doesnt allocate on the loop btw 10:50 < bridge> ok it does 10:50 < bridge> on the first line? xD cuz its a String 10:51 < bridge> I know nothing about rust but seem scary a little don't know 😄 10:52 < bridge> whats scary xD 10:52 < bridge> @diariesvexar in rust u use iterators a lot 10:52 < bridge> they are lazy and epic 10:52 < bridge> in c++ its kind of a hassle 10:52 < bridge> lines() returns a iterator over lines 10:53 < bridge> split_ascii_whitespaces returns a iterator over words separated by a whitespace ascii looking char 10:53 < bridge> and it doesnt allocate its references 10:53 < bridge> cuz slicing in rust is epic 10:53 < bridge> and safe 10:53 < bridge> then i use the iterator manually with next() 10:53 < bridge> instead of using it with a for loop 10:53 < bridge> since i know the exact items 10:53 < bridge> u use iterators a lot in cpp too? xd 10:53 < bridge> hmm yeah i heard that rust in safety is on another level but done anything with rust 10:54 < bridge> At least in the std 10:54 < bridge> its funny to use being() end() everywhere, is that still needed in modern cpp? 10:54 < bridge> begin* 10:54 < bridge> hmm yeah i heard that rust's safety is on another level but done anything with rust 10:54 < bridge> depends 10:54 < bridge> u have to accept its way easier to write in rust 10:54 < bridge> I know rust is easier than c/c++ 10:55 < bridge> @mpft are they lazy btw? 10:55 < bridge> for(auto &it : container) 10:55 < bridge> who told u that 10:55 < bridge> it is iterator 10:55 < bridge> its a mix match the difficulty 10:55 < bridge> some stuff is easier some is harder 10:55 < bridge> well maybe not easier but cool and have more fun 10:55 < bridge> holding unsafe guarantees can be harder i think 10:55 < bridge> Debatable 10:55 < bridge> if u do unsafe code 10:55 < bridge> well like other programming languages 10:56 < bridge> no i would say most other languages (not functional) are easier than c++ or rust 10:56 < bridge> functional is its own weird world 10:57 < bridge> as I know in 2023 python were easier to learn and use right ? 10:57 < bridge> this is true which is why u should learn 10:57 < bridge> if u need help ask here 10:57 < bridge> its a rust safe zone 10:57 < bridge> :justatest: 10:57 < bridge> https://edgarluque.com/blog/rust-hashmap/ 10:57 < bridge> Most of time I use C++ cuz of DDNet base and nodejs for my backend api 10:57 < bridge> :justatest: 10:58 < bridge> https://edgarluque.com/blog/rust-iterator-fibonacci/ 10:58 < bridge> iterators are fun xd 10:58 < bridge> cpp and js experience 10:58 < bridge> but If I'm going to learn a new language I choose Rust 10:58 < bridge> ur gonna hate rust xdd 10:58 < bridge> ```rust 10:58 < bridge> fn main() { 10:58 < bridge> let fib = Fibonacci::new(); 10:58 < bridge> 10:58 < bridge> // Take 20 fibonacci numbers and put them into a vector. 10:58 < bridge> let result: Vec = fib.take(20).collect(); 10:58 < bridge> 10:58 < bridge> println!("{:?}", result); 10:58 < bridge> } 10:58 < bridge> // [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181] 10:58 < bridge> ``` 10:58 < bridge> using iterators to make a series 10:58 < bridge> ```rust 10:58 < bridge> impl Iterator for Fibonacci { 10:58 < bridge> type Item = u64; 10:58 < bridge> 10:58 < bridge> fn next(&mut self) -> Option { 10:58 < bridge> let r = self.b; 10:58 < bridge> self.b = self.a; 10:58 < bridge> self.a += r; 10:58 < bridge> Some(r) 10:58 < bridge> } 10:59 < bridge> } 10:59 < bridge> ``` 10:59 < bridge> it's a client side accounting system that using nodejs and mongodb to register, login, ... 10:59 < bridge> 🤣 10:59 < bridge> cool (?) 10:59 < bridge> super cool 10:59 < bridge> xxx 10:59 < bridge> dont listen ur gonna love rust 10:59 < bridge> rust is epic but it will be steep learning curve 10:59 < bridge> I love all language they have their own magical world 10:59 < bridge> a good stack for replacing nodejs and mongodb is: 10:59 < bridge> axum for http server 10:59 < bridge> sqlx to interact with postgres (dont use mongodb bro) 11:00 < bridge> but it’s web scale 11:00 < bridge> let me save your message it could be helpful for next project 11:00 < bridge> @diariesvexar listen to this https://www.youtube.com/watch?v=b2F-DItXtZs 11:00 < bridge> (its parody btw) 11:02 < bridge> @diariesvexar and example of the stack i mentioned: https://github.com/ZhyraPlugins/xivhub-market-api/tree/master 11:02 < bridge> i also use prometheus 11:02 < bridge> to have data on grafana 11:02 < bridge> altho i abandoned this project rn 11:04 < bridge> what's FFXIV ?! 11:04 < bridge> is it final fantasy XIV ?! 😄 11:04 < bridge> tree 11:06 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1194582983676530739/image.png?ex=65b0e119&is=659e6c19&hm=856c60d7f4535cefcfffeb3194f9e9cb5f655490a328ff49c1137cd01492793a& 11:06 < bridge> it's what I working on for a while 😛 11:22 < bridge> yes 13:11 < bridge> https://www.phoronix.com/news/CPP-Linux-Kernel-2024-Discuss 13:11 < bridge> 😬 13:13 < bridge> Template programming incoming 13:13 < bridge> I have a dejavu - didnt we Talk about Rust 2 days ago ? :kek: 13:14 < bridge> I have a dejavu - didnt we Talk about Rust and sqlx with axum 2 days ago ? :kek: 13:16 < bridge> xd 13:36 < bridge> chillerdragon: sqlite would usually be better than a hand-rolled file format 14:09 < bridge> @jupeyy_keks https://shady-gang.github.io/vcc/ 14:09 < bridge> > Vcc - the Vulkan Clang Compiler, is a proof-of-concept C and C++ compiler for Vulkan leveraging Clang as a front-end, and Shady our own research IR and compiler. Unlike other shading languages, Vcc aims to stick closely to standard C/C++ languages and merely adds a few new intrinsics to cover GPU features. Vcc is similar to CUDA or Metal in this regard, and aims to bring the advantages of standard host languages to Vulkan shaders1. 14:24 < bridge> Time to compile ddnet for gpu 14:24 < bridge> https://news.ycombinator.com/item?id=38937129 14:26 < bridge> https://biology.stackexchange.com/questions/30116/does-dna-have-the-equivalent-of-if-statements-while-loops-or-function-calls-h 14:26 < bridge> https://www.nature.com/articles/nrg3885 14:26 < bridge> @jupeyy_keks time to reprogram humanity 14:28 < bridge> https://tonybaloney.github.io/posts/python-gets-a-jit.html 14:32 < bridge> Some people are written in Python 14:32 < bridge> https://github.com/ambulancja/mariposa 14:32 < bridge> lol 14:33 < bridge> mariposa is spanish for butterfly 14:33 < bridge> *taps shoulder* 14:53 < bridge> xD 15:07 < bridge> yes I assumed that as common knowledge and it was also recommended in this chat. I just mentioned that self rolled file formats also work and they even work in bigger tw scale. They might be worth the trade off. If you do not need to run complex queries or join tables and similar. Just have some level/xp/points and simple ranks files work fine. And they do not require complex external libraries. 15:10 < bridge> so one account per line and it is space seperated? What if the values contain spaces? Do you disallow spaces in passwords? Do you escape spaces somehow? 15:52 < bridge> since you surely don't save passwords unhashed, spaces are no problem 15:53 < bridge> sqlite offers a couple of things for free that you don't get with plain files 15:53 < bridge> e.g. crash safety 15:53 < bridge> the data is still there, even if you were in the middle of overwriting it 15:54 < bridge> for your hand-rolled file format, that's harder to guarantee 16:06 < bridge> ACID 16:07 < bridge> https://en.wikipedia.org/wiki/ACID 17:05 < bridge> lmao the trolling 17:06 < bridge> Yea that’s nice. But not needed for all small tw mods 17:12 < bridge> you don't need the data in small tw mods? 17:12 < bridge> seems like a problem that could occur there 17:12 < bridge> a player tries to log out, the server crashes while writing their money value, the player is sad that they lost their account and their stats 17:16 < bridge> Can someone unban me on the brazilian mod map 17:19 < ChillerDragon> @heinrich5991 yes can happen but does not have to. Not sure if noby in years of running file based stats had that issue ever. I know fokko did not run into that issue. And using this statistically valuable data i can say its worth a shot for mamad to not spend 30 minutes understanding sql if he intends to rewrite the whole mod soon anyways. 17:20 < ChillerDragon> imo self rolled file stats have a bad rap. Using git backups and write to other file and copy on finish and lock files you can get something you fully understand and easy to setup that should not result in complete data loss. 17:21 < bridge> sounds like you're partially emulating sqlite 17:21 < ChillerDragon> i never visited a single db lecture in uni idk how real databases do anything 17:22 < bridge> sqlite is basically a "file based solution" that you're trying to do 17:22 < ChillerDragon> for my tw mods sql also worked better. I did some file based fng mod once and I had some bug in the locking mechanism. 17:23 < ChillerDragon> But I would not recommend new coders to mess with sql for their first mod. Might cause rage quits and have less learnings. 17:23 < ChillerDragon> Or at least mention file based is also an option 17:24 < ChillerDragon> @heinrich5991 i had to actually giggle a bit on your hashing comment i can not tell if you were trying to be funny or not xd 17:24 < ChillerDragon> i think he even said the passwords should be short so he can read them better xD 17:25 < bridge> Doing the “file based solution” properly is far harder than you make it out to be. It only appears so simple because you ignore much of the possible issues 😄 17:25 < bridge> If nothing ever goes wrong, yes, the file based solution is trivial and works well 17:25 < ChillerDragon> > 17:08:32 bridge | mamad_melanin: i just wanna look at them in a text file, each of them looking good, not to long 17:27 < ChillerDragon> > 15:52:58 bridge | heinrich5991: since you surely don't save passwords unhashed, spaces are no problem 17:27 < ChillerDragon> comedy gold 17:28 < ChillerDragon> @learath2 yea im saying that nothing actually did go wrong as far as i know 17:28 < bridge> I remember stuff going wrong for whatever reason 17:28 < bridge> was it in ddnet's file time score? 17:28 < bridge> or some random city mod? 17:28 < bridge> maybe I'm even misremembering 17:28 < ChillerDragon> ddnet file score did have some wonkeyyness here and there for sure 17:29 < bridge> I am serious about the fact that you should save passwords hashed 17:29 < bridge> then all the character set issues go away, too 17:29 < bridge> win-win 17:29 < ChillerDragon> Okay does not make it less funny 17:34 < bridge> Usernames 😬 17:35 < bridge> chillerdragon: when SQL to bash commands compiler 17:35 < bridge> passwords needing to adhere to some limited character set does not pass my security smell test 17:35 < bridge> usernames doing the same is fine IMO 17:36 < bridge> but yea, need to do that if you don't want to have a `\nPassword: 123\nMoney: 10000000\n` as username 17:36 < bridge> That is true. But it's a common source of bugs, especially if you are rolling your own 17:36 < bridge> but yea, need to do that if you don't want to have a `abc\nPassword: 123\nMoney: 10000000\n` as username 17:36 < bridge> that's not your money for a long time 😏 17:39 < bridge> https://www.phoronix.net/image.php?id=2023&image=kde_6_alpha 17:39 < bridge> epic 17:39 < bridge> the 3d cube is back 17:40 < bridge> plasma 6 gonna hit different 17:40 < bridge> sounds like 2005 linux 😄 17:40 < bridge> this time with AR? 😛 17:40 < bridge> what is ar 17:40 < bridge> i am young 17:40 < bridge> i wasnt alive in 2005 17:40 < bridge> ok maybe i was 17:41 < bridge> but learath wasnt 17:41 < bridge> learath2 isn't <20 years old IIRC 17:41 < bridge> he is so 12 17:43 < bridge> https://reversing.info/posts/guardedregions/ wuw 17:43 < bridge> There is this ongoing meme that I am 12 17:43 < bridge> ah augmented reality yeah i remember 17:43 < bridge> why meme 17:44 < bridge> It's only one of my ages. I'm also 86 17:44 < bridge> Learath21 he's 21 17:44 < bridge> that theme reminds me of some vmprotect writeup 17:44 < bridge> that blog theme reminds me of some vmprotect writeup 17:44 < bridge> i thought we changed it to 84, so it's divisible by 12 17:45 < bridge> I'll allow it 17:45 < bridge> born in 20**12** 17:46 < bridge> 24.12 17:46 < bridge> too complex for me but I found the subject interesting to share 17:49 < bridge> why every time my server get shutdowned the server setting goes to default (when you make a server on unmodified client) 17:49 < bridge> but when i clone and run it, it works as intended 17:49 < bridge> server or client 17:49 < bridge> u cant talk about both xd 17:49 < bridge> server 17:50 < bridge> well what do u expect? 17:50 < bridge> do u change it in F2 console? 17:50 < bridge> i change the whole bunch of shit 17:50 < bridge> the server does not persist these changed values 17:50 < bridge> u gotta create a cfg file ahead of starting 17:50 < bridge> and change your stuff there 17:51 < bridge> but, u just gave me a good idea, thanks for that 17:52 < bridge> i changed the .cfg file in data, and i build from source 17:52 < bridge> mh i always find it annoying to change cfgs in build dir.. i use the config dir instead 17:53 < bridge> by config directory you mean ~/.loacal/share/ddnet ? 17:53 < bridge> yes 17:53 < bridge> ah brother 17:53 < bridge> but if u change create a cfg file. at least name it different to the default ones 17:53 < bridge> else u override them with the cmake command 17:53 < bridge> thank you 17:54 < bridge> but if u create a cfg file. at least name it different to the default ones 17:58 < bridge> ``` 17:58 < bridge> func.func @add_plus_two(%arg0: i32, %arg1: i32) -> i32 { 17:58 < bridge> %c1_i32 = arith.constant 1 : i32 17:58 < bridge> %alloca = memref.alloca() : memref<1xi32> 17:58 < bridge> %c0 = arith.constant 0 : index 17:59 < bridge> memref.store %c1_i32, %alloca[%c0] : memref<1xi32> 17:59 < bridge> %c0_0 = arith.constant 0 : index 17:59 < bridge> %0 = memref.load %alloca[%c0_0] : memref<1xi32> 17:59 < bridge> %c1_i32_1 = arith.constant 1 : i32 17:59 < bridge> %1 = arith.addi %0, %c1_i32_1 : i32 17:59 < bridge> %c0_2 = arith.constant 0 : index 17:59 < bridge> memref.store %1, %alloca[%c0_2] : memref<1xi32> 17:59 < bridge> %2 = arith.addi %arg0, %arg1 : i32 17:59 < bridge> %c0_3 = arith.constant 0 : index 17:59 < bridge> %3 = memref.load %alloca[%c0_3] : memref<1xi32> 17:59 < bridge> %4 = arith.addi %2, %3 : i32 17:59 < bridge> return %4 : i32 17:59 < bridge> } 17:59 < bridge> ``` 17:59 < bridge> i have a quiz for u, does this end up allocating when compiled to assembly by llvm? 17:59 < bridge> ```mlir 17:59 < bridge> func.func @add_plus_two(%arg0: i32, %arg1: i32) -> i32 { 17:59 < bridge> %c1_i32 = arith.constant 1 : i32 17:59 < bridge> %alloca = memref.alloca() : memref<1xi32> 17:59 < bridge> %c0 = arith.constant 0 : index 17:59 < bridge> memref.store %c1_i32, %alloca[%c0] : memref<1xi32> 17:59 < bridge> %c0_0 = arith.constant 0 : index 17:59 < bridge> %0 = memref.load %alloca[%c0_0] : memref<1xi32> 17:59 < bridge> %c1_i32_1 = arith.constant 1 : i32 17:59 < bridge> %1 = arith.addi %0, %c1_i32_1 : i32 17:59 < bridge> %c0_2 = arith.constant 0 : index 17:59 < bridge> memref.store %1, %alloca[%c0_2] : memref<1xi32> 17:59 < bridge> %2 = arith.addi %arg0, %arg1 : i32 17:59 < bridge> %c0_3 = arith.constant 0 : index 17:59 < bridge> %3 = memref.load %alloca[%c0_3] : memref<1xi32> 17:59 < bridge> %4 = arith.addi %2, %3 : i32 17:59 < bridge> return %4 : i32 18:00 < bridge> its MLIR code btw 18:00 < bridge> @jupeyy_keks u can talk about both if u click "start a local server" on ur client 18:00 < bridge> yes, but is your question if it alocates from heap? 18:00 < bridge> no 18:00 < bridge> if it allocates at all 18:00 < bridge> on the stack 18:00 < bridge> and it doesnt 18:00 < bridge> ``` 18:00 < bridge> 0000000000000030 : 18:00 < bridge> 30: 8d 44 37 02 lea eax,[rdi+rsi*1+0x2] 18:00 < bridge> 34: c7 44 24 fc 02 00 00 mov DWORD PTR [rsp-0x4],0x2 18:00 < bridge> 3b: 00 18:00 < bridge> 3c: c3 ret 18:00 < bridge> ``` 18:00 < bridge> its funny 18:01 < bridge> ``` 18:01 < bridge> fn add_plus_two(x: i32, y: i32) -> i32 { 18:01 < bridge> let mut z: i32 = 1; 18:01 < bridge> z = z + 1; 18:01 < bridge> return x + y + z; 18:01 < bridge> } 18:01 < bridge> ``` 18:01 < bridge> this is the original code btw 18:01 < bridge> so you mean it gets optimized away? 18:02 < bridge> yeah, i made so the compiler emits allocas (which are stack allocations) for local variables, and u load and store the values when a expression needs it or sets it in a assignment 18:02 < bridge> but ultimately there are no stack allocations 18:02 < bridge> because llvm can figure it out 18:02 < bridge> epic compiler moment 18:03 < bridge> since MLIR (and llvm ir) are in SSA form allocas are the easy way to modify stuff and implement "variables" itself 18:03 < bridge> SSA = single assignment form 18:03 < bridge> the difference between MLIR and LLVM here is 18:03 < bridge> MLIR has even more info 18:03 < bridge> like the shape of the alloca 18:03 < bridge> it also does alloc for heap 18:03 < bridge> the memref<1xi32> is the shape 18:04 < bridge> https://mlir.llvm.org/docs/Dialects/MemRef/# 18:04 < bridge> https://mlir.llvm.org/docs/Dialects/MemRef/#memrefalloca-memrefallocaop 18:05 < bridge> so if there was a .cfg being in build/data directory, it gets on the way of the user data directory, am i right ? 18:06 < bridge> i dont understand what you try to say, but no, it won't be inside the user data dir 18:08 < bridge> ./my_server -f my_cfg.cfg 18:08 < bridge> next to my_server there must be a cfg named my_cfg 18:10 < bridge> if you have two autoexec_server.cfg . one in data directory and another one in ~/.local/share/ddnet directory, which one get executed ? 18:10 < bridge> @learath2 i made a sin and tried league on lutris and it worked 18:10 < bridge> i thought vanguard or idk made it impossible 18:10 < bridge> the config dir 18:10 < bridge> linux is awesome 18:19 < bridge> works perfectly for me 18:20 < bridge> But tbh I also spent some time improving it and making it work nice and smooth 18:21 < bridge> But wish I had SQL haha 18:30 < bridge> It's not impossible to do properly. There is just more to it then it might seem at a first glance 18:35 < ChillerDragon> lerato is 12 forever 18:35 < ChillerDragon> like peter pan 18:42 < ChillerDragon> i do not like how many emails the new merge queue sends :( 18:43 < ChillerDragon> https://zillyhuhn.com/cs/.1704908612.png 18:43 < ChillerDragon> was bors as spammy? 18:46 < ws-client> Ah wait no its twice as many emails 18:47 < ws-client> It used to be one comment from ddnet mergers saying "Thanks bors+r" and the one "pr closed as merged" email. Now its one "Thanks" comment. One merge added email. Two merge done emails. 19:02 < bridge> Xd 19:03 < bridge> Also stop white design 19:03 < bridge> Boomer 19:45 < bridge> hello there, i am in the progress of making account system, day 4 19:46 < bridge> with c++ of course 19:46 < ChillerDragon> C masterrace 19:48 < bridge> how can i swap a text in i file ?, example: swap "21548" at line 4 and character 30 19:48 < bridge> how can i swap a text in a file ?, example: swap "21548" at line 4 and character 30 19:49 < bridge> i implemented 90% of it 19:49 < ChillerDragon> as far as i know there is no such thing as swap in a text file 19:49 < ChillerDragon> only read in all content change the content in c++ and write out all content 19:50 < bridge> then lets learn sql 19:50 < ChillerDragon> there probably is some smart way to write at a specific offset but that seems advanced 19:50 < bridge> do you implemented your acc system with sql ? 19:51 < ChillerDragon> ddnet++ is using ddnets sql infrastructure 19:51 < ChillerDragon> btw i made a yt series on how to add txt based accs 19:51 < ChillerDragon> i did not link it earlier because you were doing just fine 19:51 < ChillerDragon> might be too beginner for you 19:51 < bridge> :trollet: 19:51 < ChillerDragon> im serious 19:52 < ChillerDragon> in case u are curious here is a 1 hour video on how to do txt accounts using tw style file code so no c++ streams https://www.youtube.com/watch?v=Bwt1PoFWOOA 19:53 < ChillerDragon> you do not need sql to change values just read in the file change the content and write it out 19:53 < bridge> i will check it out, thanks ❤️ 19:53 < ChillerDragon> or if you have specific fixed offsets you can lookup on how to start writing at a offset in c++ i think that works too 19:54 < bridge> sounds exactly the thing i want 19:54 < ChillerDragon> `fseek` and shits 19:54 < ChillerDragon> well thats C 19:54 < ChillerDragon> idk c++ 19:54 < ChillerDragon> are you still storing all accounts in one file? 19:54 < ChillerDragon> i highly recommend not to do that and use one file per user instead 19:55 < bridge> yes, that is the challenge, but i did now knew it's such a pain 19:55 < bridge> yes, that is the challenge, but i did not knew it's such a pain 19:57 < bridge> the way i implemented it, the account address is just a line number in the text file 😂 19:57 < ChillerDragon> yea i would not recommend doing that 19:57 < ChillerDragon> will be annoying to maintain if you have thousands of accounts 19:58 < ChillerDragon> working with big text files might break your tooling 19:58 < ChillerDragon> consume a lot of ram while reading it 19:58 < ChillerDragon> break your editor when opening it to debug stuff 19:58 < ChillerDragon> etc 19:59 < bridge> it took me a whole day, and i still have no idea how to do this 19:59 < ChillerDragon> arent you basically done? 19:59 < ChillerDragon> do what? 20:00 < bridge> i have everything except changing the value in the text file 20:01 < ChillerDragon> does everything includ adding accounts? 20:01 < ChillerDragon> and loading accounts? 20:01 < ChillerDragon> then just call your load method change the values and call your save method 20:03 < bridge> to this point everything i don was reading the file and append(register an account) to it 20:04 < ChillerDragon> i see 20:04 < bridge> even file get readed every time someone want to register to be sure the account is not existed :brownbear: 20:05 < bridge> even file get readed every time someone wants to register to be sure that the account is not existed :brownbear: 20:13 < ChillerDragon> https://stackoverflow.com/questions/21180412/search-and-replace-string-in-txt-file-in-c 20:14 < ChillerDragon> this might work for replacing but i am not sure i can recommend doing that 20:21 < bridge> How to make the distance to draw players? How to use fng to protect against cheat clients 21:44 < bridge> configure your email client 21:44 < bridge> ChillerDragon 22:10 < bridge> Vanguard isn’t on league yet but it will be next patch 😄 22:11 < bridge> Let's follow riot's shenanigans and implement kernel level anti cheat for ddnet too 😎 22:12 < bridge> next patch? they've been saying it comes soon for a while now. is it actually coming? 22:12 < bridge> It is 22:13 < bridge> link? 22:13 < bridge> idk if next patch tho 22:14 < bridge> (I remember them saying it comes soon a couple of years back) 22:15 < bridge> Now there's a lot of players talking about. Plus they made it official on the S14 video 22:15 < bridge> https://support-leagueoflegends.riotgames.com/hc/en-us/articles/24169857932435-Riot-Vanguard-League-of-Legends- 22:15 < bridge> 22:15 < bridge> I found this released on jan 5 if it interests you 22:15 < bridge> Hm, I assumed next patch because they said it in the season 2024 video thing 22:15 < bridge> ppl still cheat on their csgo clone right? 22:15 < bridge> xd 22:16 < bridge> valorant? I do not think so? Idk haven't heard about it. 22:16 < bridge> But it will still reduce the cheaters by a lot as now you require quite the skills to cheat 22:16 < bridge> its hilarius users dont know anything and allow to install this 22:16 < bridge> *more money 22:16 < bridge> Ofc they are still cheating on valorant 22:16 < bridge> I'm quitting lol tho. @ryozuki teach me dota xd 22:16 < bridge> dota best 22:16 < bridge> the peopl with the skills aren't the ones cheating, I'd wager 22:16 < bridge> but i ocasionally play a lol game to socialize with normal ppl 22:17 < bridge> idk about that 22:17 < bridge> i think ppl with the skills know to cheat the best 22:17 < bridge> this reminded me of the minecraft speedrun drama 22:17 < bridge> well, it will still reduce the amount of cheaters 🤷‍♂️. 22:17 < bridge> I'm hardly against the idea tho as I don't think cheaters are really an issue for 99.9% of the community (I invented that stat) 22:17 < bridge> well, it will still reduce the amount of cheaters 🤷‍♂️. 22:17 < bridge> I'm hardly against the idea tho as I don't think cheaters are really an issue for 99.9% of the community (I made up that stat) 22:18 < bridge> (hardly means the opposite of hard btw) 22:18 < bridge> https://www.youtube.com/watch?v=8Ko3TdPy0TU 22:18 < bridge> i remembered this nice vid xd 22:18 < bridge> (hardly means barely btw) 22:18 < bridge> ehh, well, you got it. whoops 22:18 < bridge> true but it's still a minority 22:18 < bridge> well, it will still reduce the amount of cheaters 🤷‍♂️. 22:18 < bridge> I'm really against the idea tho as I don't think cheaters are really an issue for 99.9% of the community (I made up that stat) 22:18 < bridge> this is like the state enforcing security through control 22:18 < bridge> 1984 22:19 < bridge> but it's sad that the biggest minecraft youtuber (ever) is a cheater xD 22:19 < bridge> and he got his success by cheating 22:19 < bridge> i heard rumors he is a groomer too 22:19 < bridge> but idk if true 22:19 < bridge> lmao 22:19 < bridge> > In late 2022, Dream was accused of flirting with and grooming a minor by Twitter user 'Anastasia' who claimed she was 17 years old at the time she had an encounter with the YouTube star. Since then, the YouTuber claims he has been “harassed for almost a year due to false accusations.” 22:19 < bridge> maybe its just attention seeking from someone tho 22:42 < bridge> where are the default entities located i cant find them lol 22:48 < bridge> Editor 22:49 < bridge> Entities clear 22:49 < bridge> thanks 23:00 < bridge> Sounds time consuming 23:07 < bridge> https://cdn.discordapp.com/attachments/453298696185184257/1194764483944529950/2024-01-10_23-06-43.mp4 23:08 < bridge> :troll: 23:15 < bridge> not a lot more time-consuming than complaining ^^ 23:15 < bridge> chillerdragon 23:23 < bridge> 6 separate entities and a macro to keep pressing a bind to make em move 23:24 < bridge> this lags the helll outta the game 23:36 < bridge> Doubt took me 1 minute 23:37 < bridge> Did you ever configure your email client to do such things? Is it easy? I couldn’t even think of a regex without false positives. And i somehow doubt gmail supports regex at all