Time Nick Message 14:31 MTDiscord Even if you're not using to_table and from_table it's a lot. From what I have seen, there is no incremental updating, no database usage - it periodically rewrites the full JSON. I advise against the use of mod storage until it gets a proper database backend: Data loss up to a couple seconds is possible (no kind of logging), performance is poor (full writeout), support for Lua data types is poor as well (flat k/v store, JSON-based). 14:57 sfan5 I'm pretty sure it replaces the file atomatically 14:57 sfan5 so the first point is not valid 16:22 MTDiscord https://github.com/minetest/minetest/pull/11682 16:58 sfan5 that seems interesting but what's the usecase? 17:46 MTDiscord I wrote it because we thought the client/server desync could be an OpenSSL issue at first, and we didn't use it but I thought since I wrote it, it was worth offering to contribute it to the repo. 17:51 MTDiscord Credit goes to ExeVirus for the idea. I take responsibility for using Python though haha. 18:35 MTDiscord I need to read mod storage code a bit better I guess, seems like we aren't sure 19:21 erlehmann josiah_wi it says lubcurses-dev here, it should say libcurses-dev https://github.com/minetest/minetest/pull/11682/files 19:25 MTDiscord Good catch. 19:26 MTDiscord Someone suggested to me a much better way to do this so I may rewrite it. 19:46 MTDiscord sfan5: You misunderstood my first point, perhaps because I phrased it poorly. I was not saying it might die while writing the file - which would be pretty problematically. I'm saying that if you do :set_something on mod storage, and it completes, you're not guaranteed persistence of that change if the server dies during the next couple seconds. 19:47 sfan5 true 19:47 sfan5 but that applies to just about everything 20:20 MTDiscord silly question but i'm trying to set the field of a table from c++ and getting back bizzare userdata 20:24 MTDiscord somebody doesn't know how a stack works 20:25 MTDiscord look i remember partially how it works 20:25 MTDiscord /s 20:25 MTDiscord i've worked with it before and had it work no issue 20:27 erlehmann sfan5 luatic the server not persisting everything is a GOOD THING. there are a number of conditions where you can cause a crash and only that is preventing a crashloop. 20:28 sfan5 that's great, we should add even more bugs to prevent more crashloops 20:28 MTDiscord erlehmann: I demand ACID. 20:28 erlehmann what i mean is that if you persist a condition that causes a crash deterministically, you have a problem 20:29 MTDiscord In your mod's logic the problem resides, not in the D of ACID 20:29 MTDiscord ass 20:29 erlehmann ? 20:29 MTDiscord my bro is 20:29 erlehmann typing instead of you? 20:29 MTDiscord yep 20:29 MTDiscord standing right besides me -_- 20:29 MTDiscord sorry 20:32 Krock @Jordach get the table, push key, push value, settable(L, -3) then pop(L, 1) at the end 20:33 Krock not too difficult I'd say 20:33 MTDiscord i've already created a table similar to get_sky textures 20:33 MTDiscord newtable(L); lua_rawseti().... 20:33 MTDiscord and i want to name the field by the end of it 20:34 Krock then rawseti might not be the best choice 20:34 MTDiscord i'm just setting it based on a simple for loop 20:34 Guest69 @erlehmann Sorry for choosing such an unacceptable word... 20:35 erlehmann which word? 20:35 Guest69 a@# 20:35 MTDiscord Krock: https://gist.github.com/Jordach/7e05e7a61f5e1aafcf08cb01ad158ddc 20:36 Dragoni Now, I am gonna go watch a movie with LMD... NOW LMD!!! 20:37 erlehmann are you th prson apologizing for writing “ass”? if so, don't do it to me. i like ass! and as long as you don't go on everyone's nerves with it by doing it all the time, writing a single “bad word” is a lesser sin. 20:37 Dragoni Heh, thanks 20:37 erlehmann rather ask everyone else what they are thinking 20:37 erlehmann oh 20:37 erlehmann that leaving was premature 20:37 erlehmann lol 20:38 MTDiscord He'll see it on Discord 20:38 Krock @Jordach looks about right. you could even pre-allocate the table size using lua_createtable 20:38 MTDiscord ah 20:38 Krock keep in mind that C++ is 0 indexed 20:38 MTDiscord explains a lot 20:39 Krock you never access index 0 20:39 MTDiscord fortunately that table is indexed to 0-25 20:39 MTDiscord sky_color 20:39 MTDiscord 25 is the 11pm/midnight blend 20:39 Krock then why is your "i" starting at 1? 20:39 MTDiscord and "doesn't" exist 20:40 MTDiscord i've used the same index hack as what atmos did with it's time calculation 20:41 erlehmann sfan5 luatic i should probably be more precise: it is possible for mods to detect specific arrangements of blocks and trigger crashing behaviour in bad mod code. if the server map is reset to a few seconds before the crash (as it happens now) then you do not have a crashloop. 20:41 erlehmann like, think of the various “magic structures” where you arrange blocks in a specific way and some logic triggers once they are arranged right 20:41 erlehmann this is usually done via abm, so ofc the interval could be set to long enough that persistence bugs are not going to help (but usually they are not) 21:15 MTDiscord Krock excuse me i'm a tool 21:15 MTDiscord i was dumping the whole thing 21:16 Krock dumping - as in - discarding? 21:19 MTDiscord OH SHIT 21:20 MTDiscord nope i'm being dumb 21:20 MTDiscord this cold is ruining my process 21:27 MTDiscord fixed it 21:27 MTDiscord forgot to add two extra newtable instances 21:33 MTDiscord it all works as expected now