15:14 < dav1d> good night md_5 15:14 < nastyCreeper> i'm not pbunny, so you can't prove it unless you fake it well enough 15:14 < dx> i really don't know if i should laugh, help me Stormx2 15:15 < dav1d> y u no work ternary :( 15:15 < dav1d> ret == null ? default_ : ret 15:15 < dav1d> ^ java 15:15 < dx> dav1d: what the fuck does your /ignore have a scripting lang- 15:15 < dx> oh 15:15 < dav1d> dx: mh? 15:15 < dx> nevermind :P 15:15 < dav1d> actually I messed up the syntax 15:15 < dav1d> it's /ignore add :P 15:16 < Stormx2> nastyCreeper, I don't know why you bother hanging out in a channel where you find no value in anyone else's opinion 15:16 < nastyCreeper> Stormx2: i can ask you the same 15:16 < dx> what 15:16 < Stormx2> nastyCreeper, I value many peoples opinions in here 15:16 < nastyCreeper> so do i 15:16 < Stormx2> What are you talking about? This channel taught me minecraft. 15:16 < nastyCreeper> minecraft taught me this channel. 15:16 < Stormx2> That doesn't even make sense.. 15:17 < nastyCreeper> Stormx2: think big endian 15:17 -!- Rudench [shnaw@irc.minecraft.org] has joined #mcdevs 15:17 < Stormx2> nastyCreeper, what? 15:17 < dx> damn that's a nice hostname 15:17 < Stormx2> yeah tis 15:18 < nastyCreeper> not minecraft.net though 15:18 < nastyCreeper> anybody can reg minecraft.* domain 15:18 < dx> anybody lol 15:18 < dx> it's nice because it's hard to get 15:18 < Stormx2> All the minecraft.x tlds went ages ago 15:18 < Stormx2> also, trademarks 15:19 < dav1d> fuck java 15:19 < dx> lol wait 15:19 < Stormx2> /ban dav1d alt of pbunny 15:19 < dx> http://www.minecraft.org/downloads.php#gameclient 15:19 < nastyCreeper> minecraft.org doesn't whois to mojang 15:19 < nastyCreeper> dx: anybody can run such site 15:19 < dav1d> Stormx2: no seariously 15:19 < dx> >What? Minecraft Game Client made by Triddin 15:19 < dx> maximum legitness 15:19 < nastyCreeper> i think Rudench is just a wannabe 15:20 < dx> nastyCreeper: duh 15:20 < Stormx2> dav1d, I have a lot of issues with Java too haha 15:20 < dx> nastyCreeper: it's obvious it's not mojang 15:20 < dav1d> Stormx2: https://gist.github.com/Dav1dde/fc4fc653e3b2bd8a867f 15:20 < dav1d> Stormx2: A extends Object declared in class MyList 15:20 < dav1d> line 35 15:20 < dav1d> wtf? 15:20 < nastyCreeper> "Version 3.0.2 works with Minecraft 0.30" 15:21 < nastyCreeper> Rudench: wtf 15:21 < dav1d> I mean the code isn't exactly the nicest, because I don't care 15:21 < nastyCreeper> what is minecraft 0.30 ? 15:21 < Thinkofdeath> nastyCreeper, Classic 15:21 < jast> I find the best way to hurt freeloader sites like that, chock full with ads and content made mainly by others, is to get as many people as possible to go there and reload the page as often as possible 15:21 <+sadimusi> did I miss something? 15:21 < dx> nastyCreeper: it's a version you can legally use right now 15:22 < jast> that should trigger abuse detection 15:22 < dx> sadimusi: welcome back! 15:22 < dx> jast: "abuse detection"? 15:22 < Stormx2> sadimusi, quite a lot of sadness from nastyCreeper 15:23 < dx> jast: oh you mean, to get the ad companies to check if the site is legit? 15:23 * sadimusi reads backlog 15:23 < nastyCreeper> sadimusi: i am being pbunny by joining after he was banned 15:23 < nastyCreeper> i'm sorry for that 15:24 < dx> okay guys you heard him, pbunny is sorry 15:24 <+sadimusi> nastyCreeper: you are being pbunny by acting like him 15:24 < nastyCreeper> ... 15:24 < dx> he will now promise to pretend to not be pbunny 15:24 < nastyCreeper> ok i'm sorry for acting like him 15:24 < dav1d> lol 15:25 < dx> (btw, did i get the word order right?) 15:25 < dx> or is it "not to be"? 15:26 <+sadimusi> nastyCreeper: remember yesterday when you offered to leave the channel? now would be a good time 15:27 < dav1d> sadimusi: don't forget his other two nicks 15:27 <+sadimusi> what's the newest one? 15:28 < nastyCreeper> sadimusi: if i was pbunny, wouldn't i try to act as differently as i could from him? 15:28 < nastyCreeper> i think he is a smart person and could easily manage to hide his identity 15:28 < dx> lol 15:28 < dav1d> sadimusi: luntik13 15:28 < nastyCreeper> well, stupid people don't generally make servers from scratch 15:29 < dav1d> ^ lol 15:29 < nastyCreeper> i think IQ of at least 100 is required to make a server 15:29 < dx> lol 15:29 < nastyCreeper> and something like 95 to hide own identity from others 15:30 <+Prf_Jakob> nastyCreeper: actually, stupid people do, smart people join another project. 15:30 * dx would like to point out that intelligence is not a linear scale 15:30 < dav1d> Prf_Jakob: that hurts 15:30 -!- mode/#mcdevs [+o sadimusi] by ChanServ 15:30 <+Fador> =( 15:30 -!- mode/#mcdevs [+b *!*@static-71-174-73-11.bstnma.fios.verizon.net] by sadimusi 15:30 -!- nastyCreeper was kicked from #mcdevs by sadimusi [nastyCreeper] 15:30 < dx> rip. 15:30 -!- mode/#mcdevs [-o sadimusi] by sadimusi 15:31 <+Prf_Jakob> dav1d: its not like I didn't start me own project as well :p 15:31 <+Prf_Jakob> my* 15:31 < dav1d> Prf_Jakob: but it was the first out there, wasn't it? 15:31 < dx> the first out there is the mojang one :P 15:31 < jast> let's see how long it takes for more nicks to appear 15:31 <+Prf_Jakob> For D:ish yes, there where some other clients out there 15:31 < dav1d> dx: yeah but you can hardly join it 15:32 < dx> dav1d: hmod / bukkit did something close to that :D 15:32 < dav1d> hehe 15:32 -!- kittiepiggy [~meow@static.87.42.63.178.clients.your-server.de] has joined #mcdevs 15:32 < dx> nyan 15:33 < kittiepiggy> :3 15:33 <+Prf_Jakob> dav1d: to be fair, mineflayer would probably have been the best bet (at the time) 15:33 < dav1d> sadimusi: :( 15:33 <+Prf_Jakob> C++ core with JavaScript engine. 15:33 < dav1d> yeah but "C++" 15:33 <+Prf_Jakob> Qt based. 15:33 <+Prf_Jakob> Right 15:33 < dx> wasn't mineflayer a client? 15:33 <+Prf_Jakob> yes 15:33 < dav1d> dx: yeah 15:33 < dx> i thought we were talking about servers 15:33 < dx> but ok 15:33 < dav1d> dx: na about Prf_Jakobs client 15:34 < dx> oh 15:34 <+Prf_Jakob> dx: both me and dav1d have clients written in D. 15:34 < dav1d> and 15:34 < dav1d> "+Prf_Jakob | nastyCreeper: actually, stupid people do, smart people join another project." 15:34 < dav1d> :) 15:34 < dx> oh okay i get it 15:34 <+Prf_Jakob> dav1d: then again, if I would have been smart I would have not used D, because ugh D's toolchain :-/ 15:34 < dav1d> yeah 15:34 < dx> that was just Prf_Jakob telling dav1d that he's stupid, nothing else 15:34 < dav1d> but D aas language <3 15:34 < dav1d> dx: :D 15:34 < dx> :D 15:35 < dx> but seriously alternate minecraft clients are a rare thing, and D projects are sort of rare too, why aren't you guys working together? 15:36 <+Prf_Jakob> dx: no, that was seriously, targeted at him. Tho to be fair I'm just as stupid. 15:36 < dx> (or at least i hope you steal code from each other) 15:36 <+Prf_Jakob> dx: where him != dav1d :) 15:37 < dx> Prf_Jakob: hah you confused me for a second 15:37 < dav1d> dx: well back in the time I started (I didn't even knew about his project the first month?) his project was D1 (the old "version" of D), also I made my client to learn OpenGL, but Prf_Jakob has already a complete engine, so nothing to do with opengl 15:37 < dav1d> dx: well stealing from Prf_Jakob is hard :P 15:37 < dx> :( 15:38 < dav1d> he is the no dependency, low language feauture guy, where I am the I don't care about dependencies too much and give me all the new feautures I can get guy 15:39 < dx> sounds like Prf_Jakob does more work and his work is easier to steal... also sounds like he wouldn't like that 15:39 <+Prf_Jakob> I don't mind 15:39 <+Prf_Jakob> The no dependency thing is because its a PITA to pack it all up and releases it. 15:40 <+Prf_Jakob> release it* 15:40 < dav1d> yeah 15:40 < dav1d> the next difference, his project is actually useable :P 15:40 <+Prf_Jakob> http://charged-miners.com/ 15:40 <+Prf_Jakob> if you are wondering 15:40 <+Prf_Jakob> but its classic only 15:40 < dx> ooh 15:40 < dav1d> dx: I tried stealing from him, but meh, the code is too minimalistic for me :P 15:41 -!- Exio [~x@trekweb/user/nax] has quit [Quit: bbl] 15:41 < dx> "i didn't steal the code because it wasn't bloated enough" 15:41 < dav1d> haha 15:42 < dx> Prf_Jakob: the first thing i thought was "why restrict it to minecraft classic?" 15:43 < dx> implementing minecraft modern is complex for everybody but if you got that far you could just make a different game with your own server 15:43 < dav1d> dx: I think networking is implemented until beta 1.8, I was thinking of donating my networking code to it at some point, never did though 15:45 < dx> i never saw networking as a problem, but connecting to modern servers with classic features gives you a sort of disappointing feature set IMO 15:46 < dx> unavoidable at early stages and not bad if you have a lot of time to work on it, but... 15:46 < dav1d> oh I think that wouldn't be that much of a problem, charged looks like a pretty grown engine 15:46 < dav1d> huge part would be https://github.com/Dav1dde/BraLa/tree/master/brala/dine/builder/vertices_ 15:46 < dav1d> :P 15:46 < dav1d> implementing all these stinking blocks with the correct textures 15:46 < dx> ..lol 15:47 < dx> yeah i guess 15:47 < dav1d> most of that code is magic 15:47 < dav1d> magic and 1k lines of glue 15:47 < dav1d> (../builder.d) 15:47 <+Prf_Jakob> yeah there is a lot of magic in CM's builder.d as well 15:48 < dx> what's a builder.d? 15:49 < dav1d> dx: my builder.d places all the vertices inside a buffer, which then is uploaded to opengl 15:49 < dav1d> ready to be rendered 15:49 <+Prf_Jakob> ditto 15:49 < dx> heh 15:50 <+Prf_Jakob> https://github.com/Charged/Miners/blob/master/src/miners/builder/classic.d <-- here is the code for classic. 15:50 < dx> i was thinking it'd be something common in the .d language 15:50 -!- unnicked432 [~50e8f3d5@204.155.152.124] has joined #mcdevs 15:53 < dav1d> sadimusi: ... 15:54 < dav1d> lol 15:54 -!- xy [xy@unaffiliated/xy] has quit [Quit: bye] 15:55 < dav1d> We have to implement a queue for university, I wonder what they would say to my queue: https://github.com/Dav1dde/BraLa/blob/master/brala/utils/queue.d#L16 15:57 < dx> er.. 15:57 < dx> dav1d: what do you expect? 15:57 -!- Paprikachu [~Paprikach@80.120.175.113] has quit [Remote host closed the connection] 15:57 < dav1d> dx: would be interesting if they would even understand what's going on 15:58 < dx> dav1d: ...lol 15:58 < dav1d> our programming course is really really bad 15:58 < dx> okay i get it 15:58 < dav1d> they might be really good mathematicans 15:58 < dav1d> but it feels like they never programmed before 15:58 < dav1d> (at least in java) 15:58 < dx> i was reading the code and it seemed like a normal queue to me 15:59 < dx> *normal multithreaded queue 15:59 < dav1d> dx: yeah it is, with some (imo) nifty threading/lock techniques (definitly spelled incorrectly) 15:59 < dx> yes, it's spelt "definitely" 15:59 < dav1d> haha 16:00 < dx> also, unit tests as a language feature! that's cool 16:01 < dav1d> you can't do much with them, but they are extremly useful, never thought they would be so great 16:01 < dav1d> (if you've ever seen py.test etc.) 16:01 -!- kittiepiggy [~meow@static.87.42.63.178.clients.your-server.de] has quit [Ping timeout: 256 seconds] 16:01 < dx> cool mostly because they consider that, but i bet some people reinvent that wheel to have more flexibility or a different api 16:02 < dav1d> they covered my ass several times already 16:03 -!- Paprikachu [~Paprikach@80.120.175.113] has joined #mcdevs 16:03 <+Prf_Jakob> covered? 16:04 < dav1d> oh 16:04 < dav1d> this was definitly the wrong word 16:05 < dav1d> saved 16:05 < dx> definitely 16:05 < dav1d> gah again :( 16:05 < dx> :D 16:05 < dav1d> *definitely 16:05 * dav1d goes to write definitely 100 times 16:05 <+Prf_Jakob> haha 16:06 <+Prf_Jakob> German word for saved, is the same as the german word for cover(ed)? 16:06 < jast> no 16:06 < dx> actually 'covered' confused me, it sounded wrong and acceptable at the same time, but all i could think was that dav1d was butt naked several times 16:06 <+Prf_Jakob> hehe 16:06 < dav1d> no 16:07 < dx> dav1d: it's okay to be naked as long as it's not in public 16:07 < dav1d> I tend to pick the wrong english words 16:07 <+Prf_Jakob> In Swedish the word for unsure is the same as unsecure. 16:07 <+Prf_Jakob> tend to get that wrong :) 16:07 < dav1d> Prf_Jakob: same in german :) 16:07 < jast> insecure? :) 16:07 < jast> insecure is two things 16:07 < dx> google tells me that unsecure exists too 16:08 < jast> it has both meanings, too, sort of 16:08 < dx> http://english.stackexchange.com/questions/19653/insecure-or-unsecure-when-dealing-with-security 16:08 < dav1d> not in dict.cc 16:08 < dx> of course insecure is much more common 16:08 < dav1d> http://www.dict.cc/?s=unsecure 16:08 -!- Yoshi2 [~chatzilla@xdsl-78-35-215-53.netcologne.de] has joined #mcdevs 16:08 < jast> unsecured is a word, unsecure isn't 16:08 < jast> IMO 16:09 < dx> oh, good point, that link i posted doesn't mention "unsecure" either 16:09 < dx> it's unsecured 16:09 < jast> and insecure can mean both 'not sure' as well as 'not secured' 16:09 < jast> and a host of other things :) 16:10 < jast> it's a bit more specific than 'not sure', though 16:10 < dx> yeah, 'not sure' is 'lighter' 16:13 <+sadimusi> lol @ #minecraft 16:13 < dx> i'm not there, what happened? 16:13 <+sadimusi> [4:10pm] nastyCreeper: hi, i just came to tell you sadimusi from #mcdevs is stupid piece of shit, bans people for nothing and then asks them for account details in pm 16:13 < dx> lol 16:14 < dx> i like how ambiguous 'account details' is 16:14 < jast> in freenode? 16:14 < dx> there's a #minecraft here 16:14 < jast> shouldn't that be ##minecraft, then? :} 16:15 < dx> hmm 16:15 < jast> (bless freenode's idea of sanity) 16:15 < dx> i think it's owned by the moderators of reddit's /r/minecraft, that's almost official :D 16:15 < jast> ... except not at all 16:15 < dx> yeah i know 16:17 -!- Not-003 [~notifico@198.199.82.216] has quit [Remote host closed the connection] 16:17 <+pdelvo> i won't be satisfied in this life until seeing sadimusi burning in hell for eternity 16:17 <+pdelvo> :o 16:17 < dx> i think he's a bit angry 16:18 < dx> TkTech sadimusi: btw, the chanserv +o list has a bunch of people who aren't here anymore, refill that please 16:18 < jast> so he wants to wait for eternity until he will be satisfied in this life 16:18 < jast> makes sense 16:19 -!- xy [xy@unaffiliated/xy] has joined #mcdevs 16:20 < dav1d> sadimusi: lol 16:20 < dav1d> jast: it should me ##minecraft but freenode staff is ok with #minecraft 16:37 -!- dola [~dola@77-57-175-131.dclient.hispeed.ch] has quit [Quit: ZNC - http://znc.in] 16:38 -!- dola [~dola@77-57-175-131.dclient.hispeed.ch] has joined #mcdevs 16:52 -!- kahrl [~kahrl@p5B338A92.dip0.t-ipconnect.de] has joined #mcdevs 17:00 -!- Jckf [~jckf@2001:470:27:155::2] has quit [Ping timeout: 240 seconds] 17:00 -!- Jckf [~jckf@2001:470:27:155::2] has joined #mcdevs 17:01 -!- KolakCC [~KolakCC@unaffiliated/kolakcc] has joined #mcdevs 17:05 -!- |Blaze| [~scott@S01060002b3983ca3.ed.shawcable.net] has quit [Remote host closed the connection] 17:24 -!- dexter0 [~dexter0@c-24-23-138-192.hsd1.ca.comcast.net] has quit [Quit: exit(0);] 17:28 < Stormx2> i think he is a smart person and could easily manage to hide his identity 17:29 < Stormx2> hahahahaha 17:29 < dav1d> Stormx2: well unnicked432 is the next pbunny 17:29 < AnotherOne> Effect position X int 250 effect X multiplied by 8 17:30 < AnotherOne> why multiplied by 8? 17:30 < AnotherOne> (from http://www.wiki.vg/Protocol#Named_Sound_Effect_.280x3E.29) 17:30 -!- KolakCC [~KolakCC@unaffiliated/kolakcc] has left #mcdevs [] 17:31 <+pdelvo> to increase the precission 17:31 < Stormx2> AnotherOne, gives you granularity to 1/8th of a block 17:32 -!- SuinDraw [~NiaTeppel@WiseOS/Founder/NiaTeppelin] has joined #mcdevs 17:32 < AnotherOne> but why no double? 17:32 < dav1d> what if the position (x) is: int.max/8+1 17:32 -!- Paprikachu [~Paprikach@80.120.175.113] has quit [Remote host closed the connection] 17:33 < AnotherOne> :D 17:33 < dav1d> AnotherOne: double would be twice the size, but float would work, but that is too accurate, you don't need it that accurate 17:34 -!- SuinDraw [~NiaTeppel@WiseOS/Founder/NiaTeppelin] has quit [Read error: Connection reset by peer] 17:34 < AnotherOne> damnit dav1d 17:34 < unnicked432> ? 17:34 < AnotherOne> you made me want to check what happens 17:34 < unnicked432> dav1d: ? 17:34 < dav1d> AnotherOne: mh? 17:34 < dav1d> AnotherOne: I made you check how a float works? 17:35 < AnotherOne> what if the position (x) is: int.max/8+1 17:35 < unnicked432> dav1d: what do you want from me? 17:35 < dav1d> AnotherOne: oh this will overflow into the negative 17:35 < Stormx2> unnicked432, I want your nuanced critique of java plzkthx 17:35 < AnotherOne> i know 17:35 < unnicked432> Stormx2: what is wrong with java? 17:35 < unnicked432> i think java is the best language available 17:36 < unnicked432> java gave birth to minecraft 17:36 < Stormx2> hahahahahaha 17:36 < dav1d> AnotherOne: oh I understand now :) 17:36 < Stormx2> too far in the other direction 17:36 < unnicked432> ? 17:36 < Stormx2> good effort though 17:36 < dav1d> AnotherOne: at a certain distance (away from 0,0) minecraft will fail anyways 17:36 < AnotherOne> farlands 17:36 < unnicked432> Stormx2: what language do you use? 17:36 < dav1d> sethbling made such a video once 17:36 < AnotherOne> lovely broken farlands 17:36 < dav1d> I think it was at 300k 17:36 < dav1d> or 30k, can't quite remember 17:37 < AnotherOne> i was there 17:37 < AnotherOne> on 1.5.2 17:37 < dav1d> legit? 17:37 < AnotherOne> no beautiful mountains 17:37 < AnotherOne> just dirt under the ocean 17:38 < AnotherOne> and local server dies in 30 seconds 17:39 -!- SuinDraw [~NiaTeppel@WiseOS/Founder/NiaTeppelin] has joined #mcdevs 17:39 < AnotherOne> it was at x 30 000 000 17:39 < AnotherOne> so let's count 17:40 < AnotherOne> int_max / 8 is 268 435 455,875 17:40 < AnotherOne> so we cant check what happens with sound 17:41 -!- redu [~redu@31.185.255.248] has joined #mcdevs 17:41 < AnotherOne> but what if i teleport to x 29 999 999 in nether and dive out with portal? 17:43 < Yoshi2> some very fun stuff could happen 17:43 < AnotherOne> server crash? 17:44 < Yoshi2> maybe, I don't know 17:44 < Thinkofdeath> Well just tping to 29,999,999 in the nether causes mc to freeze for me 17:45 < jast> magick! 17:45 -!- dexter0 [~dexter0@c-24-23-138-192.hsd1.ca.comcast.net] has joined #mcdevs 17:46 < Thinkofdeath> java.lang.ArithmeticException: / by zero on tping to NaN though 17:49 < AnotherOne> can you help me with my problem? i am trying to login to some offline mode server and i get lots of nicknames and end of stream after receiving 0x0D 17:49 < AnotherOne> is it because i read too slow? 17:49 < dav1d> you can't read to slow 17:50 < AnotherOne> respond too slow? 17:50 < dav1d> no 17:50 < AnotherOne> so why end of stream? 17:50 < dav1d> well you can read too slow, but that has to be really slow then 17:51 < dav1d> AnotherOne: what does the minecraft server say? 17:51 < dx> what happened with the guy who wanted to connect to a server using putty? 17:51 < AnotherOne> i dont know 17:51 < jast> bah. putty is telnet for noobs. 17:51 < AnotherOne> it is not my server 17:51 < jast> real experts use socat 17:52 < dx> jast: using the word 'noob' for this use case is an understatement 17:52 < jast> or an ethernet cable, a power source, a few buttons and quick fingers 17:52 < Yoshi2> real men use IE6 to remote control their PCs from a toaster 17:52 < jast> if you use IE6 you can't possibly be real 17:53 < dx> butterflies suck 17:53 < jast> that hasn't been my experience. seems like their expertise focuses on flying 17:55 < dx> HOLY SHIT GUYS THERE'S A SNAPSHOT 17:56 -!- Calinou [~Calinou@unaffiliated/calinou] has joined #mcdevs 17:56 < AnotherOne> so what should i do? 17:56 < dx> i haven't messed with decompiled snapshots before, but i really want to take a look at the new internal chat system 17:57 < dav1d> AnotherOne: launch your own server, connect to it, look what it spits out 17:58 < AnotherOne> it's ok eith my own server 17:58 < AnotherOne> with* 17:58 < AnotherOne> do i need to launch bukkit server with couple of thousands of registered users? 18:01 < dx> doesn't sound practical but if you buy a few thousand accounts mojang would appreciate it 18:01 < dav1d> not bukkit vanilla 18:01 < dav1d> you should always test against vanilla 18:01 < AnotherOne> heh:) 18:01 < dav1d> that's the reference implementation not bukkit 18:01 < AnotherOne> i've tried another bukkit server 18:02 < AnotherOne> without that stupid transmission of all nicks 18:02 < AnotherOne> and it is ok 18:02 < AnotherOne> so that was some kind of timeout 18:02 < dav1d> yeah that's the reason why you should test against vanilla, then if everything works on vanilla think about bukkit and maybe some plugins 18:03 < dav1d> every plugin might change stuff 18:03 -!- unnicked432 [~50e8f3d5@204.155.152.124] has quit [Quit: .] 18:04 < AnotherOne> can you help me with send/receive architecture? 18:04 < AnotherOne> i have a thread that listens to socket and puts all data into the stream buffer 18:04 < AnotherOne> how can i determine there are enough data to process next message? 18:05 < dav1d> I would let the thread also spit out packets 18:05 < dav1d> *also parse the packets 18:05 < dav1d> AnotherOne: let the thread parse the packets 18:05 < dav1d> .read(n) will wait until n bytes are read from the stream 18:06 < AnotherOne> so should i combine reading and parsing? 18:06 < dav1d> yes 18:06 < dav1d> what language are you using? 18:06 < AnotherOne> C++ 18:07 < dav1d> then C++ classes should work 18:07 < dav1d> (as packets) 18:07 < AnotherOne> they do 18:07 < dav1d> yeah :) 18:07 < AnotherOne> but i did want to separate reading from parsing 18:07 < dav1d> give them a virtual function which returns the packet id, then you can dynmaically cast 18:07 < dav1d> why? 18:07 < AnotherOne> fukken modularity 18:07 < dav1d> no 18:08 < dav1d> read a byte, dispatch the byte to the correct packet class, packet.read!() 18:08 < AnotherOne> so i can use parser library without binding to specified network library 18:08 -!- dexter0 [~dexter0@c-24-23-138-192.hsd1.ca.comcast.net] has quit [Quit: exit(0);] 18:08 < dav1d> AnotherOne: this overcomplicates things 18:09 < dav1d> you're probably already using threads because you want to have your logic concurrently 18:09 < dav1d> which means, you means you want only to react to complete packets not to a few bytes 18:10 < AnotherOne> yes 18:10 < dav1d> so parsing packets in the connection thread makes sense 18:10 < dav1d> if you use an intermediate buffer where you append the read data (assuming socket.read()) 18:10 < dav1d> only makes things harder, instead of passing the socket object to the packet parsing function 18:11 < dav1d> which then can call socket.read(EXACT_AMOUNT_OF_BYTES_I_NEED) 18:11 < dav1d> since this will block, until exactly that amount of bytes was read 18:11 < AnotherOne> there is a little problem 18:11 < AnotherOne> i don't always know how many bytes do i need 18:12 <+pdelvo> you know how many you need for the next part of a packet 18:12 < AnotherOne> hmm 18:12 -!- Yoshi2 [~chatzilla@xdsl-78-35-215-53.netcologne.de] has quit [Quit: ChatZilla 0.9.90 [Firefox 21.0/20130511120803]] 18:12 < AnotherOne> i can check if stream buffer empty on every part read 18:12 < dav1d> AnotherOne: yeah, only read when you need it 18:13 < dav1d> AnotherOne: you also would need to check the size 18:13 < dav1d> well, that's basically implicit if size >= needed_size 18:13 < dav1d> but what if it doesn't match? 18:13 < dav1d> you need to wait 18:13 < dav1d> so you need some mechanism to wait, or call on the buffer again 18:14 < dav1d> but the socketobject itself works perfectly fine as such buffer already 18:14 < AnotherOne> yes 18:14 < dav1d> doing it like this works really good for me 18:15 < AnotherOne> lang? 18:15 < AnotherOne> c# iirc 18:15 < dav1d> no 18:15 < dav1d> D 18:15 <+pdelvo> one note above 18:16 < AnotherOne> oh yes 18:17 -!- dexter0 [~dexter0@c-24-23-138-192.hsd1.ca.comcast.net] has joined #mcdevs 18:17 -!- Yoshi2 [~chatzilla@xdsl-78-35-215-53.netcologne.de] has joined #mcdevs 18:17 < AnotherOne> and you told bad things about me when i told bad things about d 18:17 < dav1d> AnotherOne: well, I simply hate it if people talk about something they don't know about 18:17 < dav1d> and act as they would know everything 18:18 < dav1d> but yeah I probably overreacted, sorry 'bout that 18:18 < AnotherOne> np:) 18:19 < AnotherOne> what if i make class wrapper for socket? 18:20 < dav1d> makes things easier 18:20 < dav1d> I made myself a helper: read!int(socket) – read!Chunk(socket) 18:20 < AnotherOne> and by changing that class i can achieve my beloved modularity 18:20 < AnotherOne> what is ! in D? 18:21 < dav1d> which reads anything from a socket (where ! indicates D templates), if it's a primitive type then it calls, socket.read(_x_) if not type.read(socket) 18:21 < dav1d> AnotherOne: templates 18:21 < dav1d> https://github.com/Dav1dde/BraLa/blob/master/brala/network/util.d#L66 18:22 < dav1d> probably hard to read if you haven't seen D before 18:22 <+pdelvo> like generics? 18:22 < dav1d> ah yeah and it allows things like: read!(int, Chunk, short, byte, EntityMetadata)(socket) 18:22 < eddyb> no, generics are like templates :P 18:23 < dav1d> which is pretty neat 18:23 < eddyb> I'd like C++ <> better 18:23 < eddyb> read(socket) 18:23 < dav1d> also: read!(int[])(socket) 18:23 < dav1d> for arrays a short is automatically read as length 18:23 < eddyb> ! and parens is too confusing 18:23 < dav1d> eddyb: ? 18:23 < dav1d> foo(T)(T x) 18:23 < dav1d> that's the definition 18:24 < dav1d> ! only indicates the compile time part 18:24 < eddyb> even worse, templates using function call syntax 18:24 < dav1d> oh I see your example now 18:24 < dav1d> eddyb: well, ever dealt with nested templates or more complex stuff? 18:25 < dav1d> gets unreadable pretty fast in C++ 18:25 < dav1d> especially <<..> > 18:25 < eddyb> like F<5, G> ? 18:25 < eddyb> << isn't valid 18:25 < dav1d> eddyb: wouldn't that error 18:25 < dav1d> either in VS or in g++ this errors 18:25 < eddyb> it's fine in C++11 and a bit earlier, too 18:25 < dx> uh, guys, is it just me or b.wiki.vg lets you diff against 1.5.2 but that version isn't an option in the dropdowns? 18:25 < eddyb> it only errors if the compiler is using crappy old parsers 18:25 < dav1d> ah so they changed that 18:26 < dav1d> good to hear 18:26 < eddyb> it's a compiler error, not part of the specs :P 18:26 < dav1d> eddyb: https://github.com/Dav1dde/BraLa/blob/master/brala/network/packets/util.d#L24 :D 18:26 < dav1d> yes I overdid it there 18:26 < dav1d> but I'd like to see the C++ solution :P 18:26 < AnotherOne> hey people, what about swapping byteorder on generic size object? 18:27 < eddyb> no 18:27 < AnotherOne> other that std::reverse 18:27 < dav1d> AnotherOne: htons and friends? 18:27 < eddyb> "swapping byteorder" is only done for u16, u32 and u64 18:27 < AnotherOne> and for floats and doubles 18:28 < eddyb> AnotherOne: those are u32 and u64 in memory 18:28 < AnotherOne> i know 18:28 < AnotherOne> that sweet cast magic 18:28 < dav1d> so it makes no difference :) 18:28 < eddyb> so just reinterpret_cast or pointer cast in C 18:29 < eddyb> dav1d: like, >> requires some context in the parser and a separate tokenizer (like in the old lex/yacc parsers) makes it very hard 18:30 < eddyb> wtf I'm not seeing the semantics in that get_packets_mixin 18:30 < eddyb> Rust makes more sense with this stuff 18:30 < dav1d> eddyb: haha yeah 18:30 < dav1d> as I said, I overdid it 18:31 < dav1d> basically puts every Packet class it finds inside a tuple as type 18:31 < dav1d> parse_packet takes an arbitrary id and returns a parsed packet 18:31 < dav1d> (id has to be known at compile time) 18:32 < dav1d> but that is not a big deal, you can generate switch..case at compiletime, too 18:32 < eddyb> does D have ADTs? 18:32 < dav1d> so my parsing is then done in ~6 lines 18:32 < dav1d> eddyb: adt? 18:32 -!- Paprikachu [~Paprikach@178.112.23.181.wireless.dyn.drei.com] has joined #mcdevs 18:33 < eddyb> dav1d: like tagged unions, a central data structure in Haskell and friends 18:33 < eddyb> Rust has them in a form of parametrized enums 18:33 < dav1d> eddyb: tagged union, kinda 18:33 < dav1d> sbut library solutions 18:34 < eddyb> no, this is syntax-level 18:34 < dav1d> http://dlang.org/phobos/std_variant.html#.Algebraic and http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/ 18:34 < eddyb> enum Option { Something(T), None }; // something like that 18:34 < dav1d> ah yeah 18:34 < dav1d> enum Option : T { } 18:34 < eddyb> "Currently, Algebraic does not allow recursive data types. They will be allowed in a future iteration of the implementation." pffft :P 18:34 < dav1d> enum Option : T { X = T(blub) } 18:35 < eddyb> no 18:35 < eddyb> that's almost like C++11, ADTs are different 18:35 < dav1d> then I don't understand 18:35 < dav1d> enum or union? 18:36 < eddyb> enum Tree {Node(Tree, Tree), Leaf(T)} 18:36 < AnotherOne> hey dav1d 18:36 < AnotherOne> why D? 18:36 < eddyb> dav1d: an enum in Rust is an ADT if you have parameters to the variants 18:37 < dav1d> AnotherOne: I find C++ a pain and D less pain, also a GC (yeah I am a sissy), for performance critical code I can still use malloc and friends though. Coding in D is more productive and less pain (personal experience) 18:37 < dav1d> eddyb: any examples? 18:37 < eddyb> the one I just gave up D:? 18:37 < eddyb> that's a binary tree 18:37 < jast> Rust is _really_ interesting 18:37 < dav1d> eddyb: I skipped that :P 18:37 < AnotherOne> less pain you say 18:37 < dav1d> eddyb: so basically a struct? 18:37 < eddyb> maybe I need a None variant, just in case 18:38 < AnotherOne> are you about butthurt?;) 18:38 < eddyb> dav1d: tagged union 18:38 < dav1d> eddyb: I think we think of different things when we hear tagged union 18:39 < dav1d> AnotherOne: well if you enjoy coding in C++, go ahead, I find D an improvement in every way (except stability, which has improved quite a lot though) 18:39 < eddyb> struct { int tag; union {struct variantA{int;float;}; struct variantB{double;double;};};}; 18:39 < eddyb> but in C/C++ you have to manually manage it 18:40 -!- act4 [~alex@dhcp-129-234-83-199.tr.esol.dur.ac.uk] has joined #mcdevs 18:40 < dav1d> eddyb: well in D I can also put an arbitrary type in a union? 18:40 < dav1d> also http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/ 18:40 < dav1d> ^ what I understand as tagged union 18:40 -!- xy [xy@unaffiliated/xy] has quit [Read error: Connection reset by peer] 18:40 < eddyb> yes 18:41 < eddyb> except much easier to manage 18:41 < dav1d> eddyb: you can dynamically build that at compile time (as shown in the example) but it's not builtin into the language 18:41 -!- act4 [~alex@dhcp-129-234-83-199.tr.esol.dur.ac.uk] has quit [Client Quit] 18:41 < eddyb> even in D it's heavier than in Rust 18:42 < AnotherOne> oh damn 18:42 < AnotherOne> now everyone tries to make a language better than C++ 18:42 < AnotherOne> but... 18:42 < AnotherOne> we have java 18:42 < dav1d> eddyb: yes? of course it's a library thing and not language supported 18:42 < eddyb> java isn't the best thing either 18:42 < AnotherOne> and c# 18:42 < eddyb> dav1d: in Rust they're compile-time safe 18:43 < AnotherOne> but i like c# 18:43 < AnotherOne> though it is a bastard too 18:43 < dav1d> then use it? 18:43 < dav1d> use what ever you prefer most 18:43 < AnotherOne> is mono ok now? 18:43 < dav1d> just don't think the language you use is the best, because it probably isn't (depends on the job) 18:43 < AnotherOne> what about linux c#? 18:43 < dav1d> mono is amazing, from what I've heared 18:43 < AnotherOne> i don't 18:43 -!- xy [xy@unaffiliated/xy] has joined #mcdevs 18:44 < AnotherOne> there is a russian expression, literally "golden middle", idk is there english variant 18:44 < eddyb> dav1d: something like this: def depthFirst(tree : Tree, fn : (Tree) -> void) -> void {match(tree) {Leaf(x) => fn(x); Node(left, right) => depthFirst(left), depthFirst(right)}} 18:45 <+pdelvo> the most parts are good, but there are some I dont like about mono 18:45 < eddyb> dav1d: there's zero chance of pointer-related failures 18:45 < AnotherOne> and it is c++: not too low-level and not too high-level 18:45 -!- act4 [~alex@dhcp-129-234-83-199.tr.esol.dur.ac.uk] has joined #mcdevs 18:45 <+pdelvo> there are some methods which are present in mono, but with a slightly different signature, so you have to compile 2 times :( 18:45 < dav1d> eddyb: type can't be known at compiletime 18:46 < dav1d> it has to be dispatched at runtime 18:46 < eddyb> the tag? 18:46 < dav1d> otherwise you wouldn't need a union 18:46 < eddyb> yepp, but Rust enforces safe ADT-using code 18:46 < eddyb> it doesn't have nullable pointers, so it has an Option ADT for that 18:47 < eddyb> you will never be able to use a "null" Option as a pointer 18:47 < dav1d> at runtime enforced? 18:47 < eddyb> nope 18:47 < dav1d> well then I can still null it 18:48 < eddyb> that's the best part, you can't 18:48 < dav1d> there are no casts? 18:48 < dav1d> there is always a way to break the typesystem :P 18:48 < eddyb> it's a safe language, so no 18:48 < dav1d> yeah well then probably not 18:48 < eddyb> only safe inheritance casts 18:48 < dav1d> (tbh I like beeing able to null instances) 18:49 < dav1d> eddyb: they can fail, too 18:49 < dav1d> downcasting? 18:49 < eddyb> (and integer/float value casts, of course) 18:49 < eddyb> dav1d: can't remember the details, but anything that can break safety just doesn't exist 18:49 < dav1d> eddyb: downcasts can fail 18:50 < eddyb> then it's either not in Rust, it returns an Option or it has an explicit failure detecting mechanism 18:50 < dav1d> C inherits from B, B inherits from A and D inherits from A, now I want to downcast A, to C or to D? 18:50 < dav1d> eddyb: ^ 18:50 <+clonejo> eddyb: Does Rust have supervision trees? 18:50 -!- AlphaBlend1 is now known as AlphaBlend 18:50 < eddyb> clonejo: is it wrong that I haven never heard of that concept before? 18:51 < dav1d> eddyb: I think that's an erlang thing with its processes 18:51 <+clonejo> eddyb: no, it's an Erlang feature 18:51 < eddyb> dav1d: C to D is just compile-time invalid 18:51 < dav1d> eddyb: no 18:52 < eddyb> since C doesn't inherit from D and D doesn't inherit from C 18:52 <+clonejo> Supervision trees are the things that make Erlang software hard to crash completely. 18:52 < dav1d> eddyb: I have an instance of A, but I don't know if it is an instance of C or D 18:52 < eddyb> dav1d: ah, that's better 18:52 < dav1d> eddyb: how can the compiler know this, it can't 18:52 < eddyb> as I said, pick one of those tree options 18:52 < eddyb> let me search for it, actually 18:52 < dav1d> eddyb: he, if it allows casting, then the result will be null, which breaks your non-nullable types 18:53 < eddyb> "result will be null" that's impossible 18:53 < dav1d> except you don't allow the result assigned to a non-nullable 18:53 < dav1d> eddyb: of course 18:53 < dav1d> eddyb: what would you expect a failing downcast to return? 18:53 < eddyb> as I said, it either returns a Option or you have to handle an explicit fail case (or it's like an if statement) 18:53 < dav1d> other than invalid state 18:54 < eddyb> with an Option you'd still have to handle the failure cast, but it's more generic 18:55 < dav1d> well tbh I don't really care too much 18:55 < eddyb> so far I see you can cast to traits, but that couldn't fail anyways 18:55 < dav1d> btw I think I've seen that tagged unions thing on reddit 18:55 < eddyb> oh, I know where I've seen !() before 18:55 < eddyb> macros in Rust 18:58 < eddyb> "No, casts from an interface to a particular type (I call them downcasts, but you seem to call them upcasts) are not possible in Rust. The article mentions this in that Rust has no equivalent of Go's type assertion. You need to use an 'enum' type in Rust if you want that sort of functionality." 18:58 < eddyb> dav1d: I hope that answers your question :) 18:59 < dav1d> interesting approach 18:59 < eddyb> the enum type is one of those ADTs 18:59 < dav1d> so you can only cast with a union 18:59 < dav1d> which is supposed to be safe 18:59 < dav1d> (and probably is) 19:00 < eddyb> I was thinking of packet parsing, and with some macros, it could be nice in Rust. sadly there's no variadic generics yet, those could be helpful at some point 19:01 < eddyb> enum Packet { Packet00(Packet00_data), ...} (just to get named fields) 19:02 < eddyb> anyway, I wanted to work on something completely different, got stuck in IRC land again :( 19:02 < dav1d> same here 19:02 < dav1d> xD 19:03 < AnotherOne> lol 19:03 < AnotherOne> same, fukken same 19:03 < AnotherOne> but i'm trying to make that sockwt wrapper 19:03 < eddyb> AnotherOne: and to answer your question, C++ is pretty good, but only if you're good at it 19:03 < AnotherOne> sure 19:04 < eddyb> I've written a class at some point that made it trivial to work with JS values (from v8) in bindings code 19:04 < AnotherOne> but it does not mean kiddies must have access to programming 19:04 -!- Yoshi2 [~chatzilla@xdsl-78-35-215-53.netcologne.de] has quit [Quit: ChatZilla 0.9.90 [Firefox 21.0/20130511120803]] 19:04 < eddyb> AnotherOne: it's quite the opposite 19:05 < eddyb> with some polishing, Rust is better to teach good coding styles and concepts 19:05 < eddyb> should I mention that I don't think I've ever seen a program written by one of my classmates for a CS problem, that isn't trivially exploitable? 19:06 < dav1d> university teaches you that every input is sane 19:06 < dav1d> except the few cases they state what error you have to expect 19:08 < eddyb> good thing I know how to break a program *before* going to uni :P 19:09 < eddyb> and the project I'm working on (if I ever finish it... wasting time like this isn't going to help at all :() could make large code bases (or even large obscure binaries) easier to scan for vulns 19:09 < AnotherOne> looks like i'm falling into sin of OOP 19:10 < eddyb> OOP isn't a sin as long as you don't end up writing Java code in C++ 19:10 < AnotherOne> :D 19:10 < AnotherOne> too many OOP is a sin 19:11 < eddyb> there's this GPS app someone asked to RE, and I'm seeing statically allocated factories (with strings telling me what they're for) to build classes, or other factories 19:11 < eddyb> not sure what the hell they were thinking 19:12 < AnotherOne> thank you padre 19:12 < AnotherOne> i'm feeling better 19:19 -!- luntik13 [~Sashka@m77-219-23-197.cust.tele2.lv] has joined #mcdevs 19:19 < luntik13> hai 19:21 < luntik13> why is minecraft coded in java? 19:21 < AnotherOne> hi 19:21 < AnotherOne> because Notch 19:21 < luntik13> why is Notch? 19:21 <+clonejo> luntik13: Ask his parents 19:22 < luntik13> lol 19:22 < luntik13> btw 19:22 < dav1d> eddyb: enjoy university 19:22 < luntik13> any way to speak with notch directly? 19:22 < dav1d> one task: make a buttload (~10) factory classes which then return some obscure instance of a class which only parses cmd-line and then calls another class 19:23 < eddyb> mail? 19:23 < eddyb> dav1d: nope.avi 19:23 < dav1d> sadimusi: yay 19:23 < dav1d> eddyb: unfortunatly yes 19:25 <+clonejo> luntik13: Do you think you talking to him would change anything? 19:26 < luntik13> clonejo: i will make him smarter 19:26 < eddyb> notch doesn't even work on minecraft anymore 19:26 < eddyb> and he hasn't for almost two years now, I think 19:26 < dav1d> back to math, stinkin' test tomorrow 19:27 < eddyb> luntik13: have you been in #minecraft this week or the one before? I remember your name :/ 19:27 < eddyb> what am I talking, let me grep logs 19:27 < luntik13> eddyb: i was here 19:28 < luntik13> also Luntik is cartoon character 19:29 < eddyb> hmm, you're not in my logs, I must have seen things 19:29 < redu> that name and 13 go together very well then 19:29 < redu> :D 19:31 < luntik13> well i'm 13 now 19:31 -!- Paprikac_ [~Paprikach@194-166-34-221.adsl.highway.telekom.at] has joined #mcdevs 19:31 < AnotherOne> http://img15.nnm.ru/0/d/e/6/e/aaf99b178b3b467af0dd4018ac4.jpg 19:31 < redu> .ru :| too scary 19:32 < AnotherOne> heh 19:35 -!- Paprikachu [~Paprikach@178.112.23.181.wireless.dyn.drei.com] has quit [Ping timeout: 252 seconds] 19:35 -!- luntik13 [~Sashka@m77-219-23-197.cust.tele2.lv] has quit [Quit: used jmIrc] 19:36 < dav1d> there goes the next pbunny instance, only one left 19:37 < eddyb> dav1d: call the destructors! 19:37 < dav1d> eddyb: ? 19:37 < dav1d> oh 19:37 < dav1d> :D 19:37 < dav1d> just helped someone in #d with destructors 19:37 < dav1d> I was confused for a second 19:47 -!- SuinDraw [~NiaTeppel@WiseOS/Founder/NiaTeppelin] has quit [Quit: Leaving] 19:59 -!- act4 [~alex@dhcp-129-234-83-199.tr.esol.dur.ac.uk] has quit [Quit: act4] 20:10 -!- yorick [~yorick@oftn/member/yorick] has joined #mcdevs 20:13 < AnotherOne> if i get end of stream in process of reading, should i close the connection? 20:14 < eddyb> how low-level are you? 20:14 < eddyb> and what does end-of-stream mean in the context? 20:14 < AnotherOne> making a socket wrapper 20:14 < AnotherOne> it means SDLNet_TCP_Recv() returns -1 20:14 < AnotherOne> http://sdl.beuc.net/sdl.wiki/SDLNet_TCP_Recv 20:14 < eddyb> there's at least 5 different ways a TCP connection could end 20:15 < eddyb> lol, using SDL 20:15 < AnotherOne> yes:) 20:15 < AnotherOne> is it bad? 20:15 < eddyb> AnotherOne: if you don't need multimedia stuff from SDL, you could find libuv a bit better 20:15 < eddyb> IIRC boost also has async networking 20:16 < AnotherOne> i think i do need multimedia stuff 20:16 < AnotherOne> but later 20:16 < AnotherOne> i can't boost 20:16 < AnotherOne> too complicated 20:19 < eddyb> https://github.com/joyent/node/blob/master/src/tcp_wrap.h https://github.com/joyent/node/blob/master/src/tcp_wrap.cc it's a bit clunky, but Ctrl+F uv_ 20:20 < eddyb> AnotherOne: nevermind that mess, http://nikhilm.github.io/uvbook/networking.html#tcp 20:20 < eddyb> http://nikhilm.github.io/uvbook/networking.html#client 20:23 < AnotherOne> if something comes to my socket and i dont read it, does it stay there? 20:23 < eddyb> AnotherOne: also has timers, fs, threads, processes, and you can even mix its event loop with others http://nikhilm.github.io/uvbook/ 20:24 < eddyb> AnotherOne: I suggest you use async IO, preferably abusing C++11 features :P 20:24 < eddyb> (yes, it's "there" until you read it, but it's just easier to get a notification when data comes in) 20:26 < eddyb> AnotherOne: TCP connections are streams: http://nikhilm.github.io/uvbook/filesystem.html#buffers-and-streams 20:27 < AnotherOne> nice 20:28 < eddyb> https://github.com/d5/node.native OMG I WANTED TO DO THIS 20:28 < eddyb> AnotherOne: just use that ^^ it will be the most awesome thing you've done in C++ 20:28 < AnotherOne> i'll try:) 20:29 < AnotherOne> but what if i just combine reading from socket and parsing? 20:29 < eddyb> I wanted to have something like that as part of an OS API 20:29 < AnotherOne> no buffers 20:29 < eddyb> AnotherOne: you should parse as part of the read callback (so when you get data) 20:30 < eddyb> you have to at least store a partial packet in case you didn't get all the data 20:31 < eddyb> hmm, it doesn't seem like he updated it recently :/ 20:31 < AnotherOne> what if i read a single byte for packet id and then call functions that read corresponding fields and deserialize them? 20:32 < AnotherOne> and again and again in infinite loop 20:32 < eddyb> it doesn't work that way 20:32 < AnotherOne> and no problems with partial data 20:32 < AnotherOne> why? 20:32 < eddyb> because syscalls are costly 20:32 < eddyb> and you'd also put stress on the kernel-level networking stack 20:33 -!- Yoshi2 [~chatzilla@xdsl-78-35-222-43.netcologne.de] has joined #mcdevs 20:33 < eddyb> "problems with partial data" - if only C++ had generators/coroutines :P 20:33 < Calinou> SDL is awesome eddyb 20:33 < eddyb> Calinou: I know SDL in-depth, but it's not that great here 20:33 < Calinou> it is 20:33 < Calinou> other APIs are a mess that aren't crossplatform 20:34 < AnotherOne> so should i read large blocks and process on callback? 20:34 < eddyb> libuv has been written to be the crossplatform 20:34 < AnotherOne> and those nasty buffers 20:34 < AnotherOne> fuck 20:34 < eddyb> AnotherOne: seriously, buffer management is like 5 lines 20:34 < AnotherOne> orly? 20:34 < eddyb> yes 20:35 < eddyb> you should parse in a loop, until it fails, save the extra data, and next time you get new data, prepend the old extra data to it 20:35 < AnotherOne> so std::stringstream is bad buffer? 20:36 < eddyb> it's not a buffer, it's a string stream 20:36 < eddyb> i.e. a string you can stream to/from 20:37 < eddyb> vector maybe, but it's too element-oriented 20:39 < eddyb> I should pick up node.native, clean it up and update it 20:41 < eddyb> AnotherOne: so you can have a static byte buffer where you do this: read_start(callback); 20:41 -!- Calinou [~Calinou@unaffiliated/calinou] has quit [Remote host closed the connection] 20:41 < eddyb> if your static buffer is twice max_alloc_size, then it can fit old data and new data. you just have to be careful so you don't end up with packets not fitting 20:42 < eddyb> then again, just find a good buffer class 20:43 < eddyb> http://stackoverflow.com/questions/1874354/a-dynamic-buffer-type-in-c 20:44 < eddyb> AnotherOne: then again, std::vector should work quite well 20:45 < eddyb> http://en.cppreference.com/w/cpp/container/vector 20:46 < eddyb> with memmove and resize, you should be able to do some easy buffer management 20:49 < AnotherOne> vector... prepending... isn't it a hardcode memory rape? 20:50 < AnotherOne> but yes... a little rape is better than my current version of client 20:51 < eddyb> it's easier to copy memory than have an extra check for every access (which would be the other way to do this) 20:51 < AnotherOne> yep... 20:51 < AnotherOne> fuck 20:51 < dav1d> SDL is bad 20:51 < dav1d> well api-wise 20:52 < eddyb> https://github.com/deoxxa/libmcnet 20:52 < AnotherOne> i have to remake all message classes again 20:52 < eddyb> ^^not updated, but it has an awesome packet description system 20:52 < AnotherOne> nononononono 20:52 < eddyb> based on my older JS implementation 20:53 < AnotherOne> fukk macros 20:53 < eddyb> AnotherOne: I suggest trying to work with something like this: https://github.com/deoxxa/libmcnet/blob/master/include/mcnet/packets.h 20:53 < eddyb> macros are the only way to do this in a sane way, in C/C++ 20:54 < eddyb> deoxxa had C code, so that packet list generates structs and pack/unpack code 20:54 < AnotherOne> do you want me to have fun debug time?:) 20:54 < eddyb> this is much better than anything you could come up with 20:55 < eddyb> but you can have a static function in each packet class, and then have a vector of those functions, so it's pretty much a "jump table" 20:56 < eddyb> or have a switch statement, like him, but with 0 packet-specific code, just calling the packet static function, which would get inlined 20:56 < AnotherOne> http://pastebin.com/Zi6CcKpf 20:56 < AnotherOne> i have classes like this 20:56 < eddyb> in a couple of hours I could come up with a nice C++ version for this and maybe even update the packet definitions for the latest versions of MC 20:57 < eddyb> haha 20:57 < eddyb> AnotherOne: that's just not going to work for you 20:57 < AnotherOne> why? 20:57 < eddyb> wtf, one file per packet? that's even worse, about hundred files instead of a small one 20:59 < AnotherOne> if something goes wrong, you will pay for your laze with fun debug time:) 21:00 < eddyb> you're afraid of debugging *as if* you're going to have to do debugging 21:00 < eddyb> my solution is hundreds of times smaller than yours 21:00 < eddyb> which means *at least* hundreds of times easier to debug 21:01 < AnotherOne> lol 21:01 < AnotherOne> nope 21:01 < dav1d> also it's a lot to type 21:01 < dav1d> I did it 21:01 < dav1d> and I regret it 21:01 < dav1d> the file had in the end 3.5k lines 21:01 < dav1d> only the server packets 21:01 < AnotherOne> i made code generator:) 21:01 < dav1d> https://github.com/Dav1dde/BraLa/blob/master/brala/network/packets/server.d 21:01 < dav1d> 274 lines and easy to maintain :) 21:02 < dav1d> I wanted to change all these classes to structs... 21:04 -!- Yoshi2| [~chatzilla@xdsl-87-79-218-85.netcologne.de] has joined #mcdevs 21:04 -!- Yoshi2 [~chatzilla@xdsl-78-35-222-43.netcologne.de] has quit [Ping timeout: 240 seconds] 21:04 < eddyb> AnotherOne: what code generator? 21:04 -!- Yoshi2| is now known as Yoshi2 21:04 < AnotherOne> that generates classes for packets 21:04 < eddyb> derp, I know what it would do 21:04 < eddyb> but how did you do it? 21:05 <+pdelvo> Im using runtime code generation to reduce meta programming, but my packet classes are to complex to generate 21:05 < eddyb> AnotherOne: https://gist.github.com/eddyb/9be5aa242e05ac7d609e and it's still bigger than PACKET(06, INT(x) INT(y) INT(z)), and it has no pack/unpack code 21:05 < eddyb> pdelvo: what language? 21:05 <+pdelvo> C# 21:05 < AnotherOne> http://pastebin.com/zLf2V9kJ 21:06 < eddyb> so what does that do? output C++ code? 21:06 <+pdelvo> https://github.com/pdelvo/Pdelvo.Minecraft/blob/master/Pdelvo.Minecraft.Protocol/PacketFactory.cs#L118 it is more or less code generation in il 21:06 < AnotherOne> yes 21:06 < eddyb> AnotherOne: you could have the same thing, in one short line, and without writing the file to disk 21:07 < dav1d> pdelvo: +1 for german comments 21:07 <+pdelvo> oh i got german comments on that... 21:07 < eddyb> and if you really want codegen, I could repurpose my old mcsmp node.js lib to output C++ code 21:07 < eddyb> using C++ code to gen C++ source code is quite bad in my books 21:08 < AnotherOne> why? 21:08 < eddyb> brb, food, please ponder on metaprogramming 21:08 < AnotherOne> wait 21:08 < AnotherOne> show me please where PACKET is defined 21:08 < eddyb> that's the beauty 21:08 < eddyb> it's not :) 21:08 < eddyb> you define PACKET to whatever you want 21:08 < AnotherOne> oh i see 21:08 < eddyb> also the type macros 21:09 < eddyb> here is the struct generation: https://github.com/deoxxa/libmcnet/blob/master/include/mcnet/structs.h 21:09 -!- Yoshi2| [~chatzilla@xdsl-78-35-227-236.netcologne.de] has joined #mcdevs 21:09 < eddyb> you can see that define's and undef's are most of the files 21:10 -!- Yoshi2 [~chatzilla@xdsl-87-79-218-85.netcologne.de] has quit [Ping timeout: 276 seconds] 21:10 < AnotherOne> damn 21:10 -!- Yoshi2| is now known as Yoshi2 21:10 < eddyb> now really food, this talk and the lack of real work makes me hungry 21:10 < eddyb> read code https://github.com/deoxxa/libmcnet/blob/master/src/parser.c 21:10 < AnotherOne> i dont get that magic 21:13 < AnotherOne> damnit 21:13 < AnotherOne> it is better to have tons of code 21:14 -!- Yoshi2| [~chatzilla@xdsl-81-173-163-49.netcologne.de] has joined #mcdevs 21:14 < AnotherOne> than make macro magic 21:14 -!- Yoshi2 [~chatzilla@xdsl-78-35-227-236.netcologne.de] has quit [Ping timeout: 240 seconds] 21:14 <+pdelvo> it would be cool to have a json documentation which can be parsed to generate packet classes 21:15 < AnotherOne> i'll try to parse wiki later 21:15 <+pdelvo> to parse the wiki will be hard i think 21:15 < AnotherOne> once i have stable packet architecture 21:15 < AnotherOne> i love parsing 21:15 <+pdelvo> Regex <3 ? 21:16 < AnotherOne> especially hardcore pure c++ parsing 21:16 < AnotherOne> nope:) 21:16 < AnotherOne> not yet 21:16 <+pdelvo> regex is cool 21:16 < AnotherOne> yes 21:16 -!- Yoshi2 [~chatzilla@xdsl-81-173-160-195.netcologne.de] has joined #mcdevs 21:16 < AnotherOne> but i'm too lazy to get regex 21:16 < AnotherOne> i dont need it now 21:16 < AnotherOne> but i must do it 21:17 <+pdelvo> I think you will be faster when you 1. learn regex and then 2. use regex to parse it then parse it on your own 21:17 -!- Yoshi2|_ [~chatzilla@xdsl-78-35-198-220.netcologne.de] has joined #mcdevs 21:18 < AnotherOne> there are just html tables 21:19 -!- Yoshi2| [~chatzilla@xdsl-81-173-163-49.netcologne.de] has quit [Ping timeout: 276 seconds] 21:19 < dav1d> parsing from the wiki? 21:19 < dav1d> why 21:19 < dav1d> https://github.com/Wallbraker/PacketsJson 21:19 < dav1d> well 1.4.3 21:19 < AnotherOne> heh:D 21:19 < dav1d> but you could update it to 1.5.2 21:20 < dav1d> wouldn't be a huge deal, I would think 21:20 < dav1d> s/deal/job/ 21:20 < dav1d> also 21:20 < AnotherOne> oh damn 21:20 < dav1d> https://github.com/Wallbraker/PacketMaker 21:20 -!- Yoshi2 [~chatzilla@xdsl-81-173-160-195.netcologne.de] has quit [Ping timeout: 252 seconds] 21:20 < AnotherOne> so many new things 21:21 < dav1d> probably really fast adapted for c++ 21:21 < eddyb> AnotherOne: once you get to learn a language like JS (ES6 is even better) - you can script things much better than your silly C++ code :P 21:21 < dav1d> pfft 21:21 < dav1d> Js 21:21 < AnotherOne> python power 21:21 * dav1d got an awesome JS job today 21:21 < dav1d> AnotherOne: indeed :) 21:21 < eddyb> python is just silly for these things 21:22 < dav1d> eddyb: why? 21:22 < eddyb> dav1d: that JSON is kinda verbose for me 21:22 -!- Yoshi2|_ [~chatzilla@xdsl-78-35-198-220.netcologne.de] has quit [Ping timeout: 248 seconds] 21:22 < dav1d> eddyb: json.loads() and I have a 1:1 representation of that in python data types 21:22 < AnotherOne> let the holy war begin 21:22 < dav1d> AnotherOne: ha we already had a few of these wars, eddyb and me 21:22 < eddyb> dav1d: I don't mean JSON in python 21:23 < dav1d> oh 21:23 < dav1d> for you 21:23 < eddyb> https://github.com/eddyb/node-mcsmp/blob/master/lib/protocol.js#L10 21:23 < dav1d> whatever gotta watch homeland (and I would do it in python :P) 21:23 < eddyb> what do you think? 21:23 < eddyb> dav1d: homeland is awesome and I'm sad it was canceled :( 21:23 < dav1d> REALLY 21:23 < dav1d> omg nooooo 21:23 < dav1d> about to finish season one 21:24 < dav1d> I love homeland so far 21:24 < AnotherOne> what is homeland? 21:24 < eddyb> a TV series 21:24 < eddyb> dav1d: I can output code easier than Wallbraker does, from my JS representation 21:24 < dav1d> man this sucks 21:25 < dav1d> eddyb: Dynamic vs. static language :) 21:25 < eddyb> no, I mean, doing the same thing 21:25 < dav1d> I think his approach was to have a base for generating code for every language 21:25 < eddyb> outputting code "to disk" 21:26 < eddyb> and my representation is easy to convert to the thing deoxxa uses, even with a regex 21:26 < AnotherOne> you say "to disk" as if it is something bad 21:26 < eddyb> I mean saving source code 21:26 < eddyb> for compilation at a later time 21:27 < AnotherOne> so why is generating c++ code in c++ bad? 21:27 < eddyb> because C++ isn't that good at string processing 21:27 < eddyb> at least not with STL, a custom solution might be better 21:29 < eddyb> in JS (and, I know, other scripting languages), you work with strings, as you would with integers in C++, and it has native regexps 21:29 <+pdelvo> getting all client -> server packets of your js file: client2server[^0-9]+((?[0-9]x[0-9A-Fa-f]{2}):\s*\[(?.*?)\],?\s+)+ 21:30 < eddyb> heh 21:30 < eddyb> I mean, copying the code then using regexp to replace to the format deoxxa used 21:30 < eddyb> v8 compiles regexps to native, which makes them one of the fastest string processing utilities ever (I heard D can compile regexps at compile-time, too) 21:30 < eddyb> oh, and, it's all dynamic 21:31 <+pdelvo> .net can do that too. even to a external dll if you want. but i think you really dont need this convertion ofden so performance should not be a problem here 21:31 < eddyb> I meant in general 21:31 < AnotherOne> hey pdevlo 21:31 <+pdelvo> hi 21:31 <+pdelvo> :D 21:32 < AnotherOne> say "pig" in german 21:32 < eddyb> you may be able to beat C parser code with regexps 21:32 <+pdelvo> Schwein 21:32 <+pdelvo> ? :D 21:32 < AnotherOne> die or der? 21:32 <+pdelvo> das 21:32 < dav1d> haha 21:32 < AnotherOne> oh 21:32 < AnotherOne> that german 21:33 <+pdelvo> xD 21:33 < AnotherOne> now i can say "du bist das Schwein" 21:33 < dav1d> german is a bitch (to lern) 21:33 < dav1d> AnotherOne: "du bist ein Schwein" :) 21:33 < AnotherOne> why so? 21:33 < AnotherOne> what is ein? 21:33 < dav1d> "a" = "ein" (english - german) 21:34 < eddyb> das being the 21:34 < dav1d> you are - "du bist", a - "ein", pig - "Schwein" 21:34 < eddyb> definite article vs indefinite article 21:34 < eddyb> amirite? (I know no german at all :P) 21:34 < dav1d> yes 21:35 < AnotherOne> for female "ein" too? 21:35 <+pdelvo> eine 21:35 < dav1d> AnotherOne: yes and no 21:35 < dav1d> it's complex 21:35 < dav1d> for your pig example yes 21:35 < dav1d> for e.g. for "bitch" no 21:35 < dav1d> it would be "eine" 21:36 < eddyb> du bist eine bietch 21:36 < AnotherOne> "bietch" 21:36 < AnotherOne> some kind of assimilation? 21:36 < AnotherOne> or native word? 21:36 * eddyb points AnotherOne to "(I know no german at all :P)" 21:37 < dav1d> well you could call that dialect 21:37 < dav1d> some people say it like that 21:37 -!- Stormx2 [~Stormx2@cpc18-sotn9-2-0-cust33.15-1.cable.virginmedia.com] has quit [Remote host closed the connection] 21:37 < dav1d> proper translation would be "Hure" or "Schlampe" 21:37 < eddyb> it's an "assimilating" made-up translation 21:37 <+pdelvo> more or less. you can use "Schlampe" or "Prostituierte", "Dirne", "Hure" 21:37 < eddyb> Hure is like hoe? 21:38 < AnotherOne> is there word "aa" meaning shit? 21:38 < AnotherOne> in german 21:38 <+pdelvo> if you talk to children < 5 years to might use that :D 21:38 < AnotherOne> heh 21:38 < dav1d> eddyb: I'd rather say "Schlampe" but yeah, these mean basically all the same 21:39 < AnotherOne> i saw that in dictionary 21:39 < dav1d> Schlampe is more spoken langauge 21:39 < dav1d> well "Dirne" wouldn't be a translation for bitch in bavaria 21:39 < AnotherOne> dat bavaria 21:39 < dav1d> :P 21:40 < dav1d> AnotherOne: "aa" = shit, kinda, children might say that 21:40 < dav1d> oh well pdelvo already answered that 21:40 < AnotherOne> i got it:) 21:40 < AnotherOne> but i saw this in dictionary 21:40 < eddyb> lol 21:40 < AnotherOne> thought about "real" word 21:41 <+pdelvo> Im really sure people in germany would laugh if you use it :D 21:41 < AnotherOne> :D 21:41 < AnotherOne> and "kake"? 21:42 <+pdelvo> depends on what you want to say. 21:42 < AnotherOne> shit 21:42 <+pdelvo> "Oh shit!" can be translated to "Oh Kacke" 21:43 < dav1d> shit = "Scheisse" 21:43 <+pdelvo> but if you want to say that you were on a toilett it is not used. 21:43 < dav1d> Ich geh mal scheissen 21:44 < dav1d> ^ vulgar sentence for, I need to poop 21:44 < eddyb> ok guys 21:44 < eddyb> enough shit talk 21:44 < AnotherOne> lol