01:48 < bridge> could be, but it was very aggressively crawling non-existant links in that case 02:58 < bridge> try crowdsec 02:59 < bridge> log parser for like nginx or whatever reverse proxy you use. 09:52 < bridge> gumo ^.^ 09:52 < bridge> tried to evaluate if my quad culling has an benefit: 09:52 < bridge> - sees minor benefits in some maps 09:52 < bridge> - tries mona-lisa but no clip 09:52 < bridge> - 2000 fps difference 09:53 < bridge> tried to evaluate if my quad culling has a benefit: 09:53 < bridge> - sees minor benefits in some maps 09:53 < bridge> - tries mona-lisa but no clip 09:53 < bridge> - 2000 fps difference 11:57 < bridge> I rarely do PRs with this much text 🙈 need some ☕ 12:00 < bridge> Somebody willing to implement some proper quad grouping/clustering? With the PR above this now got infinetly more complex, because you need to think about envs and clips 12:01 < bridge> Somebody willing to implement some proper quad grouping/clustering? With the PR above this now got infinetly more complex, because you need to think about envs and clips. Oh and this may contains smart resorting of quads, but only if they don't overlap 12:15 < bridge> what to do if it says "access denied" when you try to log in to the server you have been banned (VPN Detected) 12:21 < bridge> Can you send server ip? 12:22 < bridge> all servers DDrace 12:23 < bridge> :justatest: 12:23 < bridge> :giftee_green: 12:25 < bridge> I guess just don't use vpn...? 12:25 < bridge> I don't use vpn 13:05 < bridge> Dyno Bot 13:06 < bridge> and how do I submit a request? 13:09 < ws-client> @ryozuki 99 prs 13:10 < bridge> :justatest: 13:10 < bridge> ill check tomorrow friday 13:10 < bridge> today im at office 13:11 < bridge> and how do I submit a request? @ryozuki 13:13 < bridge> idk bro im not a moderator and tbh idc 13:13 < bridge> this isnt the channel for this talk 13:13 < bridge> #✉-create-a-ticket 13:14 < bridge> #questions 13:23 < bridge> hahahahahahaha @chillerdragon 13:32 < ws-client> :p 13:32 < ws-client> @davide55 ngl you saved me 6 hours of my life 13:35 < bridge> AHAHAHAHAHAA wow @chillerdragon 13:35 < bridge> AHAHAHAHAHA wow @chillerdragon 14:15 < bridge> I have a question for developers that when they are gonna make Pakistan server in ddnet because there are Pakistani who wants Pakistani server in ddnet, can you tell me when are you guys gonna make it, so i can tell other Pakistani about that 14:20 < ws-client> @corp22_ more admin than developer question 14:20 < ws-client> @learath2 when pakistan server! 14:20 < ws-client> or riot 14:20 < bridge> https://media.discordapp.net/attachments/1391547270746603661/1395358147761274950/1.jpg?ex=687a280a&is=6878d68a&hm=e82651c61f7fed7c7bef23ed59c59ec2d7f7a2766a64660230bc2add1d88dc6f&=&width=1068&height=1424 https://media.discordapp.net/attachments/1391547270746603661/1395358148126048386/2.jpg?ex=687a280b&is=6878d68b&hm=b64ace0a3352c707c8aa61843f5af898be954c0d5c09d85365f4b10ca2bec190&=&width=1068&height=1424 https://media.discordapp.net/attachments/13 14:21 < ws-client> @goofya73 sketchy ah 14:21 < bridge> I think I replied to this before 14:22 < bridge> Here 14:22 < ws-client> Here 14:23 < ws-client> @learath2 bro everything changed there is another pakistani now! 14:23 < ws-client> they are doubling daily!!! 14:23 < ws-client> soon they will make up 90% of ddnet players 14:23 < bridge> If it was like 15-20 people it could have made sense 14:24 < ws-client> give it one more week 14:24 < ws-client> theyll spawn 14:27 < ws-client> henlo i from pakistan we big group of people! @learath2 can you buy the server, thank 14:27 < bridge> ... Punjab is a region in India, not Pakistan 14:28 < bridge> There are like 7-8 14:28 < bridge> Both 14:28 < ws-client> this lerato guy does not know or respect our culture! 14:28 < ws-client> he must be racist 14:28 < bridge> Punjab is a province in Pakistan 14:29 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395381832329203782/image.png?ex=687a3e19&is=6878ec99&hm=ddf15a58768c42f57a3c1cc71e8d354eeaf9c375838d31431bd2d537b1e8fc61& 14:29 < ws-client> @corp22_ you need to do some advertisement for ddnet in pakistan :) 14:29 < bridge> I tried 14:29 < ws-client> if you come back with more players you will get a server! 14:29 < ws-client> o nice 14:29 < bridge> There are like 7-8 pakistani, isn't that enough? 14:30 < ws-client> its close 14:30 < ws-client> bring them all here to make some noise xd 14:30 < bridge> Ah I did not spot the dashed line in the border. Is it one of those states where India claims it's India and Pakistan claims it's Pakistan? 14:30 < bridge> Will it work? 14:30 < ws-client> no idea 14:30 < ws-client> you might get banned 14:30 < ws-client> you might get a server 14:31 < ws-client> no risk no fun they say, right? 14:31 < ws-client> its like nuclear energy 14:31 < bridge> Bro punjab is a province in Pakistan 14:31 < bridge> @0xdeen I don't think it's enough people, but maybe give it a look 14:31 < ws-client> <:poggers2:1008007455936094328> 14:32 < ws-client> @corp22_ IT WORKED 14:32 < bridge> Apparently there is a Punjab in both Pakistan and India. The more you know 14:32 < bridge> Yeah you should 14:33 < bridge> Just think about it, if you make a Pakistani server then pakistani will play this game otherwise there's ping issue so i don't think so anyone gonna play 14:33 < ws-client> 🧠 14:33 < bridge> Happiness in my face 14:33 < bridge> Just think about it, if you make a Pakistani server then more pakistani will play this game otherwise there's ping issue so i don't think so anyone gonna play 14:33 < bridge> Just think about it, if you make a Pakistani server then even more pakistani will play this game otherwise there's ping issue so i don't think so anyone gonna play 14:34 < ws-client> @corp22_ do you know some games that have servers in pakistan? 14:34 < bridge> Pakistan server 14:34 < bridge> Pakistan server? 14:34 < ws-client> i wonder how rare it is yes 14:34 < bridge> Yeah there are alot of games but i don't play that games as much as i play ddnet 14:34 < ws-client> Do you have a good ping in all the big games like fortnite and cs2 and so on? 14:35 < bridge> Yeah i get good ping is cs2 and i don't play fortnite 14:52 < bridge> @chillerdragon hey bro 14:52 < bridge> 15:56 < bridge> spanish ppl from spain been demanding a sv too 15:56 < bridge> but i guess ddos makes it hard to find 15:57 < bridge> i know, u will say ger is close, but not same tbh 15:57 < bridge> entitles germans :justatest: 15:57 < bridge> entitled germans :justatest: 15:57 < bridge> with a sv in madrid or bcn i would have 8 ping 15:57 < bridge> EU I think is very hard to justify when GER is very well connected. If people were getting seriously high pings it might make sense 15:57 < bridge> i have 60 pin on ger 15:58 < bridge> the routing is not that good 15:58 < bridge> The ddos protection we get in GER we won't get anywhere else 15:58 < bridge> yeah thats the thing 15:58 < bridge> sadly 15:58 < bridge> I mean 60 is excellent. I used to play with 90 when I was in Turkey 15:58 < bridge> but 8 is perfect 15:58 < bridge> xD 15:58 < bridge> on csgo i had 5 ping 15:58 < bridge> Yeah, I get like 30~ here in Italy 15:59 < bridge> How did your job interview go btw? 15:59 < bridge> @vappy19 wants this badly 15:59 < bridge> i think okayish, it was more like here is a naive solution, it has some problems and kind of walking to the path of the correct one 15:59 < bridge> i ended up doing the correct ones so i guess its not bad 15:59 < bridge> but i had to code on google docs 15:59 < bridge> and i was rly nervous 15:59 < bridge> u can imagine 16:00 < bridge> Ew 16:00 < bridge> its like, lets put u on the worst possible scenario and see how u manage, who cares about real life scenarios 16:00 < bridge> xd 16:00 < bridge> i wonder if they do this due to not wanting ppl using ai coding stuff nowadays 16:00 < bridge> Yeah, I can imagine that being stressful 16:00 < bridge> @learath2 imma invite my pakistani friends 16:01 < bridge> @learath2 when ur nervous, u even forget lot of basic stuff 16:01 < bridge> i had a moment my mind was blank i couldnt think at all 16:01 < bridge> anyway 16:01 < bridge> then i have side projects writing a risc-v vm and such but u can fail at stupid algorithms 16:01 < bridge> then i have side projects like writing a risc-v vm and such but u can fail at stupid algorithms 16:09 < ws-client> i dont understand the benefit of doing coding interview without editor 16:10 < ws-client> doesnt a company want a developer that can produce actual code? Or just someone that happens to remember full function names the lsp would auto complete anyways? 16:10 < bridge> idk 16:10 < bridge> i think its more to asses the ability to go through the problem 16:10 < bridge> more than coding 16:10 < ws-client> hmk 16:11 < bridge> i just happened to remember all the rust keywords and functions lmao 16:18 < bridge> I think the best would be to simply code a ddnet mod live. 2h 16:18 < bridge> Fng 16:23 < ws-client> @Jupstar ✪ common interview question 16:25 < ws-client> yo jupsti what time do you think could you speedrun fng based on C++ ddnet? all corner cutting allowed it just has to be playable fng 16:25 < bridge> If ryo gets the job and will be rich, we can also do the next meetup in private jet chiller. Hope then u have time 16:26 < bridge> I ported to 0.7 in a single day 16:26 < ws-client> yea ik ur 0.7 port was crazy 16:26 < ws-client> but gimme fng estimate 16:29 < bridge> But that was fng 16:29 < bridge> I dunno what you mean 16:30 < bridge> jupsti make stream where you code city mod 16:30 < bridge> melon hi 16:30 < bridge> https://tenor.com/view/pipotam-baby-hippo-hippo-wash-shower-gif-3406421565683572068 16:30 < bridge> City could be fun with client side mods 16:30 < bridge> Too bad chiller said c++ 16:31 < bridge> idiota ChillerDragon: 16:40 < bridge> teesmash 16:41 < bridge> zombie mode! 16:41 < bridge> adding npc's should be super duper easy on ddnet-rs 16:53 < bridge> I've never seen such an error :lol: 16:53 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395418014140203059/image.png?ex=687a5fcc&is=68790e4c&hm=469f713414eff98ccda889eade78a3989b2336bddb6af74bf28180e6e3a3cb57& 17:02 < bridge> Oh I somehow thought you porting ddnet-rs to 0.6 took one day. But ye 1 day is fast for final code. But I was more thinking speedrun. Not production ready. 17:16 < bridge> que cosa? 17:16 < bridge> 👀 17:17 < bridge> server 17:19 < bridge> furo: is your ddstats community url still up? - and if, what is it? :owo: 17:19 < bridge> furo: is your ddstats community skin url still up? - and if, what is it? :owo: 17:21 < bridge> https://ddstats.tw/skins/ 17:21 < bridge> i love you 17:21 < bridge> :owo: 17:22 < bridge> 4-6h 18:46 < bridge> 100 18:58 < bridge> Idk why this keeps happening to me, whenever I try to do something with rust I hit an issue 18:59 < bridge> `error[E0015]: cannot match on 'str' in constant functions` 18:59 < bridge> This is what I get for not just using conditional compilation 😛 19:06 < bridge> ```rust 19:06 < bridge> const fn get_platform_exe() -> &'static str { 19:06 < bridge> #[cfg(target_family = "windows")] 19:06 < bridge> return "DDNet.exe"; 19:06 < bridge> #[cfg(target_family = "unix")] 19:06 < bridge> return "DDNet"; 19:06 < bridge> 19:06 < bridge> #[cfg(not(any(target_family = "windows", target_family = "unix")))] 19:06 < bridge> compile_error!("Unsupported family"); 19:06 < bridge> } 19:06 < bridge> ``` 19:06 < bridge> nasty 19:12 < ws-client> @Jupstar ✪ im talking cut edges speedrun most basic gameplay to be able to win rounds 19:12 < ws-client> really 4+ hours? 19:13 < ws-client> josspit u are 10x engineer 19:13 < ws-client> not all XXLfng2+* with rainbow spikes killing spree tracer stats and player economy 19:14 < ws-client> just laser that freezes and one type of spikes that give points and scorelimit 19:15 < ws-client> none of the weird fng hammer tuning or shits 19:15 < ws-client> segfaults allowed 19:26 < bridge> F i didnt get the job 19:26 < bridge> anyway ill just keep at my current one which isnt bad 19:26 < bridge> i hate interviews 20:04 < bridge> https://cdn.discordapp.com/attachments/252358080522747904/1267876556261560454/EB37683D3A4CDA1932DD5DD1561EC9AF.gif 20:10 < bridge> did they give you any reason ? 20:10 < bridge> google docs interview… 20:13 < bridge> nope 20:14 < bridge> wait i paste the text 20:14 < bridge> > Dear Edgar, 20:14 < bridge> > 20:14 < bridge> > Thank you for your patience, 20:14 < bridge> > 20:14 < bridge> > We appreciate your interest in our company and willingness to go through our interview process. After careful consideration, we have decided not to proceed with your candidacy. 20:14 < bridge> > 20:14 < bridge> > Please note that this decision was not easy, as we recognize the effort you put into your interview. We received many qualified candidates, and unfortunately, we had to make some tough decisions. 20:14 < bridge> > 20:14 < bridge> > We encourage you to continue pursuing your career goals and wish you all the best in your future endeavors. 20:14 < bridge> typical copy paste 20:14 < bridge> gpt 20:14 < bridge> this response was before gpt 20:14 < bridge> its the same always when rejecting 20:15 < bridge> Classic 20:15 < bridge> but yeah google docs coding was a bit weird 20:15 < bridge> 100% 20:16 < bridge> its funny they reject me for this, but u can look at my gh with nice projects 20:16 < bridge> i guess they dont count if u dont excel at some algorithm question under pressure 20:16 < bridge> xd 20:16 < bridge> which was it 20:16 < bridge> We're you really that bad? 20:16 < bridge> It's normal to do bit slow under pressure 20:17 < bridge> E.g. on my interview they said I was thr first to pass it in time, while I personally thought afterwards I could have done it much faster xD 20:17 < bridge> i dont think so 20:18 < bridge> i would say okayish 20:18 < bridge> but its truly not representative of my real skills 20:18 < bridge> at my current job my boss is praising me constantly xd 20:18 < bridge> Yeah, did you talk out loud during the interview? 20:18 < bridge> That's usually important too 20:19 < bridge> not much, im usually not much of a talked, plus its in english and when i get nervous my english drops a lot 20:19 < bridge> not much, im usually not much of a talker, plus its in english and when i get nervous my english drops a lot 20:19 < bridge> Mine was English too 20:19 < bridge> Ok rustaceans, which one do you like better? 20:19 < bridge> ```rust 20:19 < bridge> let Ok(meta) = check_path 20:19 < bridge> .metadata() 20:19 < bridge> .inspect_err(|e| info!("{:?}: {e}", check_path)) 20:19 < bridge> else { 20:19 < bridge> return false; 20:19 < bridge> }; 20:19 < bridge> ``` 20:19 < bridge> or 20:19 < bridge> ```rust 20:19 < bridge> let meta = match check_path.metadata() { 20:19 < bridge> Ok(m) => m, 20:19 < bridge> Err(e) => { 20:19 < bridge> info!("{:?}: {}", check_path, e.to_string()); 20:19 < bridge> return false; 20:20 < bridge> } 20:20 < bridge> }; 20:20 < bridge> ``` 20:20 < bridge> @jupeyy_keks do u think im a good coder 20:20 < bridge> :feelsbadman: 20:20 < bridge> i need some ego boost in these down times 20:20 < bridge> Everytime i struggled i made clear how i deal with it or simply asked if they can help, so i dont need to google 10 minutes xD 20:20 < bridge> xd 20:20 < bridge> first more idiomatic, i would say 20:20 < bridge> Don't take it as a review of you, there might really have been some cracked candidates 20:20 < bridge> map_err with anyhow ? 20:21 < bridge> Sure, why not? 20:21 < bridge> See for a pure remote job maybe the other attendance were very good too, but u are defs above average 20:21 < bridge> option 3 20:21 < bridge> though, if u have a requirement to support old rust versions, second, because on first ur using some features from newer rusts 20:21 < bridge> like inspect_err 20:21 < bridge> I'm not returning an error from this function, that was also a possibility, but the errs from io are just nasty 20:21 < bridge> depends on ur MSRV 20:21 < bridge> what is ur function? is ur program an app or a library? 20:21 < bridge> if its an app use anyhow or color_eyre 20:21 < bridge> if its alibrary use thiserror 20:22 < bridge> https://docs.rs/thiserror/latest/thiserror/ 20:22 < bridge> `fn is_dir_root(p: &Path) -> bool {` 20:22 < bridge> is one option 20:22 < bridge> `fn is_dir_root(p: &Path) -> anyhow::Result<()> {` 20:22 < bridge> is the other 20:22 < bridge> i’d take the latter 20:22 < bridge> depends 20:22 < bridge> is it in a hot path 20:22 < bridge> if not second 20:22 < bridge> Latter for sure 20:22 < bridge> if it is consider first, because bool is cheaper 20:23 < bridge> but probs wont matter 20:23 < bridge> but that comes with my error from the caller function just becoming "Os error: Not found (2)", no indication of what file was not found, I need to at least log it somewhere 20:23 < bridge> xd 20:23 < bridge> Io is rarely hot path 20:23 < bridge> ur hot 20:23 < bridge> :brownbear: 20:23 < bridge> Or always 😉 20:23 < bridge> that’s why you’d map err in the function :brownbear: 20:23 < bridge> That's a weird looking C 20:23 < bridge> 😊 20:23 < bridge> Yeah I'm about 20 minutes away from going back to C with this 20:23 < bridge> anywhow 20:23 < bridge> or add context maybe 20:23 < bridge> if ur using anyhow 20:23 < bridge> u can bail! on the error or add .context() 20:23 < bridge> to the error 20:24 < bridge> Let me try with context see how it looks 20:24 < bridge> like err.context("error with smth").unwrap() 20:24 < bridge> iirc 20:24 < bridge> with_context preferably 20:24 < bridge> lazy 20:24 < bridge> i forgot i barely use anyhow 20:24 < bridge> cuz i mostly work on libs 20:25 < bridge> @learath2 watcha doing in rust 20:25 < bridge> thats sussy baka 20:27 < bridge> btw 20:27 < bridge> next version will have this https://github.com/rust-lang/rust/pull/137306 20:27 < bridge> finally 20:28 < bridge> The context doesn't even show up if I just return this error all the way out of main 20:28 < bridge> ``` 20:28 < bridge> Part of the decision is that i128 should match __int128 in C on platforms that provide it, which documentation is updated to indicate. We will not guarantee that i128 matches _BitInt(128) since that can be different from __int128. Some platforms (usually 32-bit) do not provide __int128; if any ABIs are extended in the future to define it, we will need to make sure that our ABI matches. 20:28 < bridge> ``` 20:28 < bridge> Surprise 20:28 < bridge> TIL its not guaranted _BitInt(128) matches __int128 20:28 < bridge> xd 20:35 < bridge> You know what rust needs? `fmt.Errorf` from Go 20:37 < bridge> What can it do? 20:37 < bridge> U can use map_err 20:37 < bridge> Wdym, just Err(anyhow) that shit! 20:37 < bridge> If u prefer a more controlled err msg 20:38 < bridge> And this yeah. Anyhow macro is like every format in Rust 20:39 < bridge> ```go 20:39 < bridge> if res, err := my_fallible_function(); err != nil { 20:39 < bridge> return fmt.Errorf("My complicated function failed, this is so sad: %w", err); 20:39 < bridge> } 20:39 < bridge> ``` 20:39 < bridge> I get the exact output for my error, it wraps and chains to the original error perfectly 20:40 < bridge> That is anyhow! In rust too 20:40 < bridge> Err(anyhow!("Err: {}", err); 20:40 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395475244663312506/image.png?ex=687a9519&is=68794399&hm=ca73369e8ac16ce7f271f3d7707ec829fb4ddd4ba2b012a23450a02141ba2efc& 20:40 < bridge> Basically the same thing tbh 20:40 < bridge> If let err(err) =... Return Err(anyhow!("msg {}")) 20:41 < bridge> I don't think that chains to the original error properly, does it? 20:41 < bridge> If let err(err) =... Return Err(anyhow!("msg {err}")) 20:41 < bridge> check the image i sent, original error is under "caused by:" 20:41 < bridge> e.g. fill the source 20:41 < bridge> https://docs.rs/anyhow/latest/anyhow/struct.Error.html#display-representations 20:41 < bridge> U mean backtrace? 20:41 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395475593461502134/image.png?ex=687a956c&is=687943ec&hm=d53cf656a15cfd599af65c844f30d925b5b6c9a43a341817c367551610aaeadf& 20:42 < bridge> To print causes as well using anyhow’s default formatting of causes, use the alternate selector “{:#}”. 20:42 < bridge> > Failed to read instrs from ./path/to/instrs.json: No such file or directory (os error 2) 20:42 < bridge> Look at this Rust pro 20:42 < bridge> Always the prepared answer ready 20:42 < bridge> xd 20:43 < bridge> i just read the lib docs 20:43 < bridge> its rare to have docs in C but in rust its common 20:43 < bridge> :owo: 20:43 < bridge> :brownbear: 20:43 < bridge> It says returning this error from main should print with the Caused by part, it doesn't happen. If I log the error by hand I get this bizarre format that doesn't even have the "Caused by:" and is in the wrong order 20:43 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395476065148731524/image.png?ex=687a95dc&is=6879445c&hm=12b78c6f7acbc15204e6dfecbb793d32158a41334e9d118fc16ffe6149dd505a& 20:44 < bridge> can u show a bit of the code 20:44 < bridge> I logged it with the `{:?}` 20:44 < bridge> how do u use context 20:44 < bridge> now we now what you're working on :santatrollet: 20:44 < bridge> now we know what you're working on :santatrollet: 20:44 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395476290768863282/image.png?ex=687a9612&is=68794492&hm=48051773aef382f16ca67dfabe0b33d0cb00e4cba5b154bf794d47ee8510fc29& 20:44 < bridge> ```rust 20:44 < bridge> let meta = match check_path.metadata() { 20:44 < bridge> Ok(m) => m, 20:44 < bridge> Err(e) => return Err(anyhow!(e).context(format!("{:?}", check_path))), 20:44 < bridge> }; 20:44 < bridge> ``` 20:44 < bridge> anyhow::bail!() will do that 20:45 < bridge> ```rust 20:45 < bridge> if let Err(e) = is_dir_root(check_dir.as_path()) { 20:45 < bridge> info!("{:?}", e); 20:45 < bridge> } 20:45 < bridge> ``` 20:45 < bridge> It's not even close to being the same thing. `.context` comes closer 20:45 < bridge> depends, it takes format string in the macro 20:46 < bridge> you can put {} in there closer to your example 20:46 < bridge> @learath2 ?? 20:46 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395476709318463659/image.png?ex=687a9676&is=687944f6&hm=04082462c88d4b63c2b09cbb322ac66a9516d9513fef35ee5079368918306112& 20:46 < bridge> context would work as well but you’d need to use it on the original error 20:46 < bridge> Do I have like a bad version of anyhow or something? 20:46 < bridge> are u using ? at main level? 20:46 < bridge> where anybow!/bail! don’t need an existing error 20:46 < bridge> [dependencies] 20:46 < bridge> anyhow = "1.0.98" 20:46 < bridge> anyhow = "1.0" 20:47 < bridge> should be same 20:47 < bridge> are u using ? on the function 20:47 < bridge> idk, it works for me lol 20:48 < bridge> @learath2 quick question, if you had a struct in C let's say `Packet` and there was a function `free_packet` which would free all malloc'ed data, would you set freed pointers to `NULL`? 20:48 < bridge> Milkeey! No c, we rusting today 20:48 < bridge> :angy: 20:49 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395477430436892732/image.png?ex=687a9722&is=687945a2&hm=67f21b678ac225249b4bfca063e63a03c32094433505de738225407c87b7a7bb& 20:49 < bridge> look, its fancy af 20:49 < bridge> it shows my first context too 20:49 < bridge> I was about to start yapping about "Modern Compiler Implementation in C" book -.- 20:50 < bridge> ```rust 20:50 < bridge> fn is_root_dir(p: &Path) -> Result<()> { 20:50 < bridge> Err(std::fs::read("wrongpath").context("some context")) 20:50 < bridge> } 20:50 < bridge> 20:50 < bridge> fn determine_root_dir() -> Result { 20:50 < bridge> let mut check_dir = std::env::current_exe()?; 20:50 < bridge> check_dir.pop(); 20:50 < bridge> 20:50 < bridge> if let Err(e) = is_root_dir(check_dir.as_path()) { 20:50 < bridge> info!("{:?}", e); 20:50 < bridge> } 20:50 < bridge> } 20:50 < bridge> 20:50 < ws-client> @milkeeycat i had some malloc thoughts btw 20:50 < bridge> fn main() -> Result<()> { 20:50 < bridge> let dir = determine_root_dir()?; 20:50 < bridge> } 20:50 < bridge> ``` 20:51 < bridge> This is about what I have rn 20:51 < bridge> btw anyhow has afancy assert 20:51 < bridge> `ensure!(user == 0, "only user 0 is allowed");` 20:51 < bridge> No, I why bother? 20:51 < bridge> ok on is_root_dir 20:51 < ws-client> @milkeeycat i am mid run rn but if i dont open an issue remind me to share it i had some epic ideas 20:51 < bridge> ```rust 20:51 < bridge> fn is_root_dir(p: &Path) -> Result<()> { 20:51 < bridge> std::fs::read("wrongpath").context("some context")?; 20:51 < bridge> Ok(()) 20:52 < bridge> } 20:52 < bridge> 20:52 < bridge> ``` 20:52 < bridge> try this 20:52 < bridge> Doesn't that break the chain in `anyhow::Error.chain()`? I mean I can do that, but I can make it justwork myself, wanted to see what the correct way to do it is 20:52 < bridge> nd just call `is_root_dir(check_dir.as_path())?;` 20:52 < bridge> without any match 20:53 < bridge> I love ? 20:53 < bridge> 20:53 < bridge> ? Is op 20:53 < bridge> ```rust 20:53 < bridge> use std::path::{Path, PathBuf}; 20:53 < bridge> 20:53 < bridge> use anyhow::{Result, Context}; 20:53 < bridge> 20:53 < bridge> fn is_root_dir(p: &Path) -> Result<()> { 20:53 < bridge> std::fs::read("wrongpath").context("some context")?; 20:53 < bridge> Ok(()) 20:53 < bridge> } 20:53 < bridge> 20:53 < bridge> fn determine_root_dir() -> Result { 20:53 < bridge> let mut check_dir = std::env::current_exe()?; 20:53 < bridge> check_dir.pop(); 20:53 < bridge> 20:53 < bridge> is_root_dir(check_dir.as_path())?; 20:53 < bridge> Ok(check_dir) 20:53 < bridge> } 20:54 < bridge> 20:54 < bridge> fn main() -> Result<()> { 20:54 < bridge> let dir = determine_root_dir()?; 20:54 < bridge> Ok(()) 20:54 < bridge> } 20:54 < bridge> 20:54 < bridge> ``` 20:54 < bridge> try this 20:54 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395478574454280262/image.png?ex=687a9832&is=687946b2&hm=fc6e5410df0aab2ca282d6e3bb1dfaa93065f77359d3944c24a143176cc7bd81& 20:54 < bridge> Heh that does work 20:54 < bridge> Just so weird 20:54 < bridge> u have to think 20:54 < bridge> to use ? 20:54 < bridge> its what propagates 20:54 < bridge> upwards 20:55 < bridge> ```rust 20:55 < bridge> let meta = match check_path.metadata() { 20:55 < bridge> Ok(m) => m, 20:55 < bridge> Err(e) => return Err(anyhow!(e).context(format!("{:?}", check_path))), 20:55 < bridge> }; 20:55 < bridge> ``` 20:55 < bridge> 20:55 < bridge> now where do I put the ? 😛 20:55 < bridge> easy 20:55 < bridge> Ah, just metadata.context 20:55 < bridge> then a ? at the end 20:55 < bridge> ```rust 20:55 < bridge> let meta = match check_path.metadata() { 20:55 < bridge> Ok(m) => m, 20:55 < bridge> Err(e) => return anyhow!(e).context(format!("{:?}", check_path))?, 20:55 < bridge> }; 20:55 < bridge> ``` 20:55 < bridge> Can I make my server not show up in the server browser? Better still, if possible, in the master, although this is not possible 😄 20:55 < bridge> like this 20:55 < bridge> iirc 20:55 < bridge> ah 20:55 < bridge> u just do 20:55 < bridge> let meta = heck_path.metadata()? 20:56 < bridge> bruv 20:56 < bridge> xd 20:56 < bridge> ```rust 20:56 < bridge> let meta = heck_path.metadata()? 20:56 < bridge> ``` 20:56 < bridge> ```rust 20:56 < bridge> let meta = heck_path.metadata()?; 20:56 < bridge> ``` 20:56 < bridge> No if I do that there is no context 20:56 < bridge> Map err wrap inside anyhow then u can do context 20:56 < bridge> Bcs then it's anyhow err 20:56 < bridge> ```rust 20:56 < bridge> let meta = heck_path.metadata().with_context(|| format!("{:?}", check_path))?; 20:56 < bridge> ``` 20:57 < bridge> Wanna hear something funny, it actually doesn't work, Rust can really take some inspiration from Go to fix this mess 20:57 < bridge> yeah 20:57 < bridge> with this 20:57 < bridge> u get context 20:57 < bridge> u use with_context so u use a function so u dont incur the cost of making the format string 20:57 < bridge> on happy path 20:57 < bridge> with_context is lazy 20:57 < bridge> context is eager 20:57 < bridge> same as unwrap and such 20:57 < bridge> did u try my last snipped 20:58 < bridge> ```rust 20:58 < bridge> let meta = check_path.metadata().with_context(|| format!("{:?}", check_path))?; 20:58 < bridge> ``` 20:58 < bridge> Yep 20:58 < bridge> what doesnt work 20:59 < bridge> All it does is save your time in not having to write 20:59 < bridge> Ok(m) 20:59 < bridge> Err(e) 20:59 < bridge> 20:59 < bridge> It automatically unwraps or converts from .context if error 20:59 < bridge> 20:59 < bridge> So you can just.. remove the Ok Err shenanigans and just do 20:59 < bridge> `let meta = check_path.metadata().context(format!("{:?}", check_path))?;` 20:59 < bridge> 🦆 20:59 < bridge> Damn sorry typing on phone is hard 20:59 < bridge> If I put this right above `let meta...` 20:59 < bridge> `return Err(anyhow!("test").context("some context"));` 20:59 < bridge> 20:59 < bridge> it propagates and prints completely properly 20:59 < bridge> im lost 20:59 < bridge> can u send current code 20:59 < bridge> `let meta = check_path.metadata().with_context(|| format!("{:?}", check_path))?;` 20:59 < bridge> this should work 20:59 < bridge> It should 20:59 < bridge> did u rly try it 21:00 < bridge> isnt it rly rare for metadata to fail 21:00 < bridge> ? 21:00 < bridge> how are u making it fail 21:00 < bridge> it only prints errors if an error happens btw 21:00 < bridge> xd 21:01 < bridge> . 21:01 < bridge> and metadata 99% will succeed 21:01 < bridge> :kek: the silent reminder 21:01 < bridge> If file doesn't exist metadata fails 21:01 < bridge> ```rust 21:01 < bridge> fn is_dir_root(p: &Path) -> Result<()> { 21:01 < bridge> //return Err(anyhow!("test").context("some context")); 21:01 < bridge> let meta = check_path.metadata().with_context(|| format!("{:?}", check_path))?; 21:01 < bridge> } 21:01 < bridge> ``` 21:01 < bridge> Uncomment the first line, I get the test error printed properly with its cause 21:02 < bridge> metadata fails and it prints just the error no context 21:02 < bridge> Eh, isn't it p, not check_path 21:02 < bridge> ```rust 21:02 < bridge> use std::path::{Path, PathBuf}; 21:02 < bridge> 21:02 < bridge> use anyhow::{Context, Result}; 21:02 < bridge> 21:02 < bridge> fn is_dir_root(check_path: &Path) -> Result<()> { 21:02 < bridge> //return Err(anyhow!("test").context("some context")); 21:02 < bridge> let meta = check_path.metadata().with_context(|| format!("{:?}", check_path))?; 21:02 < bridge> Ok(()) 21:02 < bridge> } 21:02 < bridge> 21:02 < bridge> fn main() -> Result<()> { 21:02 < bridge> is_dir_root(Path::new("aaa"))?; 21:02 < bridge> 21:02 < bridge> Ok(()) 21:02 < bridge> } 21:02 < bridge> 21:02 < bridge> ``` 21:02 < bridge> U didn't add Amy 21:02 < bridge> this works form e??? 21:02 < bridge> Any 21:03 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395480814766133348/image.png?ex=687a9a49&is=687948c9&hm=358dabbec09767515a32639f226efe7475675961de199a9da2eb7258cc911a87& 21:03 < bridge> aaa is the context 21:03 < bridge> I do not understand how this works for you but not me 21:03 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395480978105045122/image.png?ex=687a9a6f&is=687948ef&hm=01ccd30abb1091b8b847e97651a4764a43bf79e9f6f6ea7c44b11e7556a8e436& 21:03 < bridge> I'll just push it somewhere and you can tell me what's wrong 21:03 < bridge> i mean 21:03 < bridge> the code u send doesnt compile 21:03 < bridge> after i fix it works xd 21:04 < bridge> . 21:04 < bridge> i think u missunderstanding how format! works? {} will print the path, u are not adding "some context" there 21:04 < bridge> `format!("some context, this is the file: {:?}", check_path)` 21:04 < bridge> OMG i think i know what's wrong with issue #10520 21:04 < bridge> https://github.com/ddnet/ddnet/issues/10520 21:05 < bridge> that's crazy 21:05 < bridge> @learath2 what output u get 21:08 < bridge> Ok, I'm stupid, the error was happening before those functions... 21:08 < bridge> I hadn't added `.context` there yet 21:08 < bridge> Please don't fix this, i want to have another PR 21:08 < bridge> Lol 21:09 < bridge> I need the path as context 21:09 < bridge> Okay, I think context is enough, so I'll keep the `Result<()>` 21:11 < bridge> reminder with_context just takes a FnOnce() instead 21:12 < bridge> Might aswell only format if there is an error, sure I'll make it `with_context` 21:22 < bridge> ```rust 21:22 < bridge> root.join("file").try_exists().map_err(Into::into) 21:22 < bridge> Ok(root.join("file").try_exists()?) 21:22 < bridge> ``` 21:22 < bridge> Which one do you like better? 21:23 < bridge> what’s Into::into accomplishing there? ? should work on std error types 21:23 < bridge> oh, i see 21:23 < bridge> Second 21:23 < bridge> I don't see if anyone replied to you, you can set `sv_register 0` in your configuration to disable master registration 21:24 < bridge> second is definitely convention 21:24 < bridge> Thank you! 21:24 < bridge> https://tenor.com/view/pipotam-baby-hippo-hippo-wash-shower-gif-3406421565683572068 21:24 < bridge> he is so clean.. 21:26 < bridge> ? should call into for errors 21:27 < bridge> ah ye, second obviously 21:32 < bridge> @ryozuki ever used https://docs.rs/snafu/latest/snafu/ ? 21:32 < bridge> Actually pretty cool. Kinda the anyhow for more specific errors 21:34 < bridge> I should use it. Kinda like it looking at it a bit 21:35 < bridge> didnt 22:10 < bridge> okay actually i think i might not be able to fix this 22:10 < bridge> there is so much code to look through 22:25 < bridge> Is every large codebase like this? 22:25 < bridge> I have no idea what i am looking at 90% of the time 22:42 < bridge> i wouldn't say ddnet is a large codebase 22:46 < bridge> ddnet isnt super big, whats nice is a lot of stuff you dont have to worry abt 22:53 < bridge> It takes a while to find your way around the code 22:55 < bridge> It helps to get used to using code search tools, then you can quickly learn what a smaller section of code is doing without needing to understand the whole thing 22:55 < bridge> it is in the popup function, OnEnd incorrectly swaps indexes sometimes 22:55 < bridge> when exactly idk 22:56 < bridge> Okay so basically 22:56 < bridge> You can either type the new index into the popup 22:56 < bridge> Or click and drag your mouse 22:57 < bridge> And when you click and drag it actually does a different thing 22:57 < bridge> does same thing from my testing 22:58 < bridge> at least updates the value same way 22:58 < bridge> Nah, when you type in the new index it swaps the two layers 22:58 < bridge> But when you drag your mouse it kinda just pushes other layers around the layer you're moving 22:59 < bridge> But the history always records a swap 22:59 < bridge> It's hard to explain 23:03 < bridge> can you take a look at the algorithm to confirm or deny my suspicions? xd 23:08 < bridge> For example case 1: 23:08 < bridge> ``` 23:08 < bridge> 0:game 23:08 < bridge> 1:tune 23:08 < bridge> 2:switch 23:08 < bridge> - in the game layer set order by typing 2 and then press enter -> 23:08 < bridge> 0:switch 23:08 < bridge> 1:tune 23:08 < bridge> 2:game 23:08 < bridge> ``` 23:08 < bridge> case 2: 23:08 < bridge> ``` 23:08 < bridge> 0:game 23:08 < bridge> 1:tune 23:08 < bridge> 2:switch 23:08 < bridge> - in the game layer set the order to 2 by dragging your mouse -> 23:09 < bridge> 0:tune 23:09 < bridge> 1:switch 23:09 < bridge> 2:game 23:09 < bridge> ``` 23:09 < bridge> In both cases the action recorded is basically `swap(layer0, layer2)` which is correct in case 1 but not correct in case 2 23:09 < bridge> @kebscs 23:10 < bridge> I might not know how to fix the bug but i feel like i am helpful 🙂 23:13 < bridge> Im not trying to sound like an English professor but shouldn't this have way more references? or at least more repeat citations to your current ones. 23:14 < bridge> 100% especially section 2. I just didn't have more time to mess around with it 23:14 < bridge> One of my critical shortcomings as a person is cutting way too close to deadlines 23:15 < bridge> it registers same thing in history for both of these for kme 23:15 < bridge> it registers same thing in history for both of these for me 23:16 < bridge> The same thing? 23:16 < bridge> press in hoistory 23:16 < bridge> So in both cases the recorded action is correct? 23:17 < bridge> yes 23:17 < bridge> idk when the bug happens 23:17 < bridge> How is that even possible 23:17 < bridge> but when its right it is 23:17 < bridge> if you move game layer idx 0 to idx 2 it should say edit layer 2 in group 1 23:17 < bridge> when the bug happens ids edit layer 0 in group 1 23:17 < bridge> 0 is an old index so undo applies to wrong layer 23:17 < bridge> idk when that happens thoguh, but i suspect OnEnd in the popup function 23:18 < bridge> What 23:18 < bridge> Actually i am confused now 23:19 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395515301361352915/image.png?ex=687aba67&is=687968e7&hm=6f2ca941ce069145bff67b965de179f9204ff650382ce61a54692caeed8e92d4& 23:20 < bridge> if he moved game layer (idx 0) to last place (idx 2) the history should say `Edit layer 2 in group 1 order property` 23:20 < bridge> `Edit layer 0` is wrong, thats the bug 23:20 < bridge> Idk i think it depends which layer you select first 23:21 < bridge> Because you can move layer idx 2 to idx 0 23:21 < bridge> Or idx 0 to idx 2 23:21 < bridge> And it seems to me like the history always just swaps the two layers 23:22 < bridge> idk what exactly the bug is, i would have fixed it if i knew 23:22 < bridge> but this is right 23:23 < bridge> Honestly the message is a bit confusing 23:23 < bridge> But wait 23:24 < bridge> ok 23:24 < bridge> no bug 23:24 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395516488978530374/image.png?ex=687abb82&is=68796a02&hm=4f149cf0f21e1bac4c91c362dfccd43e93c537503cccdf1752ef99f34b332a91& 23:24 < bridge> bug 23:24 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1395516512004997282/image.png?ex=687abb87&is=68796a07&hm=a9ae325e55009b03aa1a3297667d522846a2a7942179ac44b0abbe0faf5f1fd6& 23:24 < bridge> Why would it say `Edit layer 2 in group 1` when layer 1 is being edited? 23:24 < bridge> bcs it takes the index after it got moved 23:24 < bridge> for some reason 23:26 < bridge> Idk 23:27 < bridge> But isn't there an issue with how the layers sometimes swap and sometimes just move to a lower index? 23:27 < bridge> This is really interesting 23:27 < bridge> It's hard for me to test it again at almost midnight 23:28 < bridge> I thought it was literally that 23:57 < bridge> How unpalatable is an encrypted binary blob for client side anticheat? You'd be allowed to not run it if you don't want it. 23:57 < bridge> 23:57 < bridge> I was brainstorming a couple ideas to see if we can have some new anti cheat measures on the client 23:58 < bridge> People do trust us that the binaries we make won't be evil. So is an encrypted blob much worse? Our builds are already not reproducible 23:59 < bridge> I guess the fact that it would be almost impossible to reverse engineer makes them worse, but an anticheat is only works if it's really hard to reverse engineer 23:59 < bridge> I guess the fact that it would be almost impossible to reverse engineer makes them worse, but an anticheat only works if it's really hard to reverse engineer 23:59 < bridge> whats an encrypted blob