News for hackers. Stuff that matters.
Re:How Copyover MUD Servers Worked by borlak on Tuesday February 11, 2025 @02:45AM (#43010107)
The way my mud did it, and I believe most muds (considering I took my implementation from another popular codebase), was not by forking. Sockets are just files, so all we did was save everything including players, execl() another instance of the MUD, and exit. Same port wasn't an issue with SO_REUSEADDR.

On boot as it's loading players, their file descriptor ID was saved, so it loads it up and resumes talking to the socket. It also loads the ID of the server socket descriptor. No need to send information to a new process as it just loads the previous game state.

If you're curious: https://github.com/borlak/acmud/blob/7c2442dfccfc28364fc399a...

And: https://github.com/borlak/acmud/blob/7c2442dfccfc28364fc399a...

Re:How Copyover MUD Servers Worked by hoseja on Tuesday February 11, 2025 @08:44AM (#43012639)
That sounds so much nicer than that horrific hack in the OP.