Closed synacktic closed 3 years ago
If I had to guess, this might be caused by how the file is being opened in the first place - are we blanking the file for example with an O_TRUNC
argument or similar?
I'm also seeing this when I have not changed the config, I think... I have recompiled a lot though. I'll see if I can find more ways to make it happen. Also, I'll see if I can find what is going on with that IO, but it might be a little beyond me.
I tried reproducing but was unable to. My player data remaining throughout multiple restarts as well as changing module position order.
Thanks. Let me spend some more time reviewing and maybe try on Windows, etc. I was using a copy I build from master btw. Just hold until I update.
Ok, this is weird. I've only been testing with GALKYR and RTSLORD. module.conf: { "Modules": [ { "Identifier": "GALKYR", "Path": "GALKYR", "MenuOptionKey": "K" }, { "Identifier": "RTSLORD", "Path": "RTSLORD", "MenuOptionKey": "L" } ] }
I can reproduce everytime by following the steps above with one change... once you restart with after switching, you first go right back into the port where LORD WAS last time. This will take you to Kyrandia. X out. Then load the correct port for LORD, as soon as it loads, you see the PLAYER.DAT has been blanked.
Running under Linux, built from master...
Now look at this...
That error sometimes appears when exiting Kyrandia after the rlogin to the old/wrong/kyrandia port... what makes that so interesting, is if you search for where that message came from, it is an RTSLORD message, not a kyrandia message.
I'm still digging around, but it seems there is a memory / ptr issue, but I can't imagine why it only turns up when swapping the modules / ports.
Oh, and whenever this issue fires RTSLORD has decided to load PLAYER.BAK and overwrite PLAYER.DAT... It does not do that on "normal" runs, so I'm not sure what is firing that bit of code in the module or why it does not check to see if there is a BAK worth using, etc.
That Cannot save account # 0 - there are only -1 people playing!!?
looks alarming.
Mind sharing your appsettings.json?
Not at all.
{ "BBS.Title": "MBBSEmu", "BBS.Channels": "10", "Cleanup.Time": "03:00", "GSBL.BTURNO":"13936829", "GSBL.BTURNO.HVSTW":"97771457", "Module.DoLoginRoutine": "False", "Telnet.Enabled": "True", "Telnet.Port": "2323", "Telnet.Heartbeat": "False", "Rlogin.Enabled": "True", "Rlogin.Port": "1513", "Rlogin.RemoteIP": "127.0.0.1", "Rlogin.PortPerModule": "True", "Database.File": "mbbsemu.db", "Btrieve.CacheSize": 4, "Account.DefaultKeys": [ "DEMO", "NORMAL", "USER" ] }
So, I think I worked this out. The PR #402 should fix it. Will see if it gets merged and go from there.
We good. Thanks all.
Module Information
Describe the bug After updating module config, the PLAYER.DAT gets damaged on the next run.
To Reproduce Steps to reproduce the behavior:
Expected behavior Moving RTSLORD to a new position in the menu should not cause it to erase PLAYER.DAT
Software Information: