Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Woo, SQLite

Sign in to follow this  
Evil Steve


Well, I had the day off work today, since I had a dentist's appointment. I also did a bit of work to TEH MORPG. The login server now uses a real database (Well, MySQL [wink]), and the game servers use SQLite. Making SQLite work with my old DB class went pretty well. There were a couple issues with things, but nothing that I can't work around.
Issues I had were mainly that SQLite doesn't like auto_increment, which I was using for character IDs. That's pretty easy to get around though, it just means I need a SELECT as well as an INSERT. SQLite is pretty efficient with SELECT statements (More so that MySQL usually), and the max character ID can be cached. So it might even end up faster not to use auto_increment.
The other issue I had was that SQLite doesn't like me specifying two unique values in one statement. Meaning I can't do
UNIQUE(`character_id`, `name`)
in my CREATE TABLE statement, and I have to split it into two seperate UNIQUE statements. Interestingly, SQLite doesn't give any errors in the first case, it just ignores all but the first UNIQUE. Which is annoying, and I didn't notice for a while.

Anyway, next up is changing the login server's tables, and getting the two to play nicely using different databases and to exchange information properly. After that's done, I need to make the game servers easier to set up (so anyone can easily run them), and then implement some anti-hacking stuff.
People will still be able to modify the SQLite DB to change things, but I might look at ways to prevent that (Any suggestions?)
Players won't be able to transfer characters between servers unless both servers are trusted (I.e. I'm running them), and I'm not even sure if I want to let people transfer characters at all; it's nice to get different economies on different servers.

Anyway, I'm off to watch Mythbusters.
Sign in to follow this  


Recommended Comments

SQLite does look very nice, but I have to find a better game to use it in. My recent games don't seem like they would benefit much.

Share this comment

Link to comment
The Confederate rocket was awesome.

And the wasy SQLite uses callbacks is pretty nice too. No screwing around with result sets you need to free.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!