Sunday, October 16, 2011

Good progress with milestone 3

The server can now communicate with MongoDB. The save and load methods of my Database class can theoretically work with any object, because it examines the annotations of the class of the object.

When I want an object to be store-able in the database, I just add my @DatabaseObject annotation to the class and my @DBMapping annotation to every variable of it I want to save. I can also bind getters and setters to database fields by adding my @DBGetter or @DBSetter annotation to them.

That way it will be easy to add and remove attributes of classes stored in the database.

I can already create accounts and characters, log in with name and password and choose a character.

Which message is acceptable in which state of the connection is determined in ClientConnection. That class is getting more and more bloated. I think the login and character selection handling needs to be moved to another class soon.

Todo:
  • Create indices in the database at startup, so that account and usernames must be unique
  • When creating a character, it can not be selected unless the account logs in and out again.
  • Characters are only saved at logout - they should be saved more regularly in case of a crash (but not all at once to avoid load spikes on the database)
  • changing accounts and characters is shaky


So much about the server. The client, on the other hand, is lagging behind feature-wise. Everything I boasted about above can only be used through forging JSON messages in the debug chat tab. There is no GUI for entering account info or selecting a character. Implementing that will be my next step.

No comments:

Post a Comment