Minetest logo

IRC log for #minetest, 2024-06-07

| Channels | #minetest index | Today | | Google Search | Plaintext

All times shown according to UTC.

Time Nick Message
00:11 Can0xfBows_ joined #minetest
00:22 Pexin joined #minetest
03:54 Blockhead256 joined #minetest
03:55 Blockhead256 !tell gera In my experience, it's a choice between Moiré effect or highly visible mipmap boundaries. Sorry!
03:55 MinetestBot Blockhead256: I'll pass that on when gera is around
04:00 MTDiscord joined #minetest
04:37 olliy joined #minetest
04:44 gregon joined #minetest
04:56 amfl2 joined #minetest
05:04 Sakurai-Bunny joined #minetest
06:26 mrkubax10 joined #minetest
06:52 wsor4035 joined #minetest
06:52 MisterE1230 joined #minetest
06:52 thelounge656 joined #minetest
06:55 tarsovbak joined #minetest
07:02 Kimapr_ joined #minetest
07:08 tarsovbak joined #minetest
07:29 m42uko_ joined #minetest
08:09 ireallyhateirc joined #minetest
09:09 TomTom joined #minetest
09:13 mrkubax10 joined #minetest
10:25 Hanicef joined #minetest
10:35 dv^_^6 joined #minetest
10:37 est31 joined #minetest
10:59 wsor4035 joined #minetest
11:11 gregon joined #minetest
11:22 Mocraft joined #minetest
11:23 tarsovbak joined #minetest
12:10 B-| joined #minetest
12:42 tarsovbak joined #minetest
12:48 gregon joined #minetest
13:06 Nusakan joined #minetest
13:19 tarsovbak joined #minetest
13:20 gregon joined #minetest
13:24 fling joined #minetest
14:52 PoochInquisitor joined #minetest
14:59 MinetestBot [git] sfan5 -> minetest/minetest: Call malloc_trim() regularly to improve deallocation behavior (#14707) 7189380 https://github.com/minetest/minetest/commit/71893807b37c07bd428d71c47fd7cbd12bc82760 (2024-06-07T14:57:30Z)
15:12 ireallyhateirc joined #minetest
15:24 Hanicef joined #minetest
15:45 Izaya left #minetest
15:53 jaca122 joined #minetest
15:56 B-| joined #minetest
16:00 illwieckz joined #minetest
16:06 gregon1 joined #minetest
16:10 Glaedr joined #minetest
16:19 gregon joined #minetest
16:20 mrkubax10 joined #minetest
16:21 gregon2 joined #minetest
16:23 Galisma joined #minetest
16:23 tarsovbak joined #minetest
16:56 mrkubax10 joined #minetest
17:00 mrkubax10 joined #minetest
17:02 gregon joined #minetest
17:24 gregon1 joined #minetest
17:45 tarsovbak joined #minetest
17:50 ___nick___ joined #minetest
17:53 ___nick___ joined #minetest
18:14 sparky4 joined #minetest
18:59 Nusakan joined #minetest
18:59 yablock0 joined #minetest
19:04 PoochInquisitor joined #minetest
19:20 PoochInquisitor joined #minetest
19:58 silverwolf73828 joined #minetest
20:22 shaft joined #minetest
20:22 shaft Krock, you asleep?
20:23 Krock yes
20:23 Krock thank you for asking
20:23 shaft I think you forgot about my mesecons pr. Doesn't have to be now but it would be nice if I'm one step further on my texturepack roadmap.
20:38 Talkless joined #minetest
21:00 shaft I'll just remind you again tomorrow
21:01 ROllerozxa sleeptalking over IRC
22:27 Mocraft left #minetest
22:33 panwolfram joined #minetest
22:49 SFENCE joined #minetest
23:01 BluebirdGrey51 joined #minetest
23:03 BluebirdGrey51 I'm trying to set player meta [pref:get_meta():set_string("key", "stuff,etc") for example] inside "on_shutdown" and "on_leaveplayer" callbacks, and I've noticed that in singleplayer this does NOT work. The data are not remembered after next restart. Is this a known bug?
23:04 Mocraft joined #minetest
23:04 BluebirdGrey51 This is causing me a problem because I need to set some info on a player when they leave the game, but this seems to work only if the server is running in multiplayer mode, and DOESN'T shutdown at the same time the player leaves.
23:10 BluebirdGrey51 Did a test just now, using Minetest fetched from git just a couple days ago. I can confirm this is absolutely the case: if a multiplayer-mode server shuts down while players are connected, any data set on those players will NOT be saved, either in 'on_leaveplayer' or 'on_shutdown'.
23:10 SFENCE joined #minetest
23:11 BluebirdGrey51 I suspect trying to save the player-specific data in mod storage (rather than player meta) will have the same problem. It seems the server does not persist changes to meta that are made a such a late date.
23:11 MTDiscord <luatic> BluebirdGrey51: your observation is probably right, but i don't think your explanation is
23:12 MTDiscord <luatic> IIRC in singleplayer on_leaveplayer and/or on_shutdown just don't get run
23:12 Mantar on_leaveplayer is not run in singleplayer, or in hosted for the first connected player
23:12 Mantar it's weird
23:12 MTDiscord <luatic> Why not eagerly update the data may I ask? Updating in on_shutdown is error prone in general, for example if the server crashes.
23:12 BluebirdGrey51 That's probably true, but I tested just now in "multiplayer mode". I hosted a server, joined a test player, and shutdown the server while the player was still connected. The data that was supposed to be there, isn't.
23:13 BluebirdGrey51 So it's not just a singleplayer bug.
23:13 BluebirdGrey51 I could update the data every single time something changes.
23:13 BluebirdGrey51 But this particular data would be changing A LOT, in that case.
23:14 BluebirdGrey51 I wanted to do a lazy update and save some cycles.
23:14 BluebirdGrey51 I'm ok with not having the data after an occasional crash (I hardly ever crash)
23:14 MTDiscord <luatic> Update the data eagerly unless you can demonstrate that this is a performance issue.
23:15 MTDiscord <luatic> Minetest only persists the data lazily behind the scenes anyways (map save interval IIRC).
23:15 Mantar frequent meta accesses can cause lag, so if you're gonna be doing a lot of it, maybe cache it and only save every second or two
23:16 MTDiscord <luatic> Anyways, since you say this extends beyond singleplayer: Can you produce a minimal reproducible example?
23:16 * Mantar found the issue with Exile's hud way back was that it was doing ~35 meta accesses, per player, per tick, which caused the hud to lag badly in MP
23:17 MTDiscord <luatic> If you really reduce your mod to "save something in meta in on_leaveplayer / on_shutdown", does that demonstrably not persist the data?
23:17 BluebirdGrey51 A whole mod, or will just a snippet do?
23:17 MTDiscord <luatic> a snippet will do
23:17 MTDiscord <luatic> a mod is basically just a snippet in init.lua + mod.conf ;)
23:17 MTDiscord <luatic> but as said the crucial part is that it is minimal
23:18 MTDiscord <luatic> it is not unlikely that you have a mistake in your logic. with a minimal reproducible example, that can't happen, or if it does, it's hopefully obvious to me if i look at it.
23:19 BluebirdGrey51 minetest.register_on_shutdown(function()
23:19 BluebirdGrey51 local players = minetest.get_connected_players()
23:19 BluebirdGrey51 for k, v in ipairs(players) do
23:19 BluebirdGrey51 local meta = v:get_meta()
23:19 BluebirdGrey51 meta:set_string("fancy_long_key", "superduper value")
23:19 BluebirdGrey51 print("Data that should be here after restart: " .. meta:get_string("fancy_long_key"))
23:19 BluebirdGrey51 was kicked by ShadowBot: Message flood detected. Use a pastebin like paste.ubuntu.com.
23:19 BluebirdGrey51 joined #minetest
23:19 MTDiscord <luatic> i could imagine that on_leaveplayer / register_on_shutdown execute too late, that is, player meta access only works when the player is still online. naturally, on leave, or on shutdown run pretty late, so if the player was in a half-deinitialized state, i could imagine that they might fail. so a bug here does sound plausible.
23:19 BluebirdGrey51 Ok, so 9 lines is too much to paste.
23:20 MTDiscord <luatic> best to use a pastebin service of your choice ;)
23:20 BluebirdGrey51 https://gist.github.com/BluebirdGreycoat/8c7751410e93cd6b75ccfce5535c2d18
23:21 MTDiscord <luatic> alright thanks for the report, i'll take a look
23:24 MTDiscord <luatic> BluebirdGrey51: btw which version are you on? 5.9-dev?
23:24 MTDiscord <luatic> (i just tested with 5.8.0 and that worked fine)
23:25 BluebirdGrey51 5.9.0-dev-87232358d
23:26 BluebirdGrey51 I'm trying to test with that snippet right now and for some reason I'm not seeing the print message at all. Sigh. Still working on it ...
23:26 MTDiscord <luatic> i'm not seeing the print message either
23:26 MTDiscord <luatic> this does look like a regression. the message appears on 5.8.0 in singleplayer.
23:27 MTDiscord <luatic> i would guess get_connected_players returns the empty list on shutdown, which it shouldn't.
23:28 MTDiscord <luatic> indeed it does.
23:28 BluebirdGrey51 yes, it says 0 players on shutdown --- seems my test player is leaving before the shutdown happens. i'm going to modify my test code and send a new gist in a few mins.
23:29 MTDiscord <luatic> would you like to file a bug report? otherwise i can do it for you.
23:30 MTDiscord <luatic> this looks like a pretty clear regression to me: in 5.8.0, get_connected_players returns a list of connected players in on_shutdown. in 5.9-dev, this list is empty. note that on_leaveplayer isn't called either for shutdowns. so mods would have no way to deal with this if we don't fix it.
23:34 BluebirdGrey51 Here's the new gist: https://gist.github.com/BluebirdGreycoat/4764c1d927e2ce9a2770293cef65e4e5
23:34 Izaya joined #minetest
23:36 MTDiscord <luatic> the meta part is irrelevant if the list of players iterated on shutdown is empty
23:36 MTDiscord <luatic> minetest.register_on_shutdown(function() print("#players", #minetest.get_connected_players()) end) basically suffices to demonstrate the regression
23:37 BluebirdGrey51 I'll leave the bug report for you if you don't mind. You know more about it, I only know it isn't working
23:38 MTDiscord <luatic> okay sure
23:38 BluebirdGrey51 thanks much!
23:44 MTDiscord <luatic> https://github.com/minetest/minetest/issues/14736

| Channels | #minetest index | Today | | Google Search | Plaintext