IRC logs for #openttd on OFTC at 2020-04-18
            
00:04:28 <andythenorth> oof I need to sleep :D
00:04:30 *** andythenorth has quit IRC
00:16:25 *** Wormnest has quit IRC
00:23:38 *** WormnestAndroid has quit IRC
00:26:14 *** WormnestAndroid has joined #openttd
00:26:56 *** gelignite has quit IRC
00:38:59 *** nielsm has quit IRC
00:40:40 *** nielsm has joined #openttd
00:44:52 *** Wolf01 has quit IRC
01:01:12 *** Progman has quit IRC
01:08:08 *** tokai|noir has joined #openttd
01:08:08 *** ChanServ sets mode: +v tokai|noir
01:15:00 *** tokai has quit IRC
01:45:11 *** Gustavo6046_ has quit IRC
01:45:36 *** Gustavo6046_ has joined #openttd
01:46:22 *** Gustavo6046_ is now known as Gustavo6046
02:17:40 *** WormnestAndroid has quit IRC
02:17:45 *** WormnestAndroid has joined #openttd
03:24:35 *** Wormnest has joined #openttd
03:52:59 *** Smedles has quit IRC
03:53:52 *** Smedles has joined #openttd
04:35:39 *** D-HUND has joined #openttd
04:39:06 *** debdog has quit IRC
04:44:23 *** Flygon has joined #openttd
04:58:40 *** Eddi|zuHause2 has joined #openttd
05:01:00 *** glx has quit IRC
05:03:27 *** Eddi|zuHause has quit IRC
05:32:15 *** Wormnest has quit IRC
06:42:33 *** Gustavo6046 has quit IRC
07:56:25 *** snail_UES_ has quit IRC
08:16:57 *** Progman has joined #openttd
08:57:00 *** supermop_Home_ has quit IRC
09:11:19 *** andythenorth has joined #openttd
09:38:58 <andythenorth> hey we could buy a formaldehyde plant http://marketing.ippe.com/acton/media/9185/formaldehyde-complex-plant-for-sale-silver-catalyst-metal-oxide-process?gclid=EAIaIQobChMIoISBibvx6AIVWe3tCh1W7AL4EAAYASAAEgKUvPD_BwE
10:02:28 *** Lejving has quit IRC
10:04:17 *** Eddi|zuHause2 is now known as Eddi|zuHause
10:31:18 *** Wolf01 has joined #openttd
10:32:09 *** sla_ro|master has joined #openttd
10:47:52 *** Gustavo6046 has joined #openttd
11:06:41 *** WormnestAndroid has quit IRC
11:06:54 *** WormnestAndroid has joined #openttd
11:43:19 *** blvckhvze has joined #openttd
11:46:54 *** blvckhvze has quit IRC
12:06:33 *** andythenorth has quit IRC
12:07:08 *** andythenorth has joined #openttd
12:23:53 *** Samu has joined #openttd
12:46:19 <Samu> hi
12:47:39 <TrueBrain> https://bananas.staging.openttd.org/ <- bootstrap version is online; now let me make it auto-deploy :D
12:49:37 <andythenorth> \o/
12:50:53 <Samu> oh snap, it's not a heap
12:53:14 <Samu> the harm is already done, I can't just rename it
13:05:40 <DorpsGek_III> [OpenTTD/bananas-frontend-web] TrueBrain opened pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJSx
13:06:00 <TrueBrain> there we go, that should be it .. after that it should auto-deploy and everything :)
13:11:29 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain opened pull request #12: Fix: cleaning up usersessions could modify the list while iterating https://git.io/JfJ9t
13:20:05 <DorpsGek_III> [OpenTTD/OpenTTD] buynov commented on issue #8066: 1.10.1 crashes on start in OS X 10.12.6 https://git.io/JvA3B
13:21:38 <LordAro> TrueBrain: nice!
13:22:48 <DorpsGek_III> [OpenTTD/bananas-api] LordAro approved pull request #12: Fix: cleaning up usersessions could modify the list while iterating https://git.io/JfJ9c
13:23:05 <DorpsGek_III> [OpenTTD/bananas-api] LordAro approved pull request #11: Change: update the wishlist with what was found in bananas-frontend-web https://git.io/JfJ9C
13:23:26 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain merged pull request #12: Fix: cleaning up usersessions could modify the list while iterating https://git.io/JfJ9t
13:23:37 <TrueBrain> out-of-date, DOH
13:24:06 <DorpsGek_III> [OpenTTD/bananas-frontend-web] TrueBrain updated pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJSx
13:24:48 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain dismissed a review for pull request #11: Change: update the wishlist with what was found in bananas-frontend-web https://git.io/JfJ9C
13:24:49 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain updated pull request #11: Change: update the wishlist with what was found in bananas-frontend-web https://git.io/Jfv1F
13:25:45 <DorpsGek_III> [OpenTTD/bananas-frontend-web] LordAro commented on pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJ94
13:27:27 <DorpsGek_III> [OpenTTD/bananas-frontend-web] TrueBrain commented on pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJ9E
13:27:53 *** crem has quit IRC
13:32:24 <DorpsGek_III> [OpenTTD/bananas-frontend-web] lgtm-com[bot] commented on pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJ9o
13:33:42 <TrueBrain> I found a bug in LGTM :D
13:33:48 <LordAro> heh
13:34:39 <DorpsGek_III> [OpenTTD/bananas-frontend-cli] LordAro commented on pull request #1: Add: a very basic CLI frontend for BaNaNaS API https://git.io/JfJ9i
13:36:08 <TrueBrain> I am going to fix it nevertheless :)
13:36:15 <TrueBrain> bananas-api is with 0 alerts in LGTM .. I am shocked
13:36:43 <TrueBrain> hmm .. no, I think i cannot fix the LGTM comments :P
13:37:35 <DorpsGek_III> [OpenTTD/binaries-redirect] LordAro approved pull request #1: Add: first version of binaries-redirect https://git.io/JfJ9H
13:38:49 <LordAro> TrueBrain: that's an amusing edgecase
13:39:17 <DorpsGek_III> [OpenTTD/bananas-frontend-cli] TrueBrain updated pull request #1: Add: a very basic CLI frontend for BaNaNaS API https://git.io/JvjCk
13:40:06 <LordAro> i guess in theory it could cause issues if your import path was completely messed up
13:40:19 <DorpsGek_III> [OpenTTD/binaries-redirect] TrueBrain commented on pull request #1: Add: first version of binaries-redirect https://git.io/JfJ9F
13:41:01 <DorpsGek_III> [OpenTTD/binaries-redirect] TrueBrain commented on pull request #1: Add: first version of binaries-redirect https://git.io/JfJ9N
13:41:06 <DorpsGek_III> [OpenTTD/binaries-redirect] LordAro commented on pull request #1: Add: first version of binaries-redirect https://git.io/JfJ9A
13:41:09 <DorpsGek_III> [OpenTTD/binaries-redirect] TrueBrain merged pull request #1: Add: first version of binaries-redirect https://git.io/JvhSj
13:41:28 <TrueBrain> LordAro: yeah, I opted out of the ^ stuff
13:41:33 <TrueBrain> just because .. UGH
13:41:34 <TrueBrain> :P
13:42:22 <TrueBrain> owh, I didn't add auto-deploy scripts to that repository
13:42:22 <TrueBrain> ugh
13:42:28 <TrueBrain> on the todo list
13:44:42 <TrueBrain> LordAro: sounds more to me that LGTM is still considering Python2 behaviour, where this indeed would be plain wrong
13:45:28 <LordAro> mm
13:45:48 <LordAro> possibly worth renaming click.py to something else anyway?
13:45:58 <LordAro> i guess it could cause some confusion
13:46:04 <LordAro> click_helpers.py or whatever
13:46:14 <TrueBrain> meh; I used the same in a few other repositories
13:46:23 <TrueBrain> I rather keep it consistent for now; but yeah, I will give it a look later
13:46:36 <TrueBrain> (as in, when BaNaNaS is deployed in production, later)
13:46:45 <TrueBrain> the repos need a bit more of cleanup anyway
13:47:16 <TrueBrain> I guess this case could also be solved by doing "from webclient.click import ..."
13:47:41 <TrueBrain> but I am planning on moving this common stuff to a common library, and publish that on pypi tbh
13:47:46 <TrueBrain> just a "click-openttd" :P
13:47:53 <TrueBrain> I am now copy/pasting so much code between repos
13:47:55 <TrueBrain> it is bad
13:48:19 <LordAro> need a openttd-py repo :)
13:48:37 <TrueBrain> same with the API schema .. also has 2,possibly 3, implementations now
13:48:47 <TrueBrain> so if you don't mind, lets keep those things for after
13:49:05 <TrueBrain> (I have a hard time staying focused on solving the problem at hand, and not get distracted by making this pretty :P)
13:49:36 <LordAro> :)
13:49:58 <TrueBrain> this for me is bikeshedding :D Me enabling LGTM already was :P
13:53:34 <andythenorth> FOCUS TrueBrain :D
13:53:42 * andythenorth goes back to wikipedia
13:53:50 <andythenorth> my daily contribution is made
13:54:23 <michi_cc> andythenorth: Made an offer for one of those chemical plants yet? :p
13:54:36 <andythenorth> choosing what kind of tycoon I want to be
13:54:37 <DorpsGek_III> [OpenTTD/binaries-redirect] TrueBrain opened pull request #2: Fix: the name of the deployment is BinariesRedirect https://git.io/JfJHm
13:54:48 <andythenorth> Titanium Dioxide tycoon?
13:54:57 <DorpsGek_III> [OpenTTD/binaries-redirect] TrueBrain created new tag: 0.0.0 https://git.io/JfJH3
13:54:57 <andythenorth> Sulphuric Acid tycoon?
13:54:59 <DorpsGek_III> [OpenTTD/binaries-redirect] LordAro approved pull request #2: Fix: the name of the deployment is BinariesRedirect https://git.io/JfJHs
13:55:01 <TrueBrain> ignore that tag plz
13:55:18 * LordAro studies the tag intensely
13:55:39 * andythenorth adds it to wikipedia
13:56:39 <DorpsGek_III> [OpenTTD/binaries-redirect] TrueBrain merged pull request #2: Fix: the name of the deployment is BinariesRedirect https://git.io/JfJHm
13:57:05 <TrueBrain> turns out I already added the auto-deploy .. I did not know I did
13:59:16 <TrueBrain> LordAro: tnx for the bunch of reviews. Think I fixed all your comments, let me know if I missed any :)
14:00:12 <TrueBrain> owh, the OpenGFX nightly is failing btw. It is missing a 'apt update', and it will install a new GIMP .. hope it doesn't break anything :D
14:00:44 <TrueBrain> Your request exceeds one of the limits for this account. Remove one or more existing items and try again. Learn more
14:00:44 <TrueBrain> Cannot exceed quota for PoliciesPerUser: 10
14:00:50 <TrueBrain> Some AWS limits are just bullshit
14:08:39 <DorpsGek_III> [OpenTTD/bananas-frontend-web] TrueBrain commented on pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJH1
14:08:49 *** Gustavo6046 has quit IRC
14:09:14 *** Gustavo6046 has joined #openttd
14:09:39 <DorpsGek_III> [OpenTTD/OpenTTD] embeddedt commented on issue #8066: 1.10.1 crashes on start in OS X 10.12.6 https://git.io/JvA3B
14:27:49 *** Smedles has quit IRC
14:29:03 *** Smedles has joined #openttd
14:35:53 *** crem has joined #openttd
14:57:05 *** Progman has quit IRC
16:00:41 <DorpsGek_III> [OpenTTD/OpenTTD] magnus-forsberg opened issue #8090: Game crashes on launch on OS X https://git.io/JfJdh
16:05:44 <DorpsGek_III> [OpenTTD/OpenTTD] nielsmh commented on issue #8090: Game crashes on launch on OS X https://git.io/JfJdh
16:05:45 <DorpsGek_III> [OpenTTD/OpenTTD] nielsmh closed issue #8090: Game crashes on launch on OS X https://git.io/JfJdh
16:08:40 *** glx has joined #openttd
16:08:40 *** ChanServ sets mode: +v glx
16:16:48 <Samu> glx, do you remember that convert.exe file you used to give me, I used it to generate script logs. it doesn't seem to be generating logs, it only gets generated on exit
16:17:43 <Samu> during a server, it's only able to log player join and player leave, but not any log the ais generate
16:17:49 <glx> totally unrelated, that's how windows manages console output
16:18:33 <Samu> openttd.exe -D -c D:\OpenTTD\Core1\openttdCore1.cfg 1>>D:\OpenTTD\Core1\openttdCore1log.txt 2>&1
16:18:40 <Samu> is this still correct?
16:19:18 <glx> yes, but don't try to read the file before exit, it will be empty
16:19:58 <Samu> why not, it used to work like that
16:20:15 <glx> because windows probably changed stuff
16:21:41 <Samu> it's only able to log player join/leave before exit
16:22:23 <glx> maybe ai debug level is too low
16:22:56 <Samu> it's set to 9
16:23:39 <Samu> debuglevel net=1
16:23:39 <Samu> debuglevel script=9
16:27:10 <Samu> I just typed "help" in the server, and the help text appeared on the .txt log file
16:27:32 <Samu> something is working, but not the way I want
16:32:57 *** Wormnest has joined #openttd
16:34:49 <Samu> remind me what 2>&1 is doing
16:35:28 <LordAro> Samu: redirecting stderr (2) to stdout (1)
16:36:11 <glx> oh and I think the redirection must be done before redirecting to the file
16:36:25 <glx> so 2>&1 >file
16:37:20 <LordAro> glx: i find "sometimes" it works after, sometimes it doesn't
16:37:24 <LordAro> probably depends on the shell
16:37:33 <glx> or is it the opposite, I never remember but there's a comment in regression scripts
16:38:19 <glx> ' 2>&1 must be after >tmp.regression, else stderr is not redirected to the file
16:38:27 <glx> so after :)
16:38:46 <Samu> oh, right, i should look at how regression is doing it
16:48:37 <Samu> gonna try weird stuff
16:48:43 <Samu> 3 >&1
16:49:54 <Samu> it logged something
16:50:07 <Samu> "
16:50:07 <Samu> D:\OpenTTD\Core1>exit
16:50:07 <Samu> " that's the thing I typed to exit the server
16:54:22 <Samu> grr, can't get it to do what I want
16:57:42 <Samu> it only writes the log on the .txt file on exit, bah, disappointing
16:58:06 <Samu> oh well, better than nothing
17:04:45 <Samu> aha, managed to get it working! I had to build openttd myself
17:04:52 <Samu> then run the convert.exe
17:05:04 <Samu> the openttd from the installer doesn't work
17:29:34 *** Flygon has quit IRC
17:47:27 *** k-man has joined #openttd
17:53:58 *** k-man__ has quit IRC
18:00:53 *** Samu_ has joined #openttd
18:02:39 <DorpsGek_III> [OpenTTD/OpenTTD] glx22 updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
18:07:21 *** crem has quit IRC
18:07:41 *** Samu has quit IRC
18:07:49 *** crem has joined #openttd
18:10:34 <DorpsGek_III> [OpenTTD/bananas-frontend-web] TrueBrain updated pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJSx
18:10:44 *** frosch123 has joined #openttd
18:13:46 <TrueBrain> sweet, the new BaNaNaS frontend now correctly reports to sentry :D
18:14:15 <frosch123> does anyone actually know javascript?
18:14:26 <TrueBrain> there are people who claim as such
18:14:27 <TrueBrain> :D
18:14:49 <frosch123> turns out I don't :p
18:14:53 <TrueBrain> frosch123: the frontend is deployed on staging now. And we still have to fix the "description" bug (template assume it is mandatory, while it is optional :D)
18:14:59 <TrueBrain> something I can help with?
18:16:03 <TrueBrain> I have to say, I am really happy with the GitHub login flow
18:16:14 <TrueBrain> now I am authenticated, I only have to press "Manager", and it logs me in
18:16:17 <TrueBrain> no questions asked
18:16:33 <TrueBrain> on the other hand, it is a bit weird it doesn't ask me anything :D
18:16:59 <frosch123> there is a query parameter for the auth url to force reauthentication :)
18:17:27 <TrueBrain> this does make it silky smooth
18:17:35 <TrueBrain> but we will have to keep an eye on it, how people experience it
18:18:08 <frosch123> anyway: if i declare a variable in one <script>, apparently it is not visible in some other <script>
18:18:09 <TrueBrain> hmm .. I should be able to make sentry create issues on github .. let me see ..
18:18:25 <frosch123> i thought everything was global in js
18:18:27 <TrueBrain> depending what the content of that script is, that is correct
18:18:30 <TrueBrain> it is
18:18:40 <TrueBrain> but most people start their javascript in a way that makes it not
18:18:43 <TrueBrain> (it creates a local scope)
18:19:17 <TrueBrain> as they found out it is a terrible idea to have everything in the same scope :D
18:19:49 <FLHerne> frosch123: I did once, but now it changes every year :P
18:20:05 <FLHerne> (and even if the language doesn't, the framework du jour does)
18:20:43 <frosch123> also, turns out npm created a nodejs package, which is apparently a different thing to what webbrowsers run
18:20:45 <TrueBrain> writing in typescript removes many of these hurdles, lucky enough .. but .. it is learning a whole new language :P
18:20:48 <frosch123> it uses "require" and stuff
18:21:04 <TrueBrain> haha, you really fell into thisone didn't you? :D
18:21:19 <TrueBrain> https://github.com/tus/tus-js-client <- you used thisone?
18:21:20 <frosch123> so, i still have no idea how to get a tus.js
18:21:25 <frosch123> yes
18:22:40 <TrueBrain> you have the dist/tus.js ?
18:23:05 <frosch123> npm created one, but it contains "require"
18:24:26 <TrueBrain> bit annoying it is not in their release packages tbh
18:24:50 <frosch123> anyway, no idea how to debug my variable issues
18:25:05 <frosch123> i thought i could implement this tus stuff with google and stackoverlfow
18:25:08 <frosch123> but i am lost :)
18:25:10 <TrueBrain> :D
18:25:19 <TrueBrain> sadly, I am not of much help, other than me trying it myself :P
18:25:40 <TrueBrain> lol .. why did it just download Chromium .. tus is silly
18:26:07 <TrueBrain> in my dist/tus.js, there is "require", but it is created first
18:26:23 <TrueBrain> I did: git clone https://github.com/tus/tus-js-client; cd tus-js-client; npm install; npm run build
18:26:28 <DorpsGek_III> [OpenTTD/OpenTTD] glx22 updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
18:26:47 <TrueBrain> with that javascript file, you can use the Example snippet in their README
18:27:16 <TrueBrain> something like: <script src="dist/tus.js"></script><script>var upload = new tus.Upload(...);</script>
18:27:35 <glx> the joy of using npm ?
18:28:00 <TrueBrain> nothing wrong with npm tbh
18:28:04 <TrueBrain> their README is just a bit ... euhm ..
18:28:11 <TrueBrain> well, they assume a lot of things :D
18:28:18 <DorpsGek_III> [OpenTTD/bananas-frontend-web] lgtm-com[bot] commented on pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJAd
18:28:30 <TrueBrain> yes LGTM, I know, and I am still ignoring you
18:28:47 <glx> at least the bot is working
18:29:11 <frosch123> https://github.com/frosch123/bananas-frontend-web/commit/6d4549c37646a81586ccd85b0b182a8a3e330ff7 <- that's what i have
18:29:15 <glx> and it's not as spamy as the deps one
18:29:20 <frosch123> but it fails with very basic problems :)
18:30:00 <TrueBrain> you npm-ified the repo too? Bold :D
18:31:04 <TrueBrain> okay, I get why you do it this way; not a bad idea :)
18:31:43 <frosch123> you seem to assume i knew what i was doing :p
18:31:54 <TrueBrain> despite that, this is not a bad idea :D
18:33:08 <TrueBrain> first, I am going to see if I can get LGTM to shut up about this warning .. I have an idea how to solve it
18:33:13 <TrueBrain> after .. I am going to check your code :D
18:38:14 <DorpsGek_III> [OpenTTD/bananas-frontend-web] TrueBrain updated pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJSx
18:38:20 <TrueBrain> we will see if this solves it
18:41:52 <frosch123> you removed the logging of failed api reqursts? are you logging them somewhere else?
18:42:07 <TrueBrain> it was not logging of FAILED API requests
18:42:09 <frosch123> oh, nvm
18:42:12 <TrueBrain> I removed the logging of ALL API requests :D
18:42:24 <frosch123> yes, i do not know my code :)
18:42:25 <TrueBrain> the logs were filling up rather quickly :D
18:42:28 <TrueBrain> :P
18:42:31 <TrueBrain> does any of us, really?
18:43:48 <TrueBrain> "Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-BLA'), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback."
18:43:54 <TrueBrain> that I get when I run your branch
18:46:42 <frosch123> yes, that's something that needs adjusting in template()
18:46:43 <TrueBrain> you have a typo on line 67 in uploader.js
18:46:55 <TrueBrain> it is not "upload", but "upload_instance"
18:46:58 <TrueBrain> see the line above
18:47:05 <DorpsGek_III> [OpenTTD/bananas-frontend-web] lgtm-com[bot] commented on pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJx8
18:47:07 <TrueBrain> after that I hit more CORS
18:47:09 <TrueBrain> but it works otherwise
18:47:26 <frosch123> for me it complanied that "filelist" is unknown
18:48:10 <TrueBrain> so you got further
18:48:19 <TrueBrain> how do I bypass CORS ..
18:49:27 <TrueBrain> or do you mean on line 29 already?
18:49:48 <TrueBrain> as it complained about filelist, but that was because of the error earlier
18:49:54 <frosch123> i saw the message about the csp, but it did not stop it from giving more errors when i select files
18:50:04 <frosch123> yes 29
18:50:06 <TrueBrain> yes .... but that makes total sense of course
18:50:14 <TrueBrain> I mean ... you should know better; start with the first error :D
18:50:19 <TrueBrain> your inline script is refused to execute
18:50:23 <TrueBrain> so of course filelist is undefined :)
18:50:30 <TrueBrain> I disabled line 26 in helpers.py
18:50:36 <frosch123> the inline script is refused?
18:50:39 <TrueBrain> that fixes CSP :P
18:50:42 <TrueBrain> that is what the error says :)
18:50:49 <TrueBrain> "Refused to execute inline script"
18:50:52 <frosch123> oh, ... i thought it would affect loading stuff from extern
18:51:17 <frosch123> ok, your error is more explicit than mine
18:51:26 <TrueBrain> I am using Chrome :P
18:51:43 <frosch123> i thought ff was the webdev-ide
18:51:53 <frosch123> did that change in the last years?
18:51:55 <DorpsGek_III> [OpenTTD/bananas-frontend-web] TrueBrain updated pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJSx
18:52:02 <TrueBrain> I am pretty sure the jury is still not out on that
18:52:26 <TrueBrain> I am giving up on the LGTM warning for now. Something to fix another time :D
18:52:52 <frosch123> did you fix the flake issues?
18:52:59 <TrueBrain> I removed my commit
18:53:07 <TrueBrain> so, indirectly, I did :D
18:53:15 <TrueBrain> LGTM things "import click" and "import .click" are the same thing
18:53:17 <TrueBrain> it is not :P
18:53:28 <TrueBrain> but it only complains in frontend-web .. not in api
18:53:30 <TrueBrain> which is weird :P
18:53:37 <TrueBrain> but I am going to fix this completely differently anyway, so meh
18:53:46 <TrueBrain> first, we make it work
18:53:48 <TrueBrain> after, we make it pretty :)
18:54:09 <TrueBrain> not sure how to solve the CORS issue .. in production, it is all on the same URL
18:54:15 <TrueBrain> it is only locally, that we have two different ports
18:54:53 <frosch123> how do you tell the docker to run github auth?
18:55:01 <frosch123> or does staging run developer?
18:55:24 <TrueBrain> staging runs github
18:55:39 <TrueBrain> and to run github yourself, you need to make an oauth app
18:56:13 <frosch123> i am just asking because of the CMD in the dockerfile
18:56:14 <TrueBrain> and set the env BANANAS_API_USER_GITHUB_CLIENT_ID and BANANAS_API_USER_GITHUB_CLIENT_SECRET according
18:56:28 <TrueBrain> I overrule the CMD in AWS
18:56:38 <TrueBrain> I made the Docker do devy-stuff
18:56:57 <TrueBrain> hoping that would help :D
18:57:15 <TrueBrain> owh, you meant with bananas-frontend-web btw, sorry, you were looking at the PR ofc :)
18:57:25 <TrueBrain> so yeah, on the AWS deployment the CMD is totally different
18:57:29 <TrueBrain> this is just meant to run locally
18:58:12 <frosch123> ok, i thought i would find something about that in the .yml
18:59:02 *** supermop_Home has joined #openttd
18:59:43 <TrueBrain> no, it is all inside the infra itself
18:59:53 <TrueBrain> in AWS you define a Task Definition with these things in there
18:59:59 <TrueBrain> the GitHub Actions only trigger a redeployment
19:02:03 <DorpsGek_III> [OpenTTD/bananas-frontend-web] frosch123 approved pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJxb
19:03:20 <TrueBrain> okay, got your stuff to work, somewhat
19:03:39 <TrueBrain> now the authentication fails
19:03:46 <TrueBrain> but I expected that looking at the code :D
19:04:16 <frosch123> you mean the missing headers?
19:04:22 <DorpsGek_III> [OpenTTD/bananas-frontend-web] TrueBrain merged pull request #8: Add: dockerize this repository and make sure that it can run on AWS https://git.io/JfJSx
19:04:29 <TrueBrain> yeah
19:04:36 <frosch123> i stored them in some variables, but did not use them yet
19:04:46 <TrueBrain> indeed :) That is why I was expecting it to fail ;)
19:04:50 <TrueBrain> but I get a nice 401 back now
19:04:55 <TrueBrain> CORS is solved by tus
19:04:59 <TrueBrain> it returns the right headers
19:05:09 <TrueBrain> so I disabled the CSP header
19:05:17 <TrueBrain> changed the tus_url to: tus_url="http://localhost:1080/new-package/tus/",
19:05:23 <TrueBrain> - upload.start();
19:05:23 <TrueBrain> + upload_instance.start();
19:05:27 <TrueBrain> and your code works
19:05:34 <TrueBrain> so you didn't so bad :P Most issues were not javascript related :)
19:08:12 <frosch123> so the tus.js actually works?
19:08:15 <TrueBrain> yes
19:09:40 *** gelignite has joined #openttd
19:10:39 *** Progman has joined #openttd
19:11:11 <TrueBrain> seems the main next thing to solve is how to send the authentication token too
19:11:46 <frosch123> isn't it tus.headers = ...
19:12:14 <TrueBrain> dunno :)
19:12:20 <TrueBrain> you want to fiddle with this some more?
19:12:21 <frosch123> anyway, i hoped i could contain the api token in the python, but now i have to exploit it to the client
19:12:33 <TrueBrain> yeah, I knew that was going to happen
19:12:36 <TrueBrain> not sure if we can avoid it
19:12:55 <TrueBrain> I have been thinking if the tus-authentication shouldn't be done differently or something
19:12:57 <TrueBrain> but .. I dunno
19:12:57 <frosch123> next i will make some food
19:13:05 <TrueBrain> enjoy your food :)
19:13:07 <frosch123> so you have 45min without me at least :)
19:13:26 <TrueBrain> nah; I am looking into getting the bananas-server run on AWS
19:13:32 <TrueBrain> mainly, also via IPv6 :P
19:14:16 <andythenorth> food!
19:14:45 <TrueBrain> and indeed frosch123 , you can set 'headers'
19:18:19 <TrueBrain> but back to CORS being a bitch :P
19:18:35 <andythenorth> supermop_Home you here? :)
19:18:36 <TrueBrain> "Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response."
19:19:04 <andythenorth> oof before CORS there used to be an origin policy in Flash swf
19:19:12 <andythenorth> so we all just set it to * everywhere
19:19:18 <andythenorth> the old internet was more lolz
19:21:59 <TrueBrain> yeah, tusd correctly sets things very narrow
19:22:06 <TrueBrain> and I added "Authorization" to the list
19:22:11 <TrueBrain> tusd doesn't allow me to modify the list
19:22:12 <TrueBrain> ugh
19:22:59 <TrueBrain> I suspect we also have to support authorization via other means :D
19:24:27 <TrueBrain> and it is only an issue for development, ironicly
19:27:21 <TrueBrain> ah, of course, this was this recent thing where localhost was now also in CORS scope
19:27:49 <TrueBrain> tusd says: put a proxy in front of it, not my problem
19:27:57 <TrueBrain> but .. yeah ... for a development setup, you kinda want to avoid that :D
19:40:31 <TrueBrain> frosch123: found a few more bugs in the frontend: if your upload token expire, you get a weird error page. And if your session expires, the frontend doesn't recover
19:40:34 <TrueBrain> two things worth fixing :D
19:40:46 <TrueBrain> I am modifying the API for this to work btw
19:43:00 <TrueBrain> okay; now it seems to work. Well, minus the javascript errors that happen when the upload succeeded. Like update_status() not existing :D
19:49:27 <TrueBrain> frosch123: https://gist.github.com/TrueBrain/d24e37acaf7e66161ceb22a71c15b3b0
19:49:46 <TrueBrain> euh .. let me try that again
19:50:08 <TrueBrain> https://gist.github.com/TrueBrain/83bccbb9dc13108c33ad252120be9677
19:51:41 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain opened pull request #13: Add: allow setting Authorization / Upload-Token in Metadata for tus-c… https://git.io/JfJjU
19:52:27 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain merged pull request #11: Change: update the wishlist with what was found in bananas-frontend-web https://git.io/Jfv1F
19:52:48 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain updated pull request #13: Add: allow setting Authorization / Upload-Token in Metadata for tus-clients https://git.io/JfJjU
19:58:35 <frosch123> TrueBrain: do we actually need authentication for tusd? isn't the upload_token enough of a secret?
19:58:50 <TrueBrain> check the PR ;)
19:58:52 <TrueBrain> same issue :)
19:59:07 <TrueBrain> so yes, that would be enough, but no, that doesn't solve anything :)
19:59:31 <TrueBrain> hmm, my PR doesn't work. Ugh, euhmmmm
19:59:55 <frosch123> oh, i mixed up upload_token and file_uuid :p
20:00:03 <TrueBrain> yes, you did :)
20:00:21 <TrueBrain> no, this PR is not going to work .. tusd does something I did not expect
20:00:23 <TrueBrain> euhmmmm
20:00:58 <TrueBrain> I need to think about this .. this is more tricky than I expected
20:01:31 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain commented on pull request #13: Add: allow setting Authorization / Upload-Token in Metadata for tus-clients https://git.io/JfJjc
20:01:31 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain closed pull request #13: Add: allow setting Authorization / Upload-Token in Metadata for tus-clients https://git.io/JfJjU
20:01:41 <TrueBrain> you can still use it to continue your work on the uploader btw
20:01:47 <TrueBrain> for small files, it should work
20:01:48 <TrueBrain> I think
20:01:54 <TrueBrain> hmm .. no
20:01:55 <TrueBrain> ugh
20:02:02 <frosch123> TrueBrain: wouldn't it solve to not have to expose the api-token to the client?
20:02:24 <TrueBrain> there are two things to that: 1) only if that is considered a problem ;)
20:02:37 <TrueBrain> 2) it would increase the complexity of the API by a lot
20:02:47 <TrueBrain> so by the: build first, improve later
20:02:59 <TrueBrain> :D
20:03:24 <TrueBrain> the API is now very simple: either it is a public endpoint, or you need the authentication header
20:03:27 <frosch123> about 1) with the api-token you have access to everything. so it's along the line of csrf
20:03:54 <TrueBrain> you can also write your own client to upload stuff on the API. So what is the issue there? :)
20:04:26 <TrueBrain> I guess it does bring up a point btw .. we trust ANY client atm
20:04:35 <TrueBrain> s/client/frontend
20:04:58 <TrueBrain> so in terms of CSRF, that might already be somewhat of an issue :P
20:05:00 <frosch123> the problem is if someone steals your api-token
20:05:23 <TrueBrain> you kinda already can, because GitHub doesn't ask for approval
20:05:26 <TrueBrain> re-approval?
20:05:43 <TrueBrain> if you get what I mean
20:05:45 <frosch123> yes, but the frontend does
20:05:58 <frosch123> frontend has csrf tokens
20:06:45 <TrueBrain> I don't disagree that showing the api-token could be an issue, but it made me realise more we have a bigger one: any frontend can get the api-token
20:06:57 <TrueBrain> if you authenticated once, anyone can :)
20:07:48 <frosch123> hmm, i see
20:08:08 <frosch123> but that is not solveable if you want a console client :)
20:09:12 <TrueBrain> so we need to do several things, I think: first of all, whitelist redirect_urls
20:09:20 <TrueBrain> I already knew that was coming, so I guess that is fine
20:09:50 <TrueBrain> that solves randomly leaking of the API token
20:09:59 <TrueBrain> next, I guess, we need to make GitHub always ask: is this okay to login
20:10:13 <TrueBrain> but given we return the location header, anyone can modify this
20:10:17 <TrueBrain> so that is not really a protection against anything
20:10:27 <TrueBrain> for the CLI .. we need to think up something for that too
20:10:53 <TrueBrain> but most of all, we need to rethink tus :D
20:11:09 <TrueBrain> as besides the api-token, this CORS is a pita :D
20:11:22 <TrueBrain> what we are doing is simply not really nice :P
20:12:20 <TrueBrain> (you talk to a webfrontend, and you have to upload your files somewhere else, basically :P)
20:12:44 <TrueBrain> the CORS is also going to hit in production, I realised; as the APi is on another domain
20:14:40 <frosch123> hmm, is can we tunnel the tus data through the frontend somehow?
20:14:51 <TrueBrain> I really wanted to avoid that tbh
20:19:11 <TrueBrain> what I wanted to prevent, which tusd allows by default, that anyone can upload any file to it
20:20:27 <TrueBrain> but given the upload-token only exists for ~15 minutes
20:20:39 <TrueBrain> I guess it is safe to assume abuse based on that is highly unlikely
20:20:57 <TrueBrain> worst case, someone uploads a file, and someone replaces that with something else
20:21:04 <TrueBrain> it remains user-input, so from our perspective, nothing really changed
20:21:32 <TrueBrain> the only thing that might be an issue, is integrity of the files
20:21:41 <TrueBrain> I guess the chances on that are ... too low to worry about
20:22:11 <TrueBrain> it remains dirty :P
20:22:23 <frosch123> the upload-token is not guessable in advancwe
20:22:33 <TrueBrain> it really is not, no :)
20:22:46 <TrueBrain> so it is as secure as the api-token
20:23:23 <TrueBrain> I see three options: 1), tunnel tus through the frontend, 2) make tus only require upload-token, or 3) make whole of "new-package" only require upload-token (and no longer authorization)
20:23:33 <TrueBrain> 1) is ugh, from a performance point-of-view
20:23:41 <TrueBrain> 3) is the cleanest, but makes a bit of a weird API, I guess
20:23:47 <TrueBrain> 2) is a bit the solution in-between
20:24:48 *** Samu has joined #openttd
20:25:15 <frosch123> i like 2, since then at least the /new-package/publish uses the normal flow
20:27:21 <frosch123> so... i don't get this csp thing. it seems to generally disallow inline scripts... but how do i get tokens into the js then...
20:27:41 <frosch123> should i add hidden html elements like <input hidden>, which the js extracts from the dom again?
20:27:44 <TrueBrain> what we normally do, is make a HTML tag that is hidden with data attributes
20:27:52 <TrueBrain> so yeah
20:28:01 <TrueBrain> <input ... data-token="" data-bla="">
20:28:06 <TrueBrain> as that is not dynamic ;)
20:28:31 <frosch123> can i use custom attributes?
20:28:41 <TrueBrain> data-NNN
20:28:41 <frosch123> your "data-bla" suggets that
20:28:41 <TrueBrain> yes
20:28:51 <TrueBrain> data-* is ... not a custom attribute, yet it is
20:28:56 <TrueBrain> it is basically part of the spec :P
20:29:01 <frosch123> :o
20:29:10 <frosch123> noqa
20:29:11 <TrueBrain> https://www.w3schools.com/tags/att_data-.asp
20:29:24 <TrueBrain> IE5.5 :D
20:29:56 *** snail_UES_ has joined #openttd
20:30:21 <frosch123> is that a magic version?
20:30:29 <TrueBrain> no, it is just really old
20:30:39 *** Samu_ has quit IRC
20:31:51 <andythenorth> wasn't that mac only?
20:32:04 * andythenorth recently deleted some IE 6 stylesheets
20:32:51 <frosch123> does edge actually add something to chrome? or does it just replace google with bing?
20:33:04 <frosch123> edge reminds me about the old aol browsers
20:33:16 <frosch123> which essentially replaced the ie logo with an aol one
20:34:26 <TrueBrain> frosch123: re: api-token: if we would to make a rich frontend, it would also know the api-token btw
20:34:37 <TrueBrain> as it would be a wrapper around the API
20:34:53 <TrueBrain> (just something that pop'd to mind)
20:38:26 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain opened pull request #14: Add: tus-endpoint now only needs upload-token and moved to Metadata https://git.io/JfUep
20:38:38 <TrueBrain> with ^^ tus only needs upload-token in the metadata
20:39:16 <TrueBrain> please test :D
20:42:31 <DorpsGek_III> [OpenTTD/bananas-frontend-cli] TrueBrain updated pull request #1: Add: a very basic CLI frontend for BaNaNaS API https://git.io/JvjCk
20:42:39 <TrueBrain> for now, I am fine with this
20:42:40 <frosch123> you pass a file_uuid to get_Session_by_token, right? but then get_session expects an api-token?
20:42:51 <TrueBrain> not file-uuid
20:42:53 <TrueBrain> upload-token
20:43:29 <frosch123> yes, upload-token, but that is still no api-token
20:43:40 <TrueBrain> file-uuid returns a blob of metadata via tus. In this metadata is the upload-token. With the upload-token I lookup the user. With the user and upload-token, I look up the session
20:44:30 <TrueBrain> not sure what you are aiming at :) api-token is only used now for protected endpoints (and not tus), and handled in another part of the server
20:45:01 <frosch123> you didn't run flake
20:45:06 <TrueBrain> mind you, there is some very poorly wording in the API: get_session has nothing to do with api-token :)
20:45:20 <TrueBrain> I did run flake :o
20:45:40 <TrueBrain> it returns nothing here :op
20:45:48 <TrueBrain> owh, regression_runner
20:45:49 <TrueBrain> lol
20:45:50 <frosch123> if _sessions[user.full_id]["token"] != token: <- i don't get that line
20:46:05 <frosch123> is there only one upload-token per user-session?
20:46:14 <TrueBrain> 1 user can only have 1 active upload, yes
20:46:38 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain updated pull request #14: Add: tus-endpoint now only needs upload-token and moved to Metadata https://git.io/JfUep
20:47:16 <TrueBrain> I should add some types in that repository, that would help :)
20:47:54 <TrueBrain> and that check, honestly, is completely unneeded. It is just a safety check if I wrote correct code :P
20:48:16 <TrueBrain> accidently it wouldpick up users doing weird shit
20:49:02 <TrueBrain> but this is basically why I suggested 3) above. The "user" part is totally unneeded here now
20:49:11 <frosch123> i think it's a valid use-case that a user uploads two packages during one session
20:49:16 <frosch123> so at least they should not get mixed
20:49:28 <TrueBrain> you mix up the word "session" here, I think
20:49:36 <TrueBrain> you can upload as many packages during a user-session as you like
20:49:42 <TrueBrain> you can only upload 1 package at the time
20:49:51 <TrueBrain> the uploading of a package is called "session"
20:50:03 <TrueBrain> (as the API didn't had user-sessions for a long long time)
20:50:08 <frosch123> ok, so session is per upload-token, not per api-token
20:50:12 <TrueBrain> yes
20:50:16 <TrueBrain> that I tried to tell earlier :D
20:50:28 <TrueBrain> I promise, this repository will be rewritten to be more readable ;)
20:50:45 <TrueBrain> as user-session vs session is just stupid :P
20:51:13 <TrueBrain> but yes, and an upload-token is deleted after publish (or after timeout)
20:51:32 <nielsm> hm water with depth, if graphics should be able to make transitions between depth levels should that be handled as water edges (like canals and rivers) or as alternate tile sprites (via callback)
20:51:36 <frosch123> good :)
20:51:45 <TrueBrain> I hope it now makes a bit of sense :P
20:51:57 <TrueBrain> normally I refactor this ealier; but I try to keep a focus on the goal here :D
20:54:23 <frosch123> is chunk_size something i should set in the front-end? i left it with whatever the default is
20:54:31 <TrueBrain> fine by me
20:54:43 <DorpsGek_III> [OpenTTD/bananas-api] frosch123 approved pull request #14: Add: tus-endpoint now only needs upload-token and moved to Metadata https://git.io/JfUv2
20:55:07 <TrueBrain> I think we need to tune it over time, as I think it is ~4MB somewhere, that most proxies allow
20:55:16 <TrueBrain> but .. for now .. what-ever the default is .. fine by me
20:55:23 <TrueBrain> the python implementation has infinite, as default
20:55:26 <TrueBrain> that failed quickly :D
20:55:46 <TrueBrain> so you will notice soon or later what happens when I try to upload OpenGFX :D
20:56:48 <DorpsGek_III> [OpenTTD/bananas-api] TrueBrain merged pull request #14: Add: tus-endpoint now only needs upload-token and moved to Metadata https://git.io/JfUep
20:57:01 <TrueBrain> right .. that means you only need to solve CSP :D
20:57:22 <frosch123> i am trying to adjust that storing data in the dom is "normal"
21:01:01 *** cHawk- has quit IRC
21:01:36 *** cHawk- has joined #openttd
21:01:59 <TrueBrain> :D
21:02:03 <Samu> omg i uploaded stuff wrong to bananas, i disappoint myself
21:02:10 <Samu> now i can't delete it
21:03:33 <Samu> can i ask you to delete the last version of LuDiAI AfterFix? the one with 16? I was supposed to write v16
21:03:52 <Samu> doesn't let me edit :(
21:19:49 <nielsm> problem with depth transitions: it can require up to 240 variations for just one edge
21:20:26 <nielsm> and if you also want to take 5 neighboring tiles into account rather than just 1 neighboring tile, just lol
21:20:40 <michi_cc> Samu: Want to test some stuff?
21:21:57 <Samu> hmm what's to test
21:22:08 <michi_cc> I whipped up some real native queue: https://www.icosahedron.de/openttd/patches/script_priority_queue.patch
21:22:19 <andythenorth> so how to do methane / natural gas cargo?
21:22:36 <michi_cc> Please note that I did NOT test it in any form. It compiles, it might not work from squirrel at all.
21:23:22 <andythenorth> methane mostly goes in pipelines
21:23:22 <nielsm> andythenorth, prefilled pressure tanks that get loaded on flat cars?
21:23:30 <andythenorth> there is LNG in tankers, but it's rare
21:24:10 <andythenorth> frosch123 try this: 'storing data in the dom is wrong but normal'
21:24:17 <andythenorth> I had to make peace with it
21:24:47 <andythenorth> also 'lol namespaces' can hit you sooner than you expect if you use 3rd party plug ins :D
21:25:16 <Samu> hmm
21:25:32 <Samu> not sure what to do with a .patch file
21:25:37 <Samu> does visual studio read that
21:25:50 <nielsm> no
21:25:58 <nielsm> commandline: git patch foo.patch
21:26:06 <Samu> oh
21:26:08 <nielsm> sorry
21:26:12 <nielsm> commandline: git apply foo.patch
21:26:37 <nielsm> "git diff" generates a patch, "git apply" applies a patch
21:28:54 <nielsm> ughh... now I think I have made the changes to support depth slope sprites, now I need to make a newgrf that does it
21:29:56 <michi_cc> I pushed in to the branch script_native_queue on https://github.com/michicc/OpenTTD as well.
21:29:58 <nielsm> lol https://0x0.st/i1oO.jpg
21:30:01 *** cHawk- has quit IRC
21:30:10 <frosch123> wtf... i uses dashes in data-* and in js they show up in camelcase?
21:30:12 <nielsm> not quite as intended
21:30:41 *** cHawk- has joined #openttd
21:30:59 <TrueBrain> frosch123: MAGIC :D
21:31:00 <nielsm> ah figured out my mistake
21:31:12 <TrueBrain> there is much more to that, but data- attributes are fun :)
21:33:19 <Samu> ah, better than patch file
21:34:40 <nielsm> at work I developed a callcenter wallboard reporting on current queue status, configured by writing a <table><thead> with the columns you want and some data about how to format each of them, then the js generates the tbody from the data downloaded as a json dump
21:35:02 <nielsm> it feels like a neat way configure an application like that
21:38:34 *** arikover has joined #openttd
21:39:12 <nielsm> hmm... actually how do I best allow a water tile callback to query the depth of neighboring tiles,
21:39:28 <nielsm> there's 8 neighbors and each requires 4 bits, so could technically pack it all into 32 bits
21:39:33 <nielsm> but that sounds like a bad idea
21:40:09 <andythenorth> is it food time?
21:40:22 <frosch123> nielsm: check nearbytileinfo
21:40:35 <frosch123> it exists for all the advaned features like industries and houses
21:40:38 <frosch123> objects, ...
21:41:28 <nielsm> and 0x60 variables should also work for water features without any extra magic added?
21:41:35 <frosch123> GetNearbyTile()
21:41:36 <nielsm> they don't have any yet
21:42:04 <frosch123> nielsm: we did not add any complex variables for tiles that appear in mass, to disencourage complex grfs
21:42:15 <frosch123> but there is nothing preventing adding
21:42:42 <nielsm> yeah I'm also not sure if it will be a misfeature to allow depth slopes
21:42:46 <nielsm> since there's so many possible variations
21:43:12 <frosch123> i think anything more complex than snow density is too much
21:44:04 <frosch123> if you can create some fake-slope, so that smooth-snow-transitions work, it's good .)
21:46:36 <nielsm> yeah I'll just revert this, it's a misfeature
21:46:50 <nielsm> ottd is not a high fidelity graphics game
21:47:49 <nielsm> we can reconsider adding some kind of automatic fading between ground tiles when a GPU-accelerated video driver happens
21:49:12 <andythenorth> oof FIRS chemicals economy
21:49:26 <andythenorth> probably should be too detailed on petrochemicals :P
21:50:09 <andythenorth> propene and propylene and all that jass
21:50:21 <andythenorth> all just pipelines or tankers
21:50:40 <andythenorth> should / shouldn't /s
21:51:01 <andythenorth> phenols, pthalates, BTX, benzen, acetone
21:51:07 <andythenorth> all just seems 1 step too far
21:51:42 <andythenorth> petrochemical refining is very mysterious to me
21:51:46 <nielsm> spacefaring economy?
21:51:54 <andythenorth> everything seems to be steam cracked or whatever, then just recombined
21:51:59 *** adikt- has joined #openttd
21:52:09 <nielsm> you can have a gigantic rocket launch pad
21:52:17 <andythenorth> hydrogen peroxide
21:52:46 <andythenorth> I guess there's a difference between mixtures and compounds?
21:52:57 * andythenorth should have paid attention in school
21:53:01 *** cHawk- has quit IRC
21:53:06 <andythenorth> doesn't Eddi|zuHause do chemicals?
21:53:13 <michi_cc> You could add at least a billion different catalysts in there :)
21:53:31 *** cHawk- has joined #openttd
21:53:34 *** Wormnest has quit IRC
21:53:35 <Eddi|zuHause> could you precisise the question?
21:54:01 <DorpsGek_III> [OpenTTD/OpenTTD] nielsmh commented on pull request #7924: Feature: Water tiles have a depth https://git.io/JfUJe
21:54:19 *** adikt has quit IRC
21:54:34 <frosch123> andythenorth: look up a 12th grade school program? and add the receipts they discuss?
21:55:17 <nielsm> frosch123: depth level transitions is kind of pointless with this, right? https://user-images.githubusercontent.com/1062071/79669886-2d7b1880-81bf-11ea-86ae-ece7575809b4.png
21:55:27 <andythenorth> precisise is good wood
21:55:29 <nielsm> already very fine grained transitions
21:55:59 <andythenorth> to put my question another way, are we doing pipelines? o_O
21:56:05 * andythenorth suspects the answer is known
21:57:29 <frosch123> ugh... how do i escape names in querySelector?
21:57:38 <frosch123> is there a better solution that querySelector?
21:58:15 <Samu> did you create this queue in just 1 day?
21:58:36 <Samu> you work fast!
21:58:38 <frosch123> nielsm: there is some magic with water ground tiles. when industries draw the plain water sprite, ottd replaces it with the river/canal/... etc
21:58:46 <nielsm> Samu I imagine that has taken an hour or two to implement, it's really simple
21:58:51 <frosch123> so you can also catch that case and call the water-depth magic
21:59:48 <michi_cc> More like 10 minutes coding after one hour of remembering how the script stuff worked again :p
22:00:16 <nielsm> frosch123 ah yeah I found that now
22:02:57 <Samu> super fast!
22:03:29 <andythenorth> oof, which is better for FIRS (a) ship methane and similar gases in vehicles as we don't have pipelines (b) use slightly-realistic-but-non-standard cargos like LNG or LPG (c) play tanks
22:03:33 <andythenorth> ??
22:03:49 *** WormnestAndroid has quit IRC
22:04:21 *** WormnestAndroid has joined #openttd
22:08:53 <frosch123> andythenorth: only few industries get their supplies via pipeline
22:09:01 <frosch123> most gases are transported liquified
22:10:16 <andythenorth> methane is the only challenging one for FIRS imho
22:10:28 <andythenorth> mostly I'd choose the cargos that have most interesting vehicles where I can
22:10:39 <andythenorth> need methane for Haber-Bosch ammonia plant
22:11:20 <andythenorth> could do it as a primary :P
22:14:00 <nielsm> okay let's make GetWaterDepth also check the industry on a tile just
22:15:01 <Samu> hmm it's complaining. parameter 1 has an invalid type 'instance' ; expected 'integer'
22:15:04 <Samu> on Insert
22:16:27 <Samu> this._open.Insert(new_path, new_path.GetCost() + this._estimate_callback(this._pf_instance, node[0], node[1], goals))
22:16:32 <Samu> new_path is a class
22:16:42 <Samu> it has 5 parameters
22:17:20 <frosch123> andythenorth: cow farm?
22:17:31 <andythenorth> methane hydrates?
22:17:40 <andythenorth> bio-digestor?
22:18:02 <frosch123> it's said that cows are a major source of methane in the atmosphere
22:18:05 <andythenorth> and sheep
22:18:11 <nielsm> this looks good! https://0x0.st/i1HP.jpg
22:18:22 <andythenorth> I could do 'green' chemistry economy, solar -> hydrogen
22:19:05 <andythenorth> I noticed an oops in Steeltown last week, the 'Engine Plant' assumes internal combustion engines
22:19:10 <andythenorth> that will look odd in 5 years
22:19:30 <frosch123> it won't :p
22:20:01 <michi_cc> Samu: Well, I guess I'd have to figure out how a squirrel instance arrives on the C++ stide.
22:20:01 <Samu> hmm, let me link
22:20:20 <andythenorth> frosch123 is not electrified :P
22:20:27 <andythenorth> electro-frog!
22:20:37 <frosch123> electrified cars are for rich people, not for masses
22:20:37 <nielsm> even better example: https://0x0.st/i1HZ.png
22:21:12 <Samu> this is what new_path is: https://dev.openttdcoop.org/projects/lib-aystar/repository/entry/main.nut#L183
22:21:12 <frosch123> and you are safe from alternative chemical fuels for another 25 years probably
22:21:28 <Samu> a structure of some kind of path
22:21:55 <andythenorth> India has mandated all new vehicles must be electric by 2030
22:22:19 <andythenorth> unfortunately they are also planning to dig up most of the coal in Queensland to power their grid
22:22:48 <andythenorth> https://www.nytimes.com/2019/08/15/climate/coal-adani-india-australia.html
22:23:55 <supermop_Home> long tailpipe is still better than nothing
22:26:03 <frosch123> andythenorth: https://www.unendlich-viel-energie.de/media/image/41231.AEE_Endenergieverbrauch_Strom_Waerme_Kraftstoffe_2018_en_72dpi.jpg
22:26:26 <michi_cc> Samu: It would work as the _sorter in your native queue, as that is also only storing a numeric index. I might actually be just as efficient, but some of the code from my patch is then useless and might slow down a bit.
22:26:28 <frosch123> at least germany would need more than double the electric network to supply vehicles with power
22:26:42 <frosch123> even more if you want to replace heating
22:27:22 <frosch123> and germany needs 30 years to build one airport, so how long will it take to build a second electric network :p
22:27:24 <Samu> i must be doing this wrong i guess
22:27:42 <nielsm> guess FIRS doesn't work well with it.. https://0x0.st/i1Hq.jpg
22:28:37 <andythenorth> frosch123 it will be a really GOOD airport when it's done though? :P
22:30:43 <nielsm> well somewhat better if I change baseset to opengfx instead of original used with an opengfx-styled depth water grf
22:30:43 <nielsm> https://0x0.st/i1HT.jpg
22:30:51 <michi_cc> Samu: No, it simply doesn't work with generic Squirrel-defined types right now. And I'm not totally sure if the C++ interface can really handle passing arbitrary types as parameters.
22:31:49 <andythenorth> nielsm FIRS is...adjustable :P
22:32:31 <supermop_Home> nielsm marningworth sandbank looks a little deed for dredging!
22:32:47 <andythenorth> supermop_Home !
22:32:54 <supermop_Home> the water looks nice
22:32:57 <DorpsGek_III> [OpenTTD/OpenTTD] nielsmh updated pull request #7924: Feature: Water tiles have a depth https://git.io/JvfWw
22:33:17 <andythenorth> should FIRS chemicaltown be more about the chemicals, or more about the advanced modern consumer civilisation that results? :P
22:33:25 <supermop_Home> ooh hmm
22:33:27 <andythenorth> i.e. am I doing more acetone, or more cheese?
22:33:37 <nielsm> lol
22:33:46 <supermop_Home> cheese product?
22:33:47 <andythenorth> bearing in mind that delivering to towns is frankly dull as fuck :)
22:34:13 <supermop_Home> temperate basic is Cornish yarg, chemicaltown is kraft singles?
22:34:23 <andythenorth> 8 tile trains dumping cargo into 1 tile shops
22:34:31 <andythenorth> FIRS Cheese
22:34:37 <andythenorth> maybe just CHEESE?
22:34:41 <andythenorth> bacronym that?
22:34:44 <frosch123> TrueBrain: any idea about tus.js:1410 ?
22:34:51 <supermop_Home> andythenorth there is value is industries that are nice set dressing for a modern passesnger network game
22:35:06 <frosch123> the "eval" is blocked by the csp, but it is inside a try-catch
22:35:13 <frosch123> is that try-catch supposed to catch the csp?
22:35:38 <TrueBrain> shrug no clue
22:35:45 <supermop_Home> i guess i thought of chemicaltown as shiny white and grey industries with lots of pipes and boxy buildings
22:35:49 <michi_cc> Samu: Something like https://gist.github.com/michicc/5acb643e2e824666aab5b491d0cd4662 on the Squirrel side might work. Please not that Native_Heap::Exists (and most likely also is in your Native.Queue thing), as it would have to search _queue for the item.
22:36:11 <supermop_Home> whereas steeltown is rusty red and black piles and brick
22:36:35 <andythenorth> steeltown is animated slag :D
22:37:02 <andythenorth> I wondered if chemicaltown is endless tank farms :P
22:37:03 <supermop_Home> i think its not so much about the chemicals
22:37:36 <supermop_Home> i like the idea of it beings about GOODs that are more than just GOODs
22:37:40 <andythenorth> the actual name is Better Living Through Chemistry
22:37:46 <andythenorth> which implies goods and food
22:38:03 <supermop_Home> yeah you made me listen to that album yesterday after talking about it here
22:38:08 <andythenorth> I did make a town cargos economy, but I deleted it, it was really bad
22:38:17 <andythenorth> bakeries and so on
22:38:18 <supermop_Home> it makes me think of sequencers and drum machines?
22:38:27 <Samu> alright, gonna test that
22:38:39 <Samu> i suspected that was the problem
22:38:44 <michi_cc> Samu: Got the script that generated the error somewhere? I really don't want to figure out how the squirrel programming.
22:39:48 <supermop_Home> ABS + Silicon -> synthesizer factory, Vinyl +paper -> pressing plant
22:40:35 <andythenorth> :)
22:40:36 <Samu> michi_cc, i got it working
22:40:41 <supermop_Home> grain + sugar -> Smirnoff ice bottler
22:40:58 <TrueBrain> frosch123: // if node.js and NOT React Native, we use Buffer
22:41:00 <supermop_Home> 1998town economy
22:41:04 <TrueBrain> so .. we use neither .. so I guess it is fine?
22:41:08 <andythenorth> 808 economy
22:41:12 <andythenorth> 808 State
22:41:17 <andythenorth> Blue Monday economy
22:41:26 <Samu> I've uploaded the AI that tests native heap, the one I made, on the forum
22:41:32 <andythenorth> KLF Economy :D
22:41:38 <supermop_Home> Leeds Basic
22:41:39 * andythenorth has now won and should go to bed
22:41:40 <Samu> but not this
22:42:23 <Samu> i'm doing a race native heap vs native priority queue
22:42:33 <supermop_Home> i wonder what that skate shop i used to go to in Harrogate was called
22:42:36 <frosch123> oh, CORS is set on the tusd side?
22:42:51 <frosch123> i thought the frontend would define what it's script may talk to
22:43:07 <Samu> @calc 3477/3497
22:43:07 <DorpsGek> Samu: 0.994280812125
22:43:19 <Samu> well, very minimal gain to your queue
22:43:28 <michi_cc> Samu: If you're doing it with the squirrel adapter code, a part of the queue itself is unnecessary and will slow it down just a bit.
22:43:45 <Samu> yes, i had to use the adapter code
22:44:30 <supermop_Home> does an industry know what year it was born?
22:44:37 <supermop_Home> oops built
22:45:17 <michi_cc> Anyway, a small difference is not that surprising, as the algorithms itself boil down to the same thing: An array and a sort function, it's just that the C++ priority queue has a sorted optimized for this and not the generic sorter from the AIList.
22:46:10 <andythenorth> supermop_Home yes
22:47:21 <frosch123> TrueBrain: did you figure out a way to display CORS in tusd?
22:48:27 <michi_cc> Samu: I've pushed a commit to my branch that removes the now unnecessary code, but don't expect much of a difference.
22:48:47 <TrueBrain> do an OPTIONS to the endpoint
22:48:51 <TrueBrain> and it will be in the header :)
22:49:33 <michi_cc> I'd assume that most of the spent time is in the squirrel code and not on the C++ side.
22:49:56 <TrueBrain> frosch123: or https://github.com/tus/tusd/blob/936f465cc3518b9220661ae5363a8334e4525d94/pkg/handler/unrouted_handler.go#L225 if you want to look at code
22:50:10 <TrueBrain> hmm, that is not the right one I think ..
22:50:49 <TrueBrain> weird, Authorization is there .. but it was denied
22:50:50 <TrueBrain> owh well :P
22:51:08 <TrueBrain> https://github.com/tus/tusd/commit/43bd4b0ccb5aaf63c8d7ba21e3188a2198d626db#diff-2b20f605d4497cfb1bf263f58fab7d6d
22:51:09 <TrueBrain> ah
22:51:11 <michi_cc> Samu: BTW, you should compare Release version of OTTD, the Debug STL is significantly slower in Visual Studio.
22:51:13 <frosch123> header.Set("Access-Control-Allow-Origin", origin) <- hmm, why does that not do what i think?
22:51:25 <TrueBrain> in that case, I am going to put Authorization back I think .. hmm ..
22:51:30 *** syr has quit IRC
22:51:37 <TrueBrain> I know VERY little about CORS, so .. I cannot really help you there :)
22:51:53 *** syr has joined #openttd
22:52:32 <frosch123> time to renable that http logger plugin
22:54:25 <frosch123> ah, the debugger shows the stuff as well
22:54:51 <frosch123> and i had a typo in the tus-url :p
22:56:02 <frosch123> "(response code: 400, response text: {"message": "Upload-Metadata header is invalid"} )" <- next level of errors :)
22:58:47 <nielsm> connecting to random multiplayer servers... https://0x0.st/i1H_.jpg
22:58:57 <nielsm> reveals fascinating constructions
22:59:56 <frosch123> 2020-04-18 20:59:17 INFO 127.0.0.1 [18/Apr/2020:20:59:17 +0000] "POST /new-package/tusd-internal HTTP/1.1" 400 214 "-" "Go-http-client/1.1" <- TrueBrain: the api prints that, is that a problem?
23:00:08 <Samu> it's the release version
23:00:21 <TrueBrain> frosch123: I don't understand the question
23:00:59 <frosch123> the frontend now can reach tusd, but tusd reports some error, and also the api docker prints that message
23:01:14 <frosch123> i want to know whether the problem is with the frontend, or with the api, or with tusd
23:01:29 <TrueBrain> you can see that in the return value of that request
23:01:34 <TrueBrain> you are using the network inspector of the browser?
23:01:48 <frosch123> my paste is from the docker console
23:01:59 <TrueBrain> I understand that; but the network console of your browser also shows you the return value
23:02:11 <TrueBrain> the browser initated the connection :)
23:02:22 <frosch123> yes, that i pasted at 22:56
23:02:57 <TrueBrain> that means it couldn't parse the Upload-Metadata header :) So either it is unexpected, missing, or there is a coding error :)
23:03:03 <TrueBrain> I did test it with the tus-js-client, and it did work
23:03:10 <TrueBrain> so I need more information ;) You can see the request-header in your browser
23:03:15 <michi_cc> Samu: Then I'd say it was a nice OTTD code exercise, but making a real PR out of it is probably not worth it.
23:03:17 <TrueBrain> is Upload-Metadata in it?
23:03:53 <frosch123> Upload-Metadata: upload-token ODg1YWNhZGU0MzJkZjZmZmZjMjk1N2M3M2QzYzM4MmQ=,filename MDQuc2F2,filetype
23:03:56 <frosch123> looks plausible to me
23:04:01 <Samu> why did you change Exists to false? :o
23:04:52 <TrueBrain> it ends with "filetype"
23:04:52 <TrueBrain> ?
23:04:59 <TrueBrain> as that is not by tus-spec :D
23:05:04 <TrueBrain> it should have a space and a value :P
23:05:10 <michi_cc> Samu: Because it is wrong (and your implementation in your native queue, too).
23:05:11 <TrueBrain> anyway, please don't send filetype .. it is unneeded :)
23:05:24 <Samu> michi_cc, the new code seems to fail
23:05:25 <frosch123> i got that from the tus example...
23:05:33 <TrueBrain> yeah; and we are not using it :)
23:05:34 <frosch123> and .sav is probably unknown to the browser
23:05:49 <Samu> returns no path, nothing is queued i guess
23:05:56 <frosch123> the upload-token is correct, i decoded it
23:06:08 *** arikover has quit IRC
23:06:24 <Samu> how am I supposed to test now? with the adapter code still?
23:06:25 <michi_cc> Well, "return _sorter.HasItem(item);" is wrong, too, because you don't in fact store the item in your AIList.
23:06:27 *** arikover has joined #openttd
23:06:36 <TrueBrain> if it really ends with "filetype", and nothing more, that is not correct. But try removing that line from your javascript, and it most likely works ;)
23:07:34 <frosch123> oi, it works...
23:07:38 <TrueBrain> \o/
23:07:51 <Samu> I see, well, may have to fix it somehow
23:08:21 <frosch123> Could not recognise this file; possibly the extension is wrong? <- the api does not recognise .sav?
23:08:29 <TrueBrain> nope
23:08:31 <TrueBrain> never did
23:08:31 <frosch123> oh right... it should be .scn
23:08:33 <TrueBrain> never will? :D
23:08:34 <TrueBrain> :D
23:09:35 <Samu> _queue.push(item); the item is here then, hmm how to find items in an array?
23:09:48 <frosch123> debian-10.1.0-i386-netinst.iso <- Could not recognise this file; possibly the extension is wrong? :)
23:10:01 <frosch123> it accepts all shit :)
23:10:54 <frosch123> so it roughly works, let's make it slightly more pretty
23:11:39 <frosch123> hmm, no, let's first figure out this CSP stuff
23:12:53 <TrueBrain> :D Nice work frosch123 :)
23:13:14 <Samu> http://www.squirrel-lang.org/squirreldoc/reference/language/builtin_functions.html#id1
23:13:17 <Samu> ah, here it is
23:16:34 <frosch123> ok... so "self" is quoted, but urls are not
23:22:23 *** Westie has quit IRC
23:23:12 <Samu> local value = _queue.find(item);
23:23:12 <Samu> return value != null;
23:23:21 <Samu> testing this, not sure how though
23:27:47 <Samu> the index Exists does not exist. now that was funny
23:30:41 <TrueBrain> frosch123: okay, the current way I implemented the authentication is wrong. Will fix; won't have that much impact tbh :)
23:30:51 <TrueBrain> but fixes my issue ;)
23:35:30 <Samu> nielsm, what should I name the Native Heap, which is not a Native Heap
23:35:42 <Samu> i'm about to upload version 2, and i got time to rename it
23:43:55 <nielsm> SortedListQueue or something
23:48:56 <Samu> what's the Peek() time operation?
23:49:03 <Samu> seems to be missing
23:49:32 <nielsm> that's looking at the next element that would be taken from the queue?
23:49:50 <Samu> yes
23:50:33 <nielsm> well as _dp_ pointed out the complexity I gave in that post is actually all wrong
23:50:48 <nielsm> since you're using the sorted items and not sorted indexes
23:50:59 <nielsm> so it invokes the map-of-set reverse
23:51:00 <Samu> oh :/
23:52:08 <nielsm> still, if most of the items in the queue have distinct priority (cost?) values then it should be mostly correct
23:52:29 <nielsm> since that would make most buckets be a set of one member, which is just constant time
23:52:33 <_dp_> also idk how it works in squirrel but endlessly growing array can't be good
23:53:30 <_dp_> even if complexity is technically constant on average
23:55:05 <Samu> https://github.com/SamuXarick/Queue.NativeHeap/blob/master/main.nut#L58-L59
23:55:14 <Samu> the .push is on the array
23:55:27 <Samu> the .AddItem is on the AIList
23:56:01 <Samu> the item that is pushed is a class Aystar.Path
23:56:50 *** Wolf01 has quit IRC
23:57:13 <Samu> guess i better finish this tomorrow, it's still quite confusing
23:57:24 *** Samu has quit IRC