🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Woo, SQLite

posted in DruinkJournal
Published May 24, 2006
Advertisement
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.
Previous Entry More bands
Next Entry MySQL 5
0 likes 3 comments

Comments

johnhattan
The Mythbusters are my personal savior.
May 24, 2006 04:45 PM
Ravuya
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.
May 24, 2006 04:55 PM
Evil Steve
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.
May 24, 2006 06:08 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement