IRC logs for #openttd on OFTC at 2023-05-26
⏴ go to previous day
01:40:32 *** Wormnest has quit IRC (Quit: Leaving)
02:47:07 *** debdog has quit IRC (Ping timeout: 480 seconds)
03:11:23 *** Kitrana has joined #openttd
04:57:03 *** D-HUND is now known as debdog
05:07:03 *** Kitrana has quit IRC (Quit: Leaving.)
05:07:52 *** Kitrana has joined #openttd
05:22:17 *** keikoz has quit IRC (Ping timeout: 480 seconds)
05:38:49 *** Kitrana has quit IRC (Quit: Leaving.)
05:39:20 *** Kitrana has joined #openttd
06:23:26 *** Kitrana has quit IRC (Quit: Leaving.)
06:23:49 *** Kitrana has joined #openttd
06:55:52 <petern> Yeah, Ceil is weirdly named indeed.
06:59:04 <petern> Although rounding up is what Ceil does, normally with only 1 parameter.
06:59:59 <petern> CeilMultiple() might help.
07:09:13 <TrueBrain> sounds like Multiply 😛
07:09:42 <TrueBrain> CeilAll? (don't know the context :P)
07:11:18 <TrueBrain> owh, it is even worse 😄 Haha
07:12:13 <TrueBrain> what's in the name ... always tricky 🙂
07:13:09 <TrueBrain> grrr, `code-server` keeps signing me out .. that is annoying
07:18:47 <TrueBrain> lol, GitHub CoPilot Chat suggests `RoundUpToNearestMultiple`
07:19:15 <TrueBrain> he also says `CeilDiv` is a lie 😛
07:19:32 <TrueBrain> (seems he has issues with `Ceil` vs `RoundUp`)
07:19:39 <TrueBrain> CoPilot Chat really is ... euh ... not good
07:19:48 <petern> TBH Ceil isn't really misnamed, just a bit unexpected to take an additional parameter.
07:19:49 <TrueBrain> it lies so much ... SO MUCH ...
07:19:54 <petern> But CeilDiv() itself... yeah.
07:20:16 <petern> Anyway, Ceil means RoundUp.
07:20:21 <TrueBrain> no, sorry, I was poking fun of GitHub CoPilot Chat, not of those functions 🙂 RoundUp .. Ceil ... that is the same 🙂
07:21:54 <TrueBrain> anyway, in more seriousness, I guess `CeilToMultiple` would indeed help. `CeilMultiple` doesn't really tell you what part is multiple .. multiple ceils? So adding the `To` helps 🙂
07:23:00 <TrueBrain> and I just don't know about GitHub CoPilot Chat ... I was hoping they would make it a bit more factual .. but it is just terrible 😦 I asked it how to launch an application it told me it knew ... none of the arguments worked. None. I just .... I hope they improve it 🙂
07:32:15 <petern> Well, renaming it isn't going to affect much, it's only used (twice) in one other place. Hmm.
07:32:50 <Rubidium_> size_t -> uint (as usual)
07:33:08 <petern> I wish clang would complain about that also :/
07:52:19 <petern> Okay that's for another time 🙂
08:18:46 *** Kitrana has quit IRC (Quit: Leaving.)
08:19:48 *** Kitrana has joined #openttd
10:00:48 <Wahite> Heyy, Just a little question out of curiosity, I was looking at the source and it seems like the nodes in pathfinding for rails (roads) is each tile of the track instead of every junction, is this done for simplicity or does it have a different reason?
10:38:52 <Eddi|zuHause> how would you know what the next junction is, if you don't follow the rails?
10:39:50 <Eddi|zuHause> there is a pathfinder cache to combine longer stretches of rail for more efficiency
10:44:13 <FLHerne> also pathfinding costs take into account things like signals, reservations and the presence of station tiles, which don't correspond to segments between junctions
10:44:47 <FLHerne> I suppose you can add them up, but reservations in particular change constantly
10:56:14 <petern> Welcome to tile-based games 🙂
11:05:31 <petern> Building a list of connected nodes before pathfinding might be more expensive than just traversing the tiles.
11:07:10 <Wahite> Ofc you have to follow the tiles to create the graph that can be cached but things like length, amount of signals can be precalculated in the cost between nodes. Reservations can also be between junctions instead of per tile.
11:07:47 <Wahite> petern: But you're already building a list of nodes for caching? So there wouldn't be a big difference?
11:09:00 <Wahite> Just to be clear, I'm not saying it should be changed because i know it would be a huge change, cause a lot of headaches for maybe very little benefit. I was just asking out of curiosity
11:11:01 <petern> If you prebuild you may have make a complete graph instead of just the bits found while pathfinding.
11:12:01 <petern> (I'm no pathfinding expert though)
11:13:38 <Wahite> petern: Pretty sure you don't have to make the complete graph but the distance between nodes could be large if you're using long tracks without any junctions, so building up the graph for the first time might take longer.
11:14:17 <Wahite> are the cached graphs shared between vehicles traveling on the same graph?
11:15:17 <Wahite> Wahite: However I do think it can reduce the cost for adding nodes and recalculating new paths
11:20:19 <Eddi|zuHause> i'm pretty sure what you're suggesting is already what's happening
11:24:05 <LordAro> YAPF is notoriously hard to read and understand
11:30:47 <Wahite> It does seem like it was already happening but I was looking at the code for finding a depot which seems to be an exception sometimes? not really sure exactly
11:30:51 <Wahite> But thanks for answering my questions 🙂
11:46:41 <petern> JGR: does JGRPP always show the waypoint graphics selection window, even if only the default waypoint is available? If not you probably also want to call CheckRedrawWaypointCoverage in the rail toolbar window's OnRealtimeTick event.
12:02:09 <andythenorth> does industry random placement just pick tiles at random 5000 times?
12:50:07 <glx[d]> hehe was my guess when looking at commit history
12:55:53 <TrueBrain> Class members that are non-PODs are initialized by default, not? Still means most of the changes in your PR are correct btw, but a few look a bit odd given that the one variable below also doesn't have an explicit initializer 😄
12:56:10 <TrueBrain> `ScenarioIdentifier` for example .. we now explicit initialize md5sum, but what about filename? 😛
12:59:29 <petern> for std::array, default initialization isn't the same as value initialization.
13:01:13 <petern> Well, actually it depends on the type contained by the array.
13:01:32 <TrueBrain> I so hate how C++ initializes things ... so many rules 😛
13:01:59 <petern> std::array<PodObject, 1> gives you a default PodObject, but std::array<int, 1> gives you a default int, which is uninitialized.
13:02:12 <TrueBrain> so a less error-prune solution to 10876 would be to make MD5Hash a class, and put an explicit ctor on it?
13:02:36 <TrueBrain> petern: ah, okay, that somewhat makes sense .. I guess 😛
13:03:12 <TrueBrain> well, your explanation makes sense 😛 It is just annoying to have all these weird little rules 😄
13:04:24 <petern> TrueBrain: Possibly yes. I think the issue here, in hindsight, is we've hidden the array and not given any indication it is still an array.
13:04:47 <TrueBrain> the `using` sounded like a nice idea 😄
13:05:37 <petern> e.g. for my industry changes changes I went with `AcceptedCargoArray` as a convenience, not to hide it.
13:06:04 <TrueBrain> or just slap a ctor on it! 😄
13:06:52 *** _aD has quit IRC (Ping timeout: 480 seconds)
13:06:54 <TrueBrain> also annoying ... I can't find a decent way to deploy new versions of our webservices without going all weird on the system ... sometimes it amazes me how difficult simple things can be 🙂
13:07:10 <TrueBrain> I just want a one-liner to deploy a new version .. instead of 100+ lines of code
13:38:48 <petern> ```struct MD5Hash : std::array<byte, MD5_HASH_BYTES> {
13:38:48 <petern> MD5Hash() : std::array<byte, MD5_HASH_BYTES>{} {}
13:40:18 <petern> Then it is always initialised without the user having to care.
13:47:22 <glx[d]> I guess you can move `&operator^=` inside the struct
13:50:58 <petern> Yes but that was originally how rubidium had it but on the review it was suggested to not do this. Oh dear.
14:13:07 <TrueBrain> yeah, but I think it was overlooked at that point that it is an array of PODs 🙂
14:22:21 <TrueBrain> owh, I was going to run the changes to that Python script .. let's see ..
14:28:17 <TrueBrain> frosch: under the assumption you wrote your script correct, 0 GRFs ever uploaded to BaNaNaS trigger
14:29:22 <petern> Who designed the newgrf text stack? Was it TTDPatch?
14:30:05 <TrueBrain> I checked if the changes did anything; changing the 0x03 does trigger (only 3, but still)
14:30:09 <TrueBrain> no clue what 0x03 is 😄
14:31:32 <TrueBrain> I love having many cores 😄 Analyzing all GRFs is painfully slow 😛
14:33:49 <glx[d]> newgrf text stack (as most newgrf stuff) is working around limitation by abusing registers
14:39:03 <glx[d]> but I don't even see how push word can be used
14:54:11 *** Kitrana has quit IRC (Read error: Connection reset by peer)
14:57:19 *** Kitrana has joined #openttd
14:59:46 *** Kitrana1 has joined #openttd
15:05:24 *** Kitrana has quit IRC (Ping timeout: 480 seconds)
15:07:41 *** Wormnest has joined #openttd
15:31:30 *** HerzogDeXtEr has joined #openttd
15:50:11 <petern> Ah yes, the assumption that it just doesn't work, rather than it's something on their side.
15:56:35 *** gelignite has joined #openttd
16:06:33 <JGR> petern: Good spot, I'll pick your fix for that
16:10:34 *** georgedeagostino has joined #openttd
16:10:34 <georgedeagostino> What should I do if I find exploits in multiplayer?
16:12:34 <TrueBrain> georgedeagostino: Report them on GitHub 🙂
16:12:45 <georgedeagostino> That is not smart
16:12:57 <georgedeagostino> This stuff should be disclosed privatly
16:12:59 <TrueBrain> Or if it is really sensitive, send me a DM
16:13:33 <georgedeagostino> Okay let me make a full report on it, I'll send you PDF
16:15:45 <TrueBrain> It seems we can enable something for that on github too, but it is a bit vague .. Will check that later tonight
16:18:15 <FLHerne> looking at the updates, either everyone else did or the networking got more secure :p
16:22:02 <TrueBrain> We misused that to get newer versions in stable distros 😉
16:22:13 <TrueBrain> But as that is not a thing anymore, we cared a lot less
16:27:18 <LordAro> very much depends on the type of exploit
16:27:53 <LordAro> "can block an opponent with a train on a level crossing", not so interesting
16:28:15 <LordAro> "can cause a crash of other clients remotely", more so
16:28:24 <LordAro> (but still not all that sensitive)
16:28:46 <LordAro> s/more so/bit more interesting/
16:29:54 <andythenorth> what about "can execute arbitrary code from injected payload" ? 😛
16:30:24 <LordAro> that'd probably warrant some amount of privacy
16:30:30 <LordAro> i'd be impressed though
16:41:54 <andythenorth> my money would be on a squirrel vuln 😛
16:42:15 <andythenorth> I bet it's exploitable
16:42:37 *** Grey has quit IRC (Remote host closed the connection)
16:43:25 <andythenorth> what Squirrel do we have?
16:43:35 <andythenorth> probably older than 2.2.5? 😛
16:46:24 <LordAro> not specific to multiplayer though
16:46:28 *** gelignite has quit IRC (Quit: Stay safe!)
16:46:52 <andythenorth> not detected by CodeQL or GH scanning
16:47:51 <andythenorth> trying to figure out what squirrel version we have 😛
16:48:37 <nielsm> I think roughly the last 2.x version
16:48:46 <nielsm> with some customisations
16:49:59 <nielsm> the CVE says "through 2.2.5 and 3.x" which to me reads as "all 2.x versions are affected"
16:50:00 <andythenorth> anyone here like offensive research?
16:52:08 <georgedeagostino> LordAro: Arbitrary money multiplication
16:57:32 <nielsm> this is again a situation where I think it would be useful to have a mechanism for hotfix versioning of releases: make releases that are (intended to be) multiplayer compatible with an existing released version but fixes some critical issue in that version
16:57:35 <petern> No reason why gameplay exploits can't be reported on Github.
16:58:24 <petern> it's not worth the hassle of maintaining branches and working out what's compatible, especially now that easy distribution and update is there.
17:03:43 <LordAro> georgedeagostino: mm, unlikely to be worth hiding it
17:03:50 <LordAro> it's not like we're dealing with actual issues here :)
17:05:37 <petern> Well it's sunny and but a bit windy (and cool because of that)
17:05:53 <petern> Was thinking of going out but I think I'll save my legs for the morning ride.
17:06:50 <nielsm> a squirrel exploit that can be used for arbitrary code execution is still rather serious tbh, I don't think anyone's doing code review of everything that gets uploaded to bananas
17:07:13 <nielsm> even if it's a rather low value target as opposed to something like CS:GO
17:08:27 <petern> Sure but as a network client you don't get any control over what scripts a server is running, and the scripts don't run on clients.
17:08:51 <nielsm> no it would only be targeting single player games of course
17:08:55 <petern> Meanwhile a bad savegame can crash the game easily 😄
17:09:45 <nielsm> well true, we probably don't know whether a crafted scenario on bananas could possibly also lead to code execution
17:09:58 <nielsm> the issue is more becoming an infection vector for persistent malware
17:20:50 <pickpacket> Has anyone here played with OpenGFX+ Trains 0.3.0?
17:21:05 *** virtualrandomnumber has joined #openttd
17:21:20 <pickpacket> wondering what kind of trains it adds
17:23:01 <pickpacket> has openttdcoop.org been down a lot lately?
17:23:20 <petern> It's not down lately, it's just down.
17:24:01 <pickpacket> openttdcoop.org is up, but not dev.openttdcoop.org
17:27:14 *** virtualrandomnumber has quit IRC (Quit: virtualrandomnumber)
17:30:32 <TrueBrain> I was wondering how the security vulnerability reporting on GitHub works .. only to find out it is right there in my face 😄
17:30:46 <TrueBrain> when you create a new issue, there is this big green `Report a vulnerability` button 😄
17:30:59 <TrueBrain> turns out I enabled that a while ago 😛
17:31:16 <petern> So easy you forgot you'd done it.
17:32:51 <TrueBrain> it even allows to create a temporary private fork to work on a solution .. GitHub did pretty nice here, it seems 🙂
17:34:36 <frosch> TrueBrain: nice, what was the PR asking for the examination?
17:34:54 <georgedeagostino> TrueBrain: Oh
17:36:50 <petern> Will it merge before the nightly... 😄
17:37:21 <petern> (No, it's not super critical)
17:37:28 <TrueBrain> so tempted to force-merge it now 🙂
17:37:30 <TrueBrain> just because we can 😛
17:37:39 <petern> That went bad last time :p
17:37:49 <TrueBrain> yeah .... so I will not 🙂
17:37:55 <TrueBrain> I learnt from someone else's mistakes!
17:38:08 <petern> Interesting, random IPsec failures on IPv6.
17:38:34 <petern> "failure" as in random IP trying its luck.
18:09:31 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
18:11:25 <TrueBrain> lol @ 10877, I like the undertone of: it cannot possibly be my connection 🙂
18:11:43 <TrueBrain> at least the backend always had at least one instance running for as far as I was willing to look back (over a month)
18:11:55 <TrueBrain> although sometimes an instance crashes ... it is redundant, so that isn't a reason for timeouts 😄
18:12:24 <TrueBrain> but I hate logs without timestamps ... why don't we enable timestamps by default?
18:12:32 <TrueBrain> it makes them so ... pointless 😛
18:14:46 <petern> ^ My font of choice is now usable
18:16:48 <petern> However, the "font" command only shows the family name.
18:29:04 <petern> I was going to make a screenshot but windows clip tool crashes tool with WSLg :p
18:29:21 <TrueBrain> really? Snippet works for me just fine 🙂
18:29:27 <TrueBrain> I use it a lot .... more than I would like to admit 😛
18:30:19 <petern> It's actually working today. Interesting.
18:30:33 <TrueBrain> it is the new font 🙂
18:30:47 <petern> This is an extra bit that shows the family.
18:32:34 *** gelignite has joined #openttd
18:33:08 <TrueBrain> if one ticket doesn't trigger a response, just make a second! Well, it worked .. 😛
18:33:19 <TrueBrain> seems nobody wants to debug local network issues anymore 🙂
18:35:16 <TrueBrain> yeah, pretty sure there is a race-condition in the coordinator, causing the server to go offline .. having the coordinator able to scale-out is nice, but also tricky 😄
18:40:35 <petern> Just randomly restart it every few hours 😉
19:07:17 <petern> Yeah, this snip tool is now working fine 😄
19:07:58 <LordAro> sounds like one for andy to test
19:12:46 <petern> Or TrueBrain can see what appears in the survey data. Probably a lot of "sprite" 🙂
19:16:22 <petern> I wish auto-merge would auto-delete branch.
19:16:55 <LordAro> that seems like an oversight
19:17:04 <petern> Hmm, well, OSX is unhappy with that.
19:18:46 <petern> Ah it called GetFontName() on itself...
19:22:53 <glx[d]> petern: oh I could have failed squashing even without pressing the red button
19:23:01 <petern> Adding `.c_str()` seems to be how we do it elsewhere.
19:23:41 <TrueBrain> petern: We can enable that repo-wide
19:26:43 <glx[d]> at least I noticed my mistake instantly 🙂
19:29:45 <petern> Cool, the guy who wanted to install an addon to change gameplay features has now started a forked based on JGRPP.
19:37:20 <TrueBrain> Play the game how you want 😄
19:39:15 <petern> That is how we play it indeed 🙂
19:39:25 <petern> My fork is based on vanilla though.
19:50:44 <andythenorth> my fork is a spork
20:06:44 *** gelignite has quit IRC (Quit: Stay safe!)
20:18:07 <petern> That's a funny stack trace.
20:27:10 <petern> Well, I can make it crash.
20:33:51 <TrueBrain> So many nightly bug reports .. we were wrong about how many people play it 😄
20:34:35 <glx[d]> we didn't have survey 🙂
20:35:05 <petern> It's all these bugs I keep creating.
20:39:50 <TrueBrain> It is a good sign .. means we dare to make changes 🙂
20:40:23 <petern> [build] [523/524 99% :: 320.079] Building CXX object CMakeFiles/openttd_lib.dir/src/window.cpp.o
20:40:36 <petern> Switched to debug build, of course.
20:42:03 <petern> switch (GB(widget, 0, 16)) {
20:43:11 <petern> Oh, not even that. lol
20:46:56 <petern> Second time it's posted when I was still typing...
20:48:05 <petern> Reddit has just alerted me that fmt 10.0.0 has been released.
20:48:11 <petern> I don't know why it did that.
20:48:50 <petern> Obviously nobody places objects that much 🙂
20:52:52 <glx[d]> do we need strong typing for everything ?
20:54:19 <petern> I have a patch that makes widget index strongly typed, but... it's impossible 😄
20:54:45 <petern> It's just in arithmetic and as array indices all over the place.
20:56:14 <petern> Ironically, type conversion issues is one of the reasons I started the (unfiinished) work on scrollbars.
21:03:43 *** axet has quit IRC (Quit: Leaving.)
21:53:27 <glx[d]> it's hard to test every paths when adding something to nml
21:54:30 <sittinbythefire> Haha yeah no problem. If I had been around at the first time I probably could have caught it then
21:54:31 <glx[d]> andy triggers a lot, but not all 🙂
21:56:04 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:01:34 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:23:37 *** nielsm has quit IRC (Ping timeout: 480 seconds)
22:31:18 *** felix_ has quit IRC (Read error: No route to host)
22:43:29 *** _aD has quit IRC (Ping timeout: 480 seconds)
22:45:31 <petern> Oops, I was going to sleep early :/
22:55:04 *** felix has quit IRC (Ping timeout: 480 seconds)
23:29:30 *** felix has quit IRC (Read error: No route to host)
continue to next day ⏵