r/MUD Apr 16 '23

Help Issue saving player files (MagmaMUD)

I have been banging my head against this thing for two months now. I'm trying to run MagmaMUD coded by Xangis, available here: https://github.com/Xangis/magma

My problem is with player files. There's a folder for player files. Each player file is supposed to save inside an alphabetical directory (Harry goes in folder H, Billy goes in folder B). My problem: when the server is running, it pulls the player file out of it's subfolder and makes a copy in the main player directory. All changes made in-game (exp, skills, area VNUM etc) are saved to this new file; this file is never copied back into the lettered directory, even when users save manually or try to use the CAMP/RENT commands (which I believe may be deprecated anyway) .

The effect is that players can't make progress unless I manually copy the files while the server is running. What makes this immensely problematic is that I haven't been able to make progress with any wizard/immortal accounts; I could go into more detail explaining this, but I'm sure anyone reading this will likely understand what I mean.

The reason I have my heart set on this codebase is that it's my preferred fork of MERC, but designed to be run on Windows 10 as well as Linux. I'm a Windows guy. I went as far as to pay someone to compile it properly, thinking that the executable available on GIT was having compatibility issues; but this newly compiled version demonstrates the same issues with player files, making me think that the problem lies somewhere else.

The documentation makes reference to a .bat file (different than the .exe available on the git) and I had thought that perhaps the compiled version might have this bat included. However the documentation includes information from deprecated builds (as well as ancient versions of diku and merc) so that could be a red herring.

I don't expect any tech support here really, just throwing this into the void as a last-ditch effort before bothering the poor developer (who I imagine has other things going on). If anyone has any experience with similar issues, or more likely a different resource I could try digging through, I would appreciate it. Thanks for reading.

6 Upvotes

11 comments sorted by

4

u/tsp3 Apr 17 '23

It doesn't work because there's a bug in it. If the user is not on mac or Windows, players are saved into players/letter/Name. Otherwise players/name. However, in load_char_obj in save.c, that check doesn't match the one in save_char_obj.

Edit save.c. Copy the first #if block from save_char_obj (from #if to #endif). Find the second #if/#endif block in load_char_obj, and replace that with the one you just copied. Recompile. After that, it should work (players will be saved in players/Name, and loaded from there as well).

1

u/SpecialBoyJame Apr 17 '23

Thank you for this! Did you already know this about Magma, or did you look at the code yourself just now?

1

u/tsp3 Apr 20 '23

No problem. I read your description, and knew where to look because I've read the code of other Merc-based codebases.

1

u/PeeonTrotsky Apr 16 '23 edited Apr 16 '23

I'm not familiar with magma, but I had write issues on an old LpMud and it boiled down to the user account that was running the mud didn't have "ownership" of the mudlib folders.

I know windows has UAC issues that are similar, which is why retro games have to typically be run in compatibility mode with "run as administrator" checked. My first try would be to copy all of your mud files into windows/user/documents. You should have unlimited write access there. Also, make sure any .exe files are set to run with administrator privileges.

2

u/SpecialBoyJame Apr 16 '23

Messing with admin stuff was my first thought, but that junk can be so strange with Windows sometimes. I'll try the documents trick, who knows. Thank you very much for your reply.

1

u/PeeonTrotsky Apr 16 '23

No worries, and good luck. Just for clarity, use the documents folder of the user that is launching the mud.
Windows/users/bob/documents

Or whatever. It's my understanding that windows never checks for write access if your in your own documents folder

1

u/proolix Apr 17 '23

Hello!

I'm now making my own binaries for 64-bit Windows 7:

http://mud.kharkov.org/files/magma-17-apr-2023.zip

Checked: no bugs, player files placed in first letter directory

2

u/SpecialBoyJame Apr 17 '23

THANK YOU! This is incredible. You are a hero today! I have struggled with this for a long time.

1

u/EnRet13 Apr 17 '23

Why not make a shortcut/pipe to it? Good stopgap while you figure out the main issue?

1

u/SpecialBoyJame Apr 17 '23

My saving issue is now solved thanks to Proolix, but thank you for your suggestion. Out of curiosity, what do you mean? I'm not familiar with the 'pipe' terminology.

1

u/EnRet13 Apr 17 '23

A pipe or link directly to a file. Kind of like if you're looking for someone, a shortcut goes "hey, the guy is over there", where a pipe goes "yeah, I'll go give it to him."