Nekka has quit [Read error: Connection reset by peer]
dwdv has joined #crystal-lang
Nekka has joined #crystal-lang
<FromGitter>
<ImAHopelessDev_gitlab> `raise "This item is already in the sell buffer." if client.sell_buffer.includes itemid?` ROFL NICE FAIL
<FromGitter>
<ImAHopelessDev_gitlab> can't believe i didn't catch that sooner lol 😆
<FromGitter>
<bararchy> @ImAHopelessDev_gitlab What are you using to talk with the backend BTW? is the game online or just "pinging" for data every now and then ?
<FromGitter>
<ImAHopelessDev_gitlab> @bararchy just a simple timer in Godot (client), pings every 5 seconds
<hightower3>
Hey Blacksmoke16 , maybe you have an idea regarding your paste https://play.crystal-lang.org/#/r/7vta . You remember we were discussing that there is also AnyEvent(RealEvent, args), which should trigger whenever any other event is triggered. I converted structs to classes, and I can now do this. AnyEvent is defined as AnyEvent < Event, event_type : Event.class, event : Event. However, it needs to be triggered from emit() itself, and
<hightower3>
I don't
<hightower3>
don't understand how to emit it from there
<hightower3>
ah wait
<hightower3>
yeah, not really sure how to call it
<FromGitter>
<Blacksmoke16> wouldnt you just do like `emit obj, type` within `.emit`?
<FromGitter>
<Blacksmoke16> er `emit type, obj`
<hightower3>
Ah I see somehow when I do emit AnyEvent, type, args, the args is a Tuple(Event) instead of Event, not matching the function
<FromGitter>
<Blacksmoke16> you'd want to do it from the other emit
alexherbo2 is now known as alex```
<FromGitter>
<bararchy> btw, something I still don't understand, Does Mutex.synchronize stops the world, or just insures that specific Fiber will do the blocked actions at a time
<FromGitter>
<asterite> you can, you have to use uninitialized
<FromGitter>
<asterite> f = uninitialized Proc(Int32, Int32); f = ->(x : Int32) { f x }
<FromGitter>
<lbarasti> Folks, I'm doing this, I'll be live coding a concurrent, terminal-based, URL status checker in Crystal in ~1 hour. Tell your friends :D ⏎ https://www.twitch.tv/lbarasti/
<FromGitter>
<asterite> nice!
<hightower3>
cool!
<hightower3>
If functions in ruby/js/etc. accept dicts with all sorts of arguments, what's the best bet to port this to Crystal? To make the options classes with properties, so that each option can have the right type and default value, or?
<FromGitter>
<tenebrousedge> Crystal methods accept named arguments. see `Time#shift`
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
<FromGitter>
<ImAHopelessDev_gitlab> how to prevent arthmitic overflow exception, but let the number just max out at it's max value instead
<FromGitter>
<ImAHopelessDev_gitlab> is that possible?
dannyAAM has joined #crystal-lang
<FromGitter>
<tenebrousedge> you'd probably have to catch the exception
<FromGitter>
<ImAHopelessDev_gitlab> i bet 1 if lineer would do it
<FromGitter>
<tenebrousedge> the safe mathematical operators wrap
<hightower3>
tenebrousedge yes, yes, of course they do, I just mean the flexibility of that is limited
<hightower3>
especially when like, the value of some option is another dict.. like pos = { left: 0, right: 0 } etc.
<FromGitter>
<ImAHopelessDev_gitlab> `2147483647` is a special number, please don't hurt me, i tried an unsigned int, but db.mapping wasn't happy about that
<FromGitter>
<tenebrousedge> you can have `{ left: 0, right: 0}` as a default value
<FromGitter>
<tenebrousedge> what's the limitation?
<hightower3>
I mean when I need to pass this around, and when I don't have all members listed at once. And especially if they're not of the same type, like { blink: true, blink_rate: 0.5 } etc.
<FromGitter>
<tenebrousedge> it sounds like you maybe want to pass around a struct
<FromGitter>
<ilanpillemer> how much faster is something that is built and then the binary is run, vs something that is just run. slightly, or very?
absolutejam2 has quit [Ping timeout: 268 seconds]
<FromGitter>
<bararchy> @ilanpillemer very
<FromGitter>
<tenebrousedge> especially with `release` flag
<FromGitter>
<bararchy> ^ yeha
<FromGitter>
<ilanpillemer> that explains it then
<FromGitter>
<ilanpillemer> I solved a puzzle just by building and running it. If I justy ran it igt was too slow.
<FromGitter>
<absolutejam_twitter> Did you look at the Crystal data classes shard hightower6?
<FromGitter>
<absolutejam_twitter> Wtf I pressed 3 haha
<FromGitter>
<ImAHopelessDev_gitlab> happy to see more game dev code
<FromGitter>
<bararchy> yeha
<FromGitter>
<ImAHopelessDev_gitlab> I get channels confused with... channels like in a lobby chat room.. My mind explodes whenever I see `Channel` in code lol
<FromGitter>
<bararchy> XD
<FromGitter>
<bararchy> Channels I like, it's simple. ⏎ The new Mutex and access to shared objects is what's killing me
<FromGitter>
<bararchy> it was fun, but it took too much time, and I was pretty sure to only one that will install crystal just to play this thing is me
<FromGitter>
<ImAHopelessDev_gitlab> i like the prologues
<FromGitter>
<ImAHopelessDev_gitlab> very descriptive :)
absolutejam2 has joined #crystal-lang
alexherbo2 has joined #crystal-lang
alexherbo2 is now known as alex```
<FromGitter>
<bararchy> Thanks :)
<FromGitter>
<yorci> hey, how is going guys
<FromGitter>
<yorci> there is any hls server solution in crystal for make things faster ?
<FromGitter>
<bararchy> HLS?
<FromGitter>
<bararchy> as in High Load Servers ?
<FromGitter>
<absolutejam_gitlab> the author of Tailwind has a youtube series on it and it's amazeballs
<FromGitter>
<Daniel-Worrall> Http live streaming?
<FromGitter>
<yorci> yes live streaming
<FromGitter>
<absolutejam_gitlab> @Blacksmoke16 Is it worth adding some kind of popularity score to awesome-crystal?
<FromGitter>
<absolutejam_gitlab> eg. stars?
<FromGitter>
<Blacksmoke16> prob would run into same issue as the badges
<FromGitter>
<Blacksmoke16> would be a bunch of requests
<FromGitter>
<Blacksmoke16> but if all those in that comment get removed it'll prob be much more doable
ht__ has quit [Quit: ht__]
<FromGitter>
<ImAHopelessDev_gitlab> i'm re-logging and creating games so many times in development, that i finally just wrote a script that basically just sends the commands and auto creates a game for me. don't have to click on the ui elements, enter lobby, select char, click create game button, type in game name, etc. man, this is so much better. you'd think someone who knows the netcode of their *own* server would have done
<FromGitter>
... this already 😆 ... this gonna boost my workflow TENFOLD, am hyped
<FromGitter>
<Blacksmoke16> So an e2e test
<FromGitter>
<ImAHopelessDev_gitlab> had to google that, TIL
<FromGitter>
<ImAHopelessDev_gitlab> Damn that's nice definition, that's so me
A124 has joined #crystal-lang
A124 has quit [Client Quit]
sagax has quit [Read error: Connection reset by peer]
<FromGitter>
<tenebrousedge> automated testing is pretty necessary. I don't often write tests first, but once I get the basic functionality nailed down, they're pretty necessary for keeping things working