arendjr / PlainText

Text-based MUD game engine
GNU Affero General Public License v3.0
78 stars 17 forks source link

Files beginning with '.' in data directory crash the MUD with an unhelpful error message. #4

Closed ecdavis closed 11 years ago

ecdavis commented 11 years ago

After downloading and compiling a fresh copy of the source code I got the following error when trying to launch the MUD:

Could not start engine: Unknown game object type

This happens because the MUD tries to load an object from the .gitignore file in the data directory.

I don't know if this is a Windows-specific error (since dot-files are hidden on other platforms, so may not be returned by DiskUtil::dataDirFileList) or if it's just something that was missed somehow.

On a side note, I think that it would be a better idea to catch and log exceptions when loading object files in Realm::init rather than aborting the entire launch.

arendjr commented 11 years ago

Thanks a lot for the bug report!

I've made sure that files starting with a dot are now always ignored, even on Windows. I also improved the error message in case there are still files with an invalid name. ae4f2ad

I don't fully agree that continuing despite errors should always be preferred. For some cases I actually already do that (like game objects containing invalid references to other objects), but if there are really files in the data directory that shouldn't be there it's best to clean it up right away, I think. And cleaning up the data directory while the engine is running shouldn't be encouraged :)

Now we are on the subject, do I understand correctly that you managed to compile and run the server on Windows? I never actually tested this myself :) Can I ask what version of Windows, and what compiler you used? Did it involve Cygwin? Were there any other issues you ran into? Tips maybe for other people who would like to run it on Windows? If possible, I would like to update the documentation to indicate the level of support on Windows.

Thanks! Arend jr.

ecdavis commented 11 years ago

Excellent, thanks for the quick fix.

As for PlainText on Windows, it was very easy to set up. I just installed Qt from a binary package, added a few environment variables, imported PlainText in QtCreator, made a few small changes to the build files and was able to compile it without any warnings/errors in the code. The wonders of using a cross-platform framework, I guess. :)

I'm running Windows 7 and Qt 5.0.2 32-bit w/ MinGW. The only problem I have is that so far I've been unable to build PlainText outside of QtCreator as it can't find the headers, so it seems I'm missing a few environment variables.

I'd be happy to submit my build file changes as a pull request, if you'd like.

arendjr commented 11 years ago

Cool! Yes, if you can make a pull request that would be helpful. I'm especially interested in the environment variables you set and the changes to the build files (you're referring to the .pro file, right?).

Thanks!

ecdavis commented 11 years ago

Ok, so to compile on Windows (assuming Qt 5.0.2 32-bit w/ MinGW installed to C:\Qt) you need the (very small) change I made to the environment.pri file, then you need to add two values to your PATH environment variable:

C:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin
C:\Qt\Qt5.0.2\Tools\MinGW\bin

I added these as separate environment variables and then appended them both to my PATH.

Once you've done that you should be able to do the following from the command-line:

qmake PlainText.pro -r -spec win32-g++
mingw32-make

And it'll compile without warnings/errors.

arendjr commented 11 years ago

Thanks a lot! When I'm back from work I'll merge this info back into the documentation and close the ticket :)

Cheers!